Friday, November 30, 2007

Audio from YouTube in three steps

Needed packages: youtube-dl and mplayer. XXXX is the video ID on YouTube. You can find this out by looking at the URL of the video for which you want to get the audio.
  1. youtube-dl http://www.youtube.com/watch?v=XXXX
  2. mplayer -dumpaudio XXXX.flv
  3. mv stream.dump XXXX.mp3
Works for me. You can check if the file is really an mp3 file or if you still need to convert it from some other obscure format by running file stream.dump before renaming the file. Of course, this also works for mms:// streams with passing the mms:// URL to mplayer and using "-dumpstream" if you want the full video (or only -dumpaudio if you don't care for the video, as above).

No comments: