bilibili-chapter-generator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseB站视频章节生成器
Bilibili Video Chapter Generator
根据字幕内容为 B站视频生成章节列表,用户可直接复制到 B站视频编辑页面。
Generate chapter lists for Bilibili videos based on subtitle content, which users can directly copy to the Bilibili video editing page.
B站章节格式规范
Bilibili Chapter Format Specifications
00:00 引言
01:23 第一部分标题
05:30 第二部分标题格式要求(B站硬性限制):
- 第一个章节必须从 开始(这是强制要求)
00:00 - 章节数量:3-10 个(必须 > 2 且 ≤ 10)
- 章节标题不能包含特殊符号(禁止使用
::、,。!?【】等)() - 时间格式:(分:秒)或
MM:SS(时:分:秒)HH:MM:SS - 每行一个章节:
时间戳 章节标题 - 章节间隔必须 ≥ 5 秒
00:00 Introduction
01:23 Part 1 Title
05:30 Part 2 TitleFormat Requirements (Bilibili Mandatory Restrictions):
- The first chapter must start at (This is a mandatory requirement)
00:00 - Number of chapters: 3-10 (Must be > 2 and ≤ 10)
- Chapter titles cannot contain special characters (Prohibited characters include
::、,。!?【】etc.)() - Time format: (minutes:seconds) or
MM:SS(hours:minutes:seconds)HH:MM:SS - One chapter per line:
Timestamp Chapter Title - Interval between chapters must be ≥ 5 seconds
工作流程
Workflow
Step 1: 获取 SRT 文件
Step 1: Obtain SRT File
询问用户 SRT 字幕文件路径,或从上下文中获取。
Ask the user for the SRT subtitle file path, or retrieve it from the context.
Step 2: 解析字幕内容
Step 2: Parse Subtitle Content
调用 skill 解析字幕:
srt-to-structured-databash
python3 ~/.claude/skills/srt-to-structured-data/scripts/parse_srt.py "<srt_file_path>" --stats这会输出:
- 字幕的 JSON 结构(包含时间码和文本)
- 统计信息(总时长、字幕数量等)
Call the skill to parse subtitles:
srt-to-structured-databash
python3 ~/.claude/skills/srt-to-structured-data/scripts/parse_srt.py "<srt_file_path>" --statsThis will output:
- JSON structure of subtitles (including timestamps and text)
- Statistical information (total duration, number of subtitles, etc.)
Step 3: 分析字幕内容
Step 3: Analyze Subtitle Content
阅读字幕内容,理解视频的:
- 主题和结构
- 内容转折点
- 关键话题变化
Read the subtitle content to understand the video's:
- Theme and structure
- Content turning points
- Key topic changes
Step 4: 生成章节列表
Step 4: Generate Chapter List
根据用户的描述意图(如果有)或自动分析,生成章节列表:
- 识别内容转折点:找出话题变化、新段落开始的位置
- 确定章节标题:简洁描述该段内容(建议 2-8 个字)
- 校验时间间隔:确保相邻章节间隔 ≥ 5 秒
- 格式化输出:使用 格式
MM:SS 标题
Generate the chapter list based on the user's described intent (if any) or automatic analysis:
- Identify content turning points: Locate positions where topics change or new paragraphs begin
- Determine chapter titles: Briefly describe the content of the segment (2-8 characters recommended)
- Verify time intervals: Ensure the interval between adjacent chapters is ≥ 5 seconds
- Format output: Use the format
MM:SS Title
Step 5: 输出结果
Step 5: Output Results
输出纯文本格式的章节列表,用户可直接复制:
00:00 开场介绍
02:15 核心概念讲解
08:30 实战演示
15:00 总结回顾Output the chapter list in plain text format, which users can directly copy:
00:00 Opening Introduction
02:15 Core Concept Explanation
08:30 Practical Demonstration
15:00 Summary and Review使用示例
Usage Examples
用户输入:
帮我把 ./视频字幕.srt 转成B站章节或更详细的需求:
帮我生成B站章节,要求:
- 字幕文件:./demo.srt
- 大概分成 5-6 个章节
- 重点突出实战部分User Input:
Help me convert ./video-subtitles.srt to Bilibili chaptersOr more detailed requirements:
Help me generate Bilibili chapters with the following requirements:
- Subtitle file: ./demo.srt
- Approximately 5-6 chapters
- Highlight the practical section章节划分建议
Chapter Division Recommendations
B站限制:3-10 个章节(必须 > 2 且 ≤ 10)
- 短视频(< 5 分钟):3-4 个章节
- 中等视频(5-15 分钟):4-7 个章节
- 长视频(> 15 分钟):7-10 个章节
Bilibili Restriction: 3-10 chapters (Must be > 2 and ≤ 10)
- Short videos (< 5 minutes): 3-4 chapters
- Medium-length videos (5-15 minutes): 4-7 chapters
- Long videos (> 15 minutes): 7-10 chapters
注意事项
Notes
- 第一个章节必须是 ,命名为"开场"、"引言"或直接点题
00:00 - 章节标题禁止特殊符号:不能使用冒号、顿号、逗号、括号等,只用纯中文/英文/数字
- 章节标题要简洁有力,便于观众快速定位(建议 2-8 个字,纯文字)
- 最后一个章节可以是"总结"、"结语"或"彩蛋"
- 避免章节过于密集(间隔太短会显得杂乱)
- 时间戳取字幕段落开始时间,向下取整到秒
- 章节总数必须 > 2 且 ≤ 10,否则B站会拒绝
- The first chapter must start at , named "Opening", "Introduction" or directly state the topic
00:00 - Chapter titles are prohibited from containing special characters: Colons, commas, brackets, etc. are not allowed; only use Chinese/English/numbers
- Chapter titles should be concise and powerful, allowing viewers to quickly locate content (2-8 characters recommended, plain text only)
- The last chapter can be "Summary", "Conclusion" or "Easter Egg"
- Avoid overly dense chapters (too short intervals will look cluttered)
- Timestamps should take the start time of subtitle paragraphs, rounded down to the nearest second
- The total number of chapters must be > 2 and ≤ 10, otherwise Bilibili will reject it
章节标题示例
Chapter Title Examples
正确示例:
00:00 开场介绍03:35 Agent演示加载skill流程05:39 环境配置08:38 源码解析
错误示例(包含特殊符号):
(包含冒号)03:35 Agent演示:加载skill的流程(包含顿号)05:39 环境准备、安装依赖(包含括号)08:38 代码解析(核心逻辑)
Correct Examples:
00:00 Opening Introduction03:35 Agent Demo: Skill Loading Process05:39 Environment Configuration08:38 Source Code Analysis
Incorrect Examples (Contain Special Characters):
(Contains colon)03:35 Agent Demo: Loading Skill Process(Contains comma)05:39 Environment Preparation, Install Dependencies(Contains brackets)08:38 Code Analysis (Core Logic)