This couldn’t be easier. Here is how to extract audio from an .mp4 video file (YouTube and others):
for file in *.mp4; do mplayer -ao pcm "$file" -ao pcm:file="$file.wav" && lame -b 192 "$file.wav"; rm "$file.wav"; done
Diggity done. Make sure you have mplayer and lame installed, otherwise, well, you know.