Module: VideoInfo::Providers::YoutubePlaylistScraper

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

Instance Method Summary collapse

Instance Method Details

#authorObject



16
17
18
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 16

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

#author_thumbnailObject



20
21
22
# 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_urlObject



24
25
26
27
# 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

#dateObject



4
5
6
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 4

def date
  nil
end

#durationObject



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

def duration
  nil
end

#keywordsObject



12
13
14
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 12

def keywords
  nil
end

#thumbnail_largeObject



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_mediumObject



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_smallObject



39
40
41
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 39

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

#videosObject

Raises:

  • (NotImplementedError)


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_countObject



35
36
37
# File 'lib/video_info/providers/youtubeplaylist_scraper.rb', line 35

def view_count
  nil
end