Documentation
README
B 站视频转录 Skill
字幕优先:先尝试抓取官方/自动字幕(秒级、免 GPU、免 funasr);抓不到再下载音频用 SenseVoice-Small 转录,存为 Markdown 文件。加 --no-subtitle 可强制走音频转录。
环境要求
# Python 3.9+
python -m venv .venv
source .venv/bin/activate
# 依赖
pip install funasr modelscope torch torchaudio
# 系统依赖
# macOS: brew install ffmpeg yt-dlp
# Ubuntu: sudo apt install ffmpeg && pip install yt-dlp
使用方法
python scripts/transcribe.py "https://www.bilibili.com/video/BV1rrQGBeEen/"
python scripts/transcribe.py "BV1rrQGBeEen"
python scripts/transcribe.py "BV1rrQGBeEen" --no-subtitle # 强制音频转录
# 批量处理:每行一个 B站 URL 或 BV 号
python scripts/batch_transcribe.py ../../examples/bilibili-urls.txt -o ./output
流程
Step 1: yt-dlp 下载音频
B 站有反爬机制,需要加 User-Agent 和 Referer:
This is the opening of the README. Read the full README on GitHub.