I know these days browsers have addon for this purpose but maybe someone will be interested in how to do it from CLI.
We need two packages to do this;ffmpeg
I don´t remember installing ffmpeg so it should be installed by default.Youtube-dl package efrom repository doesn´t work so you will have to read this
to install new package version.Big thanks to a.palius
.I made request so I hope package from repo will be updated.
For start make folder in witch you will download files.Let name it youtube
Go inside of the folder
and start to download with command (this is example)
youtube-dl -f 34 http://www.youtube.com/watch?v=ZwSGPCDpddc
It will take a while but when it is finished we will convert that file to mp3
ffmpeg -i ZwSGPCDpddc.flv stratus.mp3
after that we don´t need flv file so we will delete it
rm -f *flv
P.S. Number 34 in download command is number witch describes witch format you want to download.For full list of supported formats see http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs
That is it!