yt-dlp

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

yt-dlp Cheatsheet

yt-dlp 速查表

Command-line tool for downloading videos from YouTube and other sites.
命令行工具,用于从YouTube及其他网站下载视频。

Quick Start

快速开始

bash
undefined
bash
undefined

Download video

下载视频

Download with specific format

按指定格式下载

yt-dlp -f best https://url
yt-dlp -f best https://url

Download with output filename

自定义输出文件名

yt-dlp -o "filename.%(ext)s" https://url
undefined
yt-dlp -o "filename.%(ext)s" https://url
undefined

Basic Download

基础下载

bash
undefined
bash
undefined

Download video

下载视频

Download to current directory

下载到当前目录

Download with specific format

按指定格式下载

yt-dlp -f best https://url
undefined
yt-dlp -f best https://url
undefined

Format Selection

格式选择

bash
undefined
bash
undefined

Best quality

最高画质

yt-dlp -f best https://url
yt-dlp -f best https://url

Best audio

最佳音频

yt-dlp -f bestaudio https://url
yt-dlp -f bestaudio https://url

Best video

最佳视频

yt-dlp -f bestvideo https://url
yt-dlp -f bestvideo https://url

Specific format

指定格式代码

yt-dlp -f 137 https://url
yt-dlp -f 137 https://url

Format list

列出所有可用格式

yt-dlp --list-formats https://url
yt-dlp --list-formats https://url

Format with preference

优先选择指定格式

yt-dlp -f "bestvideo[ext=mp4]+bestaudio/best" https://url
undefined
yt-dlp -f "bestvideo[ext=mp4]+bestaudio/best" https://url
undefined

Output Options

输出选项

bash
undefined
bash
undefined

Custom output filename

自定义输出文件名

yt-dlp -o "Title.%(ext)s" https://url
yt-dlp -o "Title.%(ext)s" https://url

Output template

使用输出模板

yt-dlp -o "%(title)s.%(ext)s" https://url
yt-dlp -o "%(title)s.%(ext)s" https://url

Keep original filename

保留原始文件名

yt-dlp --keep-filename https://url
yt-dlp --keep-filename https://url

Skip existing files

跳过已下载文件

yt-dlp --continue https://url
yt-dlp --continue https://url

Limit download rate

限制下载速度

yt-dlp --limit 1M https://url
yt-dlp --limit 1M https://url

Retries

设置重试次数

yt-dlp --retries 5 https://url
undefined
yt-dlp --retries 5 https://url
undefined

Playlist Handling

播放列表处理

bash
undefined
bash
undefined

Download single video

下载单个视频

Download entire playlist

下载整个播放列表

yt-dlp --yes-playlist https://url
yt-dlp --yes-playlist https://url

Download only certain videos

下载播放列表前N个视频

yt-dlp --playlist-end 10 https://url
yt-dlp --playlist-end 10 https://url

Download with start number

从指定序号开始下载

yt-dlp --playlist-start 5 https://url
yt-dlp --playlist-start 5 https://url

Download all except certain videos

忽略错误,下载其余视频

yt-dlp --ignore-errors https://url
undefined
yt-dlp --ignore-errors https://url
undefined

Authentication

身份验证

bash
undefined
bash
undefined

Username and password

使用用户名和密码

yt-dlp -u user -p pass https://url
yt-dlp -u user -p pass https://url

API key

使用Cookie文件

yt-dlp --cookies cookies.txt https://url
yt-dlp --cookies cookies.txt https://url

Netflix username/password

Netflix用户名/密码登录

yt-dlp --username user --password pass https://url
undefined
yt-dlp --username user --password pass https://url
undefined

Metadata Extraction

元数据提取

bash
undefined
bash
undefined

Extract info

提取视频信息(JSON格式)

yt-dlp --dump-json https://url
yt-dlp --dump-json https://url

Extract title

提取视频标题

yt-dlp --get-title https://url
yt-dlp --get-title https://url

Extract duration

提取视频时长

yt-dlp --get-duration https://url
yt-dlp --get-duration https://url

Extract description

提取视频描述

yt-dlp --get-description https://url
yt-dlp --get-description https://url

Extract uploader

提取上传者信息

yt-dlp --get-uploader https://url
undefined
yt-dlp --get-uploader https://url
undefined

Advanced Options

高级选项

bash
undefined
bash
undefined

Download subtitles

下载字幕

yt-dlp --write-sub https://url
yt-dlp --write-sub https://url

Download all formats

下载所有可用格式

yt-dlp --all-formats https://url
yt-dlp --all-formats https://url

Download best quality only

仅下载单个视频(忽略播放列表)

yt-dlp --no-playlist https://url
yt-dlp --no-playlist https://url

Skip download, only extract info

跳过下载,仅提取信息

yt-dlp --skip-download https://url
yt-dlp --skip-download https://url

Download to specific directory

下载到指定目录

yt-dlp -o "downloads/%(title)s.%(ext)s" https://url
yt-dlp -o "downloads/%(title)s.%(ext)s" https://url

Concurrent downloads

并发下载

yt-dlp --concurrent-connections 10 https://url
undefined
yt-dlp --concurrent-connections 10 https://url
undefined

Batch Processing

批量处理

bash
undefined
bash
undefined

Download from file

从文件读取链接批量下载

yt-dlp --batch-file urls.txt
yt-dlp --batch-file urls.txt

Download all in directory

使用归档文件避免重复下载

yt-dlp --download-archive archive.txt https://url
undefined
yt-dlp --download-archive archive.txt https://url
undefined

Tips

提示

  • Use
    -f best
    for maximum quality
  • Use
    -o "filename.%(ext)s"
    for custom naming
  • Use
    --continue
    to skip already downloaded files
  • Use
    --list-formats
    to see available formats
  • Use
    --skip-download
    to extract metadata without downloading
  • Use
    --download-archive
    to avoid re-downloading
  • 使用
    -f best
    获取最高画质
  • 使用
    -o "filename.%(ext)s"
    自定义文件名
  • 使用
    --continue
    跳过已下载文件
  • 使用
    --list-formats
    查看可用格式
  • 使用
    --skip-download
    仅提取元数据而不下载视频
  • 使用
    --download-archive
    避免重复下载

Related Skills

相关技能

  • tmux: Run yt-dlp in background with watch mode
  • tmux: 在后台运行yt-dlp并监控进程