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) Extra
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-video-download-004b69c97a44 ,按照其中的说明把「video-download」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
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 |
%(resolution)s | Video resolution |
--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, uploader, view_count, description, formats, subtitles, 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.