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
  • 39,359
Joseph
  • 69

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
  • 119,640
Deki
  • 655