
Bilibili Analyzer
Turn a Bilibili tutorial or interview URL into a Markdown report and key frames so you can study or repurpose the video without watching it end to end.
Overview
Bilibili-analyzer is an agent skill for the Idea phase that downloads a Bilibili video, extracts key frames, and writes a Markdown analysis report with optional text, object, face, and scene signals.
Install
npx skills add https://github.com/aidotnet/moyucode --skill bilibili-analyzerWhat is this skill?
- CLI: `python main.py` with Bilibili or b23.tv URLs and tunable `-i` interval, `-m` max frames, and `-w` worker paralleli
- Analysis modes via `-f`: text, objects, faces, scene; optional `--no-scene-detection` for fast previews
- Outputs `report.md`, `frames/` JPEGs, `analysis.log`, and `checkpoints/` under `./bilibili/<title>/` or `-o` custom dir
- Scenarios documented for tutorials (dense frames), long-video previews, interviews (faces), and high-parallel runs
- Requires FFmpeg for frame extraction; verbosity via `-v` or `-q` silent mode
- 8 documented CLI usage scenarios in the skill readme
- Output bundle includes report.md, frames/, analysis.log, and checkpoints/
Adoption & trust: 858 installs on skills.sh; 80 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You found a long Bilibili tutorial or talk but cannot efficiently search, quote, or repurpose what is only locked inside the video timeline.
Who is it for?
Solo builders researching CN video tutorials, course-style walkthroughs, or interviews who want frame-backed notes and configurable density (15s intervals vs 120s previews).
Skip if: Teams that need official Bilibili API compliance reviews, real-time streaming analysis, or analysis without installing FFmpeg and local Python deps.
When should I use this skill?
User provides a Bilibili or b23.tv URL and wants structured analysis, key frames, or tutorial/ interview breakdowns.
What do I get? / Deliverables
You get a per-video folder with `report.md`, sampled frame images, and logs so you can cite steps, thumbnails, and topics in specs or content drafts.
- Markdown report (`report.md`)
- Key frame JPEGs under `frames/`
- Execution log and checkpoint data
Recommended Skills
Journey fit
Solo builders often mine Chinese-language tutorials and talks on Bilibili during early research before building; this skill sits on the research shelf for video-derived intelligence. Competitor and learning research frequently includes long-form video; frame sampling plus text/object/face analysis compresses that source into searchable artifacts.
How it compares
Use instead of manually screenshotting and note-taking when the source is Bilibili-hosted long-form video.
Common Questions / FAQ
Who is bilibili-analyzer for?
Indie builders and content researchers who learn from Bilibili and want automated frame extraction plus a Markdown report rather than watching entire videos.
When should I use bilibili-analyzer?
During Idea research when dissecting tutorials (`-i 15 -m 100`), during Grow when harvesting quotes from interviews (`-f faces,text,scene`), or for quick Validate-style previews of long talks (`-i 120 -m 20 --no-scene-detection`).
Is bilibili-analyzer safe to install?
It runs local Python, downloads video from the network, and writes to disk; review the Security Audits panel on this page and treat URLs and output dirs as sensitive before sharing.
SKILL.md
READMESKILL.md - Bilibili Analyzer
# 基本使用示例 ## 快速开始 ```bash cd skills/tools/bilibili-analyzer/scripts python main.py "https://www.bilibili.com/video/BV1xx411c7mD" ``` ## 常用场景 ### 1. 分析教程视频(提取更多帧) ```bash python main.py "https://www.bilibili.com/video/BV1xx411c7mD" \ -i 15 \ -m 100 \ -f text,objects ``` ### 2. 快速预览长视频 ```bash python main.py "https://www.bilibili.com/video/BV1xx411c7mD" \ -i 120 \ -m 20 \ --no-scene-detection ``` ### 3. 分析人物访谈 ```bash python main.py "https://www.bilibili.com/video/BV1xx411c7mD" \ -i 30 \ -f faces,text,scene ``` ### 4. 高并行分析(快速完成) ```bash python main.py "https://www.bilibili.com/video/BV1xx411c7mD" \ -w 8 \ -m 30 ``` ### 5. 指定输出目录 ```bash python main.py "https://www.bilibili.com/video/BV1xx411c7mD" \ -o ./my-video-reports ``` ### 6. 使用短链接 ```bash python main.py "https://b23.tv/xxxxx" ``` ### 7. 详细日志模式(调试用) ```bash python main.py "https://www.bilibili.com/video/BV1xx411c7mD" -v ``` ### 8. 静默模式(只显示错误) ```bash python main.py "https://www.bilibili.com/video/BV1xx411c7mD" -q ``` ## 输出示例 分析完成后,输出目录结构: ``` ./bilibili/视频标题/ ├── report.md # Markdown分析报告 ├── frames/ # 关键帧图片 │ ├── frame_001_00-00-00.jpg │ ├── frame_002_00-00-30.jpg │ └── ... ├── analysis.log # 执行日志 └── checkpoints/ # 检查点数据 ``` # 常见问题 (FAQ) ## 基础问题 ### Q: 为什么需要FFmpeg? A: FFmpeg是一个强大的多媒体处理工具,本工具使用它从视频中提取关键帧。没有FFmpeg,帧提取功能将无法工作。 ### Q: 分析一个视频需要多长时间? A: 取决于多个因素: - 视频长度 - 帧提取间隔和最大帧数 - 网络速度(下载阶段) - AI分析并行度 一般来说,10分钟视频(默认设置)约需5-10分钟完成分析。 ### Q: 支持哪些视频格式? A: 支持B站所有可播放的视频格式。系统使用yt-dlp下载,会自动选择最佳质量。 ## 错误处理 ### Q: 遇到"URL无效"错误怎么办? A: 请确保URL格式正确: - 标准格式: `https://www.bilibili.com/video/BV1xx411c7mD` - 短链接: `https://b23.tv/xxxxx` - 不支持番剧、直播等其他类型链接 ### Q: 下载失败怎么办? A: 可能的原因和解决方案: 1. **网络问题**: 检查网络连接,使用`--retries`增加重试次数 2. **视频不存在**: 确认视频未被删除或设为私有 3. **地区限制**: 某些视频可能有地区限制 ### Q: FFmpeg报错怎么办? A: 1. 确认FFmpeg已正确安装: `ffmpeg -version` 2. 确认FFmpeg在系统PATH中 3. 尝试重新安装FFmpeg ### Q: AI分析失败怎么办? A: 系统会自动重试失败的分析任务。如果仍然失败: 1. 检查Claude Code配置 2. 查看日志文件了解详细错误 3. 部分结果会保存到`partial_report.json` ## 高级用法 ### Q: 如何只分析视频的特定部分? A: 目前不支持指定时间范围,但可以通过调整参数间接实现: - 增大`--interval`跳过更多内容 - 减小`--max-frames`限制分析帧数 ### Q: 如何提高分析速度? A: 1. 增加并行worker: `-w 8` 2. 减少帧数: `-m 20` 3. 增大间隔: `-i 60` 4. 禁用场景检测: `--no-scene-detection` ### Q: 如何获取更详细的分析? A: 1. 减小帧间隔: `-i 10` 2. 增加最大帧数: `-m 100` 3. 启用所有分析焦点: `-f text,objects,faces,actions,scene` ### Q: 分析中断后如何恢复? A: 系统会自动保存检查点。目前需要重新运行命令,未来版本将支持从检查点恢复。 ## 输出相关 ### Q: 报告中的图片路径是什么格式? A: 使用相对路径,格式为`./frames/frame_XXX_HH-MM-SS.jpg`,确保报告和frames目录在同一位置时图片可正常显示。 ### Q: 日志文件在哪里? A: 日志文件`analysis.log`位于输出目录中,与`report.md`同级。 ## 错误代码 | 错误 | 原因 | 解决方案 | |------|------|----------| | `URLValidationError` | URL格式不正确 | 使用正确的B站视频URL | | `MetadataFetchError` | 无法获取视频信息 | 检查视频是否存在/私有 | | `DownloadError` | 下载失败 | 检查网络,增加重试次数 | | `FFmpegError` | FFmpeg问题 | 安装/重装FFmpeg | | `AnalysisError` | AI分析失败 | 检查Claude Code配置 | | `ReportGenerationError` | 报告生成失败 | 检查输出目录权限 | # 安装指南 ## 系统依赖 ### FFmpeg(必需) FFmpeg用于从视频中提取关键帧,是必需依赖。 #### Windows ```powershell # 使用 Chocolatey choco install ffmpeg # 或使用 Scoop scoop install ffmpeg # 或手动下载 # 访问 https://ffmpeg.org/download.html 下载并添加到PATH ``` #### macOS ```bash brew install ffmpeg ``` #### Linux (Ubuntu/Debian) ```bash sudo apt update sudo apt install ffmpeg ``` #### Linux (CentOS/RHEL) ```bash sudo yum install epel-release sudo yum install ffmpeg ``` #### 验证安装 ```bash ffmpeg -version ``` ## Python依赖 ```bash # 创建虚拟环境(推荐) python -m venv venv source venv/bin/activate # Linux/macOS .\venv\Scripts\activate # Windows # 安装依赖 pip install requests yt-dlp ``` ### 依赖说明 | 包 | 版本 | 用途 | |---|------|------| | `requests` | >=2.28.0 | HTTP请求,获取视频元数据 | | `yt-dlp` | >=2023.0.0 | 视频下载 | ### 开发依赖(可选) ```bash pip install hypothesis pytest ``` | 包 | 版本 | 用途 | |---|------|------| | `hypothesis` | >=6.0.0 | 属性测试 | | `pytest` | >=7.0.0 | 单元测试 | #!/usr/bin/env dotnet run using System; using System.Collections.Generic; using System.Diagnostics; using