papersearch 0.7.3 → 0.8.1
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/NOTICE +8 -37
- package/README.fr.md +265 -0
- package/README.ja.md +265 -0
- package/README.ko.md +265 -0
- package/README.md +149 -148
- package/README.zh-Hant.md +265 -0
- package/README.zh.md +265 -0
- package/dist/capabilities/download/batch/batch.d.ts +20 -1
- package/dist/capabilities/download/batch/batch.d.ts.map +1 -1
- package/dist/capabilities/download/batch/batch.js +1057 -208
- package/dist/capabilities/download/batch/batch.js.map +1 -1
- package/dist/capabilities/download/batch/batchFolder.d.ts.map +1 -1
- package/dist/capabilities/download/batch/batchFolder.js +3 -2
- package/dist/capabilities/download/batch/batchFolder.js.map +1 -1
- package/dist/capabilities/download/batch/networkLoss.d.ts +11 -2
- package/dist/capabilities/download/batch/networkLoss.d.ts.map +1 -1
- package/dist/capabilities/download/batch/networkLoss.js +24 -3
- package/dist/capabilities/download/batch/networkLoss.js.map +1 -1
- package/dist/capabilities/download/batch/resume.d.ts +7 -0
- package/dist/capabilities/download/batch/resume.d.ts.map +1 -1
- package/dist/capabilities/download/batch/resume.js +50 -9
- package/dist/capabilities/download/batch/resume.js.map +1 -1
- package/dist/capabilities/download/batch/windowPlan.d.ts +96 -0
- package/dist/capabilities/download/batch/windowPlan.d.ts.map +1 -0
- package/dist/capabilities/download/batch/windowPlan.js +196 -0
- package/dist/capabilities/download/batch/windowPlan.js.map +1 -0
- package/dist/capabilities/download/content/markdown/pro.d.ts +6 -0
- package/dist/capabilities/download/content/markdown/pro.d.ts.map +1 -1
- package/dist/capabilities/download/content/markdown/pro.js.map +1 -1
- package/dist/capabilities/download/content/markdown/shortfall.d.ts +8 -5
- package/dist/capabilities/download/content/markdown/shortfall.d.ts.map +1 -1
- package/dist/capabilities/download/content/markdown/shortfall.js +22 -10
- package/dist/capabilities/download/content/markdown/shortfall.js.map +1 -1
- package/dist/capabilities/download/content/markdown/step.d.ts +9 -0
- package/dist/capabilities/download/content/markdown/step.d.ts.map +1 -1
- package/dist/capabilities/download/content/markdown/step.js +46 -3
- package/dist/capabilities/download/content/markdown/step.js.map +1 -1
- package/dist/capabilities/download/content/markdown/types.d.ts +10 -1
- package/dist/capabilities/download/content/markdown/types.d.ts.map +1 -1
- package/dist/capabilities/download/content/pdf/open/tiers/scihub.d.ts.map +1 -1
- package/dist/capabilities/download/content/pdf/open/tiers/scihub.js +3 -1
- package/dist/capabilities/download/content/pdf/open/tiers/scihub.js.map +1 -1
- package/dist/capabilities/download/handler.d.ts.map +1 -1
- package/dist/capabilities/download/handler.js +13 -5
- package/dist/capabilities/download/handler.js.map +1 -1
- package/dist/capabilities/download/outputLayout.d.ts.map +1 -1
- package/dist/capabilities/download/outputLayout.js +3 -1
- package/dist/capabilities/download/outputLayout.js.map +1 -1
- package/dist/capabilities/download/tools.js +2 -2
- package/dist/capabilities/download/tools.js.map +1 -1
- package/dist/capabilities/download/types.d.ts +9 -1
- package/dist/capabilities/download/types.d.ts.map +1 -1
- package/dist/cli.js +3 -1
- package/dist/cli.js.map +1 -1
- package/dist/infrastructure/http/hostGate.d.ts +24 -0
- package/dist/infrastructure/http/hostGate.d.ts.map +1 -0
- package/dist/infrastructure/http/hostGate.js +72 -0
- package/dist/infrastructure/http/hostGate.js.map +1 -0
- package/dist/infrastructure/pdf/PdfDownload.d.ts +1 -0
- package/dist/infrastructure/pdf/PdfDownload.d.ts.map +1 -1
- package/dist/infrastructure/pdf/PdfDownload.js +6 -1
- package/dist/infrastructure/pdf/PdfDownload.js.map +1 -1
- package/dist/infrastructure/runlog/RunLedger.d.ts +14 -0
- package/dist/infrastructure/runlog/RunLedger.d.ts.map +1 -1
- package/dist/infrastructure/runlog/RunLedger.js +30 -4
- package/dist/infrastructure/runlog/RunLedger.js.map +1 -1
- package/dist/infrastructure/runlog/failureClass.d.ts +2 -1
- package/dist/infrastructure/runlog/failureClass.d.ts.map +1 -1
- package/dist/infrastructure/runlog/failureClass.js +27 -4
- package/dist/infrastructure/runlog/failureClass.js.map +1 -1
- package/dist/infrastructure/school/SchoolAttempt.d.ts +11 -0
- package/dist/infrastructure/school/SchoolAttempt.d.ts.map +1 -1
- package/dist/infrastructure/school/SchoolAttempt.js +48 -5
- package/dist/infrastructure/school/SchoolAttempt.js.map +1 -1
- package/dist/infrastructure/school/SchoolMcpClient.d.ts +13 -2
- package/dist/infrastructure/school/SchoolMcpClient.d.ts.map +1 -1
- package/dist/infrastructure/school/SchoolMcpClient.js +138 -15
- package/dist/infrastructure/school/SchoolMcpClient.js.map +1 -1
- package/dist/infrastructure/school/SchoolProgress.d.ts +2 -0
- package/dist/infrastructure/school/SchoolProgress.d.ts.map +1 -1
- package/dist/infrastructure/school/SchoolProgress.js +2 -0
- package/dist/infrastructure/school/SchoolProgress.js.map +1 -1
- package/dist/infrastructure/school/SchoolReadiness.d.ts +9 -0
- package/dist/infrastructure/school/SchoolReadiness.d.ts.map +1 -1
- package/dist/infrastructure/school/SchoolReadiness.js +10 -0
- package/dist/infrastructure/school/SchoolReadiness.js.map +1 -1
- package/dist/infrastructure/school/SchoolResultNormalizer.d.ts.map +1 -1
- package/dist/infrastructure/school/SchoolResultNormalizer.js +4 -0
- package/dist/infrastructure/school/SchoolResultNormalizer.js.map +1 -1
- package/dist/infrastructure/school/index.d.ts +2 -2
- package/dist/infrastructure/school/index.d.ts.map +1 -1
- package/dist/infrastructure/school/index.js +1 -1
- package/dist/infrastructure/school/index.js.map +1 -1
- package/dist/infrastructure/school/types.d.ts +73 -1
- package/dist/infrastructure/school/types.d.ts.map +1 -1
- package/dist/infrastructure/school/types.js.map +1 -1
- package/dist/infrastructure/security/SecurityUtils.d.ts.map +1 -1
- package/dist/infrastructure/security/SecurityUtils.js +6 -2
- package/dist/infrastructure/security/SecurityUtils.js.map +1 -1
- package/dist/management/failures/index.d.ts +23 -0
- package/dist/management/failures/index.d.ts.map +1 -1
- package/dist/management/failures/index.js +68 -20
- package/dist/management/failures/index.js.map +1 -1
- package/dist/management/school/autoUpdate.d.ts.map +1 -1
- package/dist/management/school/autoUpdate.js +9 -1
- package/dist/management/school/autoUpdate.js.map +1 -1
- package/dist/management/school/cliProgress.d.ts.map +1 -1
- package/dist/management/school/cliProgress.js +3 -1
- package/dist/management/school/cliProgress.js.map +1 -1
- package/package.json +8 -3
- package/school/NOTICE +3 -2
- package/school/paper_search_school/adapters/__init__.py +2 -0
- package/school/paper_search_school/adapters/aps/__init__.py +3 -6
- package/school/paper_search_school/adapters/base.py +19 -2
- package/school/paper_search_school/adapters/copernicus/__init__.py +2 -7
- package/school/paper_search_school/adapters/elsevier/__init__.py +50 -1
- package/school/paper_search_school/adapters/frontiers/__init__.py +41 -2
- package/school/paper_search_school/adapters/ieee/__init__.py +6 -4
- package/school/paper_search_school/adapters/iop/__init__.py +8 -0
- package/school/paper_search_school/adapters/jama/__init__.py +8 -0
- package/school/paper_search_school/adapters/lww/__init__.py +14 -6
- package/school/paper_search_school/adapters/mdpi/__init__.py +12 -7
- package/school/paper_search_school/adapters/neurology/__init__.py +5 -2
- package/school/paper_search_school/adapters/optica/__init__.py +52 -13
- package/school/paper_search_school/adapters/oup/__init__.py +7 -4
- package/school/paper_search_school/adapters/platforms/__init__.py +4 -1
- package/school/paper_search_school/adapters/platforms/atypon/__init__.py +12 -3
- package/school/paper_search_school/adapters/platforms/figshare/__init__.py +23 -4
- package/school/paper_search_school/adapters/platforms/jstage/__init__.py +64 -0
- package/school/paper_search_school/adapters/taylor_francis/__init__.py +0 -3
- package/school/paper_search_school/adapters/thieme/__init__.py +2 -9
- package/school/paper_search_school/api_keys.py +63 -13
- package/school/paper_search_school/assets/api_keys.json +14 -0
- package/school/paper_search_school/assets/capsule.html +526 -147
- package/school/paper_search_school/assets/capsule_en.json +140 -49
- package/school/paper_search_school/assets/capsule_fr.json +141 -50
- package/school/paper_search_school/assets/capsule_ja.json +140 -49
- package/school/paper_search_school/assets/capsule_ko.json +140 -49
- package/school/paper_search_school/assets/capsule_zh-Hant.json +134 -48
- package/school/paper_search_school/browser/backend.py +125 -4
- package/school/paper_search_school/browser/batch_session.py +189 -8
- package/school/paper_search_school/browser/challenge/__init__.py +12 -9
- package/school/paper_search_school/browser/challenge/continuation.py +83 -0
- package/school/paper_search_school/browser/challenge/handlers/__init__.py +1 -0
- package/school/paper_search_school/browser/challenge/handlers/aws_waf.py +260 -0
- package/school/paper_search_school/browser/challenge/handlers/recaptcha_hcaptcha.py +167 -0
- package/school/paper_search_school/browser/challenge/handlers/text_captcha.py +128 -0
- package/school/paper_search_school/browser/challenge/handlers/turnstile.py +174 -0
- package/school/paper_search_school/browser/challenge/kinds.py +203 -0
- package/school/paper_search_school/browser/challenge/local/__init__.py +1 -0
- package/school/paper_search_school/browser/challenge/{interaction.py → local/interaction.py} +94 -13
- package/school/paper_search_school/browser/challenge/{pointer.py → local/pointer.py} +2 -2
- package/school/paper_search_school/browser/challenge/local/prompt.py +283 -0
- package/school/paper_search_school/browser/challenge/local/submission.py +33 -0
- package/school/paper_search_school/browser/challenge/pro.py +24 -0
- package/school/paper_search_school/browser/challenge/services/__init__.py +1 -0
- package/school/paper_search_school/browser/challenge/services/solver.py +292 -0
- package/school/paper_search_school/browser/engine.py +4 -1
- package/school/paper_search_school/browser/user_turn.py +126 -0
- package/school/paper_search_school/browser/watchdog.py +213 -60
- package/school/paper_search_school/cli_config.py +10 -5
- package/school/paper_search_school/config.py +16 -10
- package/school/paper_search_school/download_diagnostics.py +7 -2
- package/school/paper_search_school/engine/access_rules.py +12 -3
- package/school/paper_search_school/engine/batch.py +52 -18
- package/school/paper_search_school/engine/batch_access.py +62 -16
- package/school/paper_search_school/engine/batch_capture.py +260 -31
- package/school/paper_search_school/engine/batch_common.py +3 -0
- package/school/paper_search_school/engine/batch_diagnostics.py +25 -5
- package/school/paper_search_school/engine/batch_institution.py +52 -3
- package/school/paper_search_school/engine/batch_login.py +398 -36
- package/school/paper_search_school/engine/batch_pdf_urls.py +38 -7
- package/school/paper_search_school/engine/batch_user.py +48 -3
- package/school/paper_search_school/engine/batch_waits.py +221 -14
- package/school/paper_search_school/engine/bridge.py +29 -6
- package/school/paper_search_school/engine/fulltext_page.py +55 -8
- package/school/paper_search_school/engine/router.py +16 -1
- package/school/paper_search_school/engine/supplements.py +7 -1
- package/school/paper_search_school/entitlements.py +29 -1
- package/school/paper_search_school/pdf_utils.py +25 -16
- package/school/paper_search_school/progress_capsule.py +69 -11
- package/school/paper_search_school/progress_reporter.py +243 -11
- package/school/paper_search_school/progress_view.py +205 -91
- package/school/paper_search_school/publishers/builtin/iop.json +2 -1
- package/school/paper_search_school/publishers/builtin/neurology.json +4 -2
- package/school/paper_search_school/publishers/site.py +12 -4
- package/school/paper_search_school/rate_limit.py +24 -1
- package/school/paper_search_school/school_login.py +170 -8
- package/school/paper_search_school/school_test.py +1 -1
- package/school/paper_search_school/server.py +179 -23
- package/school/paper_search_school/user_settings.py +46 -4
- package/school/pyproject.toml +1 -0
- package/skills/paper-search/SKILL.md +107 -107
- package/skills/paper-search/references/browser-download.md +102 -99
- package/skills/paper-search/references/capability-routing.md +89 -89
- package/skills/paper-search/references/cli-contract.md +78 -78
- package/skills/paper-search/references/federation-support.md +172 -172
- package/skills/paper-search/references/management-layer.md +78 -78
- package/skills/paper-search/references/publisher-support.md +38 -38
- package/skills/paper-search/references/school-setup.md +56 -55
- package/skills/paper-search/references/setup.md +20 -20
- package/skills/paper-search/references/troubleshooting.md +12 -12
- package/README.en.md +0 -264
- package/school/paper_search_school/browser/challenge/prompt.py +0 -154
|
@@ -1,139 +1,142 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
- `paper-search school status --format text`
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
##
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
# School download: download PDFs with the school's access
|
|
2
|
+
|
|
3
|
+
The school download (school subscription downloads) is installed on a computer with the user's consent; when only open download is used, this file is not needed. It applies when the target paper is confirmed and needs a school subscription, or when the user reports that nothing happens after sign-in, that pages keep redirecting, or that a PDF opened but was not saved. For installation, the school and the browser, see `school-setup.md`.
|
|
4
|
+
|
|
5
|
+
## Before calling
|
|
6
|
+
|
|
7
|
+
- Verify the target DOI and title; never probe downloads with made-up DOIs.
|
|
8
|
+
- Whether the target publisher works and gives supplementary files: check `publisher-support.md` first; sites not in the table are tried with the general rules.
|
|
9
|
+
- When the user has not said which contents they want, ask once before starting: `pdf` (the full-text PDF), `supplements` (supplementary files), one or both; only once for a batch too.
|
|
10
|
+
- `paper-search school status --format text` confirms the extension is installed and enabled, or that the "PaperSearch 配置" (PaperSearch config) line shows it enabled with a backend path (a backend the user maintains; its first line showing "未安装" (not installed) is normal); when neither, follow `school-setup.md`. When the `paper-search-school` commands in this file are not on PATH, call them by the full path after "后端" (backend) there.
|
|
11
|
+
- Before starting, run `paper-search-school issues` to see whether earlier issue reports are still open; after reading them, record the conclusion with `issues resolve <ID> --note "conclusion"`.
|
|
12
|
+
|
|
13
|
+
## One call; wait for a clear result
|
|
14
|
+
|
|
15
|
+
One paper: `paper-search download` or `paper-search run download_with_fallback`; several: one `paper-search run download_batch`; parameters in `cli-contract.md`. The download order is fixed: `primary → direct_pdf_url → repositories → unpaywall → publisher_api → scihub → entitled_access → preprint`. An arXiv preprint clearly linked to the DOI is tried only after the school download fails.
|
|
16
|
+
|
|
17
|
+
- Open sources and the school's access only (no Sci-Hub): set `useSciHub=false` on `download_with_fallback` / `download_batch`.
|
|
18
|
+
- When the user says to use only the school download (or to test just the school-access step), set `"mode":"entitled_only"` on `download_batch`: the PDF and supplementary files both go straight to the school download; "go on" (接着下) keeps the batch's mode. It skips available public copies; when the user did not say so, keep the default `two_phase`.
|
|
19
|
+
- Test downloads use the commands above too, keeping the default wait times and data directory. To sign in to the school first, or to test sign-in, use `paper-search school login --doi <DOI>` (see `school-setup.md`).
|
|
20
|
+
- Only one download at a time per data directory. While the command has not finished, do not download or sign in again because the window seems stuck.
|
|
21
|
+
- By default the school download takes one paper at a time, while the open channels check the following papers, three at a time. With "同时下载" (Download mode) set to "并行" (Parallel) on the settings' "下载" (Downloads) page, a batch downloads several papers at once, each in a window of its own of the same download browser (one school sign-in): "不同出版社" (Different publishers) publishers at once × "同一出版社" (Same publisher) papers of each. Only one window at a time asks the user to sign in or verify; the others go on. When a batch is slow and the user asks for it faster, point them to this setting; do not change it for them. At a school login or verification it stops on that paper; once a prompt for manual handling appears, remind the user to act in the download browser. Wait limits: on the school login page (and on pages where no school is configured and the user must choose the school) at most 3 minutes (backend setting `browser_login_timeout`, in seconds); on other pages (human verification, publisher pages, the institution-selection page, waiting for handling while fetching the PDF) the paper ends after more than 1 minute there without a break (`browser_page_wait_timeout`). Both can be changed in the settings (gear) at the top right of the progress window, taking effect from the next paper. After one sign-in through the school's single sign-on, the other papers usually pass automatically. Once a paper has waited its full limit (the log says "这一篇等你登录或验证已到时限" (the wait for your sign-in or verification on this paper ran out)), each following paper waits only 60 seconds; while the user is typing in the login box, it waits as usual.
|
|
22
|
+
- Each publisher opens at most 100 papers per hour (backend setting `publisher_hourly_limit`; 0 for no limit; a batch's windows together). At the limit, a batch waits until it can go on and then downloads this paper (the log states the time); a batch downloading in parallel goes on with other publishers meanwhile and waits only when that publisher alone is left; a single download returns `rate_limited`: try again later.
|
|
23
|
+
- When the publisher's site blocks the current network (`access_blocked`, such as a Cloudflare block page or the publisher's own "IP has been blocked" page), that paper ends; other articles of the same journal are skipped for now (`journal_blocked_earlier`); every 5 minutes one paper tries the site again, and once it opens, downloading goes on as usual (after a network change there is no need to wait half an hour); other journals carry on. Tell the user it may be the site's protection blocking the current network, or a pause because of too many downloads: change networks or try later; for the latter, contact the school library.
|
|
24
|
+
- Human verification not passed within the wait (`captcha_required`), HTTP 429 (too many requests) on supplementary files, and the blocking above all count as "被网站拦截" (Blocked by site). In batch downloads (default and `entitled_only`), that publisher's papers pause first while other publishers carry on; after 10 minutes it tries once more automatically, and the progress window shows "被网站拦截,HH:MM 再试暂停的 N 篇" (blocked by the site; the N paused papers are retried at HH:MM), with nothing for the user to do; when the retry is blocked again, that publisher's remaining papers are not tried again in this batch (`blocked_paused`), and they do not go into the final "原因不明" (Unclear) retry or the school switch. Tell the user the site is blocking, not that there is no access; after a while (or on another network) they can say "go on" (接着下).
|
|
25
|
+
- The backend first waits briefly for automatic verification; on each verification wait it tries clicking a recognizable Turnstile checkbox at most 2 times, at least 3 seconds apart; only when the program asks for manual handling, remind the user to take over in the download browser; do not ask the user to act just because of `checking_access`. When an image recognition service is configured, supported publisher AWS WAF puzzles, reCAPTCHA/hCaptcha grids and standalone character codes continue through that service after local controls, with only images and the question sent. Answers are entered in the same browser. Supported embedded Turnstile widgets can also continue through the configured service: only the public HTTPS site origin, sitekey and optional action are sent, and the answer returns to the original widget callback or associated form. Widgets requiring session data or lacking an unambiguous continuation remain manual. Full-page Cloudflare checks stay local. After the widget acknowledges success, the backend also submits its associated verification form when it has one unambiguous native submit control, regardless of the button label. It observes delayed acknowledgements during the wait; downloading continues only after the publisher page actually clears. Unsupported puzzles, exhausted attempts, school sign-in and two-factor checks remain manual; on school authentication pages, the consent to release information and the terms of use, and the terms confirmation pages during a publisher's login, are accepted by the backend (at most twice per paper each; the user is reminded only when it is still stuck on that page). Never ask for the account, password or verification code; the agent does not open another browser to act for the user.
|
|
26
|
+
- Typing, choosing or clicking a control on the dedicated manual login page, or taking over the login by clicking the capsule, pauses the remaining school-login budget; pauses between inputs do not count as leaving; the timer resumes after leaving that manual step. With no one acting, it still ends at the original limit. Never ask the user for their account or password. When the user stops midway on the login page (for example, to get a code from their phone), keep waiting, counted against the original limit; do not start the login again.
|
|
27
|
+
- The school-login reminder relies on a visible account, password, two-factor code or QR code field, or a consent step the backend could not click; the school domain and idle time are not evidence of a manual step. The capsule's "提醒你操作前最多等" (Wait before asking you) is still saved to `browser_stall_notify_after` (default 30 seconds, 1–600); when a visible verification control cannot be handled automatically, the handover happens at that value or at half the remaining budget, whichever is earlier. While a control is still loading, already ticked and processing, or not yet shown, automatic watching continues. Clicks not dispatched do not use up the at most 2 input attempts; failure reasons are in `challenge_observation`. A clear site ban and an exhausted budget still end the current route; not every CAPTCHA is passed automatically. When a page the program does not recognize stays stuck that long and has clickable controls, it also reminds "页面可能需要你处理" (the page may need you); likewise ask the user to take a look in the download browser.
|
|
28
|
+
- The generic Human Verification image check page waits for the steps after Begin. Once the user acts on the dedicated verification page or takes over through the capsule, the manual stage pauses the remaining verification and article wait budgets; after leaving the verification successfully, the automatic flow carries on. With no action it still ends at the original limit; the outer task's resource limits do not change.
|
|
29
|
+
- Go by the structured notices of this call for the stage (written to stderr; stdout has only the final JSON); do not guess the stage from the waiting time.
|
|
30
|
+
- A PDF opened in a new tab is not the same as saved; go by the command's final result; a web address is not a local file.
|
|
31
|
+
- To cancel, abort the current call; while an old browser still holds the data directory, do not start the next download, and do not delete the lock automatically.
|
|
32
|
+
|
|
33
|
+
## The progress window and issue reports
|
|
34
|
+
|
|
35
|
+
- To judge whether a batch download is stuck: in the run log (the result's `runLog`, or the directory given by `[批量] 运行记录:…` ([batch] run log: …) on stderr), compare the time on the last line of `timeline.log` with the system's current time; do not judge by your own estimate of the wait. When the last line has not changed for more than 5 minutes, first check whether the progress window is waiting for sign-in or verification; do not turn off a source or rerun the whole batch because of it.
|
|
36
|
+
- The progress window is a small capsule in a corner of the screen (top right on macOS, bottom right on Windows): it shows done/total, whether it is downloading the full text or the supplementary files, and the publisher; when the user needs to sign in or verify, it turns amber, its background and edges breathe gently and a countdown shows; with system notifications on, a notification is sent too; with the system's "Reduce motion" on, it only changes color. Hovering expands it to show the current paper, the step, saved/failed/left and the buttons below; clicking the "成功" (Saved), "失败" (Failed) or "剩余" (Left) number lists those papers (clicking a saved one opens its folder with the PDF selected; failed ones are grouped by reason, and clicking one opens the article page in the browser, with papers whose supplementary files are incomplete listed after them; the remaining ones are split into downloading now, queued for the school download, and open download not checked yet, and clicking one also opens the article page; in a batch for supplementary files only, the saved ones are split into "补上附录" (supplementary files added) and "没有附录(已核对)" (no supplementary files, checked), and clicking one opens the folder of its existing PDF), during and after the download; "–" at the top right minimizes it to the Dock or taskbar; the pin button "钉住" (Pin) keeps it expanded when the mouse moves away; click it again to undo; it applies only to this window. When everything succeeded, it closes 8 seconds after the end; with failures or a stop it stays until the user closes it with ×. When pywebview or the web engine is unavailable, no window shows and the download goes on as usual.
|
|
37
|
+
- The Google Chrome window used for downloads keeps running, but does not take the foreground on start, navigation, new tabs or while waiting for manual handling. When action is needed, clicking a reminder on the capsule such as "请登录学校" (Sign in to school) switches to the current task's download browser; during a download, expanding the capsule and clicking the title line of the paper being downloaded also switches to it (not clickable during the open-access phase, which has no browser).
|
|
38
|
+
- At the end the card lists the papers without a full text, by reason. When the PDF and supplementary files are downloaded together (`pdf,supplements`), papers whose PDF is saved but whose supplementary files are incomplete are listed separately as "附录未下全" (Supp. missing), one line per reason, collapsed by default; the last line on the command line also writes them separately ("附录未下全 N 篇:原因 n" (Supp. missing: N; reason n)). When the user stops it in the window, the papers not processed do not count as failures: the end card's three numbers are saved, failed and "已终止" (Stopped); clicking "已终止" lists them; the last line on the command line says "成功 n,失败 n,已终止 n" (saved n, failed n, stopped n).
|
|
39
|
+
- Mac system notifications use the PaperSearch name and icon; clicking a notification uses the same entry as the capsule to bring back the current task's browser. The system's notification permission or Focus may limit banners; the capsule reminders remain. When notifications are turned on in the settings' "等待和提醒" (Waits & alerts) page, it checks whether the system allows PaperSearch to show notifications, and "测试" (Test) next to the switch sends a test notification; when the system does not allow it or the user says nothing appeared, the capsule lists what to change and can open the system's notification settings (on Windows, notifications are sent as "Windows PowerShell"). No separate notification tool is needed; do not change the system's notification settings for the user.
|
|
40
|
+
- The capsule's gear can change the default download folder (type an absolute path or choose a folder), sharing the setting with `paper-search config set DEFAULT_DOWNLOAD_PATH "/full/path/Papers"`. New tasks use it automatically; an explicit `savePath` / `--save-path` takes precedence; a running batch does not change folders.
|
|
41
|
+
- "终止" (Stop; called "终止任务" in older windows): after confirming, the current paper ends at once, the whole batch stops, and the remaining papers are recorded as `batch_stopped` (not downloaded). When the user wants to stop the whole batch, have them press this; do not abort the command separately.
|
|
42
|
+
- Current source (unreleased fix): `browser_operation_timeout` means automatic page actions used up the shared budget; it is neither no access nor waiting for the user to sign in. Do not sign in again and again because of it; first check whether `entitled_only` was used by mistake. Stopping during the supplementary-file stage also stops the following papers and keeps the full texts already saved.
|
|
43
|
+
- Expanded, it shows which part and which step is being downloaded: the full text has a five-step bar (open the article, access, fetch the PDF, check, supplementary files); supplementary files show "附录 2/5" (Supp. 2/5).
|
|
44
|
+
- The gear (settings) at the top right: type the longest waits (seconds) for the school login page and for other pages, the reminder time for a page with no progress (default 30 seconds), and the maximum downloads per publisher per hour; once saved, they apply to later papers. The small switch "马上生效" (Apply now) next to the limit (off by default), when on, makes papers waiting at the limit go on at once under the new limit; when off, the new limit applies after this hour; the "系统通知" (Notifications) switch saves on click and can be turned on or off at any time; when off, the capsule still changes color and breathes, and clicking the reminder still brings back the browser.
|
|
45
|
+
- "跳过" (Skip): ends only the current paper, taking effect within 1–2 seconds of the click. The download itself decides whether the school has access; nothing needs marking in the progress window; "⋯" opens "报告问题" (Report issue).
|
|
46
|
+
- "报告问题" (Report issue) under "⋯": after the user picks the problem they see, the backend takes a screenshot of the page and handles it (reading an already opened PDF, going back to the article, reloading, stopping the automatic school selection), and the window shows the outcome.
|
|
47
|
+
- When starting a school download, also listen for the user's reports (with the same `SCHOOL_DATA_DIR` as the download):
|
|
48
|
+
- When you can run commands in the background and get notified when they end: run `paper-search-school issues watch --since <timestamp when the download started>` in the background; when the user reports, it returns the report JSON (URL, title, text snippet, screenshot path, outcome) and exits.
|
|
49
|
+
- When you can only run commands one at a time: during the download, run `paper-search-school issues watch --since <timestamp> --timeout 30` periodically; with no new report it returns `{"timeout": true}` (exit code 3).
|
|
50
|
+
- When a report arrives, look at the screenshot at once (when you cannot read images, look at the URL, title and text snippet), and tell the user where the page stopped, what the problem is and what they can do now. To keep listening, use the returned `reported_ts` as the next `--since`.
|
|
51
|
+
|
|
52
|
+
## Live status and browser view
|
|
53
|
+
|
|
54
|
+
Reads the same status as the progress window, without starting a window, a browser or a new download:
|
|
54
55
|
|
|
55
56
|
```bash
|
|
56
|
-
SCHOOL_DATA_DIR="
|
|
57
|
-
SCHOOL_DATA_DIR="
|
|
58
|
-
--run-id "
|
|
57
|
+
SCHOOL_DATA_DIR="<data directory>" paper-search-school progress --json
|
|
58
|
+
SCHOOL_DATA_DIR="<data directory>" paper-search-school progress --json --watch \
|
|
59
|
+
--run-id "<this run's run_id>" --identifier "<target DOI>" --timeout 30
|
|
59
60
|
```
|
|
60
61
|
|
|
61
|
-
|
|
62
|
+
Read it once before starting the download and note the old `run_id`; after starting the download, confirm that `identifier` is the target DOI and that `run_id` has changed, then bind this task with `--watch`. Each watch lasts at most 60 seconds; while the original task is still running, keep watching the same `run_id`; do not download again. A long time without updates only means no new progress; do not infer no access from it.
|
|
62
63
|
|
|
63
|
-
| `stage` |
|
|
64
|
+
| `stage` | Action |
|
|
64
65
|
| ------------------------------------------------------ | ---------------------------------------------------------------- |
|
|
65
|
-
| `waiting_login` |
|
|
66
|
-
| `waiting_verification` |
|
|
67
|
-
| `opening_article` / `checking_access` / `fetching_pdf` |
|
|
68
|
-
| `pdf_captured` |
|
|
69
|
-
| `saved_pending_verification` |
|
|
70
|
-
| `route_failed` |
|
|
71
|
-
| `failed` / `cancelled` / `interrupted` / `unknown` |
|
|
66
|
+
| `waiting_login` | Remind the user to sign in in the download browser; keep watching. |
|
|
67
|
+
| `waiting_verification` | Keep watching; go by actual reminders for manual handling; do not keep pressing the user just because of this stage. |
|
|
68
|
+
| `opening_article` / `checking_access` / `fetching_pdf` | Wait; do not ask for sign-in again. |
|
|
69
|
+
| `pdf_captured` | The PDF has been read; still wait for it to be saved. |
|
|
70
|
+
| `saved_pending_verification` | Saved; wait for the original call's final result and identity check. |
|
|
71
|
+
| `route_failed` | This route failed; the original task may go on; wait for the final result; do not start the download again. |
|
|
72
|
+
| `failed` / `cancelled` / `interrupted` / `unknown` | Check the original call's result; do not report success or no access from this. |
|
|
72
73
|
|
|
73
|
-
|
|
74
|
+
Latest screenshot of the download browser (read-only):
|
|
74
75
|
|
|
75
76
|
```bash
|
|
76
|
-
SCHOOL_DATA_DIR="
|
|
77
|
+
SCHOOL_DATA_DIR="<data directory>" paper-search-school preview --run-id "<this run's run_id>" --doi "<target DOI>"
|
|
77
78
|
```
|
|
78
79
|
|
|
79
|
-
|
|
80
|
+
Returns JSON with the screenshot path. The screenshot may be a few seconds old; judge the current state by the progress; school selection, sign-in and verification still happen in the actual download window.
|
|
80
81
|
|
|
81
|
-
##
|
|
82
|
+
## Results and failure classes
|
|
82
83
|
|
|
83
|
-
|
|
84
|
+
Read the `code` and the hint of `entitled_access` in `attempts[]`; do not show raw logs, signed download addresses or session contents. After a batch or single download ends, run:
|
|
84
85
|
|
|
85
86
|
```bash
|
|
86
87
|
paper-search failures --format text
|
|
87
88
|
```
|
|
88
89
|
|
|
89
|
-
|
|
90
|
+
(The latest batch by default; `--since YYYY-MM-DD`, `--runs N`, `--all`.) It sorts failures into five classes, and each reason has a fixed label (the same in the progress window, the batch's last line and the summary). The program prints these labels in Chinese, as below; the English in brackets is their meaning, and what the window shows in English. When explaining to the user, use these class names and reasons in the user's language (with the Chinese label as printed when it helps the user find it); do not make up other wording:
|
|
90
91
|
|
|
91
|
-
|
|
|
92
|
+
| Class | Reasons (common codes) | What to say and do |
|
|
92
93
|
| --- | --- | --- |
|
|
93
|
-
| 没权限 |
|
|
94
|
-
| 要你处理 |
|
|
95
|
-
| 外部原因 |
|
|
96
|
-
|
|
|
97
|
-
| 原因不明 | 没取到 PDF
|
|
94
|
+
| 没权限 (No access) | 学校没有订阅 (No school subscription, `entitlement_missing`); 出版社没开通本校 (Not enabled for school, `institution_federation_unavailable`, `institution_not_registered`); 你标记过没权限 (You marked no access, `no_entitlement`); after switching schools it reads "N 所学校都没有权限" (No access at N schools) | Add the evidence from the summary (the page's own words or the deciding step). Say only that this paper is unavailable through these schools; do not infer anything about the whole platform; when the publisher has not enabled the school, do not call it the school having no subscription; suggest downloading on the campus network or school VPN. The batch has already tried the other saved schools at the end; "go on" (接着下) does not download it again, only when the user names another saved school. |
|
|
95
|
+
| 要你处理 (Needs you) | 等你登录超时 (Login wait timed out); 你跳过或终止了 (Skipped or stopped); 浏览器被关闭 (Browser closed); 浏览器被占用 (Browser in use); 密码被学校拒绝 (Password rejected); 账号被锁或密码过期 (Locked or expired) | Say what the user needs to do (sign in, wait for another task to finish, update the password in the settings, unlock as the school says), and that after that they can say "go on" (接着下); do not resubmit the login again and again. |
|
|
96
|
+
| 外部原因 (External) | 被网站拦截 (Blocked by site); 出版社网站出错 (Publisher site error); 学校登录系统出错 (School login error); 学校登录中途失效 (School login lapsed); 网络中断 (Network down); 达到每小时下载上限 (Hourly limit reached); 全文还没上线 (Full text not online yet); DOI 查不到 (DOI not found); 网站不提供学校登录 (No school login offered); 网站没有 PDF (No PDF on the site) | Say it is a problem on the other side: neither no access nor a program error; suggest saying "go on" (接着下) after a while, or changing networks, or downloading on the campus network or school VPN. For full text not online yet, wait for formal publication; for DOI not found, try again in a few days; a DOI never registered is not downloaded again on "go on": ask the user to download it themselves by title on the publisher's site; for no school login offered, "go on" does not retry: download open-access articles directly on the site, and subscription content on the campus network or school VPN |
|
|
97
|
+
| 待适配 (Pending support) | 只在其他平台提供 (Only on another platform: EM-Consulte, ClinicalKey, which PaperSearch has no rules for yet); 网站暂未适配 (Site not adapted yet); 附录暂未适配 (Files not adapted yet) | Say PaperSearch's rules do not cover this site yet and the maintainers will add them: not that the site cannot be supported, and not no access; give the diagnostic file and screenshot locations from the summary; suggest exporting the records with `paper-search failures --export <file.zip>` to send to the maintainers; if it is urgent, the user can download it themselves on the campus network. "go on" (接着下) downloads it again only after PaperSearch is updated. |
|
|
98
|
+
| 原因不明 (Unclear) | 没取到 PDF (No PDF); 拿错 PDF (Wrong PDF); 没法确认 PDF (PDF unconfirmed); 页面或浏览器卡住 (Page or browser stuck); 没进入学校登录页 (School login not reached); 文章页没存下来 (Page not saved) | Not no access; when "失败后自动重试" (Auto-retry failures) is on in the settings, the batch has already tried once more with the same school at the end (off by default). Say the cause is still to be found, and give the summary's "停在 …" (stopped at …) step and the diagnostic file location. |
|
|
98
99
|
|
|
99
|
-
|
|
100
|
+
Papers whose full text is saved and only the supplementary files are missing are not failures: the summary does not count them among the failed papers but lists them separately as "附录未下全" (Supp. missing), one line per reason.
|
|
100
101
|
|
|
101
|
-
|
|
102
|
+
`pdf_identity_unverified` / `pdf_identity_mismatch`: never report success; `review.path` is only a file awaiting checking.
|
|
102
103
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
-
|
|
104
|
+
## School login lapses; "go on" (接着下)
|
|
105
|
+
|
|
106
|
+
- In a batch download, when earlier papers from a publisher were downloaded through the school login, and then a paper stops on the school's own login page without completing sign-in (login expired; failures that never reached the school login page, such as a stuck redirect, a slow network or human verification, do not count), the program pauses that publisher's papers: the PDF, and supplementary files all wait, while other publishers keep downloading. The collapsed progress window shows "已暂停 N 篇" (N paused) next to the progress; expanded, it has "学校登录中途失败,已暂停 N 篇" (Login lapsed: N paused) and "登录并继续" (Sign in & resume); the user can press it at any time, even while other papers are still downloading; once the current paper finishes, the paused papers go on, opening the school login page when needed. Once all other papers are done, the whole batch waits until the user presses "登录并继续" or "终止" (Stop); the command is still running then: tell the user to go back to the progress window; do not start another download. After a stop, these papers are recorded as `login_paused`.
|
|
107
|
+
- When the computer goes offline during a batch download (neither doi.org nor PubMed can be reached), the program stops and waits for the network, and the progress window says "网络断了,等网络恢复后接着下" (Offline; waiting to go on); once the network is back it downloads again the paper that was cut off and goes on, without marking the papers during the outage as failed. A single download that meets an outage reports `network_unavailable` (网络中断, Network down), not a DOI that does not exist.
|
|
108
|
+
- When the user says "go on" (接着下), "继续下载" (continue downloading) or "重试失败的" (retry the failed ones), do not pick DOIs from the failure list yourself; run:
|
|
106
109
|
|
|
107
110
|
```bash
|
|
108
111
|
paper-search run download_batch --json-args '{"resume":"latest"}'
|
|
109
112
|
```
|
|
110
113
|
|
|
111
|
-
|
|
114
|
+
It reads the last batch's run log: papers not downloaded are downloaded again with their original contents; papers whose PDF exists but whose supplementary files are incomplete (not reached, failed, login lapsed) get only the missing part, and the PDF is not downloaded again; everything goes into the original batch's download folder. Papers that truly have no full-text source are not retried. When a batch was cut off by force (such as a computer restart), papers not reached and missing from the run log are also downloaded again from this batch's list. Papers whose article page was checked and had no supplementary files are not checked again; when one "go on" run is stopped, the unprocessed papers count as they did before. To go on with an earlier batch, replace `latest` with the run ID that `paper-search failures` gives. When the original batch set environment variables (such as `XDG_DATA_HOME`, a separate data directory for switching schools), run it with the same environment variables.
|
|
112
115
|
|
|
113
|
-
##
|
|
116
|
+
## Export failure records
|
|
114
117
|
|
|
115
118
|
```bash
|
|
116
119
|
paper-search failures --export ./failure-report.zip
|
|
117
|
-
paper-search failures --run
|
|
120
|
+
paper-search failures --run <run ID> --doi <DOI> --export ./failure-report.zip
|
|
118
121
|
```
|
|
119
122
|
|
|
120
|
-
|
|
123
|
+
The latest batch by default; `--since YYYY-MM-DD` or `--runs N` can replace `--run`; the three are mutually exclusive. `--all` controls only the text summary, not how much is exported. Papers whose full text succeeded but whose attachments failed or did not finish are listed too; a completed check that found no attachments is not a failure.
|
|
121
124
|
|
|
122
|
-
|
|
125
|
+
The extension must support `report-export`; an old extension reports a clear error and does not install, update or start a download automatically. The export is offline and reads only the source records; an existing ZIP of the same name is not overwritten. One package holds at most 100 papers and 64 MiB of uncompressed material; beyond that, narrow the selection. Missing material, limits exceeded and the reasons for leaving things out are in the package's `manifest.json` and `summary.md`; missing HTML must not be treated as collected.
|
|
123
126
|
|
|
124
|
-
|
|
127
|
+
The exported copy removes school identifiers, personal paths and authentication parameters; screenshots of login pages, school sites or unknown sources are not included. Before making it public, the user must check the remaining HTML, text and images for names, emails, student numbers and the like. When helping the user write an issue, use the summary in the package; do not copy raw diagnostics, cookies, browser profiles or downloaded full texts; without the user's clear permission, do not upload the package or submit an issue. When the export fails, do not claim that a shareable record was produced.
|
|
125
128
|
|
|
126
|
-
##
|
|
129
|
+
## Supplementary files
|
|
127
130
|
|
|
128
|
-
- `
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
131
|
+
- Put `supplements` in the `content` of `download_with_fallback` / `download_batch`: alone, it fetches only the supplementary files and skips the full-text layers; with `pdf`, both the PDF and the supplementary files are fetched.
|
|
132
|
+
- Supplementary files are fetched only through the browser of school subscription downloads: when the PDF came from an open channel, it is asked separately for the supplementary files; when it is not installed or not enabled, this step is recorded as `skipped`, stating that no backend is available.
|
|
133
|
+
- Which publishers have supplementary-file rules: see `publisher-support.md`. When the check completes but the page lists no attachments, the result has an empty `supplements` and the attempt is `skipped/no_supplements`; when only supplementary files were asked for, the overall `status=ok` means the check completed, not that files were saved. When the site has no dedicated supplementary-file rules, the general rules first fetch the files in the article page's supplementary section whose addresses contain this article's DOI; when nothing is found, the attempt is `skipped/supplements_not_supported` and the overall result is still `ok`: whether there are attachments is unknown; tell the user "the site is not yet supported for downloading supplementary files automatically", and that if needed they can open the article page and download them by hand; do not say there are no supplementary files. Sign-in not completed (`login_required`), verification not completed (`challenge_timeout`), a site's human-verification page blocking the attachment download (`verification_page`, such as Figshare), a web page instead of a file (`html_page`) and other download failures are reported separately; when only supplementary files were asked for, the result is `error`, which does not affect a full text already saved.
|
|
134
|
+
- Files are saved in `<savePath>/<journal abbreviation_year-month_title>/supplements/` (another paper with the same name in the same download gets `_2`), and the full text moves into this folder too; papers without attachments keep their full text directly in `<savePath>`; `…_supplements-manifest.json` records each file's status (`saved`, `failed`, `skipped`) and reason, in the run-log directory that the result's `runLog` points to: in `diagnostics/` when some files were not downloaded, in `records/` when all were; `supplements` in the result gives the actual file paths.
|
|
135
|
+
- Limits: at most 50 files per paper; no file size limit (except files opened in the browser's own PDF viewer: over 1 GB is recorded as `too_large`); it stops after 3 minutes without progress, or after more than 15 minutes in total for one paper. Anything beyond is recorded as `skipped` (reasons `file_limit`, `too_large`, `time_budget`). `html_page` means the link opened a web page, not a file; `http_403` and the like mean the site refused.
|
|
136
|
+
- Only this article's files are taken: files of other articles, this article's figures and links in the references are not. Public Figshare article/collection links are resolved into files when linked to the article's DOI; other external attachment platforms still need adapting.
|
|
137
|
+
- Supplementary files and conflict-of-interest statements may also carry the target title and DOI; never deliver a supplementary PDF as the full text; a successful full text does not mean the supplementary files are complete.
|
|
138
|
+
- When a site (currently Taylor & Francis) refuses the program's direct download of supplementary files, the browser downloads them itself, and the list says `via: browser_download`; the browser's download list then shows entries named with a string of numbers and no extension; the files are already saved under their real names in the `_supplements` directory, and these entries can be cleared from the browser's downloads page.
|
|
136
139
|
|
|
137
|
-
##
|
|
140
|
+
## Confirm the download succeeded
|
|
138
141
|
|
|
139
|
-
|
|
142
|
+
Go by the command's final success, the files actually saved and the identity check on the PDF's first page: the DOI and title on the first page match the target. The target DOI appearing in the references does not count; `review.path`, a PDF shown in the browser, or an exit code of zero cannot prove success on their own. Random file names, files without extensions or failed entries in the browser's download list come from temporary downloads; they cannot replace the official output files, and their names alone cannot show that the content is wrong. When delivering, give the actual file path, the target DOI and this result.
|