diff --git a/pyzotero/zotero.py b/pyzotero/zotero.py index 7164686..2819837 100644 --- a/pyzotero/zotero.py +++ b/pyzotero/zotero.py @@ -204,8 +204,13 @@ def wrapped_f(self, *args, **kwargs): return retrieved.content # no need to do anything special, return JSON else: - return retrieved.json() - + # is this a snapshot though? + retr = retrieved.json() + # I know, I know + if isinstance(retr, dict) and retr.get('data', {}).get('linkMode', {}) == u"imported_url": + return retrieved.content + else: + return retr return wrapped_f diff --git a/test/api_responses/attachments_doc.json b/test/api_responses/attachments_doc.json index 09328dc..4c0ccb5 100644 --- a/test/api_responses/attachments_doc.json +++ b/test/api_responses/attachments_doc.json @@ -37,7 +37,7 @@ "itemType": "attachment", "title": "1641 Depositions", "accessDate": "2012-01-11T19:54:47Z", - "linkMode": "imported_url", + "linkMode": "idk", "charset": "utf-8", "relations": {}, "filename": "project-conservation.html",