多平台视频摘要工具,支持 YouTube 和 B站(未来可扩展更多平台),支持单个视频、频道扫描、每日批量处理。
cd ~/.openclaw/skills/video-summarizer
./setup.sh
安装完成后会引导你选择默认图文模式(可随时重新配置):
📋 选择默认图文模式:
1) text-only - 纯文字,不抽帧(最快)
2) auto-insert - 自动选帧插入文档(推荐平衡)
3) ai-review - AI 智能选图(默认,最佳效果,多消耗 ~5-8k token)
请选择 [1/2/3] (默认 3):
配置写入 config/settings.json,可随时运行 video-summarizer --setup 重新配置。
sudo apt install ffmpeg
pip install faster-whisper yt-dlp youtube-transcript-api innertube
brew install ffmpeg
pip install faster-whisper yt-dlp youtube-transcript-api innertube
# 安装 ffmpeg(推荐 chocolatey 或 scoop)
choco install ffmpeg
# 或 scoop install ffmpeg
pip install faster-whisper yt-dlp youtube-transcript-api innertube
path.join(),跨平台兼容| 依赖 | 用途 |
|---|---|
| ------ | ------ |
yt-dlp | 视频下载、信息获取(YouTube + B站) |
youtube-transcript-api | YouTube 字幕提取 |
innertube | 绕过 YouTube API 限流 |
faster-whisper | B站语音转文字(本地,无需 API) |
ffmpeg | 音频提取 + 关键帧截取(系统级) |
Skill 使用多种方法获取字幕,避免 YouTube 限流:
B站视频使用 yt-dlp 下载音频 → faster-whisper 本地转录,全程无需外部 API。
| 模式 | 说明 | 额外 token | 适用场景 |
|---|---|---|---|
| ------ | ------ | ----------- | --------- |
text-only | 纯文字,不抽帧 | 0 | 快速摘要、纯文字需求 |
auto-insert | 固定规则选帧,按时间戳插入(帧偏移+5s避转场) | ~0 | 平衡速度与图文效果 |
ai-review ← 默认 | 基于文章结构反向选图,可补帧/删帧/替换 | ~5-8k | 最佳图文效果 |
ai-review 流程(文章驱动选图):
auto-insert 流程:
通过以下方式指定模式(优先级从高到低):
--modeSUMMARY_MODEconfig/settings.json 中的 default_modevideo-summarizer --url "https://www.youtube.com/watch?v=VIDEO_ID"
video-summarizer --url "https://www.bilibili.com/video/BV1xxxxx"
# 短链接也支持(自动跟随跳转)
video-summarizer --url "https://b23.tv/xxxxx"
# 指定图文模式
video-summarizer --url "https://www.bilibili.com/video/BV1xxxxx" --mode text-only
video-summarizer --url "https://www.bilibili.com/video/BV1xxxxx" --mode auto-insert
video-summarizer --url "https://www.bilibili.com/video/BV1xxxxx" --mode ai-review
# 自定义 whisper 模型(精度更高,但更慢)
video-summarizer --url "https://www.bilibili.com/video/BV1xxxxx" --whisper-model large-v3
# 跳过关键帧提取(等效 --mode text-only)
video-summarizer --url "https://www.bilibili.com/video/BV1xxxxx" --no-frames
# 自定义关键帧间隔(默认30秒一帧)
video-summarizer --url "https://www.bilibili.com/video/BV1xxxxx" --frame-interval 60
video-summarizer --channel "UC_x5XG1OV2P6uZZ5FSM9Ttw" --hours 24
video-summarizer --config /path/to/channels.json --daily --output /tmp/video_daily.json
channels.json:
{
"channels": [
{
"name": "Lex Fridman",
"id": "UCSHZKyawb77ixDdsGog4iWA",
"url": "https://www.youtube.com/@lexfridman"
},
{
"name": "Y Combinator",
"id": "UCcefcZRL2oaA_uBNeo5UOWg",
"url": "https://www.youtube.com/@ycombinator"
}
],
"hours_lookback": 24,
"min_duration_seconds": 300,
"max_videos_per_channel": 5
}
{
"generated_at": "2026-02-14T11:17:00Z",
"items": [
{
"title": "视频标题",
"url": "https://youtube.com/watch?v=...",
"video_id": "VIDEO_ID",
"platform": "youtube",
"channel": "频道名",
"duration": "15:30",
"published": "2026-02-14T08:00:00Z",
"has_transcript": true,
"summary": "# 摘要内容(markdown)\n\n### 🎯 核心问题..."
},
{
"video_id": "BV1xxxxx",
"title": "B站视频标题",
"url": "https://www.bilibili.com/video/BV1xxxxx",
"platform": "bilibili",
"has_transcript": true,
"transcript_path": "/tmp/bili_BV1xxxxx_transcript.txt",
"frame_files": ["/tmp/bili_BV1xxxxx_frames/frame_001.jpg", "..."],
"frame_count": 12,
"summary": "# 摘要内容(markdown)..."
}
],
"stats": {
"total_videos": 5,
"with_transcript": 4,
"without_transcript": 1
}
}
| 变量 | 用途 | 必须 |
|---|---|---|
| ------ | ------ | ------ |
LLM_API_URL | 自定义 LLM API 端点 | 否 |
LLM_API_KEY | 自定义 LLM API Key | 否 |
LLM_MODEL | 自定义模型名 | 否 |
OPENCLAW_GATEWAY_TOKEN | OpenClaw Gateway token | 否 |
GITHUB_TOKEN | GitHub token(有 Copilot 订阅时可用) | 否 |
POLLINATIONS_API_KEY | Pollinations API Key | 否 |
SUMMARY_MODE | 图文模式:text-only / auto-insert / ai-review | 否 |
WHISPER_MODEL | B站 whisper 模型大小(默认 small) | 否 |
FRAME_INTERVAL | B站关键帧间隔秒数(默认 30) | 否 |
FRAME_TIME_OFFSET | 帧时间戳偏移秒数,避开转场(默认 5) | 否 |
无需任何 Key 也可运行:转录功能不需要 API Key;摘要功能会尝试 Pollinations 免费匿名调用。
has_transcript: falseREQUEST_DELAY_SECONDS (默认 3 秒)max_videos_per_channel共 1 个版本