Module: VideoInfo::Providers::YoutubePlaylistScraper
- Defined in:
- lib/video_info/providers/youtubeplaylist_scraper.rb
Instance Method Summary collapse
- #author ⇒ Object
- #author_thumbnail ⇒ Object
- #author_url ⇒ Object
- #date ⇒ Object
- #duration ⇒ Object
- #keywords ⇒ Object
- #thumbnail_large ⇒ Object
- #thumbnail_medium ⇒ Object
- #thumbnail_small ⇒ Object
- #videos ⇒ Object
- #view_count ⇒ Object
Instance Method Details
#author ⇒ Object
18 19 20 |
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 18 def data.css('.channel-header-profile-image').attr('title')[0].value end |
#author_thumbnail ⇒ Object
22 23 24 |
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 22 def data.css('.channel-header-profile-image').attr('src')[0].value end |
#author_url ⇒ Object
26 27 28 29 |
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 26 def element = data.css('.channel-header-profile-image-container') 'https://www.youtube.com' + element.attr('href')[0].value end |
#date ⇒ Object
6 7 8 |
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 6 def date nil end |
#duration ⇒ Object
10 11 12 |
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 10 def duration nil end |
#keywords ⇒ Object
14 15 16 |
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 14 def keywords nil end |
#thumbnail_large ⇒ Object
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_medium ⇒ Object
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_small ⇒ Object
41 42 43 |
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 41 def thumbnail_small thumbnail_medium.sub('mqdefault.jpg', 'default.jpg') end |
#videos ⇒ Object
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_count ⇒ Object
37 38 39 |
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 37 def view_count nil end |