Module: VideoInfo::Providers::YoutubePlaylistScraper

Defined in:
lib/video_info/providers/youtubeplaylist_scraper.rb

Instance Method Summary collapse

Instance Method Details

#authorObject



18
19
20
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 18

def author
  data.css('.channel-header-profile-image').attr('title')[0].value
end

#author_thumbnailObject



22
23
24
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 22

def author_thumbnail
  data.css('.channel-header-profile-image').attr('src')[0].value
end

#author_urlObject



26
27
28
29
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 26

def author_url
  element = data.css('.channel-header-profile-image-container')
  'https://www.youtube.com' + element.attr('href')[0].value
end

#dateObject



6
7
8
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 6

def date
  nil
end

#durationObject



10
11
12
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 10

def duration
  nil
end

#keywordsObject



14
15
16
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 14

def keywords
  nil
end

#thumbnail_largeObject



49
50
51
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 49

def thumbnail_large
  thumbnail_medium.sub('mqdefault.jpg', 'hqdefault.jpg')
end

#thumbnail_mediumObject



45
46
47
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 45

def thumbnail_medium
  'https:' + data.css('div.pl-header-thumb img').attr('src')[0].value
end

#thumbnail_smallObject



41
42
43
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 41

def thumbnail_small
  thumbnail_medium.sub('mqdefault.jpg', 'default.jpg')
end

#videosObject

Raises:

  • (NotImplementedError)


31
32
33
34
35
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 31

def videos
  raise(NotImplementedError,
        'To access videos, you must provide an API key ' \
        'to VideoInfo.provider_api_keys')
end

#view_countObject



37
38
39
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 37

def view_count
  nil
end