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
16 17 18 |
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 16 def data.css(".channel-header-profile-image").attr("title")[0].value end |
#author_thumbnail ⇒ Object
20 21 22 |
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 20 def data.css(".channel-header-profile-image").attr("src")[0].value end |
#author_url ⇒ Object
24 25 26 27 |
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 24 def element = data.css(".channel-header-profile-image-container") "https://www.youtube.com" + element.attr("href")[0].value end |
#date ⇒ Object
4 5 6 |
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 4 def date nil end |
#duration ⇒ Object
8 9 10 |
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 8 def duration nil end |
#keywords ⇒ Object
12 13 14 |
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 12 def keywords nil end |
#thumbnail_large ⇒ Object
47 48 49 |
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 47 def thumbnail_large thumbnail_medium.sub("mqdefault.jpg", "hqdefault.jpg") end |
#thumbnail_medium ⇒ Object
43 44 45 |
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 43 def thumbnail_medium "https:" + data.css("div.pl-header-thumb img").attr("src")[0].value end |
#thumbnail_small ⇒ Object
39 40 41 |
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 39 def thumbnail_small thumbnail_medium.sub("mqdefault.jpg", "default.jpg") end |
#videos ⇒ Object
29 30 31 32 33 |
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 29 def videos raise(NotImplementedError, "To access videos, you must provide an API key " \ "to VideoInfo.provider_api_keys") end |
#view_count ⇒ Object
35 36 37 |
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 35 def view_count nil end |