youtube-to-slides
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseyoutube-to-slides
youtube-to-slides
Convert YouTube videos into beautiful infographic slide decks.
将YouTube视频转换为精美的信息图幻灯片集。
Natural Language Examples
自然语言指令示例
Users can invoke this skill with natural language. Here are examples of what they might say and how to handle each:
Setup and troubleshooting:
- "Set up youtube-to-slides" → Run
setup.sh - "Check if youtube-to-slides is ready" → Run
check-env.sh - "I need to configure my API keys" → Guide to setup
.env - "It's not working" → Run , read diagnostics, consult
check-env.shreferences/TROUBLESHOOTING.md
Generate slides:
- "Generate slides from https://youtu.be/VIDEO_ID"
- "Convert this YouTube video to slides: https://youtube.com/watch?v=VIDEO_ID"
- "Make infographic slides from https://youtu.be/VIDEO_ID in comic style"
- "Create 5 magazine-style slides from https://youtu.be/VIDEO_ID"
- "Turn this video into slides https://youtu.be/VIDEO_ID --style geek"
Choose a style:
- "Use the davinci style" →
--style davinci - "Make it look like a magazine" →
--style magazine - "Comic book style please" →
--style comic - "Geek / bulletin board style" →
--style geek - "Chalkboard style" →
--style chalkboard
Control slide count:
- "Just give me 4 slides" →
--max-sections 4 - "Make as many slides as needed" →
--max-sections 0
Preview without generating images:
- "Do a dry run first"
- "Just show me the prompts, don't generate images yet"
用户可以通过自然语言调用该技能。以下是用户可能的表述及对应的处理方式:
设置与故障排查:
- "设置youtube-to-slides" → 运行
setup.sh - "检查youtube-to-slides是否可用" → 运行
check-env.sh - "我需要配置API密钥" → 引导用户进行文件设置
.env - "工具无法正常工作" → 运行,查看诊断信息,参考
check-env.shreferences/TROUBLESHOOTING.md
生成幻灯片:
- "从https://youtu.be/VIDEO_ID生成幻灯片"
- "把这个YouTube视频转换成幻灯片:https://youtube.com/watch?v=VIDEO_ID"
- "用comic风格把https://youtu.be/VIDEO_ID转换成信息图幻灯片"
- "从https://youtu.be/VIDEO_ID生成5张magazine风格的幻灯片"
- "把这个视频转成幻灯片 https://youtu.be/VIDEO_ID --style geek"
选择风格:
- "使用davinci风格" →
--style davinci - "做成杂志风格" →
--style magazine - "请用漫画书风格" →
--style comic - "极客/公告板风格" →
--style geek - "黑板风格" →
--style chalkboard
控制幻灯片数量:
- "只给我4张幻灯片" →
--max-sections 4 - "按需生成幻灯片" →
--max-sections 0
预览(不生成图片):
- "先做一次试运行"
- "只显示提示词,暂时不生成图片"
Argument Parsing
参数解析
Parse to extract:
$ARGUMENTS- url (required) — YouTube video URL. Supports formats: ,
https://youtu.be/ID,https://www.youtube.com/watch?v=IDhttps://youtube.com/watch?v=ID - --style (optional, default: ) — One of:
davinci,davinci,magazine,comic,geekchalkboard - --max-sections (optional, default: ) — Maximum number of slide sections to generate. Use
8for unlimited.0 - --dry-run (optional) — Show prompts without generating images
- --ar (optional, default: ) — Aspect ratio:
16:9,16:9, or4:31:1
If no URL is provided, ask the user for one. If the URL looks invalid (not a YouTube URL), tell the user and ask for a valid one.
For style guidance, read in this skill directory.
references/STYLES.md解析以提取以下参数:
$ARGUMENTS- url(必填)—— YouTube视频链接。支持格式:、
https://youtu.be/ID、https://www.youtube.com/watch?v=IDhttps://youtube.com/watch?v=ID - --style(可选,默认值:)—— 支持的风格:
davinci、davinci、magazine、comic、geekchalkboard - --max-sections(可选,默认值:)—— 生成的幻灯片最大分段数。设为
8表示无限制。0 - --dry-run(可选)—— 仅显示提示词,不生成图片
- --ar(可选,默认值:)—— 宽高比:
16:9、16:9或4:31:1
如果未提供链接,请询问用户获取。如果链接无效(非YouTube链接),告知用户并请求提供有效的链接。
关于风格的详细说明,请查看该技能目录下的。
references/STYLES.mdExecution Steps
执行步骤
Step 1: Pre-flight Check
步骤1:预检查
Run the environment check script:
bash
bash "$SKILL_DIR/scripts/check-env.sh"- If it exits 0, proceed to Step 2.
- If it exits non-zero, read its output for diagnostics:
- Missing virtual environment or package — Run the setup script:
Then re-runbash
bash "$SKILL_DIR/scripts/setup.sh"to confirm.check-env.sh - Missing API keys — Tell the user:
- Copy the example env file:
cp "$SKILL_DIR/.env.example" "$SKILL_DIR/.env" - Add their Gemini API key (get one free at https://aistudio.google.com/apikey)
- Add their YouTube Data API key (get one at https://console.cloud.google.com/apis/credentials — enable YouTube Data API v3 first)
- See for detailed setup steps.
references/TROUBLESHOOTING.md
- Copy the example env file:
- After fixing, re-run to confirm everything passes.
check-env.sh
- Missing virtual environment or package — Run the setup script:
If the user just asks to "set up" or "install" the skill, run both and , then report the result.
setup.shcheck-env.sh运行环境检查脚本:
bash
bash "$SKILL_DIR/scripts/check-env.sh"- 如果脚本返回0(正常),继续步骤2。
- 如果返回非0值,查看输出的诊断信息:
- 缺少虚拟环境或依赖包 —— 运行设置脚本:
然后重新运行bash
bash "$SKILL_DIR/scripts/setup.sh"确认。check-env.sh - 缺少API密钥 —— 告知用户:
- 复制示例环境文件:
cp "$SKILL_DIR/.env.example" "$SKILL_DIR/.env" - 添加Gemini API密钥(可在https://aistudio.google.com/apikey免费获取)
- 添加YouTube Data API密钥(需先启用YouTube Data API v3,再在https://console.cloud.google.com/apis/credentials获取)
- 详细设置步骤请参考。
references/TROUBLESHOOTING.md
- 复制示例环境文件:
- 修复问题后,重新运行确认所有项都通过。
check-env.sh
- 缺少虚拟环境或依赖包 —— 运行设置脚本:
如果用户只是要求“设置”或“安装”该技能,同时运行和,然后报告结果。
setup.shcheck-env.shStep 2: Run the Pipeline
步骤2:运行处理流程
Build the command from parsed arguments and run:
bash
bash "$SKILL_DIR/scripts/run.sh" "<url>" --style <style> --max-sections <max_sections> --ar <ar>Add flag if requested.
--dry-runThis takes 3-5 minutes for a full run. Inform the user that generation is in progress and what style/settings are being used.
根据解析后的参数构建命令并运行:
bash
bash "$SKILL_DIR/scripts/run.sh" "<url>" --style <style> --max-sections <max_sections> --ar <ar>如果用户请求试运行,添加参数。
--dry-run完整运行需要3-5分钟。告知用户生成正在进行中,并说明使用的风格和设置。
Step 3: Present Results
步骤3:展示结果
After successful completion:
- Determine the video ID from the URL (the 11-character ID, e.g. from
twzLDx9iers)https://youtu.be/twzLDx9iers - Read to get the list of generated slides
output/<video_id>/metadata.json - Present a summary to the user:
- Video title and channel
- Style used
- Number of slides generated
- List each slide with its title and file path
- Show the user how to open the slides:
bash
open output/<video_id>/
运行成功完成后:
- 从链接中提取视频ID(11位字符,例如中的
https://youtu.be/twzLDx9iers)twzLDx9iers - 读取获取生成的幻灯片列表
output/<video_id>/metadata.json - 向用户展示摘要信息:
- 视频标题和频道
- 使用的风格
- 生成的幻灯片数量
- 列出每张幻灯片的标题和文件路径
- 告知用户打开幻灯片的方式:
bash
open output/<video_id>/
Error Handling
错误处理
If the pipeline fails, check output for common errors and consult :
references/TROUBLESHOOTING.md- 429 Rate Limit — Gemini rate limit hit. The tool has built-in retry logic. If it still fails, suggest waiting 60 seconds and retrying.
- No transcript available — The video may not have captions. Inform the user.
- Invalid URL — Ask the user for a valid YouTube URL.
- API key errors — Guide user to set up their file with valid keys.
.env
如果处理流程失败,检查输出中的常见错误并参考:
references/TROUBLESHOOTING.md- 429 Rate Limit —— 触发Gemini的请求频率限制。工具内置了重试逻辑,如果仍然失败,建议等待60秒后重试。
- 无可用字幕 —— 该视频可能没有字幕。告知用户。
- 无效链接 —— 请求用户提供有效的YouTube链接。
- API密钥错误 —— 引导用户在文件中配置有效的密钥。
.env
Variable Reference
变量参考
- — Absolute path to this skill's directory (
$SKILL_DIR)skills/youtube-to-slides/ - — Raw argument string passed by the user
$ARGUMENTS
- —— 该技能目录的绝对路径(
$SKILL_DIR)skills/youtube-to-slides/ - —— 用户传递的原始参数字符串
$ARGUMENTS