class Getvideo::Wole
Public Instance Methods
cover()
click to toggle source
# File lib/getvideo/56.rb, line 26 def cover response["info"]["bimg"] if response end
flash()
click to toggle source
# File lib/getvideo/56.rb, line 34 def flash "http://player.56.com/v_#{id}.swf" end
html_url()
click to toggle source
# File lib/getvideo/56.rb, line 7 def html_url if url =~ /v_([^.]+).html/ url else "http://www.56.com/u/v_#{id}.html" end end
id()
click to toggle source
# File lib/getvideo/56.rb, line 15 def id if url =~ /v_([^.]+).[html|swf]/ url.scan(/v_([^.]+)\.[html|swf]/)[0][0] elsif url =~ /w.+\/play_album.+_vid-([^.]+)\.html/ ids = url.scan /w.+\/play_album.+_vid-([^.]+)\.html/ ids[0][0] else url end end
m3u8()
click to toggle source
# File lib/getvideo/56.rb, line 38 def m3u8 "http://vxml.56.com/m3u8/#{response["info"]["vid"]}/" if response end
media()
click to toggle source
# File lib/getvideo/56.rb, line 42 def media video_list = {} response["info"]["rfiles"].each do |f| f_type = f["url"].scan(/\.(flv|mp4|m3u8)\?/)[0][0] if video_list[f_type].nil? video_list[f_type] = [] video_list[f_type] << f["url"] else video_list[f_type] << f["url"] end end return video_list end
play_media()
click to toggle source
# File lib/getvideo/56.rb, line 56 def play_media media["mp4"][0] if media["mp4"] end
title()
click to toggle source
# File lib/getvideo/56.rb, line 30 def title response["info"]["Subject"] if response end