youtube-dl

You can download the best video and audio by using:

youtube-dl -f bestvideo+bestaudio “link to youtube video”
If that gives you an error, try the following instead:

youtube-dl -f ‘bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio’ –merge-output-format mp4 “link to youtube video”

Best MP3 audio
youtube-dl -f bestaudio –extract-audio –audio-format mp3 –audio-quality 0 –embed-thumbnail –add-metadata “link to youtube video”

The –audio-quality 0 uses the highest encoding quality but can increase your file size unnecessarily. The default is 5 and might be a better choice depending on the source quality.

youtube-dl -f bestaudio –extract-audio –audio-format mp3 –audio-quality 5 –embed-thumbnail –add-metadata “link to youtube video”

If quality and file size matter to you, you should avoid re-encoding and stay with Youtube’s native music formats:

youtube-dl -f bestaudio[ext=m4a] –embed-thumbnail –add-metadata “link to youtube video”
resulting in an m4a file

or

youtube-dl -f bestaudio –extract-audio –embed-thumbnail –add-metadata “link to youtube video”
probably resulting in an ogg file.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.