Using the youtube-dl command line application you can download videos and directly extract the audio of the video in various formats.
youtube-dl supports a large variety of online video hosts, including:
Note: Please be sure that you are allowed to download a video before you do that, many of these hosts do not expect that you will be downloading their videos as they do not allow that.
The following command, will download a video, convert it to an
mp3 and delete the original video:
youtube-dl --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=cwI-n3sI8ec
If you want to keep the original video, you just add the parameter
--audio-format parameter accepts other types of audio format outputs, specifically it supports
youtube-dl is a very powerful tool, advice the documentation for some of the great features it supports.