rafguns / doidownloader

You give it DOIs, it gives you the article PDFs
MIT License
0 stars 0 forks source link

Handle Elsevier and Wiley PDFs #2

Open rafguns opened 2 years ago

rafguns commented 2 years ago

PDFs on wiley.com and sciencedirect.com cannot be downlaoded any more using doidonwloader, due to too many roadblocks. It seems like zotero/translators is the place to look at, althoug the sheer volume is a bit disheartening. E.g. here 's the getPDFlink function for ScienceDirect: https://github.com/zotero/translators/blob/01fa697837734ae0af06907f13d47dd9e5394f6c/ScienceDirect.js#L67-L208

rafguns commented 8 months ago

I forgot I one wrote code to download from ScienceDirect in a separate branch. Not sure if it actually works though.

rafguns commented 7 months ago

It seems the easiest way to handle Elsevier is to obtain an API key at https://dev.elsevier.com/apikey/manage. With the article retrieval API, you can then just do:

import httpx

r = httpx.get(
    "https://api.elsevier.com/content/article/doi/10.1016/j.burns.2023.08.011",
    headers={
        "Accept": "application/pdf",
        "X-ELS-APIKey": api_key,
    },
)
rafguns commented 7 months ago

I forgot I one wrote code to download from ScienceDirect in a separate branch. Not sure if it actually works though.

This throws up an interstitial "check this box to prove you're a human", so the API way seems the best route for ScienceDIrect/Elsevier.