ChenSheg
knowledge-from-literature-and-bilibili
A tool box for literature search and analysis
- Stars
- 0
- Language
- Python
- Created
- Jul 14, 2026
- Updated
- Jul 14, 2026
Introduction
research-skills · 科研工具箱
一组面向科研工作流的实用 CLI 工具 / Agent Skills:文献检索 · 文献下载(含正式刊模式)· PDF 解析 · B站视频转写。 零依赖或轻依赖,开箱即用;既可命令行直接跑,也可被 Claude Code / Codex 等 Agent 当作 Skill 调用。
功能一览
| Skill | 作用 | 核心依赖 | 入口脚本 |
|---|---|---|---|
| literature-search | 多源文献检索(PubMed / arXiv / Europe PMC / Crossref / Semantic Scholar),跨源去重,导出 CSV + JSON | 无(纯标准库) | scripts/search.py |
| literature-download | 按 DOI / arXiv / PMID / PMCID 下载 PDF;默认走开放获取多源回退,--formal 模式可经机构访问取付费墙正式刊 | 无(纯标准库) | scripts/download.py |
| literature-parse | PDF → Markdown / 文本 / JSON,自动提取标题、作者、摘要、章节;扫描件推荐 MinerU | PyMuPDF(已装)/ 可选 pymupdf4llm、MinerU | scripts/parse.py |
| bilibili-transcript | B站视频取字幕(WBI 签名)/ 官方 AI 文稿(conclusion/get,需 SESSDATA)/ whisper 兜底,导出 TXT + SRT | 无 / 可选 yt-dlp + faster-whisper + PyAV | scripts/bili_transcript.py |
目录结构
research-skills/
├── README.md # 本文件
├── ENV.md # 本机环境约定(个人备忘,可删/可忽略)
├── LICENSE # MIT
├── requirements-optional.txt# 可选依赖(仅 whisper / pymupdf4llm 等增强功能需要)
├── literature-search/
│ ├── SKILL.md
│ └── scripts/search.py
├── literature-download/
│ ├── SKILL.md
│ └── scripts/download.py
├── literature-parse/
│ ├── SKILL.md
│ └── scripts/parse.py
└── bilibili-transcript/
├── SKILL.md
└── scripts/bili_transcript.py
环境要求
- Python 3.8+(检索 / 下载 / B站取字幕三条主路径均为纯标准库,无需
pip install)。 - 可选增强依赖(仅特定功能需要),见 requirements-optional.txt:
yt-dlp+faster-whisper+av(PyAV):B站 whisper 兜底转写(PyAV 解码音频,无需 ffmpeg.exe)。pymupdf/pymupdf4llm:文献解析的高精度 Markdown 后端。mineru[core]:扫描件 / 复杂公式表格的 SOTA 解析(独立工具,脚本会引导)。
本仓库作者自用环境的固定约定(解释器路径、conda 环境、VPN 等)记录在
ENV.md,属个人备忘,开源使用时可忽略或按自己的环境改写。
快速开始
# 0) (可选)装增强依赖
pip install -r requirements-optional.txt
PY=python # 或你自己的 python3 解释器
# 1) 检索 -> CSV/JSON
$PY literature-search/scripts/search.py "berberine multidrug resistance" --limit 50 --out ./lit
# 2) 下载 PDF(默认开放获取;付费墙用 --formal 走机构访问)
$PY literature-download/scripts/download.py --csv ./lit.csv --email you@example.com --out ./pdfs
$PY literature-download/scripts/download.py --id 10.1038/s41586-026-10689-z --formal \
--cookie-file ./cookies.txt --out ./pdfs
# 3) 解析 PDF -> Markdown + 元数据
$PY literature-parse/scripts/parse.py ./pdfs --out ./parsed
# 4) B站视频转写(带 SESSDATA 拿官方 AI 全文)
$PY bilibili-transcript/scripts/bili_transcript.py BV1kKNg62EgT --sessdata "<你的SESSDATA>" --out ./bili
各 Skill 详解
每个子目录都有独立的 SKILL.md,含完整参数、输出格式、依赖与提示。下面仅给要点,详细以各 SKILL.md 为准。
literature-search
跨 5 个数据源一键检索,按 DOI/PMID/标题去重,导出 <out>.csv(UTF-8-BOM,Excel 直接打开)与 <out>.json。支持 --sources、--limit、--year-from。
literature-download
- 开放获取模式(默认):对每篇依次尝试
arXiv → Unpaywall → Europe PMC OA → PubMed Central,命中即停;付费墙标记为[fail]。 - 正式刊模式(
--formal):解析 DOI 到出版社落地页,自动发现 PDF 链接,用你的机构会话 Cookie 下载付费墙 PDF。需先连机构 VPN + 在浏览器登录(如 ZJU 的 aTrust VPN + CARSI/ZJU SSO),再把该域名 Cookie 通过--cookies "a=b; c=d"或--cookie-file cookies.txt(Netscape 格式)传入。未登录时自动回退到 OA 链。
literature-parse
自动择优后端:pymupdf4llm(版式感知 Markdown)→ fitz(纯文本 + 启发式标题)。每篇输出 <name>.md/.txt 与 <name>.meta.json(标题/作者/页数/摘要/章节/字符数)。扫描件 / 复杂公式推荐 MinerU。
bilibili-transcript
三条路径自动衔接(命中即止):① WBI 签名的官方/AI CC 字幕;② conclusion/get 官方 AI 文稿(传 --sessdata 即可零模型下载拿到全文,首选);③ yt-dlp + faster-whisper 兜底。输出 TXT + SRT。
正式刊模式与机构访问(Formal-journal mode)
很多顶刊(Nature / NMI / Elsevier / Wiley / ACS …)是付费墙。本工具默认只取合法免费的 OA 版本。若你拥有机构订阅:
- 连接校园 VPN(如 ZJU 的深信服 aTrust 客户端),并通过 CARSI / 学校 SSO 在浏览器登录出版社;
- 用浏览器扩展(如 Get cookies.txt LOCALLY)导出该出版社域名的 Cookie(Netscape 格式)或复制 Cookie 字符串;
- 运行
download.py --id <DOI> --formal --cookie-file cookies.txt。
脚本会自动解析 DOI → 出版社落地页 → 发现 PDF 链接 → 带 Cookie 下载;取回的是登录墙 HTML 时会提示你未登录并回退 OA。仅下载你有权访问的 PDF,遵守出版社条款。
在 Agent / Codex 中使用
本仓库的每个子目录都是自包含的一个 Skill:SKILL.md 含 YAML frontmatter(name / description / version / license)+ 正文用法,脚本在 scripts/ 下、零/轻依赖、可直接运行。
- Claude / CodeBuddy 类:将本仓库放入 skills 目录(如
~/.workbuddy/skills/或项目.workbuddy/skills/),Agent 会自动读取SKILL.md并按其中的命令调用脚本。 - Codex / 通用 Coding Agent:直接让 Agent 阅读对应
SKILL.md与脚本头部 docstring 即可理解用法;所有命令均为python <skill>/scripts/<script>.py [参数]形式,无需额外配置。 - 每个
SKILL.md的description字段已用英文/中文写明「何时使用」,便于 Agent 检索路由。
许可证
MIT。文献检索/下载请遵守各数据源与出版社的使用条款,仅用于合法的研究与学习用途。
English
research-skills is a small collection of CLI tools / agent skills for research workflows:
literature search, PDF download (incl. a formal-journal mode for paywalled PDFs via
institutional access), PDF parsing, and Bilibili video transcription. Most paths are
pure Python standard-library (no pip install needed). Each subfolder is a self-contained
skill with a SKILL.md (YAML frontmatter + usage) and a runnable script under scripts/,
so they work both from the command line and as skills for agents like Claude Code / Codex.
Highlights:
literature-search: search PubMed/arXiv/Europe PMC/Crossref/Semantic Scholar, dedupe, export CSV+JSON.literature-download: OA fallback chain by DOI/arXiv/PMID/PMCID;--formalmode fetches paywalled publisher PDFs using your institutional session cookie (VPN + SSO required).literature-parse: PDF → Markdown/text/JSON with abstract & section extraction (pymupdf4llm/fitz; MinerU for scans).bilibili-transcript: Bilibili video → TXT/SRT via CC subtitles, the official AI transcript API (conclusion/get, needs SESSDATA), or a yt-dlp + faster-whisper fallback.
Licensed under MIT.