Closed Tomptez closed 5 months ago
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
Hm, not sure where to go from here.
The code has worked previously, I haven't made any changes, but of course some sync issues could be part of that.
But I can access said attachment via the api.
This URL I can access via my browser:
https://api.zotero.org/groups/2364338/items/MC44N87M/
But using the pyzotero.dump() call it seems to call:
https://api.zotero.org/groups/2364338/items/MC44N87M/file
which produces the 404 error.
I create the zotero instance like this:
zot = zotero.Zotero(libraryID, "group", APIkey)
and try to get the pdfs like this:
attachments = zot.children(articleID)
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.
Please reopen if need be, but I can't reproduce.
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
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 "