Skip to content

Instantly share code, notes, and snippets.

@BrutalBirdie
Last active November 17, 2025 19:58
Show Gist options
  • Select an option

  • Save BrutalBirdie/dd5183e79caf20afda24a64c799f0aae to your computer and use it in GitHub Desktop.

Select an option

Save BrutalBirdie/dd5183e79caf20afda24a64c799f0aae to your computer and use it in GitHub Desktop.
yt-dlp cheat sheet

yt-dlp Cheat Sheet

Note

Set the $URL variable with your URL for easy copy and paste

Example:

export URL='https://youtu.be/PLUZDtJCdDM'

Basic Usage

# Download a video (best quality with audio in mp4)
yt-dlp -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" $URL
# Download best quality possible (any format)
yt-dlp -f "best" $URL

Video Downloads

# Download best MP4 format available
yt-dlp -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]" $URL
# Download specific quality (720p)
yt-dlp -f "bestvideo[height<=720][ext=mp4]+bestaudio[ext=m4a]" $URL
# Download video only (no audio)
yt-dlp -f "bestvideo" --no-audio $URL

Audio Downloads

# Download best audio quality (converts to mp3)
yt-dlp -x --audio-format mp3 $URL
# Download original audio (no conversion)
yt-dlp -x $URL
# Download best audio quality in m4a format
yt-dlp -f "bestaudio[ext=m4a]" $URL

Playlists

# Download entire playlist (best quality)
yt-dlp -f "best" PLAYLIST_$URL
# Download specific range (videos 1-10)
yt-dlp --playlist-items 1-10 PLAYLIST_$URL

Advanced Options

# Download subtitles (embedded if available)
yt-dlp --write-subs --sub-langs "en.*" $URL
# Download thumbnails and metadata
yt-dlp --write-thumbnail --write-info-json $URL
# Continue incomplete download
yt-dlp --continue $URL

Output Control

# Custom output filename
yt-dlp -o "%(title)s.%(ext)s" $URL
# Save to specific directory
yt-dlp -o "/path/to/directory/%(title)s.%(ext)s" $URL

Helpful Shortcuts

# List all available formats
yt-dlp -F $URL
# Simulate download (no actual download)
yt-dlp --simulate $URL

Note

Replace $URL with the actual video/playlist URL or set as bash variable. For more options, see the official documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment