Class: Getvideo::Ku6

Inherits:
Video
  • Object
show all
Defined in:
lib/getvideo/ku6.rb

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

Constructor Details

This class inherits a constructor from Getvideo::Video

Instance Method Details

#coverObject



27
28
29
# File 'lib/getvideo/ku6.rb', line 27

def cover
  response["data"]["bigpicpath"]
end

#flashObject



31
32
33
# File 'lib/getvideo/ku6.rb', line 31

def flash
  "http://player.ku6.com/refer/#{id}/v.swf"
end

#html_urlObject



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

#idObject



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

#m3u8Object



35
36
37
# File 'lib/getvideo/ku6.rb', line 35

def m3u8
  "http://v.ku6.com/fetchwebm/#{id}.m3u8"
end

#mediaObject



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

#titleObject



13
14
15
# File 'lib/getvideo/ku6.rb', line 13

def title
  response["data"]["t"]
end