Tooluck logoTooluck
SKILL.md

bilibili-transcribe

Agent skill fromchubbyguan/chubbyskills

哔哩哔哩视频 → 下载 → 转录 → 存为 Markdown 的完整工作流。 支持 BV 号和完整链接,无需登录。

How to install bilibili-transcribe

install bilibili-transcribe
# install the chubbyskills pack with the skills CLI
npx skills add chubbyguan/chubbyskills

# or add only this skill to Claude Code: copy the folder

bilibili-transcribe/

# into

~/.claude/skills/bilibili-transcribe/ (all projects)

.claude/skills/bilibili-transcribe/ (one project)

bilibili-transcribe/SKILL.md

MITFull file
1# B 站视频转录 Skill
2
3**字幕优先**:先尝试抓取官方/自动字幕(秒级、免 GPU、免 funasr);抓不到再下载音频用 SenseVoice-Small 转录,存为 Markdown 文件。加 `--no-subtitle` 可强制走音频转录。
4
5## 环境要求
6
7```bash
8# Python 3.9+
9python -m venv .venv
10source .venv/bin/activate
11
12# 依赖
13pip install funasr modelscope torch torchaudio
14
15# 系统依赖
16# macOS: brew install ffmpeg yt-dlp
17# Ubuntu: sudo apt install ffmpeg && pip install yt-dlp
18```
19
20## 使用方法
21
22```bash
23python scripts/transcribe.py "https://www.bilibili.com/video/BV1rrQGBeEen/"
24python scripts/transcribe.py "BV1rrQGBeEen"
25python scripts/transcribe.py "BV1rrQGBeEen" --no-subtitle # 强制音频转录
26
27# 批量处理:每行一个 B站 URL 或 BV 号
28python scripts/batch_transcribe.py urls.txt -o ./output
29```
30
31## 流程
32
33### Step 1: yt-dlp 下载音频
34
35B 站有反爬机制,需要加 User-Agent 和 Referer:
36
37```bash
38yt-dlp --extract-audio --audio-format mp3 --audio-quality 128K \
39 --user-agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ..." \
40 --referer "https://www.bilibili.com" \
41 "https://www.bilibili.com/video/BV1rrQGBeEen/"
42```
43
44### Step 2: SenseVoice-Small 转录
45
46```python
47from funasr import AutoModel
48from funasr.utils.postprocess_utils import rich_transcription_postprocess
49
50model = AutoModel(
51 model="iic/SenseVoiceSmall",
52 trust_remote_code=True,
53 vad_model="fsmn-vad",
54 vad_kwargs={"max_single_segment_time": 30000},
55 device="cpu",
56)
57
58result = model.generate(input=audio_path, language="zh", use_itn=True, batch_size_s=60)
59```
60
61### Step 3: 生成 Markdown
62
63自动创建带 frontmatter 的 Markdown 文件。
64
65### 批量模式
66…

Excerpt shown under the repository's MIT license.

More skills in chubbyskills

Keep exploring

Similar skill repositories

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates