papersearch 0.4.9 → 0.4.10
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/README.en.md +50 -63
- package/README.md +50 -63
- package/assets/overview.en.png +0 -0
- package/assets/overview.png +0 -0
- package/assets/progress-capsule.en.png +0 -0
- package/assets/progress-capsule.png +0 -0
- package/carsi/README.md +5 -6
- package/carsi/paper_search_carsi/adapters/elsevier/__init__.py +1 -1
- package/carsi/paper_search_carsi/adapters/ieee/__init__.py +1 -1
- package/carsi/paper_search_carsi/adapters/jama/__init__.py +3 -1
- package/carsi/paper_search_carsi/adapters/karger/__init__.py +2 -1
- package/carsi/paper_search_carsi/adapters/lww/ovid.py +2 -2
- package/carsi/paper_search_carsi/adapters/oup/__init__.py +3 -4
- package/carsi/paper_search_carsi/adapters/world_scientific/__init__.py +5 -4
- package/carsi/paper_search_carsi/assets/capsule.html +114 -15
- package/carsi/paper_search_carsi/browser/backend.py +269 -233
- package/carsi/paper_search_carsi/browser/batch_session.py +42 -0
- package/carsi/paper_search_carsi/browser/challenge_interaction.py +28 -9
- package/carsi/paper_search_carsi/browser/cookies.py +8 -8
- package/carsi/paper_search_carsi/browser/driver.py +29 -0
- package/carsi/paper_search_carsi/browser/engine.py +17 -23
- package/carsi/paper_search_carsi/browser/foreground.py +21 -15
- package/carsi/paper_search_carsi/browser/login.py +12 -18
- package/carsi/paper_search_carsi/browser/preview.py +31 -12
- package/carsi/paper_search_carsi/browser/profiles.py +16 -23
- package/carsi/paper_search_carsi/browser/watchdog.py +61 -55
- package/carsi/paper_search_carsi/cli.py +22 -7
- package/carsi/paper_search_carsi/cold_start.py +65 -51
- package/carsi/paper_search_carsi/config.py +6 -4
- package/carsi/paper_search_carsi/engine/batch.py +9 -5
- package/carsi/paper_search_carsi/engine/batch_capture.py +56 -20
- package/carsi/paper_search_carsi/engine/batch_common.py +56 -16
- package/carsi/paper_search_carsi/engine/batch_institution.py +122 -13
- package/carsi/paper_search_carsi/engine/batch_login.py +30 -2
- package/carsi/paper_search_carsi/engine/batch_user.py +1 -1
- package/carsi/paper_search_carsi/engine/batch_waits.py +21 -7
- package/carsi/paper_search_carsi/engine/bridge.py +23 -13
- package/carsi/paper_search_carsi/engine/login_wait.py +1 -1
- package/carsi/paper_search_carsi/mcp_progress.py +13 -5
- package/carsi/paper_search_carsi/network.py +1 -1
- package/carsi/paper_search_carsi/progress_reporter.py +88 -7
- package/carsi/paper_search_carsi/progress_view.py +61 -0
- package/carsi/paper_search_carsi/server.py +47 -10
- package/carsi/paper_search_carsi/session_broker.py +1 -1
- package/carsi/pyproject.toml +7 -7
- package/dist/capabilities/pdf-discovery/OpenAccessFallbackService.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/OpenAccessFallbackService.js +6 -0
- package/dist/capabilities/pdf-discovery/OpenAccessFallbackService.js.map +1 -1
- package/dist/capabilities/pdf-discovery/batch.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/batch.js +15 -5
- package/dist/capabilities/pdf-discovery/batch.js.map +1 -1
- package/dist/capabilities/pdf-discovery/batchSummary.d.ts +22 -0
- package/dist/capabilities/pdf-discovery/batchSummary.d.ts.map +1 -0
- package/dist/capabilities/pdf-discovery/batchSummary.js +131 -0
- package/dist/capabilities/pdf-discovery/batchSummary.js.map +1 -0
- package/dist/capabilities/pdf-discovery/carsi/CarsiAttempt.d.ts +1 -0
- package/dist/capabilities/pdf-discovery/carsi/CarsiAttempt.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiAttempt.js +52 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiAttempt.js.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiMcpClient.d.ts +8 -4
- package/dist/capabilities/pdf-discovery/carsi/CarsiMcpClient.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiMcpClient.js +89 -30
- package/dist/capabilities/pdf-discovery/carsi/CarsiMcpClient.js.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiReadiness.d.ts +4 -0
- package/dist/capabilities/pdf-discovery/carsi/CarsiReadiness.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/CarsiReadiness.js +10 -0
- package/dist/capabilities/pdf-discovery/carsi/CarsiReadiness.js.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/index.d.ts +2 -2
- package/dist/capabilities/pdf-discovery/carsi/index.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/index.js +1 -1
- package/dist/capabilities/pdf-discovery/carsi/index.js.map +1 -1
- package/dist/capabilities/pdf-discovery/carsi/types.d.ts +36 -0
- package/dist/capabilities/pdf-discovery/carsi/types.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/handler.d.ts.map +1 -1
- package/dist/capabilities/pdf-discovery/handler.js +11 -6
- package/dist/capabilities/pdf-discovery/handler.js.map +1 -1
- package/dist/capabilities/pdf-discovery/types.d.ts +3 -0
- package/dist/capabilities/pdf-discovery/types.d.ts.map +1 -1
- package/dist/cli.js +13 -9
- package/dist/cli.js.map +1 -1
- package/dist/management/carsi/installer.d.ts +26 -14
- package/dist/management/carsi/installer.d.ts.map +1 -1
- package/dist/management/carsi/installer.js +113 -69
- package/dist/management/carsi/installer.js.map +1 -1
- package/dist/management/carsi/runtime.d.ts +12 -1
- package/dist/management/carsi/runtime.d.ts.map +1 -1
- package/dist/management/carsi/runtime.js +30 -1
- package/dist/management/carsi/runtime.js.map +1 -1
- package/package.json +1 -1
- package/skills/paper-search/SKILL.md +4 -4
- package/skills/paper-search/references/browser-download.md +3 -3
- package/skills/paper-search/references/carsi-setup.md +7 -6
- package/skills/paper-search/references/cli-contract.md +4 -4
- package/skills/paper-search/references/management-layer.md +2 -2
- package/carsi/paper_search_carsi/assets/quiet-browser/api.js +0 -142
- package/carsi/paper_search_carsi/assets/quiet-browser/manifest.json +0 -24
- package/carsi/paper_search_carsi/assets/quiet-browser/schema.json +0 -1
- package/carsi/paper_search_carsi/browser/background.py +0 -68
package/README.en.md
CHANGED
|
@@ -7,10 +7,13 @@
|
|
|
7
7
|
<p align="center"><b>Let your AI tools search the literature, verify citations, and download full texts and supplementary files.</b></p>
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
10
|
-
<a href="https://www.npmjs.com/package/papersearch"><img src="https://img.shields.io/npm/v/papersearch" alt="npm"></a>
|
|
11
|
-
<img src="https://img.shields.io/
|
|
12
|
-
<img src="https://img.shields.io/badge/
|
|
13
|
-
<a href="https://
|
|
10
|
+
<a href="https://www.npmjs.com/package/papersearch"><img src="https://img.shields.io/npm/v/papersearch?style=flat-square" alt="npm"></a>
|
|
11
|
+
<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="Publish workflow status"></a>
|
|
12
|
+
<a href="#institutional-download-extension"><img src="https://img.shields.io/badge/CARSI-institutional%20downloads-7284CE?style=flat-square" alt="CARSI institutional download extension"></a>
|
|
13
|
+
<a href="https://nodejs.org/"><img src="https://img.shields.io/node/v/papersearch?style=flat-square" alt="Required Node.js version"></a>
|
|
14
|
+
<a href="#agent-skill"><img src="https://img.shields.io/badge/Agent%20Skill-bundled-D97757?style=flat-square" alt="Bundled Agent Skill"></a>
|
|
15
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-2F9E44?style=flat-square" alt="MIT license"></a>
|
|
16
|
+
<a href="https://linux.do"><img src="https://img.shields.io/badge/LinuxDo-community-1f6feb?style=flat-square" alt="LinuxDo community"></a>
|
|
14
17
|
</p>
|
|
15
18
|
|
|
16
19
|
<p align="center"><a href="README.md">简体中文</a> | English</p>
|
|
@@ -22,7 +25,7 @@ PaperSearch provides the `paper-search` command and a bundled Skill. Once instal
|
|
|
22
25
|
- **Every paper checked**: each PDF's first page is checked against the DOI and title; a file of another article is not counted as a success.
|
|
23
26
|
- **Ready to use**: one folder per paper named journal_year_title, with the main text and supplementary files together; papers not downloaded come with a reason.
|
|
24
27
|
|
|
25
|
-
<p align="center"><img src="assets/overview.en.png" width="
|
|
28
|
+
<p align="center"><img src="assets/overview.en.png" width="840" alt="What PaperSearch does: search papers, full-text snippets, journal metrics, citations and references, full texts and supplementary files"></p>
|
|
26
29
|
|
|
27
30
|
[What you get](#what-you-get) | [Quick start](#quick-start) | [Common tasks](#common-tasks) | [How it works](#how-it-works) | [Institutional download extension](#institutional-download-extension) | [Search sources](#search-sources) | [Configuration](#configuration) | [Agent Skill](#agent-skill) | [Commands](#commands) | [Troubleshooting](#troubleshooting)
|
|
28
31
|
|
|
@@ -46,39 +49,39 @@ downloads/
|
|
|
46
49
|
└── diagnostics/ run records, file manifests, screenshots
|
|
47
50
|
```
|
|
48
51
|
|
|
49
|
-
|
|
52
|
+
## Quick start
|
|
50
53
|
|
|
51
|
-
|
|
54
|
+
First-time installation requires Node.js 18 or later and npm. Copy one line to install `paper-search` and its Skill for Codex. For another AI tool, replace `codex` with its `--targets` value from [Agent Skill](#agent-skill).
|
|
52
55
|
|
|
53
|
-
|
|
56
|
+
**macOS, Linux, or Windows Command Prompt:**
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
npm install -g papersearch && paper-search skills update --targets codex
|
|
60
|
+
```
|
|
54
61
|
|
|
55
|
-
|
|
62
|
+
**Windows PowerShell:**
|
|
56
63
|
|
|
57
|
-
```
|
|
58
|
-
npm install -g papersearch
|
|
59
|
-
paper-search setup
|
|
60
|
-
paper-search doctor --format text
|
|
64
|
+
```powershell
|
|
65
|
+
npm.cmd install -g papersearch; if ($LASTEXITCODE -eq 0) { paper-search.cmd skills update --targets codex }
|
|
61
66
|
```
|
|
62
67
|
|
|
63
|
-
`paper-search
|
|
68
|
+
Start a new AI session after installing, and you can search for papers. For terminal use, installing `paper-search` alone is enough. Run `paper-search setup` when you need to configure API keys or email. For papers your school subscribes to, install the [institutional download extension](#institutional-download-extension). Run `paper-search doctor --format text` to check which features are available.
|
|
64
69
|
|
|
65
|
-
|
|
70
|
+
If you already have `paper-search`, install the Skill on its own; the `--targets` values are listed under [Agent Skill](#agent-skill) below:
|
|
66
71
|
|
|
67
72
|
```bash
|
|
68
73
|
paper-search skills update --targets claude
|
|
69
74
|
```
|
|
70
75
|
|
|
71
|
-
For Kimi Code and Qwen Code, use `--targets agents` to install into the shared directory. See [Agent Skill](#agent-skill) below for TRAE and CodeBuddy.
|
|
72
|
-
|
|
73
76
|
You can also send this to your AI tool and let it do the install:
|
|
74
77
|
|
|
75
78
|
```text
|
|
76
|
-
Please install PaperSearch for me: run npm install -g papersearch, then install the bundled Skill for yourself using the README's Agent Skill instructions
|
|
79
|
+
Please install PaperSearch for me: run npm install -g papersearch, then install the bundled Skill for yourself using the README's Agent Skill instructions, then run paper-search doctor --format text and tell me which features work and which keys are missing; then ask me which folder downloaded papers should go to by default and save it with paper-search config set DEFAULT_DOWNLOAD_PATH. I will enter API keys myself with paper-search setup in a terminal; do not ask me to paste them into the chat.
|
|
77
80
|
```
|
|
78
81
|
|
|
79
82
|
**Coming from the old package `paper-search-cli`**: run `npm uninstall -g paper-search-cli`, then `npm install -g papersearch`. Both provide the same `paper-search` command and cannot be installed together; your configuration, Skill, school login and download records stay.
|
|
80
83
|
|
|
81
|
-
**Later upgrades**: `npm install -g papersearch@latest`.
|
|
84
|
+
**Later upgrades**: `npm install -g papersearch@latest`. When a new version is out, commands say so in the terminal; the first run after an upgrade updates the Skill you installed.
|
|
82
85
|
|
|
83
86
|
## Common tasks
|
|
84
87
|
|
|
@@ -138,7 +141,7 @@ A literature request
|
|
|
138
141
|
|---|---|---|
|
|
139
142
|
| Available | As soon as PaperSearch is installed | After `paper-search carsi install` |
|
|
140
143
|
| Gets | Open-access main text | Main text your school subscribes to; supplementary files from the publishers with rules for them |
|
|
141
|
-
| How | Direct downloads, usually seconds, no login: the source's own download, PDF links in the metadata, PubMed Central, Unpaywall, publisher APIs (your own Elsevier/Springer keys); last, the Sci-Hub fallback, on by default |
|
|
144
|
+
| How | Direct downloads, usually seconds, no login: the source's own download, PDF links in the metadata, PubMed Central, Unpaywall, publisher APIs (your own Elsevier/Springer keys); last, the Sci-Hub fallback, on by default | Chrome signs in to your school through CARSI and takes the PDF from the publisher's site |
|
|
142
145
|
| What you do | Nothing | Sign in to your school in the browser; verification is handled automatically, with a prompt when manual action is needed |
|
|
143
146
|
|
|
144
147
|
Both use the same download command: open downloading first, and when it finds nothing, the institutional download if it is installed.
|
|
@@ -150,28 +153,32 @@ Both use the same download command: open downloading first, and when it finds no
|
|
|
150
153
|
|
|
151
154
|
### Download results
|
|
152
155
|
|
|
153
|
-
A download folder has two parts. `papers/` holds the papers, one folder each, with the main text named journal_year_title and supplementary files under that paper's `supplements/` with their original names. `diagnostics/` holds run records, file manifests and screenshots, for tracking down problems. The short ID at the end of a folder name tells apart papers with the same title. A missing journal or year is written as unknown.
|
|
156
|
+
A download folder has two parts. `papers/` holds the papers, one folder each, with the main text named journal_year_title and supplementary files under that paper's `supplements/` with their original names. `diagnostics/` holds run records, file manifests and screenshots, for tracking down problems. The short ID at the end of a folder name tells apart papers with the same title. A missing journal or year is written as unknown. The JSON a command returns gives each file's actual location.
|
|
154
157
|
|
|
155
158
|
## Institutional download extension
|
|
156
159
|
|
|
160
|
+
Papers the open channels cannot get can come through your school's subscriptions: PaperSearch opens Chrome, signs in to your school through CARSI (the China higher-education identity federation), and takes the main text and supplementary files from the publisher's site.
|
|
161
|
+
|
|
162
|
+
Install [Google Chrome](https://www.google.com/chrome/) first, then run:
|
|
163
|
+
|
|
157
164
|
```bash
|
|
158
|
-
paper-search carsi install
|
|
159
|
-
paper-search carsi status --format text
|
|
165
|
+
paper-search carsi install # choose your school during installation
|
|
166
|
+
paper-search carsi status --format text # check that it is ready
|
|
160
167
|
```
|
|
161
168
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
-
|
|
165
|
-
-
|
|
166
|
-
- The
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
169
|
+
Then ask your AI tool to download papers as usual:
|
|
170
|
+
|
|
171
|
+
- **The first time a login is needed**, sign in to your school in the browser that opens; the login is remembered.
|
|
172
|
+
- **Human verification** is clicked automatically; you are asked only when it does not pass.
|
|
173
|
+
- **The progress capsule** in a screen corner shows the progress. It turns amber when you need to sign in or verify; click it to switch to the browser. Hover over it to skip a paper or stop the task; the gear sets the waiting times, the default download folder and system notifications.
|
|
174
|
+
- **The browser works in the background** and does not jump to the front.
|
|
175
|
+
- **When the download ends**, the capsule lists what succeeded and what failed, with reasons; `paper-search failures --format text` gives the details.
|
|
176
|
+
|
|
177
|
+
<p align="center"><img src="assets/progress-capsule.en.png" width="840" alt="The progress capsule: downloading, sign-in needed, expanded on hover, and the finished card with what failed and why"></p>
|
|
178
|
+
|
|
179
|
+
Which publishers' main texts and supplementary files it can fetch is in the [publisher support table](skills/paper-search/references/publisher-support.md) (Chinese).
|
|
180
|
+
|
|
181
|
+
Update the extension with `paper-search carsi update`; remove it with `paper-search carsi uninstall`. On Windows, if PowerShell blocks `npm`, use `npm.cmd`.
|
|
175
182
|
|
|
176
183
|
## Search sources
|
|
177
184
|
|
|
@@ -211,7 +218,7 @@ paper-search config list --pretty
|
|
|
211
218
|
paper-search config set SEMANTIC_SCHOLAR_API_KEY <your key>
|
|
212
219
|
```
|
|
213
220
|
|
|
214
|
-
The configuration file is `~/.config/paper-search-cli/config.json` (mode `0600
|
|
221
|
+
The configuration file is `~/.config/paper-search-cli/config.json` (mode `0600`). `config list` and `doctor` show keys masked.
|
|
215
222
|
|
|
216
223
|
| Key | Use | When |
|
|
217
224
|
|---|---|---|
|
|
@@ -227,6 +234,7 @@ The configuration file is `~/.config/paper-search-cli/config.json` (mode `0600`;
|
|
|
227
234
|
| `GOOGLE_SCHOLAR_PROXY_URL` | Egress proxy for Google Scholar | When direct requests keep being challenged; use a proxy you are allowed to use |
|
|
228
235
|
| `PAPER_SEARCH_CARSI_ENABLED` | Switch for the institutional download extension | Set by `paper-search carsi install` |
|
|
229
236
|
| `PAPER_SEARCH_SKILL_AUTO_UPDATE` | `false` stops upgrades from updating the installed Skill | On by default; set it to manage the Skill yourself |
|
|
237
|
+
| `PAPER_SEARCH_UPDATE_NOTIFY` | `false` stops the new-version notices | On by default; set it if you do not want the notices |
|
|
230
238
|
|
|
231
239
|
Where to get keys: [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/)
|
|
232
240
|
|
|
@@ -243,32 +251,12 @@ paper-search skills status --pretty
|
|
|
243
251
|
paper-search skills update --targets claude
|
|
244
252
|
```
|
|
245
253
|
|
|
246
|
-
AI tools
|
|
247
|
-
|
|
248
|
-
| Tool | Setup |
|
|
249
|
-
|---|---|
|
|
250
|
-
| [Kimi Code](https://www.kimi.com/code/docs/kimi-code-cli/customization/skills.html), [Qwen Code](https://github.com/QwenLM/qwen-code/blob/main/docs/users/features/skills.md) | Run `paper-search skills update --targets agents` to install into the shared `~/.agents/skills/paper-search/` directory supported by both tools |
|
|
251
|
-
| [TRAE](https://docs.trae.ai/ide/skills?_lang=zh) | Copy the bundled Skill folder to `.trae/skills/paper-search/` in your project |
|
|
252
|
-
| [CodeBuddy](https://www.codebuddy.ai/docs/zh/ide/Features/Skills) | Copy the bundled Skill folder to `.codebuddy/skills/paper-search/` in your project |
|
|
253
|
-
|
|
254
|
-
Run `npm root -g` to locate the global npm directory; the bundled Skill is under `papersearch/skills/paper-search/` there. Copy the entire folder, including `references/`, and copy it again after an update. Start a new AI session after installation.
|
|
254
|
+
`--targets` takes `codex`, `claude`, `cursor`, `gemini`, `antigravity` or `agents` (the shared `~/.agents/skills/` directory). For other AI tools that read Skill folders, copy the bundled Skill into their Skill directory: run `npm root -g` to locate the global npm directory; the bundled Skill is under `papersearch/skills/paper-search/` there. Copy the entire folder, including `references/`, and copy it again after an update. Start a new AI session after installation.
|
|
255
255
|
|
|
256
|
-
-
|
|
257
|
-
-
|
|
256
|
+
- `--targets all` syncs the Skill to all built-in locations. Updating overwrites the files the package manages and keeps files you added to the Skill directory.
|
|
257
|
+
- The first run after upgrading PaperSearch updates the Skill you installed; replaced files are backed up under `~/.local/share/paper-search-cli/skill-backups/`. To turn this off: `paper-search config set PAPER_SEARCH_SKILL_AUTO_UPDATE false`.
|
|
258
258
|
- `paper-search doctor` shows Skill locations and version status for the built-in installation targets.
|
|
259
259
|
|
|
260
|
-
### Update notices (since 0.4.8)
|
|
261
|
-
|
|
262
|
-
When npm has a newer stable version, ordinary invocations show the installed and latest versions and an upgrade command. Checks run alongside online tasks and cache successful results for 24 hours. Network failures do not affect paper tasks; unfinished checks are cancelled when the command ends. Notices go to stderr, preserving stdout JSON. Offline management commands use only cached results; CI, help and configuration commands do not show automatic notices.
|
|
263
|
-
|
|
264
|
-
```bash
|
|
265
|
-
paper-search update check --format text
|
|
266
|
-
paper-search config set PAPER_SEARCH_UPDATE_NOTIFY false # Disable automatic checks and notices
|
|
267
|
-
paper-search config set PAPER_SEARCH_UPDATE_NOTIFY true # Enable them again
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
Updates are never installed automatically. Installed Skills sync under the existing rules after a CLI upgrade; update the institutional extension separately with `paper-search carsi update`. This setting is independent of capsule/system notifications.
|
|
271
|
-
|
|
272
260
|
## Commands
|
|
273
261
|
|
|
274
262
|
| Command | Use |
|
|
@@ -278,7 +266,7 @@ Updates are never installed automatically. Installed Skills sync under the exist
|
|
|
278
266
|
| `paper-search download` | Download the PDF of a verified paper |
|
|
279
267
|
| `paper-search run <tool>` | Call one tool exactly, with `--arg` or `--json-args` |
|
|
280
268
|
| `paper-search failures` | Why downloads failed, summarized |
|
|
281
|
-
| `paper-search update check` | Check
|
|
269
|
+
| `paper-search update check` | Check for a new version |
|
|
282
270
|
| `paper-search carsi` | Install, check, update or remove the institutional download extension |
|
|
283
271
|
| `paper-search setup` / `config` | Configure keys, the Skill and the extension |
|
|
284
272
|
| `paper-search doctor` | Health check: configuration, available features, Skill and extension status |
|
|
@@ -304,8 +292,7 @@ Commands print JSON by default; `--pretty` formats it and `--format text` prints
|
|
|
304
292
|
|
|
305
293
|
- Next: steadier batch downloads and smoother installs on new computers; beyond PDFs, a full-text package (the original XML/HTML, Markdown and the figures). See the [roadmap](docs/ROADMAP.zh.md) (Chinese).
|
|
306
294
|
- How it works inside and where the code is: [architecture](docs/ARCHITECTURE.zh.md) (Chinese).
|
|
307
|
-
- For failed downloads or publisher requests, use the download-failure issue template and provide the version, OS, website and DOI.
|
|
308
|
-
- New in 0.4.8: `paper-search failures --export ./failure-report.zip` exports institutional failures from the latest run, including saved main texts with incomplete supplements. Add `--run <run-id> --doi <DOI>` to select a paper. Review `summary.md`, HTML and images for personal information before attaching the ZIP manually. Export sanitizes copies without modifying originals, retrying downloads or uploading anything. Missing HTML in older records is explicitly reported. If your installed version lacks this command, report the version and symptoms without uploading raw diagnostics.
|
|
295
|
+
- For failed downloads or publisher requests, use the download-failure issue template and provide the version, OS, website and DOI. `paper-search failures --export ./failure-report.zip` exports the failure records; check the `summary.md` and screenshots in it for personal information before attaching it.
|
|
309
296
|
- To add publisher rules yourself: see [carsi/CONTRIBUTING.md](carsi/CONTRIBUTING.md).
|
|
310
297
|
|
|
311
298
|
## Use responsibly
|
package/README.md
CHANGED
|
@@ -7,10 +7,13 @@
|
|
|
7
7
|
<p align="center"><b>让 AI 帮你查文献、核对引用、下载全文和补充材料。</b></p>
|
|
8
8
|
|
|
9
9
|
<p align="center">
|
|
10
|
-
<a href="https://www.npmjs.com/package/papersearch"><img src="https://img.shields.io/npm/v/papersearch" alt="npm"></a>
|
|
11
|
-
<img src="https://img.shields.io/
|
|
12
|
-
<img src="https://img.shields.io/badge/
|
|
13
|
-
<a href="https://
|
|
10
|
+
<a href="https://www.npmjs.com/package/papersearch"><img src="https://img.shields.io/npm/v/papersearch?style=flat-square" alt="npm"></a>
|
|
11
|
+
<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
|
+
<a href="https://nodejs.org/"><img src="https://img.shields.io/node/v/papersearch?style=flat-square" alt="Node.js 版本要求"></a>
|
|
14
|
+
<a href="#agent-skill"><img src="https://img.shields.io/badge/Agent%20Skill-bundled-D97757?style=flat-square" alt="随包 Agent Skill"></a>
|
|
15
|
+
<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>
|
|
14
17
|
</p>
|
|
15
18
|
|
|
16
19
|
<p align="center">简体中文 | <a href="README.en.md">English</a></p>
|
|
@@ -22,7 +25,7 @@ PaperSearch 提供 `paper-search` 命令和一份随包 Skill。装好后,Clau
|
|
|
22
25
|
- **每一篇都核对过**:逐个核对 PDF 首页的 DOI 和题名,不是这篇文章的不算成功。
|
|
23
26
|
- **结果直接能用**:按“期刊_年份_标题”建文件夹,正文和补充材料放在一起;没下到的篇目说明原因。
|
|
24
27
|
|
|
25
|
-
<p align="center"><img src="assets/overview.png" width="
|
|
28
|
+
<p align="center"><img src="assets/overview.png" width="840" alt="PaperSearch 能做的事:检索论文、搜正文片段、查期刊与分区、查引文和参考文献、下载全文和补充材料"></p>
|
|
26
29
|
|
|
27
30
|
[效果](#效果) | [快速开始](#快速开始) | [常见任务](#常见任务) | [工作方式](#工作方式) | [机构下载扩展](#机构下载扩展) | [检索来源](#检索来源) | [配置](#配置) | [Agent Skill](#agent-skill) | [命令](#命令) | [排障](#排障)
|
|
28
31
|
|
|
@@ -46,39 +49,39 @@ downloads/
|
|
|
46
49
|
└── diagnostics/ 运行记录、附件清单、截图
|
|
47
50
|
```
|
|
48
51
|
|
|
49
|
-
|
|
52
|
+
## 快速开始
|
|
50
53
|
|
|
51
|
-
|
|
54
|
+
首次安装需要 Node.js 18 或更高版本和 npm。下面以 Codex 为例,复制一行即可装好 `paper-search` 和配套 Skill。用其他 AI 工具时,把 `codex` 换成 [Agent Skill](#agent-skill) 里对应的 `--targets` 取值。
|
|
52
55
|
|
|
53
|
-
|
|
56
|
+
**macOS、Linux 或 Windows 命令提示符:**
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
npm install -g papersearch && paper-search skills update --targets codex
|
|
60
|
+
```
|
|
54
61
|
|
|
55
|
-
|
|
62
|
+
**Windows PowerShell:**
|
|
56
63
|
|
|
57
|
-
```
|
|
58
|
-
npm install -g papersearch
|
|
59
|
-
paper-search setup
|
|
60
|
-
paper-search doctor --format text
|
|
64
|
+
```powershell
|
|
65
|
+
npm.cmd install -g papersearch; if ($LASTEXITCODE -eq 0) { paper-search.cmd skills update --targets codex }
|
|
61
66
|
```
|
|
62
67
|
|
|
63
|
-
`paper-search
|
|
68
|
+
装好后,新开一个 AI 会话就可以查文献。只在终端使用的话,装 `paper-search` 就够了。需要 API key 或邮箱时,再运行 `paper-search setup`;需要下载学校订阅的论文时,再按 [机构下载扩展](#机构下载扩展) 安装。想检查当前可用功能,运行 `paper-search doctor --format text`。
|
|
64
69
|
|
|
65
|
-
|
|
70
|
+
已装好 `paper-search` 的用户可以单独补装 Skill,`--targets` 的取值见下方 [Agent Skill](#agent-skill):
|
|
66
71
|
|
|
67
72
|
```bash
|
|
68
73
|
paper-search skills update --targets claude
|
|
69
74
|
```
|
|
70
75
|
|
|
71
|
-
Kimi Code、Qwen Code 使用 `--targets agents`,将 Skill 安装到共享目录。TRAE、CodeBuddy 的接入方式见下方 [Agent Skill](#agent-skill)。
|
|
72
|
-
|
|
73
76
|
也可以把下面这段话发给你的 AI 工具,让它帮你装:
|
|
74
77
|
|
|
75
78
|
```text
|
|
76
|
-
请帮我安装 PaperSearch:运行 npm install -g papersearch,再按 README 的 Agent Skill 说明为你自己安装随包 Skill
|
|
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 输入,不要让我发到聊天里。
|
|
77
80
|
```
|
|
78
81
|
|
|
79
82
|
**从旧包 `paper-search-cli` 升级**:先运行 `npm uninstall -g paper-search-cli`,再 `npm install -g papersearch`。两个包提供同一个 `paper-search` 命令,不能同时装;配置、Skill、学校登录和下载记录都会保留。
|
|
80
83
|
|
|
81
|
-
**以后升级**:`npm install -g papersearch@latest
|
|
84
|
+
**以后升级**:`npm install -g papersearch@latest`。有新版本时,命令会在终端提示;升级后第一次运行时,装过的 Skill 会自动更新。
|
|
82
85
|
|
|
83
86
|
## 常见任务
|
|
84
87
|
|
|
@@ -138,7 +141,7 @@ paper-search failures --format text
|
|
|
138
141
|
|---|---|---|
|
|
139
142
|
| 能不能直接用 | 装好就能用 | 要另外安装:`paper-search carsi install` |
|
|
140
143
|
| 能拿到什么 | 开放获取的正文 | 你的学校订阅的正文;有规则的出版社还能取补充材料 |
|
|
141
|
-
| 怎么拿 | 程序直接下载,通常几秒,不用登录:来源自带的下载、元数据里的 PDF 地址、PubMed Central、Unpaywall、出版社接口(你自己的 Elsevier/Springer key);最后是默认开启的 Sci-Hub 兜底 |
|
|
144
|
+
| 怎么拿 | 程序直接下载,通常几秒,不用登录:来源自带的下载、元数据里的 PDF 地址、PubMed Central、Unpaywall、出版社接口(你自己的 Elsevier/Springer key);最后是默认开启的 Sci-Hub 兜底 | 打开 Chrome,经 CARSI 登录你的学校,在出版社网站上取 PDF |
|
|
142
145
|
| 你要做的事 | 无 | 在浏览器里登录学校;程序自动过验证,需要人工接管时再按提示操作 |
|
|
143
146
|
|
|
144
147
|
两种方式用同一个下载命令:先试开放下载,拿不到时,装了机构下载才继续用学校权限。
|
|
@@ -150,28 +153,32 @@ paper-search failures --format text
|
|
|
150
153
|
|
|
151
154
|
### 下载结果
|
|
152
155
|
|
|
153
|
-
下载目录分两部分:`papers/` 放论文,每篇一个文件夹,正文按“期刊_年份_标题”命名,补充材料在该篇的 `supplements/` 里并保留原文件名;`diagnostics/`
|
|
156
|
+
下载目录分两部分:`papers/` 放论文,每篇一个文件夹,正文按“期刊_年份_标题”命名,补充材料在该篇的 `supplements/` 里并保留原文件名;`diagnostics/` 放运行记录、附件清单和截图,查问题时用。文件夹名末尾的短标识用来区分同名论文。缺少期刊或年份时写“未知期刊”“未知年份”。命令返回的 JSON 里写着每个文件的实际位置。
|
|
154
157
|
|
|
155
158
|
## 机构下载扩展
|
|
156
159
|
|
|
160
|
+
开放渠道拿不到的论文,可以用学校的订阅下载:程序打开 Chrome,经 CARSI(中国高校身份联盟)登录你的学校,在出版社网站上取正文和补充材料。
|
|
161
|
+
|
|
162
|
+
先装好 [Google Chrome](https://www.google.com/chrome/),再运行:
|
|
163
|
+
|
|
157
164
|
```bash
|
|
158
|
-
paper-search carsi install
|
|
159
|
-
paper-search carsi status --format text
|
|
165
|
+
paper-search carsi install # 安装时选择你的学校
|
|
166
|
+
paper-search carsi status --format text # 查看是否装好
|
|
160
167
|
```
|
|
161
168
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
-
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
|
|
170
|
-
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
- Windows
|
|
169
|
+
装好后照常让 AI 下载论文:
|
|
170
|
+
|
|
171
|
+
- **第一次需要登录时**,在打开的浏览器里登录学校,之后会记住登录状态。
|
|
172
|
+
- **人机验证**由程序自动点击,过不去时再提醒你。
|
|
173
|
+
- **进度胶囊**在屏幕角落显示进度;需要你登录或验证时变成琥珀色,点一下就切到浏览器。鼠标指上去可以跳过本篇或终止任务,齿轮里可以改等待时间、默认下载文件夹和系统通知。
|
|
174
|
+
- **浏览器在后台工作**,不会跳到前台打扰你。
|
|
175
|
+
- **下载结束**后,胶囊列出成功和失败的篇目及原因;更详细的原因用 `paper-search failures --format text` 查看。
|
|
176
|
+
|
|
177
|
+
<p align="center"><img src="assets/progress-capsule.png" width="840" alt="进度胶囊:下载中、需要你登录、鼠标指上去展开、结束时列出成功失败和原因"></p>
|
|
178
|
+
|
|
179
|
+
能取哪些出版社的正文和补充材料,见 [出版社支持表](skills/paper-search/references/publisher-support.md)。
|
|
180
|
+
|
|
181
|
+
更新扩展:`paper-search carsi update`;卸载:`paper-search carsi uninstall`。Windows 的 PowerShell 拦住 `npm` 时,改用 `npm.cmd`。
|
|
175
182
|
|
|
176
183
|
## 检索来源
|
|
177
184
|
|
|
@@ -211,7 +218,7 @@ paper-search config list --pretty
|
|
|
211
218
|
paper-search config set SEMANTIC_SCHOLAR_API_KEY <你的 key>
|
|
212
219
|
```
|
|
213
220
|
|
|
214
|
-
配置文件在 `~/.config/paper-search-cli/config.json`(权限 `0600
|
|
221
|
+
配置文件在 `~/.config/paper-search-cli/config.json`(权限 `0600`),`config list` 和 `doctor` 会把 key 脱敏显示。
|
|
215
222
|
|
|
216
223
|
| 配置项 | 用途 | 什么时候配置 |
|
|
217
224
|
|---|---|---|
|
|
@@ -227,6 +234,7 @@ paper-search config set SEMANTIC_SCHOLAR_API_KEY <你的 key>
|
|
|
227
234
|
| `GOOGLE_SCHOLAR_PROXY_URL` | Google Scholar 的出口代理 | 直连反复被拦时,用有授权的代理 |
|
|
228
235
|
| `PAPER_SEARCH_CARSI_ENABLED` | 机构下载扩展的开关 | `paper-search carsi install` 自动设置 |
|
|
229
236
|
| `PAPER_SEARCH_SKILL_AUTO_UPDATE` | 设为 `false` 时,升级后不再自动更新已安装的 Skill | 默认开启,想自己管理 Skill 时设置 |
|
|
237
|
+
| `PAPER_SEARCH_UPDATE_NOTIFY` | 设为 `false` 时,不再提示有新版本 | 默认开启,不想看到提示时设置 |
|
|
230
238
|
|
|
231
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/)
|
|
232
240
|
|
|
@@ -243,32 +251,12 @@ paper-search skills status --pretty
|
|
|
243
251
|
paper-search skills update --targets claude
|
|
244
252
|
```
|
|
245
253
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
| 工具 | 接入方式 |
|
|
249
|
-
|---|---|
|
|
250
|
-
| [Kimi Code](https://www.kimi.com/code/docs/kimi-code-cli/customization/skills.html)、[Qwen Code](https://github.com/QwenLM/qwen-code/blob/main/docs/users/features/skills.md) | 运行 `paper-search skills update --targets agents`,安装到它们共同支持的 `~/.agents/skills/paper-search/` |
|
|
251
|
-
| [TRAE](https://docs.trae.ai/ide/skills?_lang=zh) | 将随包 Skill 文件夹复制到项目的 `.trae/skills/paper-search/` |
|
|
252
|
-
| [CodeBuddy](https://www.codebuddy.ai/docs/zh/ide/Features/Skills) | 将随包 Skill 文件夹复制到项目的 `.codebuddy/skills/paper-search/` |
|
|
253
|
-
|
|
254
|
-
`npm root -g` 可查看全局 npm 目录;随包 Skill 位于其下的 `papersearch/skills/paper-search/`。复制时保留完整文件夹及 `references/`,更新时从新版本复制。安装后新开 AI 会话即可使用。
|
|
254
|
+
`--targets` 可选 `codex`、`claude`、`cursor`、`gemini`、`antigravity`、`agents`(共享目录 `~/.agents/skills/`)。其他读取 Skill 文件夹的 AI 工具,把随包 Skill 复制到它的 Skill 目录即可:`npm root -g` 可查看全局 npm 目录,随包 Skill 位于其下的 `papersearch/skills/paper-search/`;复制时保留完整文件夹及 `references/`,更新时从新版本复制。安装后新开 AI 会话即可使用。
|
|
255
255
|
|
|
256
|
-
-
|
|
257
|
-
-
|
|
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
258
|
- `paper-search doctor` 显示内置安装目标中的 Skill 位置和版本状态。
|
|
259
259
|
|
|
260
|
-
### 新版提醒(0.4.8 新增)
|
|
261
|
-
|
|
262
|
-
发现 npm 上有新的稳定版本时,日常调用会在终端提示当前版本、最新版本和升级命令。在线任务期间异步检查,成功结果缓存 24 小时;检查失败不会影响文献任务,命令结束即取消未完成的检查。提醒写入 stderr,stdout 的 JSON 不变;离线管理命令只使用缓存,CI、帮助和配置命令不自动提醒。
|
|
263
|
-
|
|
264
|
-
```bash
|
|
265
|
-
paper-search update check --format text
|
|
266
|
-
paper-search config set PAPER_SEARCH_UPDATE_NOTIFY false # 关闭自动检查和提醒
|
|
267
|
-
paper-search config set PAPER_SEARCH_UPDATE_NOTIFY true # 重新开启
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
不会自动安装更新。升级 CLI 后,已安装的 Skill 会按现有规则同步;机构下载扩展仍用 `paper-search carsi update` 更新。此开关与胶囊的系统通知开关独立。
|
|
271
|
-
|
|
272
260
|
## 命令
|
|
273
261
|
|
|
274
262
|
| 命令 | 用途 |
|
|
@@ -278,7 +266,7 @@ paper-search config set PAPER_SEARCH_UPDATE_NOTIFY true # 重新开启
|
|
|
278
266
|
| `paper-search download` | 下载已核验论文的 PDF |
|
|
279
267
|
| `paper-search run <工具>` | 精确调用某个工具,参数用 `--arg` 或 `--json-args` |
|
|
280
268
|
| `paper-search failures` | 汇总下载失败的原因 |
|
|
281
|
-
| `paper-search update check` |
|
|
269
|
+
| `paper-search update check` | 检查是否有新版本 |
|
|
282
270
|
| `paper-search carsi` | 机构下载扩展的安装、状态、更新、卸载 |
|
|
283
271
|
| `paper-search setup` / `config` | 配置 key、Skill 和扩展 |
|
|
284
272
|
| `paper-search doctor` | 健康检查:配置、可用功能、Skill 和扩展的状态 |
|
|
@@ -304,8 +292,7 @@ paper-search config set PAPER_SEARCH_UPDATE_NOTIFY true # 重新开启
|
|
|
304
292
|
|
|
305
293
|
- 接下来的重点:批量下载更稳、新电脑安装更顺;在 PDF 之外交付全文包(原始 XML/HTML、Markdown 和正文图片)。详见 [路线图](docs/ROADMAP.zh.md)。
|
|
306
294
|
- 想了解原理和代码结构:[架构说明](docs/ARCHITECTURE.zh.md)。
|
|
307
|
-
- 下载失败或想要支持某家出版社:使用“下载失败 / 想支持某家出版社”Issue 模板,说明版本、系统、网站和 DOI。
|
|
308
|
-
- 0.4.8 新增:`paper-search failures --export ./failure-report.zip` 导出最近一批机构下载失败记录;可加 `--run <运行ID> --doi <DOI>` 筛选,也包含正文成功但附件失败的条目。请先检查包内 `summary.md`、HTML 与截图中的个人信息,再手动附到 Issue。导出只处理副本,不改原记录、不重跑或上传;旧记录没有的 HTML 会标为缺失。已安装版本没有该命令时,先提供版本和现象,勿上传原始诊断。
|
|
295
|
+
- 下载失败或想要支持某家出版社:使用“下载失败 / 想支持某家出版社”Issue 模板,说明版本、系统、网站和 DOI。可以用 `paper-search failures --export ./failure-report.zip` 导出失败记录,先检查包里的 `summary.md` 和截图有没有个人信息,再附到 Issue。
|
|
309
296
|
- 想自己加出版社规则:见 [carsi/CONTRIBUTING.md](carsi/CONTRIBUTING.md)。
|
|
310
297
|
|
|
311
298
|
## 使用边界
|
package/assets/overview.en.png
CHANGED
|
Binary file
|
package/assets/overview.png
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/carsi/README.md
CHANGED
|
@@ -8,18 +8,17 @@ PaperSearch 的机构授权下载后端,负责 CARSI 等联盟登录、出版
|
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
python3 -m venv .venv
|
|
11
|
-
.venv/bin/pip install -e ".[
|
|
12
|
-
.venv/bin/python -m camoufox fetch # 下载 Camoufox 浏览器本体(约 0.5 GB 压缩包)
|
|
11
|
+
.venv/bin/pip install -e ".[ego,dev]" # 含驱动 Patchright;浏览器用本机的 Google Chrome,不另下载
|
|
13
12
|
```
|
|
14
13
|
|
|
15
14
|
`bin/paper-search-carsi` 优先使用仓库内的 `.venv`(可用 `CARSI_PYTHON` 指定其他解释器)。
|
|
16
15
|
|
|
17
16
|
浏览器后端二选一,配置键 `browser_backend`:
|
|
18
17
|
|
|
19
|
-
- `
|
|
20
|
-
- `ego`(需要 agent 接手你正在用的浏览器时选用):直接使用你日常运行的 ego-lite(Chromium 内核),
|
|
18
|
+
- `chrome`(默认):本机安装的 Google Chrome,由 Patchright 启动,全部浏览器路线都用它。用自己的浏览器资料(原目录旁的 `-chrome` 兄弟目录),不碰日常 Chrome 的资料;首次使用需要登录一次机构。没装 Chrome 时从 https://www.google.com/chrome/ 安装;装在别处时用 `chrome_executable` 指定程序路径。`setup --check` 显示 Chrome 的路径、版本和驱动版本,低于测试过的版本(156.0.8078.80)时提示先更新。
|
|
19
|
+
- `ego`(需要 agent 接手你正在用的浏览器时选用):直接使用你日常运行的 ego-lite(Chromium 内核),Patchright 经 CDP 接管,沿用其中已有的登录;规则与适配器和 chrome 同一套。在 ego 里打开 `chrome://inspect/#remote-debugging` 勾选 "Allow remote debugging for this browser instance",勾选一次即保存在 ego 设置中,重启后仍有效;程序只操作并关闭自己开的标签页,不关闭浏览器,也不写入 Cookie。ego 的数据目录可用 `ego_user_data_dir` 指定;未安装 ego-lite 时自动回到 chrome。
|
|
21
20
|
|
|
22
|
-
旧值 `patchright`、`cloakbrowser` 会记一条警告并按 `
|
|
21
|
+
旧值 `camoufox`、`patchright`、`cloakbrowser` 会记一条警告并按 `chrome` 处理。
|
|
23
22
|
|
|
24
23
|
## 使用
|
|
25
24
|
|
|
@@ -33,7 +32,7 @@ python3 -m venv .venv
|
|
|
33
32
|
# 1. 选择机构入口:用 --institution 配置自己的学校(CARSI 成员学校的中文名、英文名或域名,在 CARSI 学校列表里查找后保存中英文名和 entityID),之后各出版社的选校页由程序自动选中(只点与它对应的那一项);不配置则在登录窗口里手选
|
|
34
33
|
paper-search-carsi setup --carsi # 或 --carsi --institution "学校名"
|
|
35
34
|
paper-search-carsi setup --list-carsi-schools 关键词 # 查 CARSI 成员学校
|
|
36
|
-
paper-search-carsi setup --check #
|
|
35
|
+
paper-search-carsi setup --check # 环境检查:数据目录、浏览器(Chrome 路径和版本)、入口是否配置
|
|
37
36
|
|
|
38
37
|
# 2. 在弹出的浏览器窗口完成一次机构登录(凭证只在窗口里输入,CLI 不经手)
|
|
39
38
|
paper-search-carsi login --doi 10.1016/... # 打开这篇文章的出版社页面,在出版社的机构登录里选学校(CARSI)
|
|
@@ -96,7 +96,7 @@ _ENTRY_JS = """
|
|
|
96
96
|
const targetUrl = new URL(href, location.href);
|
|
97
97
|
if (targetUrl.protocol !== 'https:' || !['auth.elsevier.com',
|
|
98
98
|
'www.sciencedirect.com', 'sciencedirect.com'].includes(targetUrl.hostname)) return null;
|
|
99
|
-
// Not [...searchParams.keys()]: "not iterable" in
|
|
99
|
+
// Not [...searchParams.keys()]: "not iterable" in the Firefox build's evaluate,
|
|
100
100
|
// which kept every signed-out ScienceDirect entry from a click (2026-10-31).
|
|
101
101
|
if (/[?&](?:entityid|idp|institutionid|organizationid|homeorg)=/i.test(targetUrl.search)) return null;
|
|
102
102
|
}
|
|
@@ -21,7 +21,7 @@ from ..base import PublisherAdapter, SupplementLink, register
|
|
|
21
21
|
|
|
22
22
|
_SUPPLEMENTS_JS = r"""() => {
|
|
23
23
|
let metadata = window.xplGlobal?.document?.metadata;
|
|
24
|
-
//
|
|
24
|
+
// The driver's isolated evaluation world does not expose page globals. Read
|
|
25
25
|
// the same JSON declaration from the DOM without executing website code.
|
|
26
26
|
if (!metadata) {
|
|
27
27
|
for (const script of document.scripts) {
|
|
@@ -28,7 +28,9 @@ class JAMAAdapter(PublisherAdapter):
|
|
|
28
28
|
binds_pdf_to_citation = True
|
|
29
29
|
keeps_pdf_out_of_downloads = True
|
|
30
30
|
binds_response_url = True
|
|
31
|
-
|
|
31
|
+
# The articlepdf address redirects to Silverchair's watermarked file, the
|
|
32
|
+
# response Chrome has to capture (Firefox read it from PDF.js, 2026-11-07).
|
|
33
|
+
native_pdf_patterns = ("https://jamanetwork.com/journals/*/articlepdf/*", "https://watermark*.silverchair.com/*")
|
|
32
34
|
# Redirects have no body to validate. Native/HTTP final responses retain
|
|
33
35
|
# the chain and decide whether it belongs to the article; do not
|
|
34
36
|
# blacklist the legitimate origin.
|
|
@@ -12,6 +12,7 @@ import re
|
|
|
12
12
|
from typing import Any
|
|
13
13
|
from urllib.parse import urljoin, urlparse
|
|
14
14
|
|
|
15
|
+
from ...browser.driver import is_driver_error
|
|
15
16
|
from ...engine.batch_common import open_page
|
|
16
17
|
from ..base import register
|
|
17
18
|
from ..platforms.silverchair import SilverchairAdapter
|
|
@@ -64,7 +65,7 @@ class KargerAdapter(SilverchairAdapter):
|
|
|
64
65
|
# The user can select a school while this observation
|
|
65
66
|
# runs. Keep waiting on the same page after navigation;
|
|
66
67
|
# do not reopen the chooser or restart authentication.
|
|
67
|
-
if (not
|
|
68
|
+
if (not is_driver_error(exc)
|
|
68
69
|
or not any(marker in str(exc) for marker in (
|
|
69
70
|
"Execution context was destroyed",
|
|
70
71
|
"Cannot find context with specified id",
|
|
@@ -8,7 +8,7 @@ import re
|
|
|
8
8
|
from typing import Any
|
|
9
9
|
from urllib.parse import urlparse
|
|
10
10
|
|
|
11
|
-
from ...engine.batch_common import _is_browser_error
|
|
11
|
+
from ...engine.batch_common import _is_browser_error, goto_retrying
|
|
12
12
|
|
|
13
13
|
HOSTS = {"ovid.com", "www.ovid.com"}
|
|
14
14
|
_ARTICLE = re.compile(r"/jnls/[^/]+/(?:abstract|fulltext|pdf)/")
|
|
@@ -47,7 +47,7 @@ class OvidSite:
|
|
|
47
47
|
if isinstance(href, str) and self.d._article_pdf_url_matches(href, result.doi):
|
|
48
48
|
self.d._event(result, "pdf_button_clicked", "ovid-article-pdf")
|
|
49
49
|
try:
|
|
50
|
-
page
|
|
50
|
+
goto_retrying(page, href, timeout_ms=self.d.pdf_timeout_ms, referer=article)
|
|
51
51
|
except Exception as exc:
|
|
52
52
|
if not _is_browser_error(exc):
|
|
53
53
|
raise
|
|
@@ -16,6 +16,7 @@ import time
|
|
|
16
16
|
from typing import Any
|
|
17
17
|
from urllib.parse import unquote, urlparse
|
|
18
18
|
|
|
19
|
+
from ...browser.driver import is_driver_error
|
|
19
20
|
from ...engine.batch_common import AWAY_WAIT_SEC, open_page
|
|
20
21
|
from ...engine.router import _append_oxford_candidates
|
|
21
22
|
from ..base import PublisherAdapter, SupplementLink, register
|
|
@@ -217,16 +218,14 @@ class OUPAdapter(PublisherAdapter):
|
|
|
217
218
|
def retryable_navigation_error(exc: Exception) -> bool:
|
|
218
219
|
if isinstance(exc, TimeoutError):
|
|
219
220
|
return True
|
|
220
|
-
if not
|
|
221
|
+
if not is_driver_error(exc):
|
|
221
222
|
return False
|
|
222
|
-
if
|
|
223
|
+
if is_driver_error(exc, "TimeoutError"):
|
|
223
224
|
return True
|
|
224
225
|
return any(marker in str(exc) for marker in (
|
|
225
226
|
"net::ERR_CONNECTION_TIMED_OUT", "net::ERR_TIMED_OUT",
|
|
226
227
|
"net::ERR_CONNECTION_RESET", "net::ERR_CONNECTION_CLOSED",
|
|
227
228
|
"net::ERR_NETWORK_CHANGED", "net::ERR_EMPTY_RESPONSE",
|
|
228
|
-
# Firefox's word for a navigation another one replaced (AJE 1985, 2026-11-02).
|
|
229
|
-
"NS_BINDING_ABORTED",
|
|
230
229
|
"Execution context was destroyed", "Frame was detached", "because of a navigation",
|
|
231
230
|
))
|
|
232
231
|
|