download-video

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Download Video

下载视频

Download videos from YouTube, Bilibili, Twitter/X, TikTok, and 1000+ other sites using yt-dlp.
使用yt-dlp从YouTube、Bilibili、Twitter/X、TikTok及其他1000+网站下载视频。

Step 1: Check prerequisites

步骤1:检查前置条件

bash
which yt-dlp && yt-dlp --version
which ffmpeg
If yt-dlp is missing, install it:
bash
undefined
bash
which yt-dlp && yt-dlp --version
which ffmpeg
如果未安装yt-dlp,请执行以下命令安装:
bash
undefined

macOS

macOS

brew install yt-dlp ffmpeg
brew install yt-dlp ffmpeg

Cross-platform

跨平台

pip install yt-dlp
undefined
pip install yt-dlp
undefined

Step 2: Download

步骤2:开始下载

Use the bundled script — it wraps yt-dlp with sensible defaults and clear error messages.
bash
python3 scripts/download.py "VIDEO_URL"
Default output:
~/Downloads/Videos/
使用附带的脚本——它封装了yt-dlp,提供合理的默认配置和清晰的错误提示。
bash
python3 scripts/download.py "VIDEO_URL"
默认输出路径:
~/Downloads/Videos/

Common options

常用选项

bash
python3 scripts/download.py "URL" -f 1080            # Max 1080p
python3 scripts/download.py "URL" -a                  # Audio only (MP3)
python3 scripts/download.py "URL" -F                  # List formats
python3 scripts/download.py "URL" --subs              # With subtitles
python3 scripts/download.py "URL" -o ~/Desktop        # Custom output dir
python3 scripts/download.py "URL" --cookies chrome    # Use browser cookies
bash
python3 scripts/download.py "URL" -f 1080            # 最高1080p画质
python3 scripts/download.py "URL" -a                  # 仅提取音频(MP3格式)
python3 scripts/download.py "URL" -F                  # 列出所有可用格式
python3 scripts/download.py "URL" --subs              # 下载附带字幕
python3 scripts/download.py "URL" -o ~/Desktop        # 指定自定义输出目录
python3 scripts/download.py "URL" --cookies chrome    # 使用浏览器Cookie

Direct yt-dlp commands

直接使用yt-dlp命令

For cases the script doesn't cover, use yt-dlp directly:
bash
undefined
对于脚本未覆盖的场景,可以直接使用yt-dlp命令:
bash
undefined

Download playlist

下载播放列表

yt-dlp -P ~/Downloads/Videos "PLAYLIST_URL"
yt-dlp -P ~/Downloads/Videos "PLAYLIST_URL"

Custom filename template

自定义文件名模板

yt-dlp -o "%(uploader)s - %(title)s.%(ext)s" "VIDEO_URL"
yt-dlp -o "%(uploader)s - %(title)s.%(ext)s" "VIDEO_URL"

Download with subtitles in specific languages

下载指定语言的字幕

yt-dlp --write-subs --sub-lang zh,en -P ~/Downloads/Videos "VIDEO_URL"
undefined
yt-dlp --write-subs --sub-lang zh,en -P ~/Downloads/Videos "VIDEO_URL"
undefined

Troubleshooting

故障排查

Most download failures fall into these categories:
SymptomFix
"Sign in required" or age-restrictedAdd
--cookies chrome
to use browser session
Only low quality availableUpdate yt-dlp (
brew upgrade yt-dlp
), then try with
--cookies chrome
Slow downloadsTry
--concurrent-fragments 3
or
--downloader aria2c
Network errors (behind firewall)Use
--proxy socks5://127.0.0.1:1080
or set
ALL_PROXY
env var
For platform-specific details (YouTube PO tokens, Bilibili series, TikTok watermark removal, etc.), see references/platform-tips.md.
大多数下载失败可归为以下几类:
症状解决方法
"需要登录"或年龄限制添加
--cookies chrome
参数以使用浏览器会话
仅低画质可用更新yt-dlp(
brew upgrade yt-dlp
),然后尝试添加
--cookies chrome
参数
下载速度慢尝试使用
--concurrent-fragments 3
--downloader aria2c
参数
网络错误(处于防火墙后)使用
--proxy socks5://127.0.0.1:1080
或设置
ALL_PROXY
环境变量
关于平台特定细节(如YouTube PO令牌、B站合集、TikTok去水印等),请查看references/platform-tips.md