Class: Getvideo::Ku6
Instance Attribute Summary
Attributes inherited from Video
#url
Instance Method Summary
collapse
Methods inherited from Video
get_api_uri, #initialize, #json, #play_media, #response, set_api_uri
Instance Method Details
#cover ⇒ Object
27
28
29
|
# File 'lib/getvideo/ku6.rb', line 27
def cover
response["data"]["bigpicpath"]
end
|
#flash ⇒ Object
31
32
33
|
# File 'lib/getvideo/ku6.rb', line 31
def flash
"http://player.ku6.com/refer/#{id}/v.swf"
end
|
#html_url ⇒ Object
5
6
7
8
9
10
11
|
# 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 ⇒ Object
17
18
19
20
21
22
23
24
25
|
# 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 ⇒ Object
35
36
37
|
# File 'lib/getvideo/ku6.rb', line 35
def m3u8
"http://v.ku6.com/fetchwebm/#{id}.m3u8"
end
|
39
40
41
42
43
44
45
46
|
# 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 ⇒ Object
13
14
15
|
# File 'lib/getvideo/ku6.rb', line 13
def title
response["data"]["t"]
end
|