Class: VideoInfo::Providers::YoutubePlaylist

Inherits:
Youtube show all
Defined in:
lib/video_info/providers/youtubeplaylist.rb

Instance Attribute Summary collapse

Attributes inherited from VideoInfo::Provider

#data, #options, #url, #video_id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Youtube

#provider, #thumbnail_large, #thumbnail_large_2x, #thumbnail_maxres, #thumbnail_medium, #thumbnail_small

Methods inherited from VideoInfo::Provider

#available?, #embed_code, #stats, #thumbnail, #thumbnail_large_2x, #thumbnail_maxres

Constructor Details

#initialize(url, options = {}) ⇒ YoutubePlaylist

Returns a new instance of YoutubePlaylist.



10
11
12
13
14
15
16
17
18
# File 'lib/video_info/providers/youtubeplaylist.rb', line 10

def initialize(url, options = {})
  super(url, options)

  if VideoInfo.provider_api_keys[:youtube].nil?
    extend YoutubePlaylistScraper
  else
    extend YoutubePlaylistAPI
  end
end

Instance Attribute Details

#playlist_items_dataObject

Returns the value of attribute playlist_items_data.



8
9
10
# File 'lib/video_info/providers/youtubeplaylist.rb', line 8

def playlist_items_data
  @playlist_items_data
end

Class Method Details

.usable?(url) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/video_info/providers/youtubeplaylist.rb', line 20

def self.usable?(url)
  url.match?(/((youtube\.com)\/playlist)|((youtube\.com)\/embed\/videoseries)/)
end

Instance Method Details

#dateObject



24
25
26
# File 'lib/video_info/providers/youtubeplaylist.rb', line 24

def date
  nil
end

#durationObject



28
29
30
# File 'lib/video_info/providers/youtubeplaylist.rb', line 28

def duration
  nil
end

#embed_urlObject



40
41
42
# File 'lib/video_info/providers/youtubeplaylist.rb', line 40

def embed_url
  "//www.youtube.com/embed/videoseries?list=#{playlist_id}"
end

#keywordsObject



32
33
34
# File 'lib/video_info/providers/youtubeplaylist.rb', line 32

def keywords
  nil
end

#view_countObject



36
37
38
# File 'lib/video_info/providers/youtubeplaylist.rb', line 36

def view_count
  nil
end