literature-download
Skill1 starsChanged 5 months agoMITView on GitHub
Academic PDF downloader with two modes. (1) Open-access mode (default): resolves and downloads legally free full-text PDFs by DOI, arXiv id, PMID or PMCID via a fallback chain arXiv -> Unpaywall -> Europe PMC OA -> PubMed Central; supports batch CSV. (2) Formal-journal mode (--formal): fetches the PAYWALLED publisher PDF by assuming institutional access (e.g. campus VPN + CARSI/Shibboleth SSO), resolving the DOI to the publisher landing page and downloading with your session cookie. Zero heavy deps (stdlib). Use when: downloading paper PDFs, fetching paywalled formal-journal PDFs via your institution, or building a local PDF corpus from a literature search result.
In this repository3 other files it gives its agents.
- bilibili-transcriptSkill
- literature-parseSkill
- literature-searchSkill
The file
Files
Literature Download (文献下载)
按标识符自动解析并下载开放获取全文 PDF,纯标准库,无需重依赖。
回退策略
对每个标识符依次尝试,命中即停:
arXiv id -> arxiv.org/pdf
DOI -> Unpaywall -> Europe PMC OA
PMID -> Europe PMC OA
PMCID -> PubMed Central只下载合法免费的 OA PDF;付费墙文献会被标记为 [fail] paywalled 并跳过。
快速使用
# 单篇:arXiv id
python scripts/download.py --id 1706.03762 --out ./pdfs
# 单篇:DOI(建议带 --email 以启用 Unpaywall,免费无限额)
python scripts/download.py --id 10.1002/ardp.70199 --email you@example.com --out ./pdfs
# 单篇:PMID / PMCID
python scripts/download.py --pmid 42377770 --email you@example.com --out ./pdfs
python scripts/download.py --id PMC7239701 --out ./pdfs
# 批量:直接喂 literature-search 生成的 CSV(读取 doi/pmid/title 列)
python scripts/download.py --csv ./lit_results.csv --email you@example.com --out ./pdfs参数:
--id:DOI / arXiv id / PMCID(三选一自动识别)--pmid:PubMed ID--csv:literature-search 输出的 CSV,批量下载--email:Unpaywall 联系邮箱(强烈建议填写,否则跳过 Unpaywall 源)--out:PDF 保存目录(默认./pdfs)
输出
PDF 以 <标识符>_<标题>.pdf 命名保存到 --out 目录。已存在的文件自动跳过。下载完成后打印成功/失败统计。
与其他 skill 衔接
- 上游:literature-search → 得到 CSV → 本 skill
--csv批量下载 - 下游:下载好的 PDF → literature-parse → 转 Markdown/文本
正式刊模式(付费墙 PDF)
默认只下载合法免费的 OA PDF;遇到付费墙(Nature / NMI / Elsevier / Wiley 等)会标记 [fail]。
加 --formal 后,脚本会解析 DOI 到出版社落地页、自动发现 PDF 链接,并用你的机构会话 Cookie 下载付费墙 PDF。
前提:你已通过机构访问(如 ZJU 的 aTrust VPN + CARSI/ZJU SSO 在浏览器登录)。然后把浏览器里该出版社域名的 Cookie 导出给脚本:
# 方式 A:直接粘贴 Cookie 字符串(DevTools → Application → Cookies 复制,形如 a=b; c=d)
python scripts/download.py --id 10.1038/s41586-026-10689-z --formal \
--cookies "session=xxxx; token=yyyy" --out ./pdfs
# 方式 B:从 Netscape/Mozilla cookie jar 文件读取(浏览器扩展 "Get cookies.txt LOCALLY" 导出)
python scripts/download.py --id "https://www.nature.com/articles/s41586-026-10689-z" \
--formal --cookie-file ./cookies.txt --out ./pdfs
# 批量:在 CSV 模式下一并加 --formal
python scripts/download.py --csv ./lit_results.csv --email you@zju.edu.cn \
--formal --cookie-file ./cookies.txt --out ./pdfs--formal会优先尝试出版社正式刊 PDF;若未登录/未连 VPN 导致取回的是登录墙 HTML,会自动回退到开放获取链(OA 预印本等)。- 支持的出版社链接发现:Nature、Springer、Wiley、ACS、Taylor & Francis,以及通用
<meta name="citation_pdf_url">/.pdf链接启发式。其他出版社若自动发现失败,可直接把文章页/PDF 链接作为--id传入。 - 仅下载你有权访问的 PDF,遵守出版社条款。
提示
- Unpaywall 需要邮箱(不校验,但请填真实联系邮箱),可覆盖大量期刊的 OA 版本。
- 付费墙文献在默认(OA)模式下会被跳过;如你拥有机构权限,请用上面的
--formal模式。 - 批量下载已内置 1s 间隔,避免对 API 造成压力。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

