The --audio-quality
does not affect the audio quality of the source. It's a post processing option and will re-encode the audio.
Since any kind of (lossy) re-encoding will actually deteriorate the quality of the stream—or at least make it unnecessarily larger in size—I would recommend not to post-process the audio at all.
To get the best audio quality possible you simply need to select a source format of high quality. Actually, youtube-dl
will do that by default, but you can explicitly set it with --audio-format best
. YouTube (and other providers) store different audio codecs with different bitrates, and youtube-dl
will choose the best one from those.
If you have ffmpeg
installed on your system, then youtube-dl
can extract the audio automatically:
youtube-dl --audio-format best -x <url>
Otherwise, you will get a video file from which you have to extract the audio component.