I have been using
youtube-dl -c -f 'bestvideo[height<=720]+bestaudio/best[height<=720]' to download a playlist from YouTube, but I was wondering if there is a way I can, for example, download videos 2 through 8 (out of a playlist of 10 for example) or the first 5 videos or the last 6 videos or even from video 7 onward?
Is there a way this can be done using youtube-dl?
1 Answer
You can use: --playlist-start, --playlist-end, --playlist-reverse or --playlist-items to achieve this goal.
For example to download 2 through 8:
youtube-dl -c -f '...' --playlist-start 2 --playlist-end 8 To download first 5:
youtube-dl -c -f '...' --playlist-end 5 From 7 onward:
youtube-dl -c -f '...' --playlist-start 7 Or to download 2,4,6:
youtube-dl -c -f '...' --playlist-items 2,4,6 Or even specify a range of videos:
youtube-dl -c --playlist-items 2-3,5,8-10,18 To get the last ones you should use --playlist-reverse, for example for last 6:
youtube-dl -c -f '...' --playlist-end 6 --playlist-reverse 2