-2

I want to download a particular no. of videos from a Youtube playlist where they are arranged one after the other. How can I do so using youtube-dl and FFmpeg? Also, I want to number them according to their numbers in the playlist.

Hamza
  • 171
  • 1
  • 10
Sibasish Mishra
  • 15
  • 1
  • 1
  • 7

1 Answers1

2

Use --playlist-end and a template with playlist_index, like this:

youtube-dl --playlist-end 2 -o "%(playlist_index)s-%(title)s-%(id)s.%(ext)s" PLiZxWe0ejyv9R8q1jN70HZ4mwhTJxSIXf

Replace 2 with the number of videos you want to download, and PLiZxWe0ejyv9R8q1jN70HZ4mwhTJxSIXf with the playlist ID or playlist URL you actually want to download.

  • What 'title', 'id', 'ext' should be used for the variables within the brackets in the template given above? – Sibasish Mishra Sep 24 '18 at 19:53
  • None - the value of the `-o` option should be copied verbatim and remain in quotes. youtube-dl will fill out these variables for every video. –  Sep 24 '18 at 20:02
  • I need to download a specific no. of videos from a Youtube playlist containing 100 videos and the starting index of the video in the playlist is 11 I.e. all 10 videos after the video indexed 11 in the playlist. How do I download the videos in the same order as in playlist along with their index as in the list.? – Sibasish Mishra Sep 24 '18 at 20:08
  • 2
    If you don't want to start at the first index, either add `--playlist-start` and `--playlist-end`, or _just_ **`--playlist-items`**, and use the output template from this answer. See [the documentation](https://github.com/rg3/youtube-dl/blob/master/README.md#video-selection) for more information. –  Sep 24 '18 at 20:14