Bilibili Audio Transcribe
Convert a Bilibili link into local transcript files. Prefer this skill for Bilibili and b23.tv URLs only; do not use it for YouTube or generic web pages.
Quick start
- 1. Ensure
ffmpeg and ffprobe are on PATH. - If Python dependencies are missing, run
scripts/bootstrap_env.sh or install yt-dlp and faster-whisper manually. - Run
scripts/transcribe_bilibili.py with the target URL. - Return the generated transcript artifacts or summarize them if the user asked for analysis rather than raw text.
Example:
CODEBLOCK0
Workflow
1. Validate the request
Accept only bilibili.com or b23.tv URLs. If the URL points elsewhere, stop and say this skill is the wrong tool.
2. Prefer the bundled script
Use scripts/transcribe_bilibili.py instead of rewriting yt-dlp / whisper glue code in the session. The script:
- - downloads the best available audio
- probes audio duration with INLINECODE11
- transcribes with INLINECODE12
- writes
.txt, .srt, and INLINECODE15 - prints coarse ETA / progress during ASR
3. Use sensible defaults
Default to:
- - INLINECODE16
- INLINECODE17
- INLINECODE18
- VAD enabled
These defaults are optimized for Chinese Bilibili speech. If the video is clearly non-Chinese or mixed-language, rerun with --language auto or a specific language code.
4. Keep outputs predictable
By default the script writes into downloads/bilibili-audio/ relative to the current working directory. Keep all three artifacts unless the user explicitly asks for fewer outputs:
- - transcript text: INLINECODE21
- subtitles: INLINECODE22
- segment metadata: INLINECODE23
5. Handle failures directly
If a run fails:
- - missing
ffmpeg / ffprobe → install system dependency first - missing Python packages → run INLINECODE26
- extractor or redirect issues → retry with the resolved canonical Bilibili URL
- poor transcript quality → rerun with
--language auto, a larger model, or --no-vad when speech is clipped
Read references/troubleshooting.md when dependency setup or extraction fails.
Resources
scripts/
- -
transcribe_bilibili.py — main downloader + ASR pipeline - INLINECODE31 — create a virtualenv and install Python dependencies
- INLINECODE32 — Python package list for the bootstrap script
references/
- -
troubleshooting.md — dependency and extraction failure playbook
Bilibili 音频转录
将Bilibili链接转换为本地转录文件。仅对Bilibili和b23.tv链接使用此技能;不要用于YouTube或普通网页。
快速开始
- 1. 确保ffmpeg和ffprobe已加入PATH环境变量。
- 如果缺少Python依赖,运行scripts/bootstrapenv.sh或手动安装yt-dlp和faster-whisper。
- 使用目标URL运行scripts/transcribebilibili.py。
- 返回生成的转录文件,如果用户要求分析而非原始文本,则进行总结。
示例:
bash
python scripts/transcribe_bilibili.py https://b23.tv/SSx810h \
--out-dir ./downloads/bilibili-audio \
--model-size base \
--beam-size 3
工作流程
1. 验证请求
仅接受bilibili.com或b23.tv的URL。如果URL指向其他网站,停止并说明此技能不适用。
2. 优先使用捆绑脚本
使用scripts/transcribe_bilibili.py,而非在会话中重写yt-dlp/whisper胶水代码。该脚本:
- - 下载最佳可用音频
- 使用ffprobe探测音频时长
- 使用faster-whisper进行转录
- 生成.txt、.srt和.segments.json文件
- 在ASR过程中打印粗略的预计完成时间和进度
3. 使用合理的默认值
默认设置为:
- - --model-size base
- --beam-size 3
- --language zh
- 启用VAD
这些默认值针对中文Bilibili语音进行了优化。如果视频明显为非中文或混合语言,使用--language auto或特定语言代码重新运行。
4. 保持输出可预测
默认情况下,脚本将文件写入当前工作目录下的downloads/bilibili-audio/。除非用户明确要求减少输出,否则保留所有三个文件:
- - 转录文本:.txt
- 字幕:.srt
- 片段元数据:.segments.json
5. 直接处理失败情况
如果运行失败:
- - 缺少ffmpeg/ffprobe → 先安装系统依赖
- 缺少Python包 → 运行scripts/bootstrap_env.sh
- 提取器或重定向问题 → 使用解析后的规范Bilibili URL重试
- 转录质量差 → 使用--language auto、更大的模型或语音被截断时使用--no-vad重新运行
当依赖设置或提取失败时,请阅读references/troubleshooting.md。
资源
scripts/
- - transcribebilibili.py — 主下载器+ASR管道
- bootstrapenv.sh — 创建虚拟环境并安装Python依赖
- requirements.txt — 引导脚本的Python包列表
references/
- - troubleshooting.md — 依赖和提取失败处理手册