class Getvideo::Ku6
Public Instance Methods
cover()
click to toggle source
# File lib/getvideo/ku6.rb, line 27 def cover response["data"]["bigpicpath"] end
flash()
click to toggle source
# File lib/getvideo/ku6.rb, line 31 def flash "http://player.ku6.com/refer/#{id}/v.swf" end
html_url()
click to toggle source
# File lib/getvideo/ku6.rb, line 5 def html_url if url =~ /\.html/ url else "http://v.ku6.com/show/#{id}.html" end end
id()
click to toggle source
# File lib/getvideo/ku6.rb, line 17 def id if url =~ /\.html/ url.split("/").last.split(".html")[0] elsif url =~ /\.swf/ url.split("/")[-2] else url end end
m3u8()
click to toggle source
# File lib/getvideo/ku6.rb, line 35 def m3u8 "http://v.ku6.com/fetchwebm/#{id}.m3u8" end
media()
click to toggle source
# File lib/getvideo/ku6.rb, line 39 def media video_list = {} video_list["f4v"] = [] response["data"]["f"].split(",").each do |f| video_list["f4v"] << f end return video_list end
title()
click to toggle source
# File lib/getvideo/ku6.rb, line 13 def title response["data"]["t"] end
Private Instance Methods
connection()
click to toggle source
# File lib/getvideo/ku6.rb, line 50 def connection conn = Faraday.new response= conn.post "http://v.ku6.com/fetch.htm", {"t" => "getVideo4Player", "vid" => id} Response.new(response).parsed end