feat(bilibili): 使用 yt-dlp 替换原有下载方案

- 重写 download_video 使用 yt-dlp + Netscape cookie 文件
- 支持 BILIBILI_COOKIE 环境变量
- 更新默认质量为 720P
- 更新 SKILL.md 文档

环境变量已在 ~/.bashrc 中配置
This commit is contained in:
2026-02-13 11:30:59 +08:00
parent 0da1c0fb59
commit 1fa90ac21c
4 changed files with 315 additions and 186 deletions
+30 -42
View File
@@ -1,48 +1,36 @@
# 2026-02-13
# 2026-02-13 语音识别工作记录
## 视频音频转文字方案检查
## 目标
整合说话者分离(speaker diarization)到 kb-whisper 工作流,替换 OCR 为 Whisper 视频转文字
### 方案组件
- **kb-whisper**: Whisper.cpp 本地语音识别
- **kb-funasr**: 阿里 FunASR 本地语音识别
## Passwordless Sudo 配置成功
```bash
sudo visudo -f /etc/sudoers.d/nopasswd
# 内容:starmen1265 ALL=(ALL) NOPASSWD: ALL
sudo chmod 0440 /etc/sudoers.d/nopasswd
sudo visudo -c # 验证:parsed OK
```
### 发现
- 两个工具都直接支持视频文件输入
- 内部自动通过 ffmpeg 处理音频提取和格式转换
- 无需单独的视频→音频提取步骤
## 降级操作(解决兼容性问题)
| 库 | 从 | 到 | 原因 |
|---|---|---|---|
| torch | 2.10.0 | 2.8.0 | speechbrain 需要旧 API |
| torchaudio | 2.10.0 | 2.8.0 | speechbrain 需要 list_audio_backends() |
| NumPy | 2.x | 1.26.4 | pyannote 3.1.1 需要 |
| huggingface_hub | 1.4.1 | 0.19.4 | pyannote 3.1.1 需要 use_auth_token |
| pyannote.audio | 4.0.4 | 3.1.1 | 4.x 与 torch 2.10 兼容性问题 |
### 待确认事项
- whisper.cpp 是否已安装(应位于 ~/whisper.cpp)
- CUDA/PyTorch 相关包(torch-2.10.0, torchaudio-2.10.0)已安装完成
## 用户指令
- 只允许修改 `speaker_diarization.py` 中的 segmentation 配置
- 停止所有其他修改
- 暂停说话者分离工作
---
## 下一步
- 使用已有的 kb-whisper 方案(Whisper.cpp)
- 暂停说话者分离(speaker diarization)
- 等待后续指令
## Whisper.cpp 迁移与模型下载
### 执行操作
- whisper.cpp 原位于 `~/libs/whisper.cpp`
- 移动到默认位置 `~/whisper.cpp`
- 使用 hf-mirror 下载中文模型 ggml-base.bin(147MB)
### Whisper 编译受阻
- 需要 cmake 编译 whisper.cpp
- 执行 `make` 报错:cmake 未安装
- 需要 sudo 权限安装 cmake(当前环境不支持)
---
## KB Workflow 优化
### 修改内容
- 步骤5:从 OCR(kb-ocr-processor)切换为 Whisper(kb-whisper)
- 移除了 content_subtitles 目录(不再需要)
- 输出格式更新为 `{platform}_{id}.txt` 和 `{platform}_{id}.json`
### 测试视频
- 视频:新加坡分区漫游指南(BV1Z9nXzUEhv)
- 由于 Whisper 未编译,临时使用 FunASR 完成语音识别
- 分析报告已生成并归档
### 待办
- 编译 whisper.cpp:`cd ~/whisper.cpp && make`
- 需要手动执行 sudo apt-get install cmake
## 当前环境
- whisper.cpp: ~/whisper.cpp
- whisper 模型: ggml-base.bin
- kb-whisper 脚本: skills/kb-whisper/whisper.py