video-download
它能做什么
这项技能使用 yt-dlp 工具,从网页链接中保存视频、音频或字幕。适合想保存一份公开视频的本地副本,用于剪辑或参考的人。
适用场景
- ✓当你有一个 YouTube 链接,并希望把视频保存为 MP4 文件时。
- ✓当你只需要视频中的音频,保存为 MP3 文件时。
- ✓当你只想获取视频的字幕或说明文字,而不下载视频本身时。
技能链接
https://github.com/calesthio/OpenMontage/blob/main/.agents/skills/video-download/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请以 720p 下载这个 YouTube 视频,并把字幕也保存下来。”
每周 5 个新技能,1 分钟读完。
工作原理
在安装好 yt-dlp 和 ffmpeg 后,智能体会用你选择的链接、画质、格式或字幕选项运行 yt-dlp 命令。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
video-download
Download video and audio from URLs using yt-dlp directly. No wrapper scripts needed.
Prerequisites
- yt-dlp:
brew install yt-dlporpip install yt-dlp - ffmpeg:
brew install ffmpegorapt install ffmpeg(required for merging video+audio streams)
Update yt-dlp periodically to keep up with site changes: yt-dlp -U or pip install -U yt-dlp.
Commands
Download best quality
yt-dlp "URL" -o "%(title)s.%(ext)s" --merge-output-format mp4
Download specific resolution
# 720p
yt-dlp "URL" -f "bestvideo[height<=720]+bestaudio/best[height<=720]" --merge-output-format mp4
# 1080p
yt-dlp "URL" -f "bestvideo[height<=1080]+bestaudio/best[height<=1080]" --merge-output-format mp4
Audio only
yt-dlp "URL" -x --audio-format mp3 --audio-quality 0
Download subtitles
# Download video with English subtitles
yt-dlp "URL" --write-subs --sub-langs en --merge-output-format mp4
# Download video with multiple subtitle languages
yt-dlp "URL" --write-subs --sub-langs "en,es,fr" --merge-output-format mp4
# Download only subtitles (no video)
yt-dlp "URL" --write-subs --sub-langs en --skip-download
Get metadata (no download)
yt-dlp "URL" --dump-json --no-download
List available formats
yt-dlp "URL" -F
Specify output directory
yt-dlp "URL" -o "./downloads/%(title)s.%(ext)s" --merge-output-format mp4
Quality Presets
| Quality | Format flag |
|---|---|
| Best | -f "bestvideo+bestaudio/best" (default) |
| 1080p | -f "bestvideo[height<=1080]+bestaudio/best[height<=1080]" |
| 720p | -f "bestvideo[height<=720]+bestaudio/best[height<=720]" |
| 480p | -f "bestvideo[height<=480]+bestaudio/best[height<=480]" |
| Worst | -f "worstvideo+worstaudio/worst" |
Output Template Variables
Common variables for -o templates:
| Variable | Description |
|---|---|
%(title)s |
Video title |
%(ext)s |
File extension |
%(id)s |
Video ID |
%(uploader)s |
Channel/uploader name |
%(upload_date)s |
Upload date (YYYYMMDD) |
%(duration)s |
Duration in seconds |
%(resolution)s |
Video resolution |
Tips
- Always use
--merge-output-format mp4to avoid ending up with.webmor.mkvfiles. - Use
--no-downloadwith--dump-jsonfor metadata-only queries -- no files written to disk. - If a download fails with HTTP errors, update yt-dlp first (
yt-dlp -U). - Use
-f "bestvideo[height<=720]+bestaudio"to save bandwidth when full resolution is not needed. - yt-dlp automatically handles rate limiting and retries.
- The
--dump-jsonoutput includestitle,duration,uploader,view_count,description,formats,subtitles, and much more.
Troubleshooting
- "yt-dlp: command not found": Install it (
pip install yt-dlp) and ensure your PATH includes pip's bin directory. - "ffmpeg: command not found": Install ffmpeg. Without it, downloads fail when video and audio are separate streams (common on YouTube for HD).
- Downloads fail or return errors: Run
yt-dlp -Uto update. Sites change frequently and yt-dlp ships fixes regularly.
常见问题
我需要账号或 API 密钥吗?
不需要。这项技能说明不需要 API 密钥,但必须先安装好相关工具。
还需要安装什么?
这项技能列出了 yt-dlp 和 ffmpeg,其中 ffmpeg 用于合并视频流和音频流。
我能在不下载的情况下查看视频详情吗?
可以。这项技能列出了一条命令,可以显示视频信息而不保存文件。
详情
作者的原始描述
Download video and audio from YouTube and 1000+ sites using yt-dlp. No API keys needed. Use when: (1) Downloading a video from YouTube or other sites, (2) Extracting audio from a video URL, (3) Downloading subtitles/captions from a video, (4) Getting video metadata without downloading.
repo: calesthio/OpenMontage
热度
- GitHub 星标
- 75k
- 排名
- #2696
- 许可证
- AGPL-3.0
- 更新时间
- 2026/10/28
评论
- …