papersearch 0.4.10 → 0.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.en.md +128 -226
- package/README.md +128 -226
- package/assets/carsi-flow.en.png +0 -0
- package/assets/carsi-flow.png +0 -0
- package/assets/overview.en.png +0 -0
- package/assets/overview.png +0 -0
- package/carsi/README.md +1 -1
- package/carsi/paper_search_carsi/adapters/ams/__init__.py +12 -0
- package/carsi/paper_search_carsi/adapters/elsevier/__init__.py +5 -2
- package/carsi/paper_search_carsi/adapters/elsevier/sciencedirect.py +18 -1
- package/carsi/paper_search_carsi/adapters/iop/__init__.py +19 -4
- package/carsi/paper_search_carsi/adapters/platforms/atypon/__init__.py +24 -14
- package/carsi/paper_search_carsi/adapters/platforms/silverchair/__init__.py +23 -0
- package/carsi/paper_search_carsi/assets/capsule.html +36 -9
- package/carsi/paper_search_carsi/browser/preview.py +16 -3
- package/carsi/paper_search_carsi/browser/watchdog.py +68 -4
- package/carsi/paper_search_carsi/capsule_placement.py +51 -31
- package/carsi/paper_search_carsi/download_diagnostics.py +3 -1
- package/carsi/paper_search_carsi/engine/access_rules.py +11 -0
- package/carsi/paper_search_carsi/engine/batch.py +21 -3
- package/carsi/paper_search_carsi/engine/batch_access.py +3 -0
- package/carsi/paper_search_carsi/engine/batch_capture.py +61 -11
- package/carsi/paper_search_carsi/engine/batch_common.py +4 -0
- package/carsi/paper_search_carsi/engine/batch_diagnostics.py +3 -0
- package/carsi/paper_search_carsi/engine/batch_institution.py +59 -40
- package/carsi/paper_search_carsi/engine/batch_login.py +121 -16
- package/carsi/paper_search_carsi/engine/bridge.py +5 -2
- package/carsi/paper_search_carsi/engine/supplements.py +66 -4
- package/carsi/paper_search_carsi/progress_capsule.py +93 -11
- package/carsi/paper_search_carsi/progress_macos.py +35 -10
- package/carsi/paper_search_carsi/progress_reporter.py +42 -18
- package/carsi/paper_search_carsi/progress_view.py +35 -13
- package/carsi/paper_search_carsi/server.py +7 -1
- package/dist/capabilities/journal-metrics/JournalMetricsService.d.ts.map +1 -1
- package/dist/capabilities/journal-metrics/JournalMetricsService.js +2 -1
- package/dist/capabilities/journal-metrics/JournalMetricsService.js.map +1 -1
- package/dist/capabilities/pdf-discovery/batch.d.ts +2 -0
- package/dist/capabilities/pdf-discovery/batch.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/batch.js +45 -10
- package/dist/capabilities/pdf-discovery/batch.js.map +1 -1
- package/dist/capabilities/pdf-discovery/batchSummary.d.ts +7 -1
- package/dist/capabilities/pdf-discovery/batchSummary.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/batchSummary.js +24 -0
- package/dist/capabilities/pdf-discovery/batchSummary.js.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiAttempt.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiAttempt.js +6 -0
- package/dist/capabilities/pdf-discovery/carsi/CarsiAttempt.js.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiMcpClient.d.ts +3 -0
- package/dist/capabilities/pdf-discovery/carsi/CarsiMcpClient.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiMcpClient.js +29 -4
- package/dist/capabilities/pdf-discovery/carsi/CarsiMcpClient.js.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiReadiness.d.ts +2 -0
- package/dist/capabilities/pdf-discovery/carsi/CarsiReadiness.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiReadiness.js +2 -0
- package/dist/capabilities/pdf-discovery/carsi/CarsiReadiness.js.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/types.d.ts +12 -0
- package/dist/capabilities/pdf-discovery/carsi/types.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/tiers/publisherApi.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/tiers/publisherApi.js +2 -1
- package/dist/capabilities/pdf-discovery/tiers/publisherApi.js.map +1 -1
- package/dist/cli.js +19 -8
- package/dist/cli.js.map +1 -1
- package/dist/config/ConfigService.d.ts.map +1 -1
- package/dist/config/ConfigService.js +28 -2
- package/dist/config/ConfigService.js.map +1 -1
- package/dist/config/apiKeySignup.d.ts +13 -0
- package/dist/config/apiKeySignup.d.ts.map +1 -0
- package/dist/config/apiKeySignup.js +32 -0
- package/dist/config/apiKeySignup.js.map +1 -0
- package/dist/infrastructure/runlog/failureClass.d.ts.map +1 -1
- package/dist/infrastructure/runlog/failureClass.js +6 -0
- package/dist/infrastructure/runlog/failureClass.js.map +1 -1
- package/dist/management/capability-profile/index.d.ts +7 -0
- package/dist/management/capability-profile/index.d.ts.map +1 -1
- package/dist/management/capability-profile/index.js +7 -0
- package/dist/management/capability-profile/index.js.map +1 -1
- package/dist/management/carsi/installer.js +5 -5
- package/dist/management/carsi/installer.js.map +1 -1
- package/dist/management/diagnostics/index.d.ts.map +1 -1
- package/dist/management/diagnostics/index.js +4 -1
- package/dist/management/diagnostics/index.js.map +1 -1
- package/dist/management/failures/exportReport.js +3 -3
- package/dist/management/reports/index.d.ts.map +1 -1
- package/dist/management/reports/index.js +6 -1
- package/dist/management/reports/index.js.map +1 -1
- package/dist/management/updates/index.d.ts +6 -1
- package/dist/management/updates/index.d.ts.map +1 -1
- package/dist/management/updates/index.js +18 -11
- package/dist/management/updates/index.js.map +1 -1
- package/dist/platforms/SemanticScholarSearcher.d.ts.map +1 -1
- package/dist/platforms/SemanticScholarSearcher.js +2 -1
- package/dist/platforms/SemanticScholarSearcher.js.map +1 -1
- package/package.json +2 -3
- package/skills/paper-search/SKILL.md +8 -14
- package/skills/paper-search/references/browser-download.md +7 -6
- package/skills/paper-search/references/capability-routing.md +3 -3
- package/skills/paper-search/references/carsi-setup.md +1 -1
- package/skills/paper-search/references/cli-contract.md +2 -2
- package/skills/paper-search/references/management-layer.md +1 -1
- package/skills/paper-search/references/publisher-support.md +6 -4
- package/skills/paper-search/references/troubleshooting.md +1 -2
- package/carsi/NOTICE +0 -5
package/README.md
CHANGED
|
@@ -1,309 +1,211 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="assets/logo.svg" width="
|
|
2
|
+
<img src="assets/logo.svg" width="80" alt="PaperSearch 图标">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<h1 align="center">PaperSearch</h1>
|
|
6
6
|
|
|
7
|
-
<p align="center"><b
|
|
7
|
+
<p align="center"><b>轻量、全自动的 AI 文献全能工具</b><br>
|
|
8
|
+
一句话让AI完成文献检索、核对、下载全文和补充材料,后台自动完成。</p>
|
|
8
9
|
|
|
9
10
|
<p align="center">
|
|
10
11
|
<a href="https://www.npmjs.com/package/papersearch"><img src="https://img.shields.io/npm/v/papersearch?style=flat-square" alt="npm"></a>
|
|
11
12
|
<a href="https://github.com/dr-dumpling/PaperSearch/actions/workflows/publish.yml"><img src="https://img.shields.io/github/actions/workflow/status/dr-dumpling/PaperSearch/publish.yml?style=flat-square&label=publish" alt="发布工作流状态"></a>
|
|
12
|
-
<a href="#机构下载扩展"><img src="https://img.shields.io/badge/CARSI-institutional%20downloads-7284CE?style=flat-square" alt="CARSI 机构下载扩展"></a>
|
|
13
13
|
<a href="https://nodejs.org/"><img src="https://img.shields.io/node/v/papersearch?style=flat-square" alt="Node.js 版本要求"></a>
|
|
14
|
-
<a href="#
|
|
14
|
+
<a href="#1-学校订阅下载carsi"><img src="https://img.shields.io/badge/CARSI-supported-7284CE?style=flat-square" alt="学校订阅下载 CARSI"></a>
|
|
15
|
+
<a href="docs/guide.zh.md#agent-skill"><img src="https://img.shields.io/badge/Agent%20Skill-bundled-D97757?style=flat-square" alt="随包 Agent Skill"></a>
|
|
16
|
+
<a href="#快速开始"><img src="https://img.shields.io/badge/platform-macOS%20%7C%20Windows-555555?style=flat-square" alt="支持 macOS 和 Windows"></a>
|
|
15
17
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-2F9E44?style=flat-square" alt="MIT 许可证"></a>
|
|
16
|
-
<a href="https://linux.do"><img src="https://img.shields.io/badge/LinuxDo-community-1f6feb?style=flat-square" alt="LinuxDo 社区"></a>
|
|
17
18
|
</p>
|
|
18
19
|
|
|
19
|
-
<p align="center"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- **开放获取直接下载**:PubMed Central、Unpaywall、出版社接口等渠道,装好就能用。
|
|
24
|
-
- **学校订阅也能下**:可选的机构下载扩展经 CARSI 登录你的学校,批量获取学校有权限的论文和补充材料;支持自动过验证,放行后继续下载。
|
|
25
|
-
- **每一篇都核对过**:逐个核对 PDF 首页的 DOI 和题名,不是这篇文章的不算成功。
|
|
26
|
-
- **结果直接能用**:按“期刊_年份_标题”建文件夹,正文和补充材料放在一起;没下到的篇目说明原因。
|
|
27
|
-
|
|
28
|
-
<p align="center"><img src="assets/overview.png" width="840" alt="PaperSearch 能做的事:检索论文、搜正文片段、查期刊与分区、查引文和参考文献、下载全文和补充材料"></p>
|
|
29
|
-
|
|
30
|
-
[效果](#效果) | [快速开始](#快速开始) | [常见任务](#常见任务) | [工作方式](#工作方式) | [机构下载扩展](#机构下载扩展) | [检索来源](#检索来源) | [配置](#配置) | [Agent Skill](#agent-skill) | [命令](#命令) | [排障](#排障)
|
|
31
|
-
|
|
32
|
-
## 效果
|
|
20
|
+
<p align="center">
|
|
21
|
+
<a href="README.en.md">English</a> · <a href="#快速开始">快速开始</a> · <a href="#1-学校订阅下载carsi">学校订阅下载</a> · <a href="#2-api-key">API key</a> · <a href="docs/guide.zh.md">使用说明</a> · <a href="docs/ARCHITECTURE.zh.md">架构说明</a> · <a href="docs/ROADMAP.zh.md">路线图</a> · <a href="https://github.com/dr-dumpling/PaperSearch/issues/new/choose">反馈问题</a>
|
|
22
|
+
</p>
|
|
33
23
|
|
|
34
|
-
|
|
24
|
+
PaperSearch 提供 `paper-search` 命令和一份随包 Skill。装好后,Claude Code、Codex、Cursor、Kimi Code、Qwen Code、CodeBuddy、TRAE 等支持本机命令调用的 AI 工具,就能替你:
|
|
35
25
|
|
|
36
|
-
|
|
26
|
+
- **检索论文**:一次查 PubMed、Crossref、OpenAlex、Semantic Scholar、arXiv 等 20 多个数据源,按 DOI 合并重复,核对 DOI。
|
|
27
|
+
- **搜正文片段**:利用 Semantic Scholar 收录的论文正文,搜原句,找到方法、结果的原文和出处。
|
|
28
|
+
- **查期刊 IF 与分区**:利用 EasyScholar,查找 JCR 影响因子、JCR 分区和中科院分区。
|
|
29
|
+
- **查引文和参考文献**:顺着一篇论文,找出引用它的研究和它引用的文献。
|
|
30
|
+
- **下载全文和补充材料**:OA 文章直接下载;非 OA 文章通过学校订阅下载:可以装上“学校订阅下载(CARSI)”经学校登录批量下载,也可以填出版社的 API key 下载。
|
|
37
31
|
|
|
38
|
-
|
|
32
|
+
<!-- 演示动图:做好后放在这里;概览图随后移到“参考 · 工作方式” -->
|
|
39
33
|
|
|
40
|
-
|
|
41
|
-
downloads/
|
|
42
|
-
├── papers/
|
|
43
|
-
│ ├── Nutrients_2026_α-Ketoglutarate Alleviates the Pathogenesis…_0b6e0203de/
|
|
44
|
-
│ │ ├── Nutrients_2026_α-Ketoglutarate Alleviates the Pathogenesis….pdf
|
|
45
|
-
│ │ └── supplements/
|
|
46
|
-
│ │ └── nutrients-18-03600-s001.zip 补充材料保留原文件名
|
|
47
|
-
│ └── arXiv_2017_Attention Is All You Need_a1a0262a54/
|
|
48
|
-
│ └── arXiv_2017_Attention Is All You Need.pdf 预印本会标明
|
|
49
|
-
└── diagnostics/ 运行记录、附件清单、截图
|
|
50
|
-
```
|
|
34
|
+
<p align="center"><img src="assets/overview.png" width="840" alt="PaperSearch 能做的事:检索论文、搜正文片段、查期刊 IF 与分区、查引文和参考文献、下载全文和补充材料"></p>
|
|
51
35
|
|
|
52
36
|
## 快速开始
|
|
53
37
|
|
|
54
|
-
|
|
38
|
+
### 1. 安装
|
|
55
39
|
|
|
56
|
-
|
|
40
|
+
需要 Node.js 18 或更高版本和 npm。两种方式任选一种:
|
|
57
41
|
|
|
58
|
-
|
|
59
|
-
npm install -g papersearch && paper-search skills update --targets codex
|
|
60
|
-
```
|
|
42
|
+
- 自己装:复制一行命令(以 Codex 为例)。用其他 AI 工具时,把 `codex` 换成 `claude`、`cursor`、`gemini`、`antigravity` 或 `agents`(共享目录 `~/.agents/skills/`)。
|
|
61
43
|
|
|
62
|
-
|
|
44
|
+
```sh
|
|
45
|
+
npm install -g papersearch && paper-search skills update --targets codex
|
|
46
|
+
```
|
|
63
47
|
|
|
64
|
-
|
|
65
|
-
npm.cmd install -g papersearch; if ($LASTEXITCODE -eq 0) { paper-search.cmd skills update --targets codex }
|
|
66
|
-
```
|
|
48
|
+
- 让 AI 帮你装:把下面这段话发给你的 AI 工具。
|
|
67
49
|
|
|
68
|
-
|
|
50
|
+
```text
|
|
51
|
+
请帮我安装 PaperSearch:运行 npm install -g papersearch;
|
|
52
|
+
再运行 paper-search skills update --targets 你的类型,给你自己装上随包 Skill
|
|
53
|
+
(类型可选 codex、claude、cursor、gemini、antigravity、agents);
|
|
54
|
+
最后运行 paper-search doctor --format text,告诉我哪些功能可用。
|
|
55
|
+
API key 我会自己用 paper-search setup 输入。
|
|
56
|
+
```
|
|
69
57
|
|
|
70
|
-
|
|
58
|
+
### 2. 对 AI 说一句话
|
|
71
59
|
|
|
72
|
-
|
|
73
|
-
paper-search skills update --targets claude
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
也可以把下面这段话发给你的 AI 工具,让它帮你装:
|
|
77
|
-
|
|
78
|
-
```text
|
|
79
|
-
请帮我安装 PaperSearch:运行 npm install -g papersearch,再按 README 的 Agent Skill 说明为你自己安装随包 Skill,最后运行 paper-search doctor --format text,告诉我哪些功能能用、还缺哪些 key;再问我下载的论文默认放在哪个文件夹,用 paper-search config set DEFAULT_DOWNLOAD_PATH 保存。API key 我会自己在终端运行 paper-search setup 输入,不要让我发到聊天里。
|
|
80
|
-
```
|
|
60
|
+
新开一个 AI 会话,说你要做什么,例如:
|
|
81
61
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
# 检索论文(不需要任何 key 的来源组合)
|
|
90
|
-
paper-search search "machine learning clinical prediction" --sources no-key --max-results 5 --pretty
|
|
62
|
+
| 想做什么 | 可以这样说 |
|
|
63
|
+
|---|---|
|
|
64
|
+
| 检索论文 | 找 2020 年以来 SGLT2 抑制剂治疗心力衰竭的随机对照试验,核对 DOI |
|
|
65
|
+
| 搜正文片段 | 这些试验的主要终点,原文是怎么定义的?摘几段原文 |
|
|
66
|
+
| 查期刊 IF 与分区 | 它们发表在哪些期刊?影响因子和分区各是多少 |
|
|
67
|
+
| 查引文和参考文献 | DAPA-HF 试验发表后,有哪些研究引用了它 |
|
|
68
|
+
| 下载全文和补充材料 | 把这些论文的全文和补充材料下载到 ./downloads |
|
|
91
69
|
|
|
92
|
-
|
|
93
|
-
paper-search search "SGLT2 inhibitor heart failure" --platform pubmed --max-results 10 --pretty
|
|
70
|
+
### 3. 拿到结果
|
|
94
71
|
|
|
95
|
-
|
|
96
|
-
|
|
72
|
+
- 检索、正文片段、期刊指标和引文,直接在对话里列给你。
|
|
73
|
+
- 下载的论文整理成文件夹,没拿到的篇目告诉你原因:
|
|
97
74
|
|
|
98
|
-
|
|
99
|
-
|
|
75
|
+
```text
|
|
76
|
+
downloads/
|
|
77
|
+
├── papers/
|
|
78
|
+
│ ├── Nutrients_2026_α-Ketoglutarate Alleviates the Pathogenesis…_0b6e0203de/
|
|
79
|
+
│ │ ├── Nutrients_2026_α-Ketoglutarate Alleviates the Pathogenesis….pdf
|
|
80
|
+
│ │ └── supplements/
|
|
81
|
+
│ │ └── nutrients-18-03600-s001.zip
|
|
82
|
+
│ └── arXiv_2017_Attention Is All You Need_a1a0262a54/
|
|
83
|
+
│ └── arXiv_2017_Attention Is All You Need.pdf
|
|
84
|
+
└── diagnostics/
|
|
85
|
+
```
|
|
100
86
|
|
|
101
|
-
|
|
102
|
-
paper-search journal-metrics "Nature" "BMJ" --pretty
|
|
87
|
+
### 4. 按需加上配置
|
|
103
88
|
|
|
104
|
-
|
|
105
|
-
paper-search run search_semantic_snippets --arg query="propensity score matching" --arg limit=3 --pretty
|
|
89
|
+
**装好就能用**:检索论文、查引文和参考文献、下载开放获取的论文。
|
|
106
90
|
|
|
107
|
-
|
|
108
|
-
paper-search download "<DOI>" --platform crossref
|
|
91
|
+
**加上配置,还能:**
|
|
109
92
|
|
|
110
|
-
|
|
111
|
-
|
|
93
|
+
- **查影响因子和分区**:填入 EasyScholar key,JCR 影响因子、JCR 分区和中科院分区一次查清。
|
|
94
|
+
- **在正文里找原句**:填入 Semantic Scholar key,直接搜开放获取论文的正文,找到相关段落的原文和出处。
|
|
95
|
+
- **下载学校订阅的论文**,两种方式:
|
|
96
|
+
- 装上学校订阅下载(CARSI):在 Chrome 里登录学校,开放渠道下不到的全文和补充材料也能批量下载。
|
|
97
|
+
- 填入 Elsevier、Springer 的 API key:在校园网里经出版社接口直接取全文,不用开浏览器;校外下 Elsevier 订阅文章还要填 `ELSEVIER_INSTTOKEN`。
|
|
112
98
|
|
|
113
|
-
|
|
114
|
-
paper-search failures --format text
|
|
115
|
-
```
|
|
99
|
+
怎么配见下面的 [可选配置](#可选配置)。随时运行 `paper-search doctor --format text`,查看哪些功能已经能用。
|
|
116
100
|
|
|
117
|
-
##
|
|
118
|
-
|
|
119
|
-
```text
|
|
120
|
-
用户的文献请求
|
|
121
|
-
│
|
|
122
|
-
├─ 找论文、核验 DOI/PMID → paper-search search(Crossref、PubMed、OpenAlex 等)
|
|
123
|
-
│ └─ 确认条目、需要全文 → 转到下面的“下载”
|
|
124
|
-
├─ 查施引文献、参考文献 → paper-search run get_paper_citations / get_paper_references
|
|
125
|
-
├─ 查影响因子、分区 → paper-search journal-metrics(需要 EasyScholar key)
|
|
126
|
-
├─ 找 Methods 写法、参数 → paper-search run search_semantic_snippets(需要 Semantic Scholar key)
|
|
127
|
-
│
|
|
128
|
-
└─ 下载正文、补充材料 → paper-search download / run download_with_fallback / run download_batch
|
|
129
|
-
同一个下载命令,按顺序尝试:
|
|
130
|
-
├─ ① 开放下载(默认就有):来源自带的下载、PMC、Unpaywall、出版社接口
|
|
131
|
-
├─ ② Sci-Hub 兜底(默认开启,可关闭)
|
|
132
|
-
├─ ③ 机构下载(可选扩展):浏览器经 CARSI 登录你的学校,在出版社网站取 PDF 和补充材料
|
|
133
|
-
├─ ④ arXiv 预印本:前面都没拿到正式发表版时才用,并标明是预印本
|
|
134
|
-
├─ 每一步拿到文件都核对首页的 DOI 和题名;通过就保存,后面的步骤不再试
|
|
135
|
-
└─ 都没拿到 → paper-search failures 说明原因
|
|
136
|
-
```
|
|
101
|
+
## 可选配置
|
|
137
102
|
|
|
138
|
-
|
|
103
|
+
学校订阅下载只管下载;API key 对应各个数据源和服务,管的功能更多:
|
|
139
104
|
|
|
140
|
-
|
|
|
105
|
+
| 功能 | 学校订阅下载(CARSI) | API key |
|
|
141
106
|
|---|---|---|
|
|
142
|
-
|
|
|
143
|
-
|
|
|
144
|
-
|
|
|
145
|
-
|
|
|
107
|
+
| 下载学校订阅的全文 | ✓ | ✓ 仅 Elsevier、Springer(一般要在校园网) |
|
|
108
|
+
| 下载补充材料 | ✓ | |
|
|
109
|
+
| 查影响因子和分区 | | ✓ EasyScholar |
|
|
110
|
+
| 搜正文片段 | | ✓ Semantic Scholar |
|
|
111
|
+
| 更多检索来源、更高限额 | | ✓ 各来源自己的 key |
|
|
112
|
+
| **需要准备** | Google Chrome、学校账号 | 到各家网站申请 key |
|
|
113
|
+
| **怎么配置** | `paper-search carsi install` | `paper-search setup` |
|
|
146
114
|
|
|
147
|
-
|
|
115
|
+
### 1. 学校订阅下载(CARSI)
|
|
148
116
|
|
|
149
|
-
|
|
150
|
-
- arXiv 论文先找正式发表版,都没拿到才下载预印本;结果里写 `version: "preprint"`,已知时附正式版 DOI。
|
|
151
|
-
- 不想用 Sci-Hub 时,在 `download_with_fallback` / `download_batch` 里设 `"useSciHub": false`。
|
|
152
|
-
- 每个 PDF 都核对首页的 DOI 和题名;对不上的不算成功,单独留待核查。
|
|
117
|
+
开放渠道下不到的论文,可以借你学校的订阅来下。CARSI 是中国高校身份联盟,国内高校基本都已加入,用学校账号就能登录各家出版社。装好后,每篇论文这样下载:
|
|
153
118
|
|
|
154
|
-
|
|
119
|
+
<p align="center"><img src="assets/carsi-flow.png" width="840" alt="学校订阅下载的流程:打开文章页进入机构登录,自动选 CARSI 和学校,你在学校登录页输入账号,回到出版社取 PDF 和补充材料,核对 DOI 和题名"></p>
|
|
155
120
|
|
|
156
|
-
|
|
121
|
+
它的优点:
|
|
157
122
|
|
|
158
|
-
|
|
123
|
+
- **学校账号就能用**:不用另外申请 key;出版社 API key 只覆盖 Elsevier、Springer 两家。
|
|
124
|
+
- **深度适配出版社**:深度优化了下载的通用流程,并且针对 30 多家出版社逐家写了专门规则,机构登录入口在哪、PDF 和补充材料怎么取,都按各自出版社的实际情况来,下载更准、更少漏篇。优化的出版社主要有:
|
|
125
|
+
- 综合:Elsevier(含 Cell、Lancet)、Springer Nature(含 Nature、BMC)、Wiley、Oxford Academic、Taylor & Francis、Sage、PNAS、Science
|
|
126
|
+
- 医学:NEJM、JAMA、AHA、ASH、Wolters Kluwer、Karger、Thieme
|
|
127
|
+
- 理工:ACS、IEEE、ACM
|
|
128
|
+
- 完整列表见 [出版社支持表](skills/paper-search/references/publisher-support.md)
|
|
129
|
+
- 需要支持别的出版社,欢迎[提 Issue](https://github.com/dr-dumpling/PaperSearch/issues/new/choose),附上一篇你有权限的文章 DOI;这些适配规则会持续维护和更新。
|
|
130
|
+
- **验证框自动点击**:遇到人机验证,程序自动定位并点击,网站放行后继续下载;过不去才提醒你。
|
|
131
|
+
- **后台下载不打扰**:浏览器在后台工作。屏幕角落的进度胶囊显示进度;需要你登录学校或手动验证时变成琥珀色,点一下就切到浏览器,处理完程序接着下载。
|
|
159
132
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
先装好 [Google Chrome](https://www.google.com/chrome/),再运行:
|
|
133
|
+
电脑上需要已装有 [Google Chrome](https://www.google.com/chrome/)。安装:
|
|
163
134
|
|
|
164
135
|
```bash
|
|
165
136
|
paper-search carsi install # 安装时选择你的学校
|
|
166
137
|
paper-search carsi status --format text # 查看是否装好
|
|
167
138
|
```
|
|
168
139
|
|
|
169
|
-
装好后照常让 AI 下载论文:
|
|
170
|
-
|
|
171
|
-
- **第一次需要登录时**,在打开的浏览器里登录学校,之后会记住登录状态。
|
|
172
|
-
- **人机验证**由程序自动点击,过不去时再提醒你。
|
|
173
|
-
- **进度胶囊**在屏幕角落显示进度;需要你登录或验证时变成琥珀色,点一下就切到浏览器。鼠标指上去可以跳过本篇或终止任务,齿轮里可以改等待时间、默认下载文件夹和系统通知。
|
|
174
|
-
- **浏览器在后台工作**,不会跳到前台打扰你。
|
|
175
|
-
- **下载结束**后,胶囊列出成功和失败的篇目及原因;更详细的原因用 `paper-search failures --format text` 查看。
|
|
176
|
-
|
|
177
140
|
<p align="center"><img src="assets/progress-capsule.png" width="840" alt="进度胶囊:下载中、需要你登录、鼠标指上去展开、结束时列出成功失败和原因"></p>
|
|
178
141
|
|
|
179
|
-
|
|
142
|
+
### 2. API key
|
|
180
143
|
|
|
181
|
-
|
|
144
|
+
按用途分四类,需要哪类就申请对应的 key,再用 `paper-search setup <KEY>` 填入(输入时不显示)。
|
|
182
145
|
|
|
183
|
-
|
|
146
|
+
#### 查期刊、搜正文
|
|
184
147
|
|
|
185
|
-
|
|
|
148
|
+
| 功能 | 要填的 key | 去哪里申请 |
|
|
186
149
|
|---|---|---|
|
|
187
|
-
|
|
|
188
|
-
|
|
|
189
|
-
| 预印本和会议稿 | arXiv、bioRxiv、medRxiv、OpenReview、IACR ePrint | 不需要 |
|
|
190
|
-
| 计算机和工程 | DBLP、ACM、USENIX | 不需要 |
|
|
191
|
-
| 开放获取和仓储 | CORE、OpenAIRE、Unpaywall | Unpaywall 填邮箱;CORE、OpenAIRE 可选 |
|
|
192
|
-
| 出版社和引文库 | ScienceDirect、Scopus、Springer Nature、IEEE Xplore、Web of Science | 需要各自的 key(ScienceDirect、Scopus 共用 Elsevier key) |
|
|
193
|
-
| 期刊指标 | EasyScholar | 需要 |
|
|
194
|
-
|
|
195
|
-
- 不需要 key 的来源已经收录了各大出版社的论文;配了 key,多的是出版社自己的检索入口。
|
|
196
|
-
- 单个来源用 `--platform`,多个用 `--sources a,b,c`;`--sources no-key` 是不需要任何 key 的组合(Crossref、PubMed、Europe PMC、arXiv、OpenReview)。
|
|
197
|
-
- Google Scholar 是网页解析,容易触发验证,不在 `--sources all` 里;需要时用 `--platform googlescholar`。
|
|
198
|
-
- 多个来源返回同一篇论文时按 DOI 合并;arXiv 预印本和正式发表版有明确 DOI 关联时,保留正式发表记录。
|
|
199
|
-
- Sci-Hub 不是检索来源,只在下载时按 DOI 兜底。
|
|
200
|
-
|
|
201
|
-
## 配置
|
|
150
|
+
| 查影响因子和分区 | `EASYSCHOLAR_KEY` | [EasyScholar](https://www.easyscholar.cc/console/user/open) |
|
|
151
|
+
| 搜正文片段 | `SEMANTIC_SCHOLAR_API_KEY` | [Semantic Scholar](https://www.semanticscholar.org/product/api) |
|
|
202
152
|
|
|
203
|
-
|
|
153
|
+
#### 下载订阅全文(出版社接口)
|
|
204
154
|
|
|
205
|
-
|
|
|
155
|
+
| 出版社 | 要填的 key | 去哪里申请 |
|
|
206
156
|
|---|---|---|
|
|
207
|
-
|
|
|
208
|
-
|
|
|
209
|
-
| 不配时 | 用免费来源检索;“检索来源”里需要 key 的来源和功能不可用 | 下载只走开放下载渠道(见[两种下载方式](#两种下载方式)) |
|
|
157
|
+
| Elsevier | `ELSEVIER_API_KEY`;校外下订阅文章还要 `ELSEVIER_INSTTOKEN` | [Elsevier](https://dev.elsevier.com/apikey/manage) |
|
|
158
|
+
| Springer | `SPRINGER_API_KEY` | [Springer Nature](https://dev.springernature.com/) |
|
|
210
159
|
|
|
211
|
-
|
|
160
|
+
#### 增加检索来源
|
|
212
161
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
```bash
|
|
216
|
-
paper-search setup
|
|
217
|
-
paper-search config list --pretty
|
|
218
|
-
paper-search config set SEMANTIC_SCHOLAR_API_KEY <你的 key>
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
配置文件在 `~/.config/paper-search-cli/config.json`(权限 `0600`),`config list` 和 `doctor` 会把 key 脱敏显示。
|
|
222
|
-
|
|
223
|
-
| 配置项 | 用途 | 什么时候配置 |
|
|
162
|
+
| 来源 | 要填的 key | 去哪里申请 |
|
|
224
163
|
|---|---|---|
|
|
225
|
-
|
|
|
226
|
-
|
|
|
227
|
-
|
|
|
228
|
-
|
|
|
229
|
-
| `CORE_API_KEY` | CORE 仓储检索 | 经常用 CORE 或遇到限流 |
|
|
230
|
-
| `EASYSCHOLAR_KEY` | 期刊指标 | 要查影响因子、分区;用 `paper-search setup EASYSCHOLAR_KEY` 隐藏输入 |
|
|
231
|
-
| `PUBMED_API_KEY`、`NCBI_EMAIL` | PubMed 更高限额 | 经常用 PubMed |
|
|
232
|
-
| `WOS_API_KEY`、`IEEE_API_KEY`、`ELSEVIER_API_KEY`、`SPRINGER_API_KEY` | 各自的元数据;Elsevier、Springer 的 key 也用于出版社接口取全文(权限跟随你的网络或 key) | 要用对应来源时 |
|
|
233
|
-
| `ELSEVIER_INSTTOKEN` | 校外经 Elsevier 接口取全文 | 校外需要全文时;校园网不需要 |
|
|
234
|
-
| `GOOGLE_SCHOLAR_PROXY_URL` | Google Scholar 的出口代理 | 直连反复被拦时,用有授权的代理 |
|
|
235
|
-
| `PAPER_SEARCH_CARSI_ENABLED` | 机构下载扩展的开关 | `paper-search carsi install` 自动设置 |
|
|
236
|
-
| `PAPER_SEARCH_SKILL_AUTO_UPDATE` | 设为 `false` 时,升级后不再自动更新已安装的 Skill | 默认开启,想自己管理 Skill 时设置 |
|
|
237
|
-
| `PAPER_SEARCH_UPDATE_NOTIFY` | 设为 `false` 时,不再提示有新版本 | 默认开启,不想看到提示时设置 |
|
|
238
|
-
|
|
239
|
-
申请入口:[EasyScholar](https://www.easyscholar.cc/console/user/open) · [Semantic Scholar](https://www.semanticscholar.org/product/api) · [Unpaywall](https://unpaywall.org/products/api) · [CORE](https://core.ac.uk/services/api) · [NCBI](https://ncbiinsights.ncbi.nlm.nih.gov/2017/11/02/new-api-keys-for-the-e-utilities/) · [Web of Science](https://developer.clarivate.com/apis) · [IEEE Xplore](https://developer.ieee.org/docs/read/Searching_the_IEEE_Xplore_Metadata_API) · [Elsevier](https://dev.elsevier.com/apikey/manage) · [Springer Nature](https://dev.springernature.com/) · [OpenAIRE](https://develop.openaire.eu/)
|
|
240
|
-
|
|
241
|
-
### CARSI
|
|
164
|
+
| Web of Science | `WOS_API_KEY` | [Clarivate](https://developer.clarivate.com/apis) |
|
|
165
|
+
| IEEE Xplore | `IEEE_API_KEY` | [IEEE](https://developer.ieee.org/docs/read/Searching_the_IEEE_Xplore_Metadata_API) |
|
|
166
|
+
| ScienceDirect、Scopus | `ELSEVIER_API_KEY`(和上面同一个) | [Elsevier](https://dev.elsevier.com/apikey/manage) |
|
|
167
|
+
| Springer | `SPRINGER_API_KEY`(和上面同一个) | [Springer Nature](https://dev.springernature.com/) |
|
|
242
168
|
|
|
243
|
-
|
|
169
|
+
#### 提高限额、更稳定
|
|
244
170
|
|
|
245
|
-
|
|
171
|
+
| 来源 | 要填的 key | 去哪里申请 |
|
|
172
|
+
|---|---|---|
|
|
173
|
+
| PubMed | `PUBMED_API_KEY` | [NCBI](https://ncbiinsights.ncbi.nlm.nih.gov/2017/11/02/new-api-keys-for-the-e-utilities/) |
|
|
174
|
+
| CORE | `CORE_API_KEY` | [CORE](https://core.ac.uk/services/api) |
|
|
175
|
+
| OpenAIRE | `OPENAIRE_API_KEY` | [OpenAIRE](https://develop.openaire.eu/) |
|
|
246
176
|
|
|
247
|
-
|
|
177
|
+
常用命令:
|
|
248
178
|
|
|
249
179
|
```bash
|
|
250
|
-
paper-search
|
|
251
|
-
paper-search
|
|
180
|
+
paper-search setup # 逐项填写常用的几项
|
|
181
|
+
paper-search setup EASYSCHOLAR_KEY # 只填某一项
|
|
182
|
+
paper-search config list --pretty # 查看已配置的项,key 脱敏显示
|
|
252
183
|
```
|
|
253
184
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
- `--targets all` 会同步到所有内置位置。更新会覆盖包里管理的文件,保留你在 Skill 目录里自己加的文件。
|
|
257
|
-
- 升级 PaperSearch 后第一次运行时,装过的 Skill 会自动更新,被替换的旧文件备份在 `~/.local/share/paper-search-cli/skill-backups/`。不想自动更新:`paper-search config set PAPER_SEARCH_SKILL_AUTO_UPDATE false`。
|
|
258
|
-
- `paper-search doctor` 显示内置安装目标中的 Skill 位置和版本状态。
|
|
185
|
+
配置保存在 `~/.config/paper-search-cli/config.json`,只有你自己能读。下载文件夹、联系邮箱、代理和自动更新等其他设置,见 [使用说明 · 其他设置](docs/guide.zh.md#其他设置)。
|
|
259
186
|
|
|
260
|
-
##
|
|
187
|
+
## 更多文档
|
|
261
188
|
|
|
262
|
-
|
|
263
|
-
|---|---|
|
|
264
|
-
| `paper-search search` | 检索论文元数据 |
|
|
265
|
-
| `paper-search journal-metrics` | 期刊指标(EasyScholar) |
|
|
266
|
-
| `paper-search download` | 下载已核验论文的 PDF |
|
|
267
|
-
| `paper-search run <工具>` | 精确调用某个工具,参数用 `--arg` 或 `--json-args` |
|
|
268
|
-
| `paper-search failures` | 汇总下载失败的原因 |
|
|
269
|
-
| `paper-search update check` | 检查是否有新版本 |
|
|
270
|
-
| `paper-search carsi` | 机构下载扩展的安装、状态、更新、卸载 |
|
|
271
|
-
| `paper-search setup` / `config` | 配置 key、Skill 和扩展 |
|
|
272
|
-
| `paper-search doctor` | 健康检查:配置、可用功能、Skill 和扩展的状态 |
|
|
273
|
-
| `paper-search skills` | Skill 的状态、差异和更新 |
|
|
274
|
-
| `paper-search smoke` | 离线或真实的自检 |
|
|
275
|
-
| `paper-search tools` | 列出所有工具名和参数 |
|
|
276
|
-
|
|
277
|
-
命令默认输出 JSON,`--pretty` 排版,`--format text` 输出给人看的报告。完整命令见 `paper-search tools --pretty` 或 [命令约定](skills/paper-search/references/cli-contract.md)。
|
|
278
|
-
|
|
279
|
-
## 排障
|
|
280
|
-
|
|
281
|
-
| 问题 | 怎么办 |
|
|
282
|
-
|---|---|
|
|
283
|
-
| 找不到 `paper-search` 命令 | `npm install -g papersearch` 重新安装 |
|
|
284
|
-
| 安装时报 `EEXIST` | 旧包还在:先 `npm uninstall -g paper-search-cli` |
|
|
285
|
-
| 某个功能不能用 | `paper-search doctor --format text` 看缺什么,再 `paper-search setup` 配置 |
|
|
286
|
-
| 学校订阅的文章下载不到 | `paper-search carsi status --format text` 看扩展是否装好;`paper-search failures --format text` 看每篇的原因 |
|
|
287
|
-
| 来源限流 | 减小 `--max-results`、配置对应 key,或换来源 |
|
|
288
|
-
| Google Scholar 出验证页 | 等一会儿再试,或改用 `--sources no-key` |
|
|
289
|
-
| AI 读到的 Skill 是旧的 | `paper-search skills status --pretty`,再 `paper-search skills update --targets <工具>`;新开一个 AI 会话 |
|
|
189
|
+
[使用说明](docs/guide.zh.md):[命令示例](docs/guide.zh.md#命令示例)、[工作方式](docs/guide.zh.md#工作方式)、[检索来源](docs/guide.zh.md#检索来源)、[Agent Skill](docs/guide.zh.md#agent-skill)、[全部命令](docs/guide.zh.md#全部命令)、[排障](docs/guide.zh.md#排障)。也可以在终端运行 `paper-search tools --pretty` 查看全部工具和参数。
|
|
290
190
|
|
|
291
|
-
##
|
|
191
|
+
## 路线图
|
|
292
192
|
|
|
293
|
-
|
|
294
|
-
- 想了解原理和代码结构:[架构说明](docs/ARCHITECTURE.zh.md)。
|
|
295
|
-
- 下载失败或想要支持某家出版社:使用“下载失败 / 想支持某家出版社”Issue 模板,说明版本、系统、网站和 DOI。可以用 `paper-search failures --export ./failure-report.zip` 导出失败记录,先检查包里的 `summary.md` 和截图有没有个人信息,再附到 Issue。
|
|
296
|
-
- 想自己加出版社规则:见 [carsi/CONTRIBUTING.md](carsi/CONTRIBUTING.md)。
|
|
193
|
+
接下来计划做这几件事:
|
|
297
194
|
|
|
298
|
-
|
|
195
|
+
1. **进度胶囊优化**:提醒时机更准,学校登录页能自动放行时不提前打扰;减少 Windows 上浏览器启动、换页时短暂跳到前台的情况,优化显示效果。
|
|
196
|
+
2. **并行下载**:不同出版社之间并行下载,同时处理多篇,缩短几十上百篇的总耗时;每家出版社仍遵守下载上限。
|
|
197
|
+
3. **Markdown 全文包**:除了 PDF,再交付原始 XML/HTML、Markdown 阅读副本和正文图片,图号、图注和正文引用一一对应,方便直接交给 AI 阅读和引用。
|
|
198
|
+
4. **更多学校访问方式**:除了 CARSI,有条件的话再接入 WebVPN、EZProxy 等访问方式。
|
|
199
|
+
5. **检索论文、搜正文片段再优化**:参考同类工具的做法,进一步提升检索论文和搜正文片段的效果。
|
|
299
200
|
|
|
300
|
-
|
|
201
|
+
完整计划见 [路线图](docs/ROADMAP.zh.md),原理和代码结构见 [架构说明](docs/ARCHITECTURE.zh.md)。还想要什么功能,欢迎提 [Issue](https://github.com/dr-dumpling/PaperSearch/issues/new/choose) 和 PR;下载失败或想支持某家出版社,请用对应的 Issue 模板,想自己加出版社规则见 [carsi/CONTRIBUTING.md](carsi/CONTRIBUTING.md)。
|
|
301
202
|
|
|
302
|
-
##
|
|
203
|
+
## 致谢
|
|
303
204
|
|
|
304
|
-
- 感谢
|
|
205
|
+
- 感谢 LinuxDo 社区:命令 + Skill 的路线和工作流改进来自社区交流与开源分享。
|
|
305
206
|
- [openags/paper-search-mcp](https://github.com/openags/paper-search-mcp):本项目参考了它的思路,并改成独立的命令行工具。
|
|
306
|
-
- [
|
|
207
|
+
- [Dianel555/paper-search-mcp-nodejs](https://github.com/Dianel555/paper-search-mcp-nodejs)(MIT):命令行版最初由它的 Node.js 实现改编而来。
|
|
208
|
+
- [Rimagination/scansci-pdf](https://github.com/Rimagination/scansci-pdf)(MIT):机构下载后端(`carsi/`)借鉴了它的架构(CARSI 等联盟登录、出版社网站抓取、会话复用、PDF 捕获)。
|
|
307
209
|
|
|
308
210
|
## License
|
|
309
211
|
|
|
Binary file
|
|
Binary file
|
package/assets/overview.en.png
CHANGED
|
Binary file
|
package/assets/overview.png
CHANGED
|
Binary file
|
package/carsi/README.md
CHANGED
|
@@ -22,7 +22,7 @@ python3 -m venv .venv
|
|
|
22
22
|
|
|
23
23
|
## 使用
|
|
24
24
|
|
|
25
|
-
遇到 Cloudflare/Turnstile 验证框时,程序先等待网站自动检查,再自动定位并点击复选框,网站放行后继续下载。每次验证等待最多尝试 3 次,两次至少间隔 3
|
|
25
|
+
遇到 Cloudflare/Turnstile 验证框时,程序先等待网站自动检查,再自动定位并点击复选框,网站放行后继续下载。每次验证等待最多尝试 3 次,两次至少间隔 3 秒,复用当前浏览器和原等待时限;自动阶段结束后仍未放行时提示人工接管。学校登录及二次验证由本人在浏览器完成;学校认证页的信息发送同意和使用条款、出版社登录途中的条款确认页由程序代点同意,每篇各最多两次。浏览器兼容设置随学校订阅下载一起安装,在新电脑上同样生效。
|
|
26
26
|
|
|
27
27
|
等待用户操作:停在学校登录页(以及没配置学校时的选校页)每篇最多 3 分钟(配置键 `browser_login_timeout`,秒,默认 180);停在其他页面(人机验证、出版社页面、选机构页、取 PDF 时等待处理)连续超过 1 分钟就结束这一篇(`browser_page_wait_timeout`,默认 60)。两项和每家出版社每小时最多下载篇数都能在进度窗口右上角的设置(齿轮)里改。浏览器某一步 90 秒没有响应时,这一篇以 `browser_unresponsive` 结束。进度窗口的按钮:跳过本篇、本刊无权限、出版社无权限、终止任务(整批停下,剩余篇目记为 `batch_stopped`)、⚑ 报告问题。
|
|
28
28
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"""American Meteorological Society: journals on journals.ametsoc.org.
|
|
2
2
|
|
|
3
3
|
The PDF of an article page ``/view/<path>.xml`` is ``/downloadpdf/view/<path>.pdf``.
|
|
4
|
+
The site offers no institutional sign-in: its "Sign in" is the AMS member login
|
|
5
|
+
(www.ametsoc.org/ams/log-in, user name and password only), and institutions reach
|
|
6
|
+
the journals by their network address (checked 2026-11-08).
|
|
4
7
|
"""
|
|
5
8
|
from __future__ import annotations
|
|
6
9
|
|
|
@@ -42,6 +45,15 @@ def supplement_links_from_rows(rows: list[dict], doi: str) -> list[SupplementLin
|
|
|
42
45
|
class AMSAdapter(PublisherAdapter):
|
|
43
46
|
publisher = "ams"
|
|
44
47
|
|
|
48
|
+
def prepare_institution_choice(self, page: Any, result: Any) -> bool | None:
|
|
49
|
+
"""No school to choose here: the article ends at once as having no login route
|
|
50
|
+
for the school, instead of waiting on the article page for a choice."""
|
|
51
|
+
if result is not None and not getattr(result, "_institution_not_listed", False):
|
|
52
|
+
self.d._event(result, "institution_login_unavailable",
|
|
53
|
+
"AMS: member sign-in only; institutions by network address")
|
|
54
|
+
result._institution_not_listed = True
|
|
55
|
+
return False
|
|
56
|
+
|
|
45
57
|
def supplement_links(self, page: Any, doi: str) -> list[SupplementLink]:
|
|
46
58
|
return supplement_links_from_rows(page.evaluate(_SUPPLEMENT_ROWS_JS), doi)
|
|
47
59
|
|
|
@@ -254,8 +254,11 @@ class ElsevierAdapter(PublisherAdapter):
|
|
|
254
254
|
and parsed.path.startswith("/as/"))
|
|
255
255
|
|
|
256
256
|
def unsupported_platform(self, page: Any) -> str | None:
|
|
257
|
-
|
|
258
|
-
|
|
257
|
+
url = str(getattr(page, "url", "") or "")
|
|
258
|
+
host = (urlparse(url).hostname or "").lower()
|
|
259
|
+
if _CLINICALKEY.fullmatch(host) or (sciencedirect.is_page(url) and self.sciencedirect.clinicalkey_only(page)):
|
|
260
|
+
return "ClinicalKey"
|
|
261
|
+
return None
|
|
259
262
|
|
|
260
263
|
def supplements_page_urls(self, doi: str) -> list[str]:
|
|
261
264
|
"""ScienceDirect first; journals on their own Elsevier site (Cell Press,
|
|
@@ -24,7 +24,7 @@ _ITEM = re.compile(r"/science/(?:article|chapter/[^/]+)/(abs/)?pii/", re.I)
|
|
|
24
24
|
# kept in the observed tab. A control linking to another PII (a recommended or
|
|
25
25
|
# related article) never qualifies, wherever the layout puts it.
|
|
26
26
|
_VIEW_PDF_JS = """
|
|
27
|
-
() => {
|
|
27
|
+
(findOnly) => {
|
|
28
28
|
const piiOf = (value) => {
|
|
29
29
|
const match = /\\/pii\\/([0-9A-Za-z]+)/.exec(value || '');
|
|
30
30
|
return match ? match[1].toUpperCase() : '';
|
|
@@ -72,6 +72,7 @@ _VIEW_PDF_JS = """
|
|
|
72
72
|
href: target.href.slice(0, 500),
|
|
73
73
|
score: Math.round(target.score)
|
|
74
74
|
};
|
|
75
|
+
if (findOnly) return detail;
|
|
75
76
|
// Keep the site's normal navigation in the page whose PDF
|
|
76
77
|
// responses are being captured. Otherwise target=_blank
|
|
77
78
|
// opens a viewer in an unobserved tab and loses the file.
|
|
@@ -121,6 +122,22 @@ class ScienceDirectSite:
|
|
|
121
122
|
text = " ".join(self.d._body_text(page, 5000).lower().split())
|
|
122
123
|
return "cpe00001" in text and "there was a problem providing the content you requested" in text
|
|
123
124
|
|
|
125
|
+
def clinicalkey_only(self, page: Any) -> bool:
|
|
126
|
+
"""Signed in, the article page offers its full text through ClinicalKey and
|
|
127
|
+
no PDF of its own (The Lancet 1975, 2026-11-08: "You have access to this
|
|
128
|
+
article through ClinicalKey", only "View full text")."""
|
|
129
|
+
if not _ITEM.match(urlparse(str(getattr(page, "url", "") or "")).path):
|
|
130
|
+
return False
|
|
131
|
+
text = " ".join(self.d._body_text(page, 3000).lower().split())
|
|
132
|
+
if "access to this article through clinicalkey" not in text:
|
|
133
|
+
return False
|
|
134
|
+
try:
|
|
135
|
+
return not page.evaluate(_VIEW_PDF_JS, True)
|
|
136
|
+
except Exception as exc:
|
|
137
|
+
if not _is_browser_error(exc):
|
|
138
|
+
raise
|
|
139
|
+
return False
|
|
140
|
+
|
|
124
141
|
def open_pdf_entry(self, page: Any, result: Any) -> bool | None:
|
|
125
142
|
try:
|
|
126
143
|
detail = page.evaluate(_VIEW_PDF_JS)
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Without access the article page offers "Access this article" or "Access
|
|
4
4
|
through your institution". The institution login starts at myIOPscience's
|
|
5
|
-
sign-in (``myiopscience.iop.org/signin``) with the article as its target
|
|
5
|
+
sign-in (``myiopscience.iop.org/signin``) with the article as its target: with
|
|
6
|
+
``origin=deeplink`` it leads to OpenAthens' institution finder (without it, to
|
|
7
|
+
the personal account sign-in only).
|
|
6
8
|
"""
|
|
7
9
|
from __future__ import annotations
|
|
8
10
|
|
|
@@ -13,6 +15,7 @@ from ...engine.batch_common import open_page
|
|
|
13
15
|
from ..base import PublisherAdapter, SupplementLink, register
|
|
14
16
|
|
|
15
17
|
_SUPPLEMENT_ROWS_JS = """() => ({
|
|
18
|
+
status: performance.getEntriesByType('navigation')[0]?.responseStatus || 0,
|
|
16
19
|
doi: document.querySelector('meta[name="citation_doi"]')?.content || '',
|
|
17
20
|
rows: [...document.querySelectorAll('a[href]')].map(a => ({
|
|
18
21
|
href: a.href, label: (a.textContent || '').replace(/\\s+/g, ' ').trim().slice(0, 240)
|
|
@@ -25,12 +28,17 @@ def supplement_links_from_page(data: dict, page_url: str, doi: str) -> list[Supp
|
|
|
25
28
|
|
|
26
29
|
IOP's current file host uses signed URLs without a full DOI in the path.
|
|
27
30
|
Bind the list to the article page and keep the signature for the transfer.
|
|
31
|
+
An article without supplementary data has no such page (404, "Page Not
|
|
32
|
+
Found") and no "Supplementary data" link on its own page (2026-11-07).
|
|
28
33
|
"""
|
|
29
34
|
page = urlparse(page_url)
|
|
30
35
|
citation = str(data.get("doi") or "").lower().removeprefix("https://doi.org/")
|
|
31
36
|
if (page.scheme != "https" or page.netloc != "iopscience.iop.org"
|
|
32
|
-
or unquote(page.path).rstrip("/").lower() != f"/article/{doi.lower()}/data"
|
|
33
|
-
|
|
37
|
+
or unquote(page.path).rstrip("/").lower() != f"/article/{doi.lower()}/data"):
|
|
38
|
+
return None
|
|
39
|
+
if not citation and data.get("status") == 404:
|
|
40
|
+
return []
|
|
41
|
+
if citation != doi.lower():
|
|
34
42
|
return None
|
|
35
43
|
links: list[SupplementLink] = []
|
|
36
44
|
seen: set[str] = set()
|
|
@@ -64,7 +72,14 @@ class IOPAdapter(PublisherAdapter):
|
|
|
64
72
|
if "iopscience.iop.org/article/" not in current_url.lower():
|
|
65
73
|
return None
|
|
66
74
|
text = self.d._body_text(page, 5_000).lower()
|
|
67
|
-
|
|
75
|
+
offered = "access this article" in text or "access through your institution" in text
|
|
76
|
+
# An accepted manuscript's page has no access box, its PDF still needs the
|
|
77
|
+
# institution's login (Physics in Medicine & Biology, 2026-11-08). Once per
|
|
78
|
+
# article: back from the login without access, the page is left as it is.
|
|
79
|
+
manuscript = "accepted manuscript" in text and result is not None and not any(
|
|
80
|
+
e.get("state") == "sso_entry_clicked" and "myiopscience.iop.org/signin" in str(e.get("detail", ""))
|
|
81
|
+
for e in getattr(result, "events", None) or [])
|
|
82
|
+
if not offered and not manuscript:
|
|
68
83
|
return None
|
|
69
84
|
signin_url = "https://myiopscience.iop.org/signin?" + urlencode(
|
|
70
85
|
{"origin": "deeplink", "target": current_url}
|