I have downloaded some YouTube videos in a playlist for offline viewing that have no indication of play order. I would like to know what the best means of listing the videos – in order – is so I can organise them locally?
The existing answer to this question is outdated.
Best Answer
You can use youtube-dl for this, and specify the
playlist_index
tag in the output template.For example:
youtube-dl -o "%(playlist_index)s-%(title)s.%(ext)s" "https://www.youtube.com/watch?v=y064kgSr0gc&list=RDy064kgSr0gc"
will download all the videos in this playlist and add the index number in the order of the playlist, padded with zeroes to accommodate the length of the playlist.
The
-o
flag specifies the output template.Other useful flags for playlists are:
There is also an
autonumber
tag for use in the output template, which inserts a 5 digit number, in the order downloaded.