I wish to download a video from YouTube and then extract its audio. Can anyone point me to some Ruby code to download a video? Thanks!
gem install curltube
then run
curltube <youtube-url>
https://github.com/maxogden/curltube
Not sure how you would extract audio, but Ruby has many good scraping/mining libraries. You can use these to automate a browser and get scrape the data you need (e.g. the video embed code).
I recommend using a combination of mechanize and hpricot but here's a fairly comprehensive list:
Hpricot Mechanize Scrapi Scrubyt Nokogiri
You might also try Rio for downloading files/videos:
Rio: http://rio.rubyforge.org/
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With