Skip to content

LeoYeAI/agent-master-skills / skills/bilibili-cc-to-notion

bilibili-cc-to-notion

Unverified

将B站视频字幕转换为带截图的Notion学习笔记。 当用户需要从B站视频提取字幕、分析内容并创建Notion学习笔记时,必须使用此技能。 支持BV号、完整URL输入,自动下载CC字幕,智能处理内容,生成带截图标记的结构化学习笔记。 适用于学习、研究、知识整理等场景。

INTEGRATION_SUMMARY.md

View on GitHub
# Notion Skill 集成完成

## ✅ 集成概述

已成功将notion-skill的方法集成到bilibili-cc-to-notion skill中,用户无需额外安装notion-skill。

## 🔧 集成内容

### 1. 更新create_notion_notes_with_images.py
- 使用直接Notion API(无需CLI)
- 支持创建页面和添加内容块
- 支持图片上传和嵌入(使用Direct Upload API)

### 2. 新增文件上传功能
- `upload_file_to_notion.py`: Notion Direct Upload API实现
- 支持本地文件上传到Notion
- 返回file_upload_id用于在Notion页面中引用

### 3. 创建完整工作流程脚本
- `bilibili_to_notion_workflow.py`: 一键完成所有步骤
- 整合字幕下载、处理、截图生成、文件上传和Notion笔记创建

## 📁 更新的文件

```
bilibili-cc-to-notion/
├── SKILL.md                    # 工具描述清单(符合Skill Creator规范)
├── README.md                   # 快速开始指南
├── INTEGRATION_SUMMARY.md      # 本文件
└── scripts/
    ├── download_bilibili_cc.py       # 字幕下载工具
    ├── process_subtitles.py          # 字幕处理工具
    ├── screenshot_tool.py            # 视频截图工具
    ├── upload_file_to_notion.py      # ✅ Notion文件上传工具
    ├── create_notion_notes_with_images.py  # ✅ 支持图片上传的Notion笔记创建
    └── bilibili_to_notion_workflow.py # ✅ 完整工作流程脚本
```

## 🎯 使用方法

### 一键完成(推荐)
```bash
cd skills/bilibili-cc-to-notion/scripts

python3 bilibili_to_notion.py \
  --url "https://www.bilibili.com/video/BV1xx411c7mW" \
  --database-id "your_notion_database_id" \
  --tags "Python,机器学习"
```

### 方法选择逻辑
1. **优先使用notion-cli**: 如果检测到notion-cli-py,自动使用
2. **回退到API**: 如果未安装notion-cli但设置了NOTION_API_KEY,使用API
3. **错误提示**: 如果两者都没有,返回清晰的错误信息

## ⚙️ 配置要求

### 必需工具
- ✅ BBDown: B站下载器(已配置)
- ✅ FFmpeg: 视频处理(已安装)

### 环境变量
```bash
# Notion API Key(必需)
export NOTION_API_KEY=secret_xxx

# 默认数据库ID(可选)
export NOTION_DATABASE_ID=your_database_id
```

## 📊 对比集成前后

| 项目 | 集成前 | 集成后 |
|------|--------|--------|
| **安装要求** | 需要安装notion-skill | 只需安装notion-cli-py |
| **使用复杂度** | 需要多个skill配合 | 一个skill完成所有功能 |
| **错误处理** | 分散处理 | 统一处理,清晰提示 |
| **用户负担** | 高(多个skill) | 低(单一skill) |

## ✨ 优势

1. **简化安装**: 用户只需安装一个skill
2. **自动选择**: 智能选择最佳方法(notion-cli或API)
3. **清晰提示**: 错误时提供明确的解决方案
4. **一键完成**: 集成脚本简化整个流程

## 🎓 使用示例

### 场景1: 学习笔记创建
```
用户: 把这个B站视频做成Notion学习笔记:https://www.bilibili.com/video/BV1xx411c7mW

模型: 
1. 调用download_bilibili_cc下载字幕
2. 调用process_subtitles处理内容
3. 调用create_notion_notes创建笔记(使用notion-cli)

结果: 返回Notion页面链接
```

### 场景2: 批量处理
```
用户: 下载多个B站视频的字幕并创建Notion笔记

模型: 
循环调用集成脚本处理每个视频
```

## 🔍 技术细节

### notion-cli命令
```bash
# 创建页面
notion-cli create --database <database_id> --props <json>

# 追加内容
notion-cli append --page <page_id> --markdown <content>

# 查询数据库
notion-cli query --database <database_id>
```

### API回退方案
如果notion-cli不可用,自动使用Direct API调用:
- 创建页面:POST /v1/pages
- 追加块:PATCH /v1/blocks/{page_id}/children

## 📝 注意事项

1. **数据库权限**: 确保Notion Integration已分享到目标数据库
2. **字幕可用性**: 部分视频可能没有字幕
3. **登录要求**: 部分视频需要B站账号登录
4. **API限制**: Notion API有速率限制,批量操作需注意

---

**集成完成时间**: 2026-03-12
**集成状态**: ✅ 已完成
**测试状态**: ✅ 通过
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 196kUpdated Claude CodeCodexVerifiedInstall