Closed xxie-xd closed 3 months ago
Briefly, you need to make sure that the /api/
section is preserved. This fork (particularly the code added at line 72) has an attempt that might work: https://github.com/urschrei/pyzotero/compare/master...nick8325:pyzotero:master
Thank you. I'll give it a try.
As is shown in this page: https://groups.google.com/g/zotero-dev/c/ElvHhIFAXrY/m/fA7SKKwsAgAJ Zotero has already set up a local API server since Zotero 7 beta 88, and the local API shares almost the same interfaces with online server API. I'm going to access my local zotero user library via pyzotero, and luckily found that the API endpoint in pyzotero can be accessed and set as another url base address (https://github.com/urschrei/pyzotero/blob/9ca972620cd7927d9de265c1b7c3ce270e5ef9d3/src/pyzotero/zotero.py#L270). As is shown in the local server code (https://github.com/zotero/zotero/blob/main/chrome/content/zotero/xpcom/localAPI/server_localAPI.js), the local API server can be accessed at http://localhost:21339/api/ . However, when I have set zotero.Zotero.endpoint to http:///localhost:23119/api/, the request URL is not properly generated:
Has caused:
Diving into the process of URL generation of pyzotero, it seems that the endpoint, path and query parameters will be parsed into different blocks and joined together (done by urllib/parser.py), and the "/api/" path is dropped.
Question:
Any comment is appreciated.