2

This question already has an answer here:

Can I use youtube-dl for that? I've downloaded youtube videos with the help of youtube-dl but one by one. I mean to say is there any command by which I can download all the vidoes in a particular playlist?

marked as duplicate by karel, Eric Carvalho, Byte Commander, waltinator, Pilot6 Sep 17 '15 at 8:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

10

Updated answer:

Use command below to download playlist:

youtube-dl -i -o (location) http://www.youtube.com/playlist?list=XXXXXXXXXXX 

where

-o, --output TEMPLATE   Output filename template, see the "OUTPUT TEMPLATE"
-i, --ignore-errors              Continue on download errors, for example to
                                 skip unavailable videos in a playlist

See Output Template

Example:

$ youtube-dl --get-filename -o '%(title)s.%(ext)s' BaW_jenozKc
youtube-dl test video ''_ä↭𝕐.mp4    # All kinds of weird characters

$ youtube-dl --get-filename -o '%(title)s.%(ext)s' BaW_jenozKc --restrict-filenames
youtube-dl_test_video_.mp4          # A simple file name

# Download YouTube playlist videos in separate directory indexed by video order in a playlist
$ youtube-dl -o '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' https://www.youtube.com/playlist?list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re

# Download all playlists of YouTube channel/user keeping each playlist in separate directory:
$ youtube-dl -o '%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' https://www.youtube.com/user/TheLinuxFoundation/playlists

# Download Udemy course keeping each chapter in separate directory under MyVideos directory in your home
$ youtube-dl -u user -p password -o '~/MyVideos/%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s' https://www.udemy.com/java-tutorial/

# Download entire series season keeping each series and each season in separate directory under C:/MyVideos
$ youtube-dl -o "C:/MyVideos/%(series)s/%(season_number)s - %(season)s/%(episode_number)s - %(episode)s.%(ext)s" http://videomore.ru/kino_v_detalayah/5_sezon/367617

# Stream the video being downloaded to stdout
$ youtube-dl -o - BaW_jenozKc

By default youtube-dl tries to download the best quality, but sometimes you may want to download other format so use command :

youtube-dl -i -o (location) -f mp4 http://www.youtube.com/playlist?list=XXXXXXXXXXX

Note:

You will find Options -citk or -citw in old answers that is not needed now . Please see youtube-dl FAQs.

References:

  • -c forces continuing instead of the default (continue only when formats fit) and is thus a bad idea. -t is superfluous. -k makes little sense here. Answers like this are the reason for problems users encounter. – phihag Mar 2 '17 at 12:44
  • Thanks phihag. this is old answer and still people using this option that's why they added that to FAQs. i added your answer link here. – pl_rock Mar 2 '17 at 13:30
  • I'm not sure why you would divide your answer in right and wrong. Why not write an up-to-date version? I fear people may stop reading after the first example. By the way, I wrote that FAQ entry. – phihag Mar 2 '17 at 13:34

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