开发者

How to download youtube videos in ruby on rails

How to fetch youtube video with it开发者_如何学运维s name fro, youtube when you have url of the video.


Try youtube_it gem


You can also try quvi gem which can extract most metadata from many media sites. For example you can get URLs of streams and pass them to downloader of your choice:

require 'quvi'

q = Quvi::Handle.new
media = q.parse_media("https://soundcloud.com/tasod/taso-du-val-originally-superior-ep-1")
media[:streams].map{ |m| m[:url] }
# => ["http://media.soundcloud.com/stream/U203a5DmFj9U?stream_token=1Q17x"]


you can use the standard open when including openuri like this:

require 'open-uri'
youtube_video  = open('http://www.yotube.com/whatever') {|f| f.read }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜