bilibili-transcript
Use when the user wants a transcript, 逐字稿, captions, subtitles, 口播文稿, CC字幕, or AI字幕 from a Bilibili/B站 video URL or BV id.
Source facts
- Repository
- itgoyo/bilibili-transcript-skill
- Last source activity
- August 27, 2026 at 07:36
- Detected SKILL.md language
- Chinese
- Stars
- 0
- Forks
- 0
Install options
The review-first prompt is selected by default. You can switch to a direct command or download a local copy.
Review the source files
Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.
Showing SKILL.md
SKILL.md
Source instructions · Read-only preview- name
- bilibili-transcript
- description
- Use when the user wants a transcript, 逐字稿, captions, subtitles, 口播文稿, CC字幕, or AI字幕 from a Bilibili/B站 video URL or BV id.
# B站视频转逐字稿
把 B 站视频变成带时间轴的逐字稿。先拿官方/AI 字幕,没有再本地下载音频做语音识别。不要手写爬虫步骤,执行本 skill 的脚本。
## 何时使用
- 用户丢来 `bilibili.com/video/BV…` 或 BV 号,要逐字稿/字幕/文稿
- 用户说「转写 B 站」「B站口播」「导出字幕」
## 执行
在 skill 根目录运行(仓库根或 `~/.cursor/skills/bilibili-transcript`):
```bash
python3 scripts/bili_transcript.py "https://www.bilibili.com/video/BVxxxxxx" -o ./transcripts -f all
```
只接受 URL 或 BV 号。多 P 用 `--page N`(从 1 起)。
输出 `BVxxxxxx.txt` / `.srt` / `.json`。把逐字稿给用户;默认用带时间轴的可读正文,需要原档再附 SRT 路径。
## 字幕优先级
1. 播放器接口里的 CC / AI 字幕(`zh-CN` > `zh` > `ai-zh`)
2. 否则下载音频,用本机 Whisper(`whisper-cli` 优先,其次 `whisper`)
3. `--subs-only`:没有字幕就停,并说明是否缺登录态
`need_login_subtitle: true` 且字幕列表为空时:AI 字幕要登录。使用环境变量 `BILI_SESSDATA` 或 `--sessdata`,**不要**把 cookie 写入仓库、聊天或日志。禁止把浏览器 cookie 导出成文件再提交。
```bash
BILI_SESSDATA='...' python3 scripts/bili_transcript.py BV1xxx -o ./transcripts
```
## 依赖
- Python 3.9+(标准库即可)
- 无字幕时:`whisper-cli`(whisper.cpp)或 `pip install openai-whisper`
- 转音频:`ffmpeg`,或 macOS 自带 `afconvert`
- 默认模型:`~/.cache/whisper.cpp/ggml-base.bin`(缺失时脚本会从 hf-mirror 拉 ggml-base)
## 交付
- 标题、UP 主、BV、链接
- 带时间轴的逐字稿(可按句合并,不要改原意)
- 专有名词可对照视频标题/简介轻量校对,并标明来源:官方字幕 / AI 字幕 / Whisper
- Whisper 结果声明可能有识别误差
- 游戏实况等无口播片段保持空白,不要编造
## 禁止
- 不要为「拿字幕」去提取或保存浏览器 cookie 文件
- 不要把 SESSDATA 写进 README、issue、commit
- 不要把视频下载后的音视频提交进 git
View on GitHub