npx skills add https://github.com/heygen-com/skills --skill video-download使用 yt-dlp 直接从 URL 下载视频和音频。无需包装脚本。
brew install yt-dlp 或 pip install yt-dlpbrew install ffmpeg 或 apt install ffmpeg (用于合并视频和音频流)定期更新 yt-dlp 以跟上网站变化:yt-dlp -U 或 pip install -U yt-dlp。
yt-dlp "URL" -o "%(title)s.%(ext)s" --merge-output-format mp4
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
# 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
yt-dlp "URL" -x --audio-format mp3 --audio-quality 0
# 下载带英文字幕的视频
yt-dlp "URL" --write-subs --sub-langs en --merge-output-format mp4
# 下载带多种语言字幕的视频
yt-dlp "URL" --write-subs --sub-langs "en,es,fr" --merge-output-format mp4
# 仅下载字幕(不下载视频)
yt-dlp "URL" --write-subs --sub-langs en --skip-download
yt-dlp "URL" --dump-json --no-download
yt-dlp "URL" -F
yt-dlp "URL" -o "./downloads/%(title)s.%(ext)s" --merge-output-format mp4
| 质量 | 格式标志 |
|---|---|
| 最佳 | -f "bestvideo+bestaudio/best" (默认) |
| 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]" |
| 最差 | -f "worstvideo+worstaudio/worst" |
-o 模板的常用变量:
| 变量 | 描述 |
|---|---|
%(title)s | 视频标题 |
%(ext)s | 文件扩展名 |
%(id)s | 视频 ID |
%(uploader)s | 频道/上传者名称 |
%(upload_date)s | 上传日期 (YYYYMMDD) |
%(duration)s | 时长(秒) |
%(resolution)s | 视频分辨率 |
--merge-output-format mp4 以避免最终得到 .webm 或 .mkv 文件。--no-download 配合 --dump-json 进行仅元数据查询 —— 不会写入文件到磁盘。yt-dlp -U)。-f "bestvideo[height<=720]+bestaudio" 以节省带宽。--dump-json 输出包含 title、duration、uploader、view_count、description、formats、subtitles 等更多信息。pip install yt-dlp) 并确保你的 PATH 包含 pip 的 bin 目录。yt-dlp -U 进行更新。网站经常变化,yt-dlp 会定期发布修复。每周安装数
262
代码仓库
GitHub 星标数
91
首次出现
8 天前
安全审计
安装于
claude-code246
gemini-cli35
kimi-cli35
codex35
amp35
cline35
Download video and audio from URLs using yt-dlp directly. No wrapper scripts needed.
brew install yt-dlp or pip install yt-dlpbrew install ffmpeg or apt 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.
yt-dlp "URL" -o "%(title)s.%(ext)s" --merge-output-format mp4
# 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
yt-dlp "URL" -x --audio-format mp3 --audio-quality 0
# 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
yt-dlp "URL" --dump-json --no-download
yt-dlp "URL" -F
yt-dlp "URL" -o "./downloads/%(title)s.%(ext)s" --merge-output-format mp4
| 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" |
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 |
--merge-output-format mp4 to avoid ending up with .webm or .mkv files.--no-download with --dump-json for metadata-only queries -- no files written to disk.yt-dlp -U).-f "bestvideo[height<=720]+bestaudio" to save bandwidth when full resolution is not needed.--dump-json output includes title, duration, , , , , , and much more.pip install yt-dlp) and ensure your PATH includes pip's bin directory.yt-dlp -U to update. Sites change frequently and yt-dlp ships fixes regularly.Weekly Installs
262
Repository
GitHub Stars
91
First Seen
8 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
claude-code246
gemini-cli35
kimi-cli35
codex35
amp35
cline35
xdrop 文件传输脚本:Bun 环境下安全上传下载工具,支持加密分享
20,700 周安装
Docassemble 表单构建器技能 - 创建智能动态问卷与文档生成工具
257 周安装
Fastify TypeScript 生产级后端框架指南:高性能 Node.js Web 开发与 JSON 模式验证
257 周安装
AI 演示文稿生成器 | 一键创建专业幻灯片,支持 Marp 格式输出
257 周安装
Mapbox搜索模式指南:地理编码、POI搜索与位置发现最佳实践
257 周安装
Zustand适配器:为json-render提供状态管理后端,支持嵌套切片与Zustand v5+
257 周安装
Blender MCP 插件使用指南:3D 场景自动化与 Python 脚本控制教程
257 周安装
%(resolution)s| Video resolution |
uploaderview_countdescriptionformatssubtitles