YouTube

youtube-dl

apt-get install youtube-dl 

If that version is too old, take it directly from github (it's a python script): http://rg3.github.com/youtube-dl/

Download video:

youtube-dl 'http://www.youtube.com/watch?v=Lj-Rsl8brt8'

List formats:

youtube-dl -F 'Lj-Rsl8brt8'

Pick format:

youtube-dl -f 171 'Lj-Rsl8brt8'

Get only audio:

youtube-dl -x 7J2ic0q80mY

audio

Dump audio:

avconv -i Lj-Rsl8brt8.mp4 out.wav

Convert to mp3:

lame -h -v -B 192 out.wav out.mp3