leoyeai/openclaw-master-skills/bilibili-cc-to-notion
Claude Code and agent skill by leoyeai/openclaw-master-skills
- community
Checking that the SKILL.md file is still in the repository.
将B站视频字幕转换为带截图的Notion学习笔记。 当用户需要从B站视频提取字幕、分析内容并创建Notion学习笔记时,必须使用此技能。 支持BV号、完整URL输入,自动下载CC字幕,智能处理内容,生成带截图标记的结构化学习笔记。 适用于学习、研究、知识整理等场景。
Install
npx vskill@latest install leoyeai/openclaw-master-skills/bilibili-cc-to-notionSKILL.md
The same SKILL.md was published earlier as leoyeai/openclaw-master-skills/bilibili-cc-to-notion.
Bilibili CC to Notion Skill
🎯 Purpose
你是专业的视频字幕处理助手,任务是将B站视频字幕完整转换为Notion学习笔记。整个流程由你负责文本处理,而不是使用固定的Python程序。
核心工作流程
- 下载字幕:调用
download_bilibili_cc工具下载B站视频字幕 - 处理字幕:你负责将字幕转换为结构化的Markdown笔记
- 生成截图:调用
screenshot_tool工具从视频中提取截图 - 上传图片:调用
upload_file_to_notion工具上传截图到Notion - 创建笔记:调用
create_notion_notes_with_images工具创建Notion页面
你处理字幕的要求(重要!)
你的角色:你是一个什么都不懂的学习者,正在认真学习这门课程。你的任务是根据字幕内容生成真正的学习笔记,而不是简单截取片段。
1. 处理流程
第一步:完整阅读并理解
- 逐字阅读所有字幕内容(2536行,约25分钟视频)
- 理解老师讲解的每个知识点
- 标记出重点内容和关键概念
第二步:提取知识点
- 不遗漏任何知识点,即使是口语化的表达也要提取核心信息
- 识别课程的结构:章节、小节、重点
- 标记出老师强调的重点内容
第三步:构建知识框架
- 建立知识点之间的逻辑关系
- 构建层次化的知识结构
- 形成完整的知识体系
第四步:添加学习心得
- 作为学习者,记录学习过程中的思考
- 对每个知识点的理解和感悟
- 知识点之间的联系和应用场景
2. 笔记结构要求
你的学习笔记必须包含以下章节:
中心主题 ├── 第一章:xxx │ ├── 1.1 xxx │ │ ├── 知识点1 │ │ └── 知识点2 │ └── 1.2 xxx ├── 第二章:xxx └── ...
3. 内容质量要求
完整性:
- ✅ 不遗漏任何知识点
- ✅ 包含所有重要概念
- ✅ 记录老师的每个重点强调
深度:
- ✅ 不只是记录,要有理解
- ✅ 添加学习者的心得体会
- ✅ 有思考、有疑问、有延伸
逻辑性:
- ✅ 知识点之间有逻辑关系
- ✅ 层次清晰,结构完整
- ✅ 符合认知规律
实用性:
- ✅ 便于复习和回顾
- ✅ 知识点易于理解和记忆
- ✅ 有实际应用价值
4. 输出格式
你需要输出两个部分:
第一部分:结构化JSON
第二部分:完整的学习笔记Markdown
- 按照上面的结构要求
- 包含所有章节
- 有思维导图式的知识框架
- 有学习者的心得体会
5. 示例对比
❌ 错误的笔记(简单截取):
✅ 正确的笔记(真正的学习笔记):
6. 特别注意
- 不要简单截取:不要只是把字幕片段列出来,要真正理解和整理
- 要有学习者视角:以"我"的角度记录学习过程
- 要有思考:记录学习过程中的疑问、联想、应用思考
- 要有框架:建立知识体系,而不是零散的知识点
- 要有深度:不只是记录是什么,还要思考为什么、怎么做
4. 截图标记规则(关键!)
必须在以下情况下添加截图标记:
- 代码讲解:当提到代码、函数、变量、类、方法等
`` 在代码中,我们使用以下函数来计算功率 Screenshot-[00:00:20] ``
- UI交互操作:当提到点击、按钮、菜单、界面等操作
`` 点击这里查看课程大纲 Screenshot-[00:00:07] ``
- 视觉指代词:包含"这里"、"这儿"、"那里"、"那样"等
`` 如图所示,电力系统包括... Screenshot-[00:00:12] ``
- 网址/链接/地址:任何提及URL、API endpoint、GitHub等
`` 访问 https://example.com 获取资源 Screenshot-[00:00:16] ``
- 任何借助视觉材料更易理解的内容
截图标记格式必须严格为:
其中时间点使用字幕片段的开始时间(hh:mm:ss格式)
5. 输出要求
你需要输出以下内容:
- segments:处理后的字幕片段数组(包含时间、文本、是否需要截图等)
- markdown_content:完整的Markdown笔记内容(包含截图标记)
示例输出:
🔧 Available Tools
工具清单
| 工具 | 功能 | 使用时机 | |
|---|---|---|---|
download_bilibili_cc | 下载B站视频CC字幕 | 用户提供B站视频URL时 | |
screenshot_tool | 从视频中提取截图 | 你处理完字幕后需要截图时 | |
upload_file_to_notion | 上传本地文件到Notion | 需要将截图上传到Notion时 | |
create_notion_notes_with_images | 在Notion中创建学习笔记(支持图片插入) | 处理完字幕和截图后创建笔记 |
⚙️ Setup & Configuration
1. 获取Notion API Token
- 访问 Notion Integrations
- 点击 "New integration"
- 填写名称并选择工作空间
- 复制 Internal Integration Token(格式:
secret_xxx)
2. 分享数据库给Integration
- 打开你的Notion数据库
- 点击右上角
...菜单 - 选择 "Connections"
- 搜索并选择你创建的integration
3. 设置环境变量
⚠️ 安全说明 / Security Notes
凭证管理 / Credentials:
- 本技能需要 Notion API Token (
NOTION_API_KEY) 和数据库 ID (NOTION_DATABASE_ID) - 请勿将真实 Token 提交到公开仓库;使用环境变量或安全 vaults
- Token 仅用于调用 Notion API,不会发送到其他服务器
脚本文件 / Script Files:
process_subtitles.py已不再由大模型调用,仅保留作为参考或备用- 核心流程通过大模型生成的结构化 JSON/Markdown 驱动脚本执行
命令行安全 / Command Line Safety:
- 部分脚本(如
bilibili_to_notion_workflow.py)使用shell=True执行命令 - 建议在可信环境下使用,避免让模型处理包含特殊字符的未校验输入
依赖来源 / Dependencies:
- BBDown:官方 GitHub Releases(可信来源)
- FFmpeg:系统包管理器安装(可信来源)
- Python requests 库:PyPI(可信来源)
4. 安装依赖
5. BBDown使用注意事项
重要:下载字幕时必须使用 `--skip-ai false` 参数
BBDown默认会跳过AI字幕下载,必须明确指定不禁用此选项:
完整下载示例:
BBDown常用参数:
| 参数 | 说明 | |
|---|---|---|
--sub-only | 仅下载字幕 | |
--skip-ai false | 必须使用:不禁用AI字幕下载 | |
--use-app-api | 使用APP端API(通常更稳定) | |
--use-tv-api | 使用TV端API | |
-q "720P" | 指定清晰度(720P、1080P等) | |
--work-dir | 指定工作目录 | |
-p 6 | 指定下载第6P | |
-p ALL | 下载所有分P |
登录方式(必需!否则只能下载低清晰度):
清晰度说明:
| 登录状态 | 可下载清晰度 | |
|---|---|---|
| 未登录 | 最高480P | |
| 已登录WEB账号 | 最高1080P | |
| 已登录TV/APP账号 | 最高4K/8K |
建议:使用Cookie登录以获取更高清晰度和完整字幕。
🛠️ Tool Definitions
Tool 1: download_bilibili_cc
Purpose: Download CC subtitles from a Bilibili video
Input parameters:
url(string, required): Bilibili video URL or BV numberoutput(string, optional): Output directory path
Output parameters:
success(boolean): Whether download was successfulsubtitle_file(string): Path to downloaded subtitle filevideo_title(string): Video title
Tool 2: screenshot_tool
Purpose: Extract screenshots from video and replace markers in Markdown
Input parameters:
video(string, optional): Video file pathmarkdown(string, optional): Markdown file pathoutput_dir(string, optional): Output directory for screenshots
Output parameters:
output(string): Path to processed Markdown filescreenshots_dir(string): Directory containing screenshotsscreenshot_count(number): Number of screenshots generated
Tool 3: upload_file_to_notion
Purpose: Upload local files to Notion using Direct Upload API
Input parameters:
token(string, required): Notion API tokenfile(string, required): Path to local file to upload
Output parameters:
success(boolean): Whether upload was successfulfile_upload_id(string): ID of uploaded file (for referencing in Notion)
Tool 4: create_notion_notes_with_images
Purpose: Create Notion learning notes with embedded images (supports file upload)
Input parameters:
token(string, required): Notion API tokendatabase_id(string, required): Notion database IDvideo_title(string, required): Video titlevideo_url(string, required): Original Bilibili video URLsegments(array, required): Processed subtitle segmentsmarkdown_content(string, optional): Markdown content with screenshot markerstags(array, optional): Tags for organizing notesimages_dir(string, optional): Directory containing screenshot images
Output parameters:
success(boolean): Whether page creation was successfulpage_id(string): ID of created Notion pagepage_url(string): URL of created Notion pagesegments_processed(number): Number of segments addedimages_embedded(number): Number of images embedded
📝 Complete Workflow Example
User input: "帮我把这个B站视频做成带截图的学习笔记:https://www.bilibili.com/video/BV11u4m1c7ZV?p=6"
Model workflow:
Step 1: Download subtitles
调用 download_bilibili_cc 工具下载字幕(自动使用 --skip-ai false 参数下载AI字幕)
Step 2: 你处理字幕
- 读取字幕文件:从下载的字幕文件中读取所有内容
- 逐字保留:禁止任何删减、总结或省略,必须逐字保留所有文字
- 添加标点和段落:为每句话添加合适的标点符号,适当划分自然段
- 添加截图标记:在适当位置添加
Screenshot-[hh:mm:ss]标记 - 输出结构化JSON:包含segments数组和markdown_content
截图标记规则(你必须遵守):
| 场景 | 示例 | 截图标记 | |
|---|---|---|---|
| 代码讲解 | "在代码中,我们使用以下函数..." | Screenshot-[00:00:20] | |
| UI交互操作 | "点击这里查看课程大纲" | Screenshot-[00:00:07] | |
| 视觉指代词 | "如图所示,电力系统包括..." | Screenshot-[00:00:12] | |
| 网址/链接 | "访问 https://example.com" | Screenshot-[00:00:16] | |
| 任何借助视觉材料 | 任何需要看图才能理解的内容 | Screenshot-[时间] |
输出格式示例:
Step 3: Generate screenshots
调用 screenshot_tool 工具从视频提取截图
注意:screenshot_tool会自动替换Markdown中的Screenshot-[hh:mm:ss]标记为图片路径assets/screenshot_hh_mm_ss.jpg。你需要将这个路径修正为实际路径(如/tmp/screenshots/screenshot_hh_mm_ss.jpg)才能在Notion中正确显示。
Step 4: Upload images to Notion
调用 upload_file_to_notion 工具上传截图
Step 5: Create Notion notes
调用 create_notion_notes_with_images 工具创建笔记
Step 6: Notion重复检查与清理(必须执行)
- 创建成功或失败后,调用 Notion API 查询数据库,检查是否生成了标题重复的页面(尤其是报错但标题已落库的情况)。
- 保留最新的最终版本,其他同标题的旧版/出错版设置
archived: true进行软删除。 - 清理时注意不要误删用户已有的其他笔记(只清理本次处理的同标题页面)。
Output to user: "✅ 已成功创建带截图的Notion学习笔记:https://www.notion.so/xxx"
Complete Workflow Script
You can also use the integrated workflow script:
This script automatically handles all steps:
- Downloads Bilibili subtitles
- Processes subtitles and identifies key points
- Generates screenshots at key timestamps
- Uploads images to Notion
- Creates a complete Notion learning笔记 with embedded images
🎯 When to Use This Skill
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/bilibili-cc-to-notion/SKILL.md
Popularity
- Repository stars
- 2,157
- Repository forks
- 324
- 7-day trend score
- 43
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/leoyeai/openclaw-master-skills/bilibili-cc-to-notion)