Showing posts with label To get started. Show all posts
Showing posts with label To get started. Show all posts

Friday, 2 October 2026

yt-dlp/yt-dlp: A feature-rich command-line audio/video - Cheat Sheet

s 


Here is a comprehensive command cheat sheet for yt-dlp, categorised by common tasks and workflows:





1. Basic Downloading & Format Inspection

  • Download best available quality (default):
yt-dlp "URL"

*(Downloads the best video and audio streams and automatically merges them using FFmpeg)*[1].

  • List all available video/audio formats:
yt-dlp -F "URL"

*(Displays a table with format IDs, resolutions, codecs, and file sizes)*[3].

  • Download a specific format by ID:
yt-dlp -f 137+140 "URL"

(Downloads video format 137 and audio format 140 *and merges them)*[3].

 

 

 

  • Cap video quality at 1080p:
yt-dlp -f "bv*[height<=1080]+ba/b[height<=1080]" "URL"

*(Downloads the best video stream up to 1080p combined with the best audio)*[3][6].

  • Force output container to MP4:
yt-dlp -f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]" --merge-output-format mp4 "URL"

*(Selects MP4-compatible video and audio streams and forces an MP4 output container)*[6][8].

  • Download the smallest file size:
yt-dlp -S "+size" "URL"

*(Sorts formats by ascending file size)*[3][8].


2. Audio Extraction

yt-dlp -x "URL"

*(Strips the video and leaves the original audio file like Opus or AAC without re-encoding)*[8].

  • Extract audio and convert to MP3:
yt-dlp -x --audio-format mp3 "URL"

*(Converts extracted audio into MP3 format)*[3][9].

  • Extract maximum quality MP3 with embedded cover art & metadata:
yt-dlp -x --audio-format mp3 --audio-quality 0 --embed-thumbnail --embed-metadata "URL"

(Sets VBR audio quality to best ( 0 *) and embeds thumbnail image as cover art along with metadata tags)*[10].


3. Playlists & Channels

  • Download an entire playlist or channel:
yt-dlp "PLAYLIST_URL"

*(Downloads all videos in a playlist or channel URL)*[3].

  • Download a specific range of playlist items:
yt-dlp --playlist-start 10 --playlist-end 20 "URL"

*(Downloads items 10 through 20)*[14].

  • Skip previously downloaded items (Archive file):
yt-dlp --download-archive archive.txt "URL"

(Saves video IDs to archive.txt *and skips any previously logged videos on subsequent runs)*[3][15].


4. Custom Output Filenames & Templates

  • Use video title only:
yt-dlp -o "%(title)s.%(ext)s" "URL"

*(Omits the default video ID suffix)*[3][16].

yt-dlp -o "%(upload_date>%Y-%m-%d)s - %(title)s.%(ext)s" "URL"

*(Formats upload dates nicely in the filename)*[16][17].

  • Organise playlists into structured folders:
yt-dlp -o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" "URL"

*(Creates a subfolder named after the playlist and prefixes filenames with their index number)*[16].


5. Subtitles & Metadata

yt-dlp --list-subs "URL"

*(Lists all manual and auto-generated subtitle tracks)*[17][18].

  • Download and embed English subtitles:
yt-dlp --embed-subs --sub-lang en "URL"

*(Embeds English subtitles directly into MP4 or MKV files)*[3][18].

  • Embed metadata, thumbnail, and chapter markers:
yt-dlp --embed-metadata --embed-thumbnail --embed-chapters "URL"

*(Embeds video details, cover image, and internal chapters into the file)*[10].


6. Authentication & Cookies

  • Use cookies directly from your web browser:
yt-dlp --cookies-from-browser chrome "URL"

*(Extracts session cookies from Chrome, Firefox, Edge, Safari, Brave, etc. for private/age-restricted content)*[20].

  • Use an exported cookie file:
yt-dlp --cookies cookies.txt "URL"

*(Uses a Netscape-formatted cookie file for authentication)*[23][24].


7. Speed Optimization, Network & Proxies

yt-dlp -N 4 "URL"

*(Downloads 4 fragments concurrently for DASH/HLS streams)*[25].

yt-dlp --limit-rate 2M "URL"

*(Caps download bandwidth to 2 MB/s)*[25][28].

  • Download via HTTP or SOCKS5 Proxy:
yt-dlp --proxy "http://user:pass@proxy-server:port" "URL"

*(Routes traffic through a proxy to bypass geo-restrictions)*[3].


8. Trimming & Chapter Splitting

  • Split video into individual chapter files:
yt-dlp --split-chapters -o "%(title)s - %(chapter)s.%(ext)s" "URL"

*(Splits a video into separate files according to its internal chapters)*[31][32].

  • Download a specific time range:
yt-dlp --download-sections "*00:01:00-00:05:00" "URL"

*(Extracts and downloads only the section from 1:00 to 5:00)*[25][27].


9. Updates & Maintenance

  • Update executable binary:
yt-dlp -U

*(Updates standalone binaries to the latest release)*[3].

python3 -m pip install -U yt-dlp

(Updates yt-dlp *installed via pip)*[3][34].

  • Switch to the Nightly update channel:
yt-dlp --update-to nightly

*(Upgrades to the nightly channel for rapid bug fixes)*[35][36].


💡 Next Step: Would you like instructions on how to create a permanent yt-dlp.conf configuration file so you don't have to retype these flags every time?

yt-dlp/yt-dlp: A feature-rich command-line audio/video - Cheat Sheet

s  Here is a comprehensive command cheat sheet for yt-dlp , categorised by common tasks and workflows: 1. Basic Downloading & Format I...