Module: VideoInfo::YoutubePlaylistAPI
- Defined in:
- lib/video_info/providers/youtubeplaylist_api.rb
Constant Summary collapse
- ITEMS_MAX_RESULTS =
50
Instance Method Summary collapse
- #available? ⇒ Boolean
- #date ⇒ Object
- #description ⇒ Object
- #duration ⇒ Object
- #thumbnail ⇒ Object
- #thumbnail_large ⇒ Object
- #thumbnail_large_2x ⇒ Object
- #thumbnail_maxres ⇒ Object
- #thumbnail_medium ⇒ Object
- #thumbnail_small ⇒ Object
- #videos ⇒ Object
- #view_count ⇒ Object
Instance Method Details
#available? ⇒ Boolean
5 6 7 8 9 |
# File 'lib/video_info/providers/youtubeplaylist_api.rb', line 5 def available? !data["items"].empty? rescue VideoInfo::HttpError false end |
#date ⇒ Object
15 16 17 |
# File 'lib/video_info/providers/youtubeplaylist_api.rb', line 15 def date nil end |
#description ⇒ Object
11 12 13 |
# File 'lib/video_info/providers/youtubeplaylist_api.rb', line 11 def description data["items"][0]["snippet"]["description"] end |
#duration ⇒ Object
19 20 21 |
# File 'lib/video_info/providers/youtubeplaylist_api.rb', line 19 def duration nil end |
#thumbnail ⇒ Object
33 34 35 |
# File 'lib/video_info/providers/youtubeplaylist_api.rb', line 33 def thumbnail thumbnail_small end |
#thumbnail_large ⇒ Object
45 46 47 |
# File 'lib/video_info/providers/youtubeplaylist_api.rb', line 45 def thumbnail_large _video_snippet["thumbnails"]["high"]["url"] end |
#thumbnail_large_2x ⇒ Object
49 50 51 |
# File 'lib/video_info/providers/youtubeplaylist_api.rb', line 49 def thumbnail_large_2x _video_snippet["thumbnails"]["standard"]["url"] end |
#thumbnail_maxres ⇒ Object
53 54 55 |
# File 'lib/video_info/providers/youtubeplaylist_api.rb', line 53 def thumbnail_maxres _video_snippet["thumbnails"]["maxres"]["url"] end |
#thumbnail_medium ⇒ Object
41 42 43 |
# File 'lib/video_info/providers/youtubeplaylist_api.rb', line 41 def thumbnail_medium _video_snippet["thumbnails"]["medium"]["url"] end |
#thumbnail_small ⇒ Object
37 38 39 |
# File 'lib/video_info/providers/youtubeplaylist_api.rb', line 37 def thumbnail_small _video_snippet["thumbnails"]["default"]["url"] end |
#videos ⇒ Object
23 24 25 26 27 |
# File 'lib/video_info/providers/youtubeplaylist_api.rb', line 23 def videos _playlist_video_ids.map do |entry_id| VideoInfo.new("http://www.youtube.com/watch?v=#{entry_id}") end end |
#view_count ⇒ Object
29 30 31 |
# File 'lib/video_info/providers/youtubeplaylist_api.rb', line 29 def view_count nil end |