Created
November 16, 2010 15:17
-
-
Save stereosupersonic/701919 to your computer and use it in GitHub Desktop.
convert youtube videos to mp3 on OSX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
#example: | |
# youtube2mp3 EzgGTTtR0kc | |
VLC = "/Applications/VLC.app/Contents/MacOS/VLC" | |
youtube_id = ARGV.first || STDIN.read | |
raise "no youtube id is given" unless youtube_id | |
system "#{VLC} -I dummy http://www.youtube.com/watch?v=#{youtube_id} | |
--sout='#transcode{acodec=mp3,vcodec=dummy}:standard{access=file,mux=raw,dst=\"#{youtube_id}.mp3\"}' vlc://quit" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment