module VideoInfo::Providers::YoutubePlaylistScraper

Public Instance Methods

author() click to toggle source
# File lib/video_info/providers/youtubeplaylist_scraper.rb, line 16
def author
  data.css(".channel-header-profile-image").attr("title")[0].value
end
author_thumbnail() click to toggle source
# File lib/video_info/providers/youtubeplaylist_scraper.rb, line 20
def author_thumbnail
  data.css(".channel-header-profile-image").attr("src")[0].value
end
author_url() click to toggle source
# File lib/video_info/providers/youtubeplaylist_scraper.rb, line 24
def author_url
  element = data.css(".channel-header-profile-image-container")
  "https://www.youtube.com" + element.attr("href")[0].value
end
date() click to toggle source
# File lib/video_info/providers/youtubeplaylist_scraper.rb, line 4
def date
  nil
end
duration() click to toggle source
# File lib/video_info/providers/youtubeplaylist_scraper.rb, line 8
def duration
  nil
end
keywords() click to toggle source
# File lib/video_info/providers/youtubeplaylist_scraper.rb, line 12
def keywords
  nil
end
thumbnail_large() click to toggle source
# File lib/video_info/providers/youtubeplaylist_scraper.rb, line 47
def thumbnail_large
  thumbnail_medium.sub("mqdefault.jpg", "hqdefault.jpg")
end
thumbnail_medium() click to toggle source
# 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() click to toggle source
# File lib/video_info/providers/youtubeplaylist_scraper.rb, line 39
def thumbnail_small
  thumbnail_medium.sub("mqdefault.jpg", "default.jpg")
end
videos() click to toggle source
# 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() click to toggle source
# File lib/video_info/providers/youtubeplaylist_scraper.rb, line 35
def view_count
  nil
end

Private Instance Methods

available?() click to toggle source
# File lib/video_info/providers/youtubeplaylist_scraper.rb, line 53
def available?
  !data.css("div#page").attr("class")[0].value.include?("oops-content")
end