About Custom PDF Resolvers

To download PDF files from a famous website, I used codes from Internet to modify "extensions.zotero.findPDFs.resolvers":
{
"name":"A",
"method":"GET",
"url":"https://**.com/{doi}",
"mode":"html",
"selector":"#pdf",
"attribute":"src",
"automatic":false
}
At first it worked well, but later some of articles couldn't be downloaded. I found sometimes when the "src"(attribute) value is Absolute Path, like "https://**.com/001.pdf", it works. But when the "src"(attribute) value is Relative Path, like "/001.pdf", the PDF file will not be downloaded successfully. I checked the website:
https://www.zotero.org/support/kb/custom_pdf_resolvers
but it seems there is no solution at present. How to solve the problem?
  • I have the same problem (e.g. with DOI 10.1109/CSCN.2019.8931321).

    In this case, the "src" attribute of the "#pdf" selector returns a relative path (does not start with "http://" but with "/downloads/") and results in an exception (NS_ERROR_MALFORMED_URI) [nsIIOService.newURI].

    Is there a way to work around it? I tried to use some XPath functions within the selctor, but that did not work. I'm afraid that would result in modifying the getPDFResolvers source code and adding a special case for relative paths.


  • edited November 17, 2022
    The latest Zotero beta should handle relative PDF URLs when using custom PDF resolvers, and this change will be included in Zotero 6.0.19.
  • Great! Works with the latest Zotero beta (6.0.19-beta.3+89bc09469).
  • I solve the problem by using old version of the website to avoid Relative Path temporarily. Looking forward to formal version.
Sign In or Register to comment.