DEV Community

Cover image for How to download Youtube Videos & Playlists with yt-dlp (100% Free)
Ishan Jarwal
Ishan Jarwal

Posted on

How to download Youtube Videos & Playlists with yt-dlp (100% Free)

This is a short tutorial on how to download an entire youtube playlist with just one command line with yt-dlp, an open source package, No ads, No subscriptions.

Step 1 : Install yt-dlp

To install the package, use wget

wget https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -O yt-dlp
Enter fullscreen mode Exit fullscreen mode

 

Step 2: Make it executable and move to PATH

chmod +x yt-dlp
sudo mv yt-dlp /usr/local/bin/
Enter fullscreen mode Exit fullscreen mode

 

Test the installation :

yt-dlp --version
Enter fullscreen mode Exit fullscreen mode

 

Step 3: Install ffmpeg (needed for mp3 conversion)

sudo pacman -S ffmpeg
Enter fullscreen mode Exit fullscreen mode

 

Download with a single line :

Option / Format Command Example
Download video (default, best quality) yt-dlp <URL>
Download best video + audio (merge mp4/mkv) yt-dlp -f "bestvideo+bestaudio" <URL>
Extract audio only (default format) yt-dlp -x <URL>
Extract audio as MP3 yt-dlp -x --audio-format mp3 <URL>
Extract audio as WAV yt-dlp -x --audio-format wav <URL>
Download entire playlist as MP3 (with track numbers) yt-dlp -x --audio-format mp3 -o "%(playlist_index)02d - %(title)s.%(ext)s" <PLAYLIST_URL>
Save inside folder named after playlist yt-dlp -x --audio-format mp3 -o "%(playlist_title)s/%(playlist_index)02d - %(title)s.%(ext)s" <PLAYLIST_URL>
Download specific items from playlist (e.g. 1–10, 15, 20) yt-dlp --playlist-items 1-10,15,20 <PLAYLIST_URL>
Download subtitles (if available) yt-dlp --write-subs --sub-lang en <URL>
Embed metadata (artist, album, thumbnail, etc.) into MP3 yt-dlp -x --audio-format mp3 --embed-metadata --embed-thumbnail <URL>
Set custom output filename yt-dlp -o "%(title)s.%(ext)s" <URL>

 

And that's a wrap

Top comments (0)