yt-dlp - Video Download Tool
yt-dlp is a feature-rich command-line program to download videos from YouTube and other video platforms. It offers extensive options for quality selection, format choice, and batch downloading.
Installation
Section titled “Installation”# On Windows (using winget)winget install yt-dlp
# On macOSbrew install yt-dlp
# On Linuxpython3 -m pip install -U yt-dlpBasic Video Downloads
Section titled “Basic Video Downloads”# Download a single video in best qualityyt-dlp https://www.youtube.com/watch?v=VIDEO_ID
# Download with custom filenameyt-dlp -o "%(title)s.%(ext)s" https://www.youtube.com/watch?v=VIDEO_IDQuality Selection
Section titled “Quality Selection”# Download best video+audio qualityyt-dlp -f "bestvideo+bestaudio" https://www.youtube.com/watch?v=VIDEO_ID
# Limit maximum quality to 1080pyt-dlp -f "bestvideo[height<=1080]+bestaudio" https://www.youtube.com/watch?v=VIDEO_ID
# Download specific format (e.g., 720p)yt-dlp -f "bestvideo[height=720]+bestaudio" https://www.youtube.com/watch?v=VIDEO_IDAudio Downloads
Section titled “Audio Downloads”# Extract audio in best quality (default mp3)yt-dlp -x https://www.youtube.com/watch?v=VIDEO_ID
# Specify audio formatyt-dlp -x --audio-format mp3 https://www.youtube.com/watch?v=VIDEO_ID
# Set audio quality (0 is best, 9 is worst)yt-dlp -x --audio-format mp3 --audio-quality 0 https://www.youtube.com/watch?v=VIDEO_IDPlaylist Downloads
Section titled “Playlist Downloads”# Download entire playlistyt-dlp https://www.youtube.com/playlist?list=PLAYLIST_ID
# Download specific items from playlistyt-dlp --playlist-items 1,3,5-7 https://www.youtube.com/playlist?list=PLAYLIST_ID
# Download playlist starting from specific itemyt-dlp --playlist-start 5 https://www.youtube.com/playlist?list=PLAYLIST_IDAdvanced Options
Section titled “Advanced Options”Output Templates
# Save videos in specific directory with custom namingyt-dlp -o "videos/%(playlist_title)s/%(title)s.%(ext)s" URL
# Include video quality in filenameyt-dlp -o "%(title)s-%(height)sp.%(ext)s" URLDownload Options
# Download with subtitlesyt-dlp --write-sub --sub-lang en URL
# Download thumbnailyt-dlp --write-thumbnail URL
# Extract metadatayt-dlp --write-info-json URLSubtitle & Transcript Downloads
Section titled “Subtitle & Transcript Downloads”# Download subtitles only (skip video) - clean timestamped SRT formatyt-dlp --write-sub --write-auto-sub --skip-download --convert-subs srt --sub-langs en "VIDEO_URL"What this does:
--write-sub— Downloads available manual subtitles--write-auto-sub— Downloads auto-generated subtitles as fallback--skip-download— Only downloads subtitles, not the video--convert-subs srt— Converts to standard SRT format--sub-langs en— Specifies English (change toallfor all languages)
Best Practice: Manual + Auto Combined If you want manual subs with auto-generated as fallback in one command:
yt-dlp --write-sub --write-auto-sub --skip-download --convert-subs srt --sub-langs en -o "%(title)s" "VIDEO_URL"yt-dlp will prefer manual subtitles if they exist, and fall back to auto-generated if no manual subs are available.
Additional Features
Section titled “Additional Features”-
Rate Limiting: Control download speed
Terminal window yt-dlp --limit-rate 1M URL -
Batch Downloads: Download from text file
Terminal window yt-dlp -a urls.txt -
Format Selection: List available formats
Terminal window yt-dlp -F URL -
Authentication: For private videos
Terminal window yt-dlp --username USER --password PASS URL