Note
Set the $URL variable with your URL for easy copy and paste
Example:
export URL='https://youtu.be/PLUZDtJCdDM'# 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# 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# 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# 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# 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# 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# List all available formats
yt-dlp -F $URL# Simulate download (no actual download)
yt-dlp --simulate $URLNote
Replace $URL with the actual video/playlist URL or set as bash variable.
For more options, see the official documentation.