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.

  • Looking at the playlist on YouTube doesn't work? – Leo Wattenberg Jan 16 '18 at 5:01
  • sometimes the list is very long and it would be nice to have a manifest rather than rely on the scrollable list on the side of the video player. it can become wieldy to keep track of where you are. – coderatchet Jan 16 '18 at 5:03
  • Do you want a separate file which contains the list of videos in order, or have the downloaded videos be named in the playlist order, or something else? – pak Jan 22 '18 at 15:33
  • seperate file or a list online. not fussed. the important thing is it is a list of videos in the order in the playlist. – coderatchet Jan 23 '18 at 22:00

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:

--playlist-start NUMBER          Playlist video to start at (default is 1)

--playlist-end NUMBER            Playlist video to end at (default is last)

--playlist-items ITEM_SPEC       Playlist video items to download. Specify
                                 indices of the videos in the playlist
                                 separated by commas like: "--playlist-items
                                 1,2,5,8" if you want to download videos
                                 indexed 1, 2, 5, 8 in the playlist. You can
                                 specify range: "--playlist-items
                                 1-3,7,10-13", it will download the videos
                                 at index 1, 2, 3, 7, 10, 11, 12 and 13.

There is also an autonumber tag for use in the output template, which inserts a 5 digit number, in the order downloaded.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.