You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What were you trying to do?
I was trying to download a pdf file from a collection
What API call did it involve
pyzotero.dump()
What error was raised?
See below
More Details
Traceback
zot.dump("N4MTZ5LU")
Traceback (most recent call last):
File "$MYPATH/venv/lib64/python3.12/site-packages/pyzotero/zotero.py", line 426, in _retrieve_data
self.request.raise_for_status()
File "$MYPATH/venv/lib64/python3.12/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.zotero.org/groups/2364338/items/N4MTZ5LU/file
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "$MYPATH/venv/lib64/python3.12/site-packages/pyzotero/zotero.py", line 734, in dump
file = self.file(itemkey)
^^^^^^^^^^^^^^^^^^
File "$MYPATH/venv/lib64/python3.12/site-packages/pyzotero/zotero.py", line 179, in wrapped_f
retrieved = self._retrieve_data(func(self, *args))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "$MYPATH/venv/lib64/python3.12/site-packages/pyzotero/zotero.py", line 428, in _retrieve_data
error_handler(self, self.request, exc)
File "$MYPATH/LitFilter_Repo/venv/lib64/python3.12/site-packages/pyzotero/zotero.py", line 1660, in error_handler
raise error_codes.get(req.status_code)(err_msg(req)) from exc
pyzotero.zotero_errors.ResourceNotFound:
Code: 404
URL: https://api.zotero.org/groups/2364338/items/N4MTZ5LU/file
Method: GET
Response: Not found
The text was updated successfully, but these errors were encountered:
I can't reproduce this: both file() and dump() are working as expected. If you're getting a 404 error that suggests the attachment doesn't exist on the Zotero server, possibly due to a sync issue or typo. Are you sure that you're passing the ID of a file attachment to the file \ dump call? The 404 URL doesn't look correct to me; it should be something like https://api.zotero.org/users/436/items/H3XDWRWX?format=json&limit=100
for each in attachments:
try:
if each["data"]["itemType"] == "attachment":
if each["data"]["contentType"] == 'application/pdf':
pdfID = each["data"]["key"]
zot.dump(pdfID)
and I think that code is working, as I can access the attachment via the API. It is just that the /file call is producing the 404 error.
Hello, for some reason pyzotero.dump() stopped working for me. The file definitely exists in the library. I am using the lates version of pyzotero.
I tried using
instead but it didn't work either
Platform: Fedora 39
Python version: 3.12.2
Pyzotero version: 1.5.18
Problem Description
I was trying to download a pdf file from a collection
pyzotero.dump()
See below
More Details
Traceback
The text was updated successfully, but these errors were encountered: