论文抓取
- 作者仓库星标 44
- 作者更新于 实时读取
- 作者仓库 scientific-research-skills
- 领域
- 数据
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @jxtse · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需手动接入
- 是否需要外部 API Key
- 需要 · GitHub
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- Python
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 读取环境变量
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: paper-fulltext-harvest
description: Batch download academic paper full-text (PDF/XML) from a list of DOIs. Handles 25 DOI prefixes a…
category: 数据
runtime: Python
---
# paper-fulltext-harvest 输出预览
## PART A: 任务判断
- 适用问题:表格、CSV、数据集、指标或分析流程。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Decision tree / §0. Quick start (orchestrated CLI) / §1. Publisher TDM APIs”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于表格、CSV、数据集、指标或分析流程,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Decision tree / §0. Quick start (orchestrated CLI) / §1. Publisher TDM APIs”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、读取环境变量、会按任务需要访问外部网络、需要准备 GitHub API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;会按任务需要访问外部网络;需要准备 GitHub API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文出现了 `/tmp` 这类斜杠命令;如果你的 Agent 支持命令触发,优先用命令开场,再补充目标和边界。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令、读取环境变量。
先用一个小任务确认它会围绕“Decision tree / §0. Quick start (orchestrated CLI) / §1. Publisher TDM APIs”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: paper-fulltext-harvest
description: Batch download academic paper full-text (PDF/XML) from a list of DOIs. Handles 25 DOI prefixes a…
category: 数据
source: jxtse/scientific-research-skills
---
# paper-fulltext-harvest
## 什么时候使用
- paper-fulltext-harvest 是数据方向的技能,让 Agent 处理结构化文件(Excel / CSV / 表格) 适合处理表格、CSV、指标、数据集、分析和可视化报告,核心价值是把输入、判断、执行、验证和交付边界固定下…
- 面向表格、CSV、数据集、指标或分析流程,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Decision tree / §0. Quick start (orchestrated CLI) / §1. Publisher TDM APIs」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;会按任务需要访问外部网络;需要准备 GitHub API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "paper-fulltext-harvest" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Decision tree / §0. Quick start (orchestrated CLI) / §1. Publisher TDM APIs
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Python | 读取文件、写入/修改文件、执行终端命令、读取环境变量 | 会按任务需要访问外部网络
安全层 -> 需要准备 GitHub API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Paper Full-text Harvest
Pipeline for downloading academic paper full-text at scale. Handles the three classes of sources that exist in 2026:
- Publisher TDM APIs (Elsevier / Wiley / Springer) — for paywalled content where the institution has a subscription
- OA aggregators (Unpaywall / OpenAlex / Crossref) — for Open Access copies regardless of publisher
- Browser fallback (logged-in user profile) — for paywalled publishers without a TDM API (ACS / RSC / IEEE / AIP / IOP / APS / T&F / many CN journals)
The publisher router (auto_paper_download/publishers.py) recognises 25 DOI
prefixes across 19 families, each annotated with the right downstream path
(TDM client / OA aggregator / browser fallback) and a support tier. The router is
shared with the standalone auto-paper-harvester
CLI — see SUPPORTED_PUBLISHERS.md
there for the full per-publisher table.
Decision tree
Have a DOI list?
├── DOIs from Elsevier (10.1016, 10.1006, 10.1011)
│ └── Use ElsevierClient (TDM XML API) → §1
├── DOIs from Wiley (10.1002, 10.1111)
│ └── Use WileyClient (TDM PDF API) → §1
├── DOIs from Springer/Nature (10.1007, 10.1038, 10.1186, 10.1147)
│ ├── OA papers → SpringerClient OA API → §1
│ └── Subscription papers → fall through to OA/browser
├── Browser-only publishers without TDM API
│ (10.1021 ACS, 10.1039 RSC, 10.1126 Science, 10.1109 IEEE,
│ 10.1063 AIP, 10.1088/10.1143 IOP, 10.1103 APS, 10.1146 Annual Reviews,
│ 10.1080 T&F, 10.1116 AVS, 10.1149 ECS, 10.1364 Optica, 10.3938 KPS)
│ ├── Try OA first via Unpaywall/OpenAlex → §2
│ └── Last resort: browser fallback → §3
├── OA-leaning publishers (10.1073 PNAS, 10.3762 Beilstein)
│ └── OpenAlex/Unpaywall usually works → §2
└── Mixed list (typical case)
└── Use the orchestrated CLI (handles all of the above) → §0
§0. Quick start (orchestrated CLI)
For a typical mixed list of DOIs from Web of Science / Scopus export:
# Setup once
cp scripts/.env.example .env
# Edit .env to fill API keys (see §4 "Configuration")
# Run
python -m auto_paper_download \
--savedrecs your_export.xls \
--output-dir ./downloads/ \
--delay 2.0
The CLI:
- Parses DOIs from WoS savedrecs (or pass multiple
--savedrecs) - Routes each DOI to the right client by prefix
- Handles rate limiting + retries
- Per-publisher success summary at end
For resume-safe Elsevier bulk (the most common large run, e.g. 5000+ Elsevier DOIs):
python scripts/redownload_elsevier.py \
--excel papers.xlsx \
--output-dir ./elsevier_xml/ \
--resume \
--long-pause-every 200 \
--long-pause-sec 300
§1. Publisher TDM APIs
Read references/tdm-apis.md for full per-publisher details.
Quick reference:
| Publisher | API | Auth env var | Output | Rate limit |
|---|---|---|---|---|
| Elsevier | api.elsevier.com/content/article/doi/{DOI}?view=FULL |
ELSEVIER_API_KEY + ELSEVIER_INSTTOKEN |
XML (full-text) | ~5 req/sec |
| Wiley | api.wiley.com/onlinelibrary/tdm/v1/articles/{DOI} |
WILEY_TDM_TOKEN |
3 req/sec hard cap | |
| Springer (OA) | api.springernature.com/openaccess/json |
SPRINGER_API_KEY |
JSON+text | 1 req/sec free |
| Crossref TDM | URL from link[] field with intended-application: text-mining |
CR_CLICKTHROUGH_TOKEN |
varies | varies |
Critical: All TDM APIs require institutional IP allowlisting — must run from the institution's network or VPN. Test with one DOI before bulk runs.
Instantiate clients directly:
from auto_paper_download.clients import ElsevierClient, WileyClient
elsevier = ElsevierClient() # reads env vars
xml_path = elsevier.download_structured_full_text(
doi="10.1016/j.ces.2025.123003",
article_dir=Path("downloads/10.1016_j.ces.2025.123003"),
)
wiley = WileyClient()
pdf_path = wiley.download_pdf(
doi="10.1002/anie.202500001",
article_dir=Path("downloads/10.1002_anie.202500001"),
)
§2. OA fallback (Unpaywall / OpenAlex / Crossref)
For papers that may have OA copies regardless of publisher.
from auto_paper_download.clients import UnpaywallClient, OpenAlexClient, CrossrefClient
# Unpaywall: best OA PDF URL
up = UnpaywallClient()
pdf_path = up.download_pdf(doi=doi, article_dir=Path("downloads/.."))
# OpenAlex: alternative OA source
oa = OpenAlexClient()
pdf_path = oa.download_pdf(doi=doi, article_dir=Path("downloads/.."))
# Crossref: tries to find publisher PDF link
cr = CrossrefClient()
pdf_path = cr.download_pdf(doi=doi, article_dir=Path("downloads/.."))
Always validate downloaded PDFs: First 4 bytes must be %PDF and file size > 50KB. The clients in this skill do this automatically.
Expected hit rate for OA fallback: 40-60% on a generic chemistry/biology list. Recent papers (>2023) have higher OA rates.
§3. Browser fallback (paywalled, no TDM)
For publishers where API isn't available but the user has institutional Cloudflare/SSO access via browser cookies. Slowest path — only use after exhausting §1–§2.
Two routes — pick one
Route A: OpenClaw browser tool |
Route B: auto-paper-harvester v0.2+ CLI |
|
|---|---|---|
| What | Drive the user's running Chrome via the agent's browser capability with profile="user" |
Standalone CLI with built-in Playwright launch_persistent_context |
| Setup | None — reuses whatever Chrome the user is logged into | pip install 'auto-paper-download[browser]' && playwright install chromium |
| Cookies | User's existing daily-driver Chrome cookies (zero re-login) | Dedicated isolated profile; user logs into SSO once on first run |
| Selectors | Per-publisher CSS in references/browser-fallback.md (ACS / Wiley / RSC / T&F / Nature / AIP / CN journals) |
Per-family selectors baked into browser_fallback.py (14 publisher families) |
| Best for | Agent workflows where the user is actively at the keyboard, fewer DOIs (< 100), or one-off rescue runs | Unattended bulk runs (1000+ DOIs), CI/headless servers, when you don't want to lock the user's Chrome |
| Cost | Ties up user's Chrome for ~5 s/paper | Spawns its own Chromium; user's browser stays free |
| Surface area | Lives in this skill (references/browser-fallback.md + browser tool) |
Lives in the auto-paper-harvester repo (separate install) |
Decision rule:
- Default to Route A inside this skill (zero install, leverages session the user already has).
- Recommend Route B when the run is large (> 500 DOIs), runs unattended, or the user's Chrome shouldn't be locked. Both routes feed into the same downstream validation (PDF magic bytes, file size).
Route A details — OpenClaw browser tool
Read references/browser-fallback.md before starting. It covers:
- How to drive the user's logged-in Chrome via OpenClaw
browsertool withprofile="user" - Per-publisher CSS selectors for ACS, Wiley, RSC, T&F, Springer, Nature, AIP, and 3 major Chinese journals
- Cloudflare detection + retry strategy
- Single-tab reuse pattern (don't open a new tab per DOI — leaks)
- Kill-switch via
/tmp/stop_scrape
Route B details — auto-paper-harvester CLI
# One-time install (separate from this skill)
git clone https://github.com/jxtse/auto-paper-harvester.git
cd auto-paper-harvester
pip install -e '.[browser]' && playwright install chromium
# Run with same DOI file you'd otherwise feed to this skill
python -m auto_paper_download --savedrecs your_export.xls --use-browser-fallback
It routes every DOI through the same publisher TDM → OA → browser chain as this skill, with the browser pass running automatically against any DOI the API pipeline failed. See its README and SKILL.md for full docs.
Hard reality (applies to both routes)
ACS / Wiley / T&F use Cloudflare. Even with a logged-in profile, expect:
- ~30% Cloudflare challenges (retry after 10 s usually clears)
- Some sites detect headless and hard-block — a real Chrome with an active session (Route A) is more robust than fresh Chromium (Route B) in those cases
- Throughput: ~5 sec/paper, ~70-90% success
§4. Configuration
Required env vars (set in .env, see scripts/.env.example):
| Variable | Required for | How to get |
|---|---|---|
ELSEVIER_API_KEY |
Elsevier | https://dev.elsevier.com/ (free key) |
ELSEVIER_INSTTOKEN |
Elsevier institutional access | Contact your library |
WILEY_TDM_TOKEN |
Wiley | https://onlinelibrary.wiley.com/library-info/resources/text-and-datamining (institution must sign TDM agreement) |
SPRINGER_API_KEY |
Springer OA | https://dev.springernature.com/ (free key) |
CROSSREF_MAILTO |
Crossref polite pool (recommended) | Just your email |
OPENALEX_MAILTO |
OpenAlex polite pool (recommended) | Just your email |
UNPAYWALL_EMAIL |
Unpaywall (required) | Just your email |
Notes:
- All env vars are optional — missing ones simply disable that source
CROSSREF_REQUEST_DELAY/WILEY_REQUEST_DELAYallow tuning per-source delay
Core principles
- Cache directory structure: each DOI gets its own folder named
<safe_doi>/(with/replaced by_). This makes resume trivial — check if folder exists with non-empty file. - Cascade sources, cheapest first: TDM API for known publisher → OA aggregator → browser. Each fallback is more expensive (rate, time, fragility).
- Respect rate limits: defaults are conservative (
--delay 2.0). For long runs use--long-pause-everyand--long-pause-secto avoid cumulative ban. - Don't trust HTTP 200: many publisher APIs return 200 with HTML "subscribe to read" page. Validate content (PDF magic bytes, XML body markers like
<ce:para>). - Validate before declaring done: spot-check 5 random files manually before reporting success.
Common pitfalls
| Pitfall | Symptom | Fix |
|---|---|---|
| Empty PDF/XML directories created on failure | "Downloaded N papers" but files are 0 bytes | Validate file size; remove empty dirs (this code does it via _cleanup_article_dir) |
| Cloudflare blocks headless Playwright | 403 / "Just a moment..." | Use OpenClaw browser with profile="user", not headless |
| Rate-limited mid-batch | 429s, then permanent block | Increase --delay, set --long-pause-every 200, respect Retry-After |
| Springer subscription returns HTML "subscribe" | Saved 0-byte or junk PDF | Code checks %PDF magic bytes — use the SpringerClient, don't bypass |
| DOI case sensitivity | Some publishers 404 on uppercase | Code normalizes; if writing your own, always .lower() |
.abs suffix on Crossref DOIs |
404 from Crossref | Strip .abs before query |
When to ask the user
- Before running >1000 publisher API requests (institution may have weekly quota)
- Before browser scrape loop (will tie up their Chrome for ~5 sec/paper)
- When >30% of fetches fail unexpectedly (network / auth problem — investigate before continuing)
- When you detect a publisher with no API + no OA — confirm whether to skip or try browser
File layout
paper-fulltext-harvest/
├── SKILL.md (this file)
├── references/
│ ├── tdm-apis.md Per-publisher TDM API details
│ └── browser-fallback.md Browser scraping guide for paywalled non-TDM publishers (Route A)
└── scripts/
├── .env.example Template for API keys
├── pyproject.toml Dependencies (pip/uv installable)
├── redownload_elsevier.py Resume-safe Elsevier bulk downloader
└── auto_paper_download/ Main package
├── __init__.py
├── __main__.py CLI entrypoint
├── publishers.py 25 DOI prefixes → publisher family + handler + support tier (shared with auto-paper-harvester)
├── clients.py ElsevierClient, WileyClient, SpringerClient, CrossrefClient, UnpaywallClient, OpenAlexClient
├── downloader.py Orchestration: parse savedrecs, route by publisher, batch download
└── supplements.py Supplementary file downloader
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核