YT-DLP Usage Guide
Learn how to use YT-DLP to download videos, extract audio, download playlists, and more. This guide covers the most common use cases and commands.
Getting Started with YT-DLP
YT-DLP is a command-line program to download videos from YouTube and other video platforms. It's a fork of youtube-dl with additional features and fixes.
Basic Usage
The simplest way to use YT-DLP is to provide a URL to download:
yt-dlp https://www.youtube.com/watch?v=dQw4w9WgXcQ
This will download the video in the best quality available.
Checking Available Formats
To see all available formats for a video:
yt-dlp -F https://www.youtube.com/watch?v=dQw4w9WgXcQ
This will display a list of all available formats with their format codes, which you can use to select a specific format.
Selecting a Specific Format
To download a specific format, use the -f
option followed by the format code:
yt-dlp -f 22 https://www.youtube.com/watch?v=dQw4w9WgXcQ
This will download the video in format 22 (usually 720p MP4).
Common Format Selection Options
-f best
- Best quality (default)-f worst
- Worst quality-f bestvideo+bestaudio
- Best video and audio quality, downloaded separately and merged-f bestvideo[height<=720]+bestaudio
- Best video with height up to 720p and best audio
Output Template
You can customize the output filename using the -o
option:
yt-dlp -o "%(title)s.%(ext)s" https://www.youtube.com/watch?v=dQw4w9WgXcQ
This will save the file with the video title as the filename.
Common Use Cases
yt-dlp -f "bestvideo+bestaudio" --merge-output-format mp4 https://www.youtube.com/watch?v=dQw4w9WgXcQ
yt-dlp -x --audio-format mp3 --audio-quality 0 https://www.youtube.com/watch?v=dQw4w9WgXcQ
yt-dlp -o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" https://www.youtube.com/playlist?list=PLw-VjHDlEOgvtnnnqWlTqByAtC7tXBg6D
yt-dlp --write-auto-sub --sub-lang en --embed-subs https://www.youtube.com/watch?v=dQw4w9WgXcQ