3

I have found a few solutions as to how to do this, however I am not sure how to put them together.

I know if I do this:

youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 <Video-URL>

then I can download a video and it will convert it to best audio quality, however how would I do the same for all of a playlist whist also giving each file a number. And is there a way to get it to download to a directory eg. /Downloads/(playlist folder name).

I realise this may be a duplicate of some other questions however I would like to know how to combine those commands if possible.

andrew.46
  • 37,085
  • 25
  • 149
  • 228
Joseph
  • 69
  • 1
  • 1
  • 7
  • I think I've got the directory sorted I did: cd /home/'my user name'/Downloads/'the name of the playlist folder' – Joseph Sep 14 '17 at 19:34

1 Answers1

3

For best video, audio and specific path you can use:

youtube-dl -f bestvideo+bestaudio -o '/home/yourusername/Downloads' "youtubelink"

If you get an error, you can check the available video quality:

youtube-dl -F "youtubeLinkVideo"

Example: If the best quality number is 22 on YouTube, then download using this command:

youtube-dl -f 22 -o '/home/yourusername/Downloads' "youtubelink"
Eliah Kagan
  • 116,445
  • 54
  • 318
  • 493
Deki
  • 635
  • 4
  • 14