How to download playlist in order with youtube-dl


If you want to download a playlist of any sort and keep the playlist in order on your computer you can use this command.

You will want to replace the url portion with the url you want to download.

Get videos

youtube-dl -i -o "%(playlist_index)s-%(title)s.%(ext)s" URL

Get audio only

youtube-dl -f m4a -i -o "%(playlist_index)s-%(title)s.%(ext)s" URL

The parameter -i ensures that errors are ignored and that your download is not interrupted in any way forcing your to restart the process.

Important Note

In order to avoid errors ensure that the URL only contains the playlist link. If the URL contains the playlist link and a video link it may cause youtube-dl to stop downloading after the first video.

Complete Example

youtube-dl -f m4a -i -o "%(playlist_index)s-%(title)s.%(ext)s"