-f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]'
this is what I'm using in my case (on youtube).Posting this here, because it's not obvious from the docs that this works.
> Since the end of April 2015 and version 2015.04.26 youtube-dl uses -f bestvideo+bestaudio/best as default format selection […] If ffmpeg or avconv are installed this results in downloading bestvideo and bestaudio separately and muxing them together into a single file giving the best overall quality available. Otherwise it falls back to best and results in downloading the best available quality served as a single file. best is also needed for videos that don't come from YouTube because they don't provide the audio and video in two different files.
Oh ye, the list's pretty comprehensive actually [1].
[1]: https://github.com/rg3/youtube-dl/tree/master/youtube_dl/ext...
youtube-dl --extract-audio --audio-format mp3 <url>Edit: I mentioned that because you don't lose any quality reencoding.
[1] A bit of self-promotion here, if you are interested this is my soundcloud playlist https://soundcloud.com/melicerte/sets/extraits-de-vieux-film...
alias youtubemp3='youtube-dl --extract-audio --audio-format mp3'
To fully use its features you should install ffmpeg though. Youtube-dl will automatically use it if it's in the PATH, and then can download Youtube videos with higher frame rates and resolutions (they store video and audio in separate files, and ffmpeg is used to mux both together). ffmpeg is also required to download from some streaming video hosters.
For me it's essentially:
to get the list of available video and audio formats, followed by and then wait for the download to complete. And to self-update youtube-dl (because it gets updated just about every day).