[How To] Download Entire YouTube Playlists With youtube-dl
Without a doubt, YouTube is a treasure trove of billions of videos. Once a video is uploaded to YouTube, it remains there forever — unless it is taken down by the video owner, or by YouTube for copyright or terms of service violations.
Fortunately, not only are there literally tons of videos to keep you entertained, but some are placed into collections, called playlists. The playlists can help you find collections of related content that you might want to watch. My son likes episodes of Gumby, just like I did when I was a kid. Luckily, there are playlists for each season of Gumby, with all of the videos of each season in each playlist.
We’ve covered youtube-dl before in other articles in The PCLinuxOS Magazine. From those, you know how easy it is to download individual videos from YouTube to your computer. Once you have them downloaded, you can watch them from your hard drive, or you can burn them to a DVD or other storage medium to be played back on your television or portable DVD player. Since my son has a portable DVD player that we take along in the car/truck when we travel to see family who lives out of town, it would be nice to save these Gumby episodes to a storage medium that is recognized by his portable DVD player — either a DVD disc or an SD memory card (which his player recognizes, as well). Then, he can watch his Gumby episodes while traveling down the highway.
First, if you haven’t already done so, install youtube-dl from Synaptic. Youtube-dl is a command line program which will make it easy for you to download your videos and video playlists.
Next, search for (and hopefully find) the video playlist collection you want to download. Select it to cause the page to load. You might want to immediately hit the “pause” button to pause playback, since the first video in the list will immediately begin to play.
See the area highlighted with the red box in the above screen capture? It actually is a link to the entire playlist. Move your mouse cursor over that text, right click, and sel’ect “Copy Link Address” from the context menu that appears.
Now, you will want to open a terminal session. Use the cd command to change to the directory where you want to save your downloaded videos. If there isn’t already a directory, make one, then switch to it.
Then, you want to enter the following on the command line:
youtube-dl -citk –format mp4 –yes-playlist VIDEO_PLAYLIST_LINK
VIDEO_PLAYLIST_LINK is the URL copied to the clipboard when you selected “Copy Link Address” above. For the initial command line arguments, here’s what they mean. The “c” means to resume partially downloaded files. The “i” means to ignore any errors. The “t” means to use the video title as the file name. The “k” means to keep the video on the disk after the post-processing is finished. The “–format mp4” portion of the command line means to save the video files as MP4 files, and the “–yes-playlist” portion affirms that the URL that follows points to a video playlist.
Below is an abridged version what the terminal output will look like:
[[email protected] Movies]$ youtube-dl -citk –format mp4 –yes-playlist https://www.youtube.com/playlist?list=PLTmd0UJIJpfJNPdmL2agcsoP4QZOeGNCs
PLTmd0UJIJpfJNPdmL2agcsoP4QZOeGNCs: Downloading webpage
[download] Downloading playlist: A Gumby Adventure | Season 2
playlist A Gumby Adventure | Season 2: Downloading 14 videos [download] Downloading video 1 of 14
-E3E0GEdcEI: Downloading webpage
-E3E0GEdcEI: Downloading video info webpage
-E3E0GEdcEI: Extracting video information
-E3E0GEdcEI: Downloading MPD manifest
[download] Gumby – S2 Ep 1 – The Zoops–E3E0GEdcEI.mp4 has already been downloaded
[download] 100% of 18.69MiB
[download] Downloading video 2 of 14
72dUePdujj0: Downloading webpage
72dUePdujj0: Downloading video info webpage
72dUePdujj0: Extracting video information
72dUePdujj0: Downloading MPD manifest
[download] Destination: Gumby – S2 Ep 2 – Even Steven-72dUePdujj0.mp4
[download] 100% of 19.51MiB in 00:11
[download] Downloading video 3 of 14
hS-Tu6eNsFM: Downloading webpage
hS-Tu6eNsFM: Downloading video info webpage
hS-Tu6eNsFM: Extracting video information
hS-Tu6eNsFM: Downloading MPD manifest
[download] Destination: Gumby – S2 Ep 3 – The Glob-hS-Tu6eNsFM.mp4
[download] 100% of 17.02MiB in 00:09
[download] Downloading video 13 of 14
80i0aaBmc7Q: Downloading webpage
80i0aaBmc7Q: Downloading video info webpage
80i0aaBmc7Q: Extracting video information
80i0aaBmc7Q: Downloading MPD manifest
[download] Destination: Gumby – S2 Ep 13 – King for a Day-80i0aaBmc7Q.mp4
[download] 100% of 16.92MiB in 00:09
[download] Downloading video 14 of 14
R_DpcvG4D90: Downloading webpage
R_DpcvG4D90: Downloading video info webpage
R_DpcvG4D90: Extracting video information
R_DpcvG4D90: Downloading MPD manifest
[download] Destination: Gumby – S2 Ep 14 – Rain for Roo-R_DpcvG4D90.mp4
[download] 100% of 16.81MiB in 00:09
[download] Finished downloading playlist: A Gumby Adventure | Season 2
If youtube-dl encounters a video that has already been downloaded (already exists in the destination directory), it will skip over it and move on to the next video in the playlist. You can see this reflected in the output from the first video of the playlist.
That really is about all there is to it. I’m certain you will find plenty of video playlists to keep you entertained for many, many hours. Just now, you can do more than just sit in front of your computer to watch them, by burning them to DVDs or other media.