$linuxjunkies
>

yt-dlp(1)

Download videos from YouTube and other video platforms with customizable formats, subtitles, and metadata.

UbuntuDebianFedoraArch

Synopsis

yt-dlp [OPTIONS] URL [URL]...

Description

yt-dlp is a feature-rich command-line video downloader forked from youtube-dl. It supports YouTube, TikTok, Twitter, Reddit, Instagram, and hundreds of other platforms. You can download entire playlists, extract audio, embed subtitles, and customize the output filename and format.

Videos are downloaded in the best available quality by default, but you can specify exact format codes, resolution, or codec preferences. yt-dlp handles authentication, age-gated content, and automatic subtitle fetching from multiple sources.

Common options

FlagWhat it does
-f, --format FORMATSelect video format by code (e.g., 'best', '22', 'bestvideo+bestaudio'); list available with -F
-F, --list-formatsShow all available video/audio formats without downloading
-x, --extract-audioExtract audio track as MP3, M4A, WAV, or other audio format
-o, --output TEMPLATEOutput filename template using %(title)s, %(ext)s, %(id)s, %(uploader)s, etc.
--write-subs, --write-auto-subsDownload subtitle files; auto-subs downloads auto-generated captions
-a, --batch-file FILEDownload multiple URLs listed in a text file (one per line)
--playlist-items INDICESSelect specific items from playlist (e.g., '1,3,5' or '1-5')
-j, --dump-jsonOutput video metadata as JSON instead of downloading
--proxy URLRoute all traffic through a proxy server
--username USER, --password PASSLogin credentials for age-gated or private videos

Examples

Download a single video in best available quality to current directory

yt-dlp 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'

Download video in 720p or lower with best audio and merge them

yt-dlp -f 'bestvideo[height<=720]+bestaudio' 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'

Extract audio as MP3 from all URLs listed in urls.txt

yt-dlp -x -a urls.txt --audio-format mp3

Download video with subtitles, naming it as 'Uploader - Title.ext'

yt-dlp -o '%(uploader)s - %(title)s.%(ext)s' --write-subs 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'

List all available formats and codecs without downloading

yt-dlp -F 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'

Download only items 1-5 and 10 from a playlist

yt-dlp --playlist-items 1-5,10 'https://www.youtube.com/playlist?list=PLxxxxx'

Extract video title as JSON and parse with jq

yt-dlp -j 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' | jq '.title'

Download auto-generated English subtitles with the video

yt-dlp --write-auto-subs --sub-lang en 'https://www.youtube.com/watch?v=dQw4w9WgXcQ'

Related commands