by @op7418
>
Installation: If you're installing this skill from GitHub, please refer to README.md for installation instructions. The recommended method is
npx skills add https://github.com/op7418/Youtube-clipper-skill.
你将按照以下 6 个阶段执行 YouTube 视频剪辑任务:
目标: 确保所有必需工具和依赖都已安装
检测 yt-dlp 是否可用
yt-dlp --version
检测 FFmpeg 版本和 libass 支持
# 优先检查 ffmpeg-full(macOS)
/opt/homebrew/opt/ffmpeg-full/bin/ffmpeg -version
# 检查标准 FFmpeg
ffmpeg -version
# 验证 libass 支持(字幕烧录必需)
ffmpeg -filters 2>&1 | grep subtitles
检测 Python 依赖
python3 -c "import yt_dlp; print('✅ yt-dlp available')"
python3 -c "import pysrt; print('✅ pysrt available')"
如果环境检测失败:
brew install yt-dlp 或 pip install yt-dlpbrew install ffmpeg-full # macOS
pip install pysrt python-dotenv注意:
/opt/homebrew/opt/ffmpeg-full/bin/ffmpeg (Apple Silicon)目标: 下载 YouTube 视频和英文字幕
询问用户 YouTube URL
调用 download_video.py 脚本
cd ~/.claude/skills/youtube-clipper
python3 scripts/download_video.py <youtube_url>
脚本会:
向用户展示:
输出:
<id>.mp4(使用视频 ID 命名,避免特殊字符问题)<id>.en.vtt目标: 使用 Claude AI 分析字幕内容,生成精细章节(2-5 分钟级别)
调用 analyze_subtitles.py 解析 VTT 字幕
python3 scripts/analyze_subtitles.py <subtitle_path>
脚本会输出结构化字幕数据:
你需要执行 AI 分析(这是最关键的步骤):
为每个章节生成: