I have a Youtube playlist, I want to download it but I want youtube-dl to name the files like 1-{name}, 2-{name}, ... n-{name} in order to be able to watch them in the same sequence as original Youtube playlist. In other words I need my downloaded videos to be prefixed with numbers. How can I do that?
Asked
Active
Viewed 1e+01k times
5 Answers
157
The best solution I found is:
youtube-dl -o "%(playlist_index)s-%(title)s.%(ext)s" <playlist_link>
Iman Mohamadi
- 2,835
19
Use the -o option with playlist_index and the format <n>d like this:
youtube-dl -o "%(playlist_index)02d - %(title)s.%(ext)s" PLaPV8TkYEUV05rhlfVKXKqxvTkQ_3Tqek
# .
# /|\
# |
Nabil Kadimi
- 2,282
10
Please use the below link to download playlist in numbers in increment at first followed by title of the content
youtube-dl -cio '%(autonumber)s-%(title)s.%(ext)s' 'Paste your playlist link'
Fabby
- 35,017
Sairam62cse
- 101
3
excellent! but it leaves you with a file called 00001nameoffile
so run:
rename 's/000//g' *
afterwards
to get 01,02,03 etc
For this line below
youtube-dl -cio '%(autonumber)s-%(title)s.%(ext)s' 'Paste your playlist link'
or as one line:
youtube-dl -cio '%(autonumber)s-%(title)s.%(ext)s' url ; rename 's/000//g' *
shantiq
- 607