dsh-lit-fetch: Literature Retrieval, Bulk PDF Download, and Access List Generation in DSH

Introduction

When conducting literature reviews or batch acquisitions in DSH, a common practice is to manually search for DOIs in a browser and find PDFs one by one, or to write scripts to call Crossref, Sci-Hub, and Unpaywall. These steps are fragmented, making it difficult for an agent to complete the workflow of “search metadata → save PDF → organize un-downloadable entries into a clickable list” in one go. The community plugin dsh-lit-fetch (Maintainer: loyalchiiina, Category: Networking Tools) consolidates these three tasks into three tools for the agent to call during conversations. It is not a web content scraping tool; it does not parse readability or convert HTML into plain text. It only performs literature metadata retrieval, PDF downloading, and batch acquisition list HTML generation.

What is this

dsh-lit-fetch is a literature acquisition plugin for DeepSeek Harness. It queries paper metadata by DOI or title/keywords, batch downloads PDFs by DOI (prioritizing Sci-Hub mirrors and falling back to Unpaywall open access), and generates a clickable list in a Chinese page for entries that could not be automatically obtained. The host side is pure Node.js with no Python dependencies. The current package version is 1.0.5, and the license is MIT. For source code and instructions, see GitHub; for the directory page, see SkillHub.

Search: search_papers

Below is the behavior of the metadata retrieval tool to help you align with the agent when describing requirements in conversations.

  1. Exact DOI Query: When the input matches 10.xxxx/... (regex ^\d+\.\d+\//), it calls Crossref works/{doi}. The request timeout is 15 seconds; on failure, it automatically falls back to an OpenAlex keyword search.
  2. Title/Keyword Query: For non-DOI inputs or when Crossref misses, it calls OpenAlex works?search=. It returns 5 results by default, with a maximum of 20.
  3. Return Fields: Title, authors, journal, year, DOI, and official link.

This can be triggered via natural language in DSH conversations. Example: “Help me find literature on static mixer CFD” → agent calls search_papers.

Download: download_papers

Batch downloads PDFs to a specified directory based on a list of DOIs. The strategy is as follows:

  1. Sci-Hub Priority: Tries 8 mirror domains in sequence (sci-hub.ren / ee / st / ru / se / wf / hk, tesble.com). It requests the domain + DOI page (25s timeout), parses the direct PDF link from iframe/embed using regex, reads the entire package into memory, and validates the magic number %PDF- and minimum file size (rejecting files smaller than 3000 bytes). Upon passing, it writes to <filename>.pdf.part first and then renames it to the official file (non-streaming, no resume support).
  2. Open Access Fallback: If all Sci-Hub attempts fail or validation fails, it queries Unpaywall (30s timeout). It prioritizes best_oa_location, then iterates through url_for_pdf or url in oa_locations, applying the same download and validation logic.
  3. Concurrency and Naming: Concurrency defaults to 4 (adjustable, clamped between 1–8). Filenames are <two-digit-index>_<sanitized-title>.pdf (title strips \ / : * ? " < > | and newlines/tabs, max 120 characters).

Possible statuses for each paper: ok / scihub-fail / oa-fail / closed-access / no-doi. The result array is written to _lit_fetch_report.json in the output directory (the content is an array, not a summary object). Note: If Sci-Hub fails but OA succeeds, two records are written for the same paper (scihub-fail and ok), so the number of records may exceed the number of papers.

Conversation example: “Download these DOIs to D:\papers\” → agent calls download_papers.

Manifest: generate_manifest

For literature that could not be automatically obtained, it generates a clickable HTML list. The default filename is 批量获取入口.html (can be changed), and the page language is fixed to Chinese. Each row includes the index, a title linked to https://doi.org/<DOI>, the first author, the year, the journal, a status badge, and a “Download PDF” button. There is also a “Open All Sequentially” button, which opens entries one by one with an 800 ms interval.

Conversation example: “Generate an acquisition list for the literature that wasn’t downloaded” → agent calls generate_manifest.

Status Fields and Manifest Display (Important)

The statuses produced by download_papers and the statuses recognized by generate_manifest are inconsistent:

Source Status Values
download_papers ok · scihub-fail · oa-fail · closed-access · no-doi
generate_manifest only recognizes ok (green “✓ Downloaded”) · failed (orange “✗ Manual Required”)
Other values Gray “—”, neither counted as downloaded nor manual required

If you pass the download results as is to generate_manifest, only ok will display as downloaded, while all other failure states will become gray “—”. If you want failure items to display an orange “✗ Manual Required”, you need to map non-ok statuses to failed before passing them in.

Installation and Activation

The plugin runs network and disk write operations with the permissions of the current DSH process. It is recommended to review the source code and the MIT license before installation.

The official installation command is as follows (from the README):

dsh plugin --profile desktop add dsh-lit-fetch
# Or link from a local directory
# cp -r dsh-lit-fetch ~/.dsh/local-plugins/

The runtime environment requires Node.js ^22.19.0 || >=24.0.0; peer dependencies include @deepseek-ai/dsh, etc. (refer to package.json for details).

The plugin registers a /lit-fetch prefix route on the host, returning a {status, plugin, version} JSON. The version comes from package.json, facilitating confirmation of the loaded version.

Summary of Typical Usage

Based on the steps above, a common workflow is:

  1. Use natural language search to get DOIs and metadata.
  2. Specify a local directory to batch download PDFs and check _lit_fetch_report.json.
  3. Map statuses for entries still requiring manual handling, generate 批量获取入口.html, or directly open DOIs and download entries one by one in the list.

Suitable Scenarios and Limitations

Suitable for: Conducting literature research within DSH sessions, batch acquiring PDFs by DOI, and organizing un-downloadable papers into clickable lists. Its responsibilities differ from “web content scraping” plugins; do not mix them.

Known Limitations (as per README):

  • Sci-Hub has essentially stopped indexing new literature after 2021; articles from Elsevier/Wiley/ACS published after 2021 are likely not included.
  • Direct connections to Sci-Hub mirrors may be slow; the documentation suggests using a VPN/proxy.
  • The OA fallback only queries Unpaywall; some arXiv preprints may not be included.
  • PDFs are fully buffered in memory (no streaming, no resume support, no download progress); timeouts for page scraping (25s) and PDF reading (180s) mean you must tolerate failures with large files.

The DSH ecosystem emphasizes “everything is a plugin”; SkillHub is a community directory and has no official affiliation with DeepSeek / High-Flyer.

Conclusion

dsh-lit-fetch integrates Crossref/OpenAlex retrieval, Sci-Hub and Unpaywall downloading, and Chinese HTML acquisition lists into the DSH toolchain. It is suitable for developers who need to close the loop of “Search—Download—Supplement List” within agent conversations. For further details, refer to the repository README: GitHub — loyalchiiina/dsh-lit-fetch.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye