How to download YouTube playlist in Linux

Suppose you have found a favorite YouTube playlist, and want to download all videos in the playlist to play them back locally. There are several ways to download YouTube videos in a batch.

youtube-dl is one of the most powerful YouTube downloader tools available on Linux. In this tutorial, I will describe how to download YouTube playlist by using youtube-dl.

First, install youtube-dl on your Linux by following the guide here.

Next, find out the URL of the YouTube playlist that you want to download. To do so, go to the YouTube playlist page that you want, and copy the URL. The URL format of a YouTube playlist is, as shown in the screenshot below.

Now, go ahead and run the following command to download all YouTube videos in the playlist.

$ youtube-dl -citk --max-quality FORMAT

The command-line arguments used in the above command are as follows.

  • -c: resume partially downloaded video files
  • -i: continue upon download errors
  • -t: use video title as the file name
  • --max-quality FORMAT: download video in the highest quality format

If you want to download all YouTube videos in the playlist, as well as extract MP3 audio from each video file, then first install FFmpeg on your system, and run the following command.

$ youtube-dl -citk --max-quality FORMAT --extract-audio --audio-format mp3

The additional "-k" option in the above makes youtube-dl keep downloaded videos. Without this option, youtube-dl will erase downloaded video files after extracting MP3 files from them.

The following screenshot shows youtube-dl in action.

Subscribe to Xmodulo

Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.

3 thoughts on “How to download YouTube playlist in Linux

  1. awesome post. i knew about youtube-dl, but i was completely unaware about these features. :) thanx for sharing.

Leave a comment

Your email address will not be published. Required fields are marked *

Current day month ye@r *