video_info 2.6.1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/unit_test.yml +39 -0
- data/Guardfile +1 -1
- data/README.md +10 -21
- data/lib/video_info.rb +5 -4
- data/lib/video_info/provider.rb +17 -2
- data/lib/video_info/providers/dailymotion.rb +13 -0
- data/lib/video_info/providers/vimeo_api.rb +12 -12
- data/lib/video_info/providers/vimeo_scraper.rb +66 -16
- data/lib/video_info/providers/youtube.rb +12 -0
- data/lib/video_info/providers/youtube_api.rb +12 -13
- data/lib/video_info/providers/youtube_scraper.rb +44 -25
- data/lib/video_info/providers/youtubeplaylist_api.rb +15 -1
- data/lib/video_info/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_invalid_video_url/_available_/1_2_2_1_1.yml +29 -36
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_valid_video/_available_/1_2_1_1_1.yml +29 -34
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/{_description → _author}/1_3_7_1.yml +35 -39
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/{_duration → _author_thumbnail}/1_3_9_1.yml +35 -39
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/{_keywords → _author_url}/1_3_8_1.yml +35 -39
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_date/should_show_correct_date.yml +35 -39
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/{_thumbnail_large/1_3_15_1.yml → _description/1_3_10_1.yml} +35 -39
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_duration/1_3_12_1.yml +91 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_keywords/1_3_11_1.yml +91 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail/1_3_21_1.yml +91 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_large/1_3_18_1.yml +91 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_medium/1_3_17_1.yml +91 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/{_view_count → _thumbnail_small}/1_3_16_1.yml +35 -39
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_title/1_3_6_1.yml +34 -38
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_view_count/1_3_22_1.yml +91 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/_available_/1_2_3_1_1.yml +39 -852
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/_available_/2_2_3_1_1.yml +30 -21
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/_available_/1_2_2_1_1.yml +45 -854
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/_available_/2_2_2_1_1.yml +30 -21
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/_available_/1_2_1_1_1.yml +45 -2579
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/_available_/2_2_1_1_1.yml +28 -79
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/author/1_13_2_1.yml +130 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/author_thumbnail/1_13_3_1.yml +130 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/author_url/1_13_4_1.yml +132 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/available_/1_13_1_1.yml +130 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/date/1_13_7_1.yml +128 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/description/1_13_6_1.yml +131 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/duration/1_13_8_1.yml +130 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/height/1_13_10_1.yml +131 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/keywords/1_13_9_1.yml +128 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/thumbnail_large/1_13_14_1.yml +129 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/thumbnail_medium/1_13_13_1.yml +129 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/thumbnail_small/1_13_12_1.yml +129 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/title/1_13_5_1.yml +130 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/view_count/1_13_15_1.yml +129 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/width/1_13_11_1.yml +129 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author/1_3_20_1.yml +158 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author/2_3_20_1.yml +80 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_thumbnail/1_3_19_1.yml +158 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_thumbnail/2_3_19_1.yml +85 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_url/1_3_21_1.yml +159 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_url/2_3_21_1.yml +80 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_date/should_have_correct_upload_date.yml +143 -1498
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_description/1_3_7_1.yml +45 -1487
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_description/2_3_7_1.yml +42 -30
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_duration/1_3_9_1.yml +98 -1470
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_duration/2_3_9_1.yml +45 -28
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_height/1_3_11_1.yml +100 -1471
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_height/2_3_11_1.yml +42 -30
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_keywords/should_return_a_string_list_of_keywords.yml +144 -1499
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail/1_3_18_1.yml +236 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail/2_3_18_1.yml +82 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_large/1_3_15_1.yml +176 -1470
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_large/2_3_15_1.yml +43 -29
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_medium/1_3_14_1.yml +177 -1472
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_medium/2_3_14_1.yml +43 -27
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_small/1_3_13_1.yml +176 -1470
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_small/2_3_13_1.yml +43 -27
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_title/1_3_6_1.yml +44 -1487
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_title/2_3_6_1.yml +45 -28
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_view_count/1_3_22_1.yml +158 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_view_count/2_3_22_1.yml +84 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_width/1_3_10_1.yml +99 -1473
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_width/2_3_10_1.yml +43 -29
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_141349194/thumbnail/1_12_1_1.yml +234 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_141349194/thumbnail/2_12_1_1.yml +78 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_141349194/thumbnail_large/1_12_2_1.yml +233 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_141349194/thumbnail_large/2_12_2_1.yml +78 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_141349194/thumbnail_medium/1_12_3_1.yml +235 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_141349194/thumbnail_medium/2_12_3_1.yml +73 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_141349194/thumbnail_small/1_12_4_1.yml +234 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_141349194/thumbnail_small/2_12_4_1.yml +77 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_invalid_video/_available_/1_2_2_1_1.yml +29 -25
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_valid_video/_available_/1_2_1_1_1.yml +31 -25
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_duration/1_4_7_1.yml +37 -32
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_height/1_4_9_1.yml +37 -32
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_large/1_4_12_1.yml +37 -31
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_medium/1_4_11_1.yml +37 -31
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_small/1_4_10_1.yml +37 -32
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_title/1_4_6_1.yml +37 -31
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_width/1_4_8_1.yml +37 -31
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_duration/1_3_7_1.yml +36 -31
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_height/1_3_9_1.yml +36 -29
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail/1_3_15_1.yml +87 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_large/1_3_12_1.yml +36 -29
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_medium/1_3_11_1.yml +36 -29
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_small/1_3_10_1.yml +36 -31
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_title/1_3_6_1.yml +36 -31
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_width/1_3_8_1.yml +36 -29
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_available_/1_2_2_1_1.yml +25 -482
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_available_/2_2_2_1_1.yml +82 -24
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_date/1_2_2_11_1.yml +24 -484
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_date/2_2_2_11_1.yml +82 -24
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_description/1_2_2_8_1.yml +22 -484
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_description/2_2_2_8_1.yml +82 -24
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_duration/1_2_2_10_1.yml +23 -483
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_duration/2_2_2_10_1.yml +82 -24
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_keywords/1_2_2_9_1.yml +26 -486
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_keywords/2_2_2_9_1.yml +82 -24
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_title/1_2_2_7_1.yml +26 -486
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_title/2_2_2_7_1.yml +82 -24
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/1_2_2_18_1.yml +59 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/2_2_2_18_1.yml +114 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/_available_/1_2_1_1_1.yml +25 -3896
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/_available_/2_2_1_1_1.yml +153 -93
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_removed_because_of_copyright_claim/_available_/1_2_3_1_1.yml +25 -544
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_removed_because_of_copyright_claim/_available_/2_2_3_1_1.yml +80 -83
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_a_video_without_description/_description/1_1_1_1.yml +59 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_date/should_return_date_video_was_posted.yml +180 -3843
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_description/1_17_7_1.yml +20 -3968
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_description/2_17_7_1.yml +153 -93
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_duration/1_17_9_1.yml +23 -3946
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_duration/2_17_9_1.yml +153 -93
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_keywords/1_17_8_1.yml +25 -3950
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_keywords/2_17_8_1.yml +153 -93
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_title/1_17_6_1.yml +23 -3910
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_title/2_17_6_1.yml +153 -93
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_view_count/1_17_17_1.yml +59 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_view_count/2_17_17_1.yml +187 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author/1_3_6_1.yml +60 -3951
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author/2_3_6_1.yml +153 -93
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_thumbnail/1_3_7_1.yml +58 -3970
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_thumbnail/2_3_7_1.yml +272 -149
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_url/1_3_8_1.yml +22 -4043
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_url/2_3_8_1.yml +272 -149
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_url/can_be_called_twice_and_receive_the_same_value.yml +391 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_date/should_return_date_video_was_posted.yml +175 -3914
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_description/1_3_10_1.yml +25 -3957
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_description/2_3_10_1.yml +153 -93
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_duration/1_3_12_1.yml +24 -3926
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_duration/2_3_12_1.yml +153 -93
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_keywords/1_3_11_1.yml +24 -3893
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_keywords/2_3_11_1.yml +153 -93
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_title/1_3_9_1.yml +23 -3938
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_title/2_3_9_1.yml +153 -93
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/1_3_21_1.yml +59 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/2_3_21_1.yml +187 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/_available_/1_2_2_1_1.yml +88 -30
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_list_url/_available_/1_2_3_1_1.yml +121 -63
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/_available_/1_2_1_1_1.yml +121 -63
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author/1_3_21_1.yml +165 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_thumbnail/1_3_22_1.yml +274 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_url/1_3_23_1.yml +274 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_description/1_3_7_1.yml +132 -74
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_keywords/1_3_8_1.yml +132 -74
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail/1_3_18_1.yml +165 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large/1_3_15_1.yml +132 -74
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large_2x/1_3_16_1.yml +165 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_maxres/1_3_17_1.yml +165 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_medium/1_3_14_1.yml +132 -74
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_small/1_3_13_1.yml +132 -74
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_title/1_3_6_1.yml +132 -74
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_videos/returns_list_of_videos_in_playlist.yml +79 -234
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_that_does_not_exist_in_embed_path/_videos/1_4_2_1.yml +82 -24
- data/spec/lib/video_info/providers/dailymotion_spec.rb +34 -4
- data/spec/lib/video_info/providers/vimeo_spec.rb +77 -16
- data/spec/lib/video_info/providers/wistia_spec.rb +26 -8
- data/spec/lib/video_info/providers/youtube_playlist_spec.rb +186 -176
- data/spec/lib/video_info/providers/youtube_scraper_spec.rb +14 -0
- data/spec/lib/video_info/providers/youtube_spec.rb +71 -29
- data/spec/lib/video_info_spec.rb +0 -4
- data/spec/spec_helper.rb +6 -1
- data/tmp/rspec_guard_result +25 -0
- data/video_info.gemspec +8 -8
- metadata +143 -222
- data/.travis.yml +0 -14
- data/lib/video_info/providers/vkontakte.rb +0 -194
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_medium/1_3_14_1.yml +0 -95
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_small/1_3_13_1.yml +0 -95
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author/1_3_17_1.yml +0 -1530
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author/2_3_17_1.yml +0 -68
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_thumbnail/1_3_16_1.yml +0 -1530
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_thumbnail/2_3_16_1.yml +0 -68
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_url/1_3_18_1.yml +0 -1529
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_url/2_3_18_1.yml +0 -68
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_view_count/1_3_19_1.yml +0 -1530
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_view_count/2_3_19_1.yml +0 -68
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author/1_3_17_1.yml +0 -2559
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author/2_3_17_1.yml +0 -159
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_thumbnail/1_3_16_1.yml +0 -2559
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_thumbnail/2_3_16_1.yml +0 -159
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_url/1_3_18_1.yml +0 -2559
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_url/2_3_18_1.yml +0 -159
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_date/should_have_correct_upload_date.yml +0 -2714
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_description/1_3_7_1.yml +0 -2692
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_description/2_3_7_1.yml +0 -159
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_duration/1_3_9_1.yml +0 -2829
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_duration/2_3_9_1.yml +0 -159
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_height/1_3_11_1.yml +0 -2828
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_height/2_3_11_1.yml +0 -159
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_keywords/should_return_a_string_list_of_keywords.yml +0 -2716
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_large/1_3_15_1.yml +0 -2560
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_large/2_3_15_1.yml +0 -159
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_medium/1_3_14_1.yml +0 -2558
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_medium/2_3_14_1.yml +0 -159
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_small/1_3_13_1.yml +0 -2558
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_small/2_3_13_1.yml +0 -159
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_title/1_3_6_1.yml +0 -2961
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_title/2_3_6_1.yml +0 -159
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_view_count/1_3_19_1.yml +0 -2560
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_view_count/2_3_19_1.yml +0 -159
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_width/1_3_10_1.yml +0 -2560
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_width/2_3_10_1.yml +0 -159
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_hashes/available_/1_2_6_1_1.yml +0 -2996
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_invalid_video/available_/1_2_2_1_1.yml +0 -46
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_private_video/available_/1_2_3_1_1.yml +0 -865
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_redirect/available_/1_2_4_1_1.yml +0 -666
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_redirect_to_main_page_for_auth/available_/1_2_5_1_1.yml +0 -46
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_valid_video/available_/1_2_1_1_1.yml +0 -2118
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/author/1_5_14_1.yml +0 -518
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/author_thumbnail/1_5_15_1.yml +0 -519
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/author_url/1_5_16_1.yml +0 -520
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/description/1_5_8_1.yml +0 -518
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/duration/1_5_10_1.yml +0 -517
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/embed_code/1_5_6_1.yml +0 -517
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/embed_url/1_5_5_1.yml +0 -519
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/height/1_5_12_1.yml +0 -517
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/title/1_5_7_1.yml +0 -517
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/view_count/1_5_13_1.yml +0 -521
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/width/1_5_11_1.yml +0 -517
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_https_/vk_com/id44052340_z_video61291456_159590018_2F2521d92730a272a9ea/author/1_3_7_1.yml +0 -399
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_https_/vk_com/id44052340_z_video61291456_159590018_2F2521d92730a272a9ea/embed_code/1_3_6_1.yml +0 -399
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_https_/vk_com/id44052340_z_video61291456_159590018_2F2521d92730a272a9ea/embed_url/1_3_5_1.yml +0 -399
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_https_/vk_com/id44052340_z_video61291456_159590018_2F2521d92730a272a9ea/title/1_3_4_1.yml +0 -399
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video-54799401_165822734/title/1_7_4_1.yml +0 -682
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video3552522_171340713/embed_url/1_10_1_1.yml +0 -501
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/description/1_6_8_1.yml +0 -449
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/duration/1_6_10_1.yml +0 -449
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_code/1_6_6_1.yml +0 -449
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_url/1_6_5_1.yml +0 -449
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/height/1_6_12_1.yml +0 -449
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/title/1_6_7_1.yml +0 -449
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/view_count/1_6_13_1.yml +0 -449
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/width/1_6_11_1.yml +0 -449
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author/1_4_5_1.yml +0 -527
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author_thumbnail/1_4_6_1.yml +0 -527
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author_url/1_4_7_1.yml +0 -527
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/title/1_4_4_1.yml +0 -527
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/1_2_2_15_1.yml +0 -516
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/2_2_2_15_1.yml +0 -56
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_view_count/1_17_16_1.yml +0 -3948
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_view_count/2_17_16_1.yml +0 -127
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/1_3_19_1.yml +0 -3950
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/2_3_19_1.yml +0 -127
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/_available_/2_2_2_1_1.yml +0 -62
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_list_url/_available_/2_2_3_1_1.yml +0 -96
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/_available_/2_2_1_1_1.yml +0 -96
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author/1_3_18_1.yml +0 -107
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author/2_3_18_1.yml +0 -107
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_thumbnail/1_3_19_1.yml +0 -193
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_thumbnail/2_3_19_1.yml +0 -193
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_url/1_3_20_1.yml +0 -193
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_url/2_3_20_1.yml +0 -193
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_description/2_3_7_1.yml +0 -107
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_keywords/2_3_8_1.yml +0 -107
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large/2_3_15_1.yml +0 -107
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_medium/2_3_14_1.yml +0 -107
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_small/2_3_13_1.yml +0 -107
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_title/2_3_6_1.yml +0 -107
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_that_does_not_exist_in_embed_path/_videos/2_4_2_1.yml +0 -56
- data/spec/lib/video_info/providers/vkontakte_spec.rb +0 -242
@@ -1,230 +1,240 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
describe VideoInfo::Providers::YoutubePlaylist, :vcr do
|
4
|
+
before(:each) do
|
5
|
+
api_key = ENV["YOUTUBE_API_KEY"] || "youtube_api_key_123"
|
6
|
+
VideoInfo.provider_api_keys = { youtube: api_key }
|
7
|
+
end
|
8
|
+
|
9
|
+
describe '.usable?' do
|
10
|
+
subject { VideoInfo::Providers::YoutubePlaylist.usable?(url) }
|
11
|
+
|
12
|
+
context 'with youtube.com/playlist?p= url' do
|
13
|
+
let(:url) { 'http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF' }
|
14
|
+
it { is_expected.to be_truthy }
|
8
15
|
end
|
9
16
|
|
10
|
-
|
11
|
-
|
17
|
+
context 'with youtube.com/playlist?list= url' do
|
18
|
+
let(:url) { 'http://www.youtube.com/playlist?list=PLA575C81A1FBC04CF' }
|
19
|
+
it { is_expected.to be_truthy }
|
20
|
+
end
|
12
21
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
22
|
+
context 'with youtube.com url' do
|
23
|
+
let(:url) { 'http://www.youtube.com/watch?v=Xp6CXF' }
|
24
|
+
it { is_expected.to be_falsey }
|
25
|
+
end
|
26
|
+
|
27
|
+
context 'with other url' do
|
28
|
+
let(:url) { 'http://example.com/video1' }
|
29
|
+
it { is_expected.to be_falsey }
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe '#available?' do
|
34
|
+
context 'with valid playlist' do
|
35
|
+
playlist_url = 'http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF'
|
36
|
+
subject { VideoInfo.new(playlist_url.freeze) }
|
17
37
|
|
18
|
-
|
19
|
-
|
38
|
+
describe '#available?' do
|
39
|
+
subject { super().available? }
|
20
40
|
it { is_expected.to be_truthy }
|
21
41
|
end
|
42
|
+
end
|
22
43
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
44
|
+
context 'with invalid playlist' do
|
45
|
+
invalid_playlist_url = 'http://www.youtube.com/playlist?' \
|
46
|
+
'p=PLA575C81A1FBC04CF_invalid'
|
47
|
+
subject { VideoInfo.new(invalid_playlist_url) }
|
27
48
|
|
28
|
-
|
29
|
-
|
49
|
+
describe '#available?' do
|
50
|
+
subject { super().available? }
|
30
51
|
it { is_expected.to be_falsey }
|
31
52
|
end
|
32
53
|
end
|
33
54
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
subject { VideoInfo.new(playlist_url) }
|
55
|
+
context 'with &list= url' do
|
56
|
+
playlist_url = 'http://www.youtube.com/playlist?list=PLA575C81A1FBC04CF'
|
57
|
+
subject { VideoInfo.new(playlist_url) }
|
38
58
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
end
|
59
|
+
describe '#available?' do
|
60
|
+
subject { super().available? }
|
61
|
+
it { is_expected.to be_truthy }
|
43
62
|
end
|
63
|
+
end
|
64
|
+
end
|
44
65
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
66
|
+
context 'with playlist PL9hW1uS6HUftLdHI6RIsaf' do
|
67
|
+
let(:video_ids) do
|
68
|
+
[
|
69
|
+
"9g2U12SsRns", "AsqTAkLKb4M", "K681ILSXyUY", "OQVHWsTHcoc", "QtwplSG6VvM", "WK8qRNSmhEU", "XIoGq39abMk", "eKkv1C_O-QI", "lau14lhZpoU", "HvplY9BPKG8", "mTdNi9Mqiu8", "qAVwpBZ1HYA"
|
70
|
+
]
|
71
|
+
end
|
49
72
|
|
50
|
-
|
51
|
-
|
52
|
-
it { is_expected.to be_falsey }
|
53
|
-
end
|
54
|
-
end
|
73
|
+
playlist_url = 'http://www.youtube.com/playlist?' \
|
74
|
+
'p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
|
55
75
|
|
56
|
-
|
57
|
-
playlist_url = 'http://www.youtube.com/playlist?list=PLA575C81A1FBC04CF'
|
58
|
-
subject { VideoInfo.new(playlist_url) }
|
76
|
+
subject { VideoInfo.new(playlist_url) }
|
59
77
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
end
|
64
|
-
end
|
78
|
+
describe '#provider' do
|
79
|
+
subject { super().provider }
|
80
|
+
it { is_expected.to eq 'YouTube' }
|
65
81
|
end
|
66
82
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
VideoInfo.new('http://www.youtube.com/watch?v=_Bt3-WsHfB0'),
|
72
|
-
VideoInfo.new('http://www.youtube.com/watch?v=9g2U12SsRns'),
|
73
|
-
VideoInfo.new('http://www.youtube.com/watch?v=8b0aEoxqqC0'),
|
74
|
-
VideoInfo.new('http://www.youtube.com/watch?v=6c3mHikRz0I'),
|
75
|
-
VideoInfo.new('http://www.youtube.com/watch?v=OQVHWsTHcoc')
|
76
|
-
]
|
77
|
-
end
|
78
|
-
|
79
|
-
playlist_url = 'http://www.youtube.com/playlist?' \
|
80
|
-
'p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
|
83
|
+
describe '#playlist_id' do
|
84
|
+
subject { super().playlist_id }
|
85
|
+
it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
|
86
|
+
end
|
81
87
|
|
82
|
-
|
88
|
+
describe '#url' do
|
89
|
+
subject { super().url }
|
90
|
+
it { is_expected.to eq playlist_url }
|
91
|
+
end
|
83
92
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
93
|
+
describe '#embed_url' do
|
94
|
+
subject { super().embed_url }
|
95
|
+
embed_url = '//www.youtube.com/embed/videoseries' \
|
96
|
+
'?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
|
97
|
+
it { is_expected.to eq embed_url }
|
98
|
+
end
|
88
99
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
100
|
+
describe '#embed_code' do
|
101
|
+
subject { super().embed_code }
|
102
|
+
embed_code = '<iframe src="//www.youtube.com/embed/videoseries' \
|
103
|
+
'?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr" ' \
|
104
|
+
'frameborder="0" allowfullscreen="allowfullscreen">' \
|
105
|
+
'</iframe>'
|
106
|
+
it { is_expected.to eq embed_code }
|
107
|
+
end
|
93
108
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
109
|
+
describe '#title' do
|
110
|
+
subject { super().title }
|
111
|
+
it { is_expected.to eq 'YouTube Policy and Copyright' }
|
112
|
+
end
|
98
113
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
114
|
+
describe '#description' do
|
115
|
+
subject { super().description }
|
116
|
+
description_text = 'Learn more about copyright basics, flagging, ' \
|
117
|
+
'and the YouTube community.'
|
118
|
+
it { is_expected.to eq description_text }
|
119
|
+
end
|
105
120
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
'frameborder="0" allowfullscreen="allowfullscreen">' \
|
111
|
-
'</iframe>'
|
112
|
-
it { is_expected.to eq embed_code }
|
113
|
-
end
|
121
|
+
describe '#keywords' do
|
122
|
+
subject { super().keywords }
|
123
|
+
it { is_expected.to be_nil }
|
124
|
+
end
|
114
125
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
126
|
+
describe '#duration' do
|
127
|
+
subject { super().duration }
|
128
|
+
it { is_expected.to be_nil }
|
129
|
+
end
|
119
130
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
it { is_expected.to eq description_text }
|
125
|
-
end
|
131
|
+
describe '#width' do
|
132
|
+
subject { super().width }
|
133
|
+
it { is_expected.to be_nil }
|
134
|
+
end
|
126
135
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
136
|
+
describe '#height' do
|
137
|
+
subject { super().height }
|
138
|
+
it { is_expected.to be_nil }
|
139
|
+
end
|
131
140
|
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
141
|
+
describe '#date' do
|
142
|
+
subject { super().date }
|
143
|
+
it { is_expected.to be_nil }
|
144
|
+
end
|
136
145
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
146
|
+
describe '#thumbnail_small' do
|
147
|
+
subject { super().thumbnail_small }
|
148
|
+
thumbnail_url = 'https://i.ytimg.com/vi/9g2U12SsRns/default.jpg'
|
149
|
+
it { is_expected.to eq thumbnail_url }
|
150
|
+
end
|
141
151
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
152
|
+
describe '#thumbnail_medium' do
|
153
|
+
subject { super().thumbnail_medium }
|
154
|
+
thumbnail_url = 'https://i.ytimg.com/vi/9g2U12SsRns/mqdefault.jpg'
|
155
|
+
it { is_expected.to eq thumbnail_url }
|
156
|
+
end
|
146
157
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
158
|
+
describe '#thumbnail_large' do
|
159
|
+
subject { super().thumbnail_large }
|
160
|
+
thumbnail_url = 'https://i.ytimg.com/vi/9g2U12SsRns/hqdefault.jpg'
|
161
|
+
it { is_expected.to eq thumbnail_url }
|
162
|
+
end
|
151
163
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
164
|
+
describe '#thumbnail_large_2x' do
|
165
|
+
subject { super().thumbnail_large_2x }
|
166
|
+
thumbnail_url = 'https://i.ytimg.com/vi/9g2U12SsRns/sddefault.jpg'
|
167
|
+
it { is_expected.to eq thumbnail_url }
|
168
|
+
end
|
157
169
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
170
|
+
describe '#thumbnail_maxres' do
|
171
|
+
subject { super().thumbnail_maxres }
|
172
|
+
thumbnail_url = 'https://i.ytimg.com/vi/9g2U12SsRns/maxresdefault.jpg'
|
173
|
+
it { is_expected.to eq thumbnail_url }
|
174
|
+
end
|
163
175
|
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
176
|
+
describe '#thumbnail' do
|
177
|
+
subject { super().thumbnail }
|
178
|
+
thumbnail_url = 'https://i.ytimg.com/vi/9g2U12SsRns/default.jpg'
|
179
|
+
it { is_expected.to eq thumbnail_url }
|
180
|
+
end
|
169
181
|
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
is_expected.to match_array(videos)
|
175
|
-
end
|
182
|
+
describe '#videos' do
|
183
|
+
subject { super().videos.map(&:video_id) }
|
184
|
+
it 'returns list of videos in playlist' do
|
185
|
+
is_expected.to match_array(video_ids)
|
176
186
|
end
|
187
|
+
end
|
177
188
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
189
|
+
describe '#view_count' do
|
190
|
+
subject { super().view_count }
|
191
|
+
it { is_expected.to be_nil }
|
192
|
+
end
|
182
193
|
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
194
|
+
describe '#author' do
|
195
|
+
subject { super().author }
|
196
|
+
it { is_expected.to eq 'TeamYouTube [Help]' }
|
197
|
+
end
|
187
198
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
199
|
+
describe '#author_thumbnail' do
|
200
|
+
subject { super().author_thumbnail }
|
201
|
+
author_thumbnail = 'https://yt3.ggpht.com/a/' \
|
202
|
+
'AATXAJwyEv0uEyk3JLskjLiUCqSVzsGmpWw2icLfBOBzWg' \
|
203
|
+
'=s88-c-k-c0x00ffffff-no-rj'
|
204
|
+
it { is_expected.to eq author_thumbnail }
|
205
|
+
end
|
195
206
|
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
end
|
207
|
+
describe '#author_url' do
|
208
|
+
subject { super().author_url }
|
209
|
+
author_url = 'https://www.youtube.com/channel/UCMDQxm7cUx3yXkfeHa5zJIQ'
|
210
|
+
it { is_expected.to eq author_url }
|
201
211
|
end
|
212
|
+
end
|
202
213
|
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
214
|
+
context 'with playlist that does not exist in embed path' do
|
215
|
+
playlist_url = 'http://www.youtube.com/embed/videoseries?' \
|
216
|
+
'list=PL0E8117603D70E10A'
|
217
|
+
subject { VideoInfo.new(playlist_url) }
|
207
218
|
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
219
|
+
describe '#playlist_id' do
|
220
|
+
subject { super().playlist_id }
|
221
|
+
it { is_expected.to eq 'PL0E8117603D70E10A' }
|
222
|
+
end
|
212
223
|
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
end
|
224
|
+
describe '#videos' do
|
225
|
+
subject { super().videos }
|
226
|
+
it { is_expected.to eq [] }
|
217
227
|
end
|
228
|
+
end
|
218
229
|
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
230
|
+
context 'with playlist valid playlist in embed path' do
|
231
|
+
playlist_url = 'http://www.youtube.com/embed/videoseries' \
|
232
|
+
'?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
|
233
|
+
subject { VideoInfo.new(playlist_url) }
|
223
234
|
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
end
|
235
|
+
describe '#playlist_id' do
|
236
|
+
subject { super().playlist_id }
|
237
|
+
it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
|
228
238
|
end
|
229
239
|
end
|
230
240
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe VideoInfo::Providers::Youtube do
|
4
|
+
before { VideoInfo.provider_api_keys = {} }
|
5
|
+
|
6
|
+
context 'with a video without description', :vcr do
|
7
|
+
subject { VideoInfo.new('http://www.youtube.com/watch?v=WVsj2pS-zFY') }
|
8
|
+
|
9
|
+
describe '#description' do
|
10
|
+
subject { super().description }
|
11
|
+
it { is_expected.to eq " " }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
[nil,
|
4
|
-
describe VideoInfo::Providers::Youtube do
|
3
|
+
[nil, ENV["YOUTUBE_API_KEY"] || "youtube_api_key_123"].each do |api_key|
|
4
|
+
describe VideoInfo::Providers::Youtube, :vcr do
|
5
5
|
before(:all) do
|
6
6
|
VideoInfo.provider_api_keys = { youtube: api_key }
|
7
7
|
end
|
@@ -31,8 +31,8 @@ require 'spec_helper'
|
|
31
31
|
end
|
32
32
|
|
33
33
|
describe '#available?' do
|
34
|
-
context 'with valid video'
|
35
|
-
subject { VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4') }
|
34
|
+
context 'with valid video' do
|
35
|
+
subject { VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4'.freeze) }
|
36
36
|
|
37
37
|
describe '#available?' do
|
38
38
|
subject { super().available? }
|
@@ -40,7 +40,7 @@ require 'spec_helper'
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
context 'with unavailable video'
|
43
|
+
context 'with unavailable video' do
|
44
44
|
subject { VideoInfo.new('http://www.youtube.com/watch?v=SUkXvWn1m7Q') }
|
45
45
|
|
46
46
|
describe '#available?' do
|
@@ -119,13 +119,31 @@ require 'spec_helper'
|
|
119
119
|
it { is_expected.to eq thumbnail_url }
|
120
120
|
end
|
121
121
|
|
122
|
+
describe '#thumbnail_large_2x' do
|
123
|
+
subject { super().thumbnail_large_2x }
|
124
|
+
thumbnail_url = 'https://i.ytimg.com/vi/SUkXvWn1m7Q/sddefault.jpg'
|
125
|
+
it { is_expected.to eq thumbnail_url }
|
126
|
+
end
|
127
|
+
|
128
|
+
describe '#thumbnail_maxres' do
|
129
|
+
subject { super().thumbnail_maxres }
|
130
|
+
thumbnail_url = 'https://i.ytimg.com/vi/SUkXvWn1m7Q/maxresdefault.jpg'
|
131
|
+
it { is_expected.to eq thumbnail_url }
|
132
|
+
end
|
133
|
+
|
134
|
+
describe '#thumbnail' do
|
135
|
+
subject { super().thumbnail }
|
136
|
+
thumbnail_url = 'https://i.ytimg.com/vi/SUkXvWn1m7Q/hqdefault.jpg'
|
137
|
+
it { is_expected.to eq thumbnail_url }
|
138
|
+
end
|
139
|
+
|
122
140
|
describe '#view_count' do
|
123
141
|
subject { super().view_count }
|
124
142
|
it { is_expected.to be == 0 }
|
125
143
|
end
|
126
144
|
end
|
127
145
|
|
128
|
-
context 'with video removed because of copyright claim'
|
146
|
+
context 'with video removed because of copyright claim' do
|
129
147
|
subject { VideoInfo.new('http://www.youtube.com/watch?v=ffClNhwx0KU') }
|
130
148
|
|
131
149
|
describe '#available?' do
|
@@ -135,7 +153,7 @@ require 'spec_helper'
|
|
135
153
|
end
|
136
154
|
end
|
137
155
|
|
138
|
-
context 'with video mZqGqE0D0n4'
|
156
|
+
context 'with video mZqGqE0D0n4' do
|
139
157
|
subject { VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4') }
|
140
158
|
|
141
159
|
describe '#provider' do
|
@@ -173,16 +191,21 @@ require 'spec_helper'
|
|
173
191
|
|
174
192
|
describe '#author_thumbnail' do
|
175
193
|
subject { super().author_thumbnail }
|
176
|
-
author_thumbnail = 'https://yt3.ggpht.com
|
177
|
-
'
|
178
|
-
'
|
194
|
+
author_thumbnail = 'https://yt3.ggpht.com/a/' \
|
195
|
+
'AATXAJyf5l8p3WQvOx-Q0o8ssGmIL-K5taxKHv5ZEEYc' \
|
196
|
+
'=s88-c-k-c0x00ffffff-no-rj'
|
197
|
+
|
179
198
|
it { is_expected.to eql author_thumbnail }
|
180
199
|
end
|
181
200
|
|
182
201
|
describe '#author_url' do
|
183
|
-
subject { super().author_url }
|
184
202
|
author_url = 'https://www.youtube.com/channel/UCzxQk-rZGowoqMBKxGD5jSA'
|
185
|
-
|
203
|
+
|
204
|
+
it { expect(subject.author_url).to eql(author_url) }
|
205
|
+
|
206
|
+
it 'can be called twice and receive the same value' do
|
207
|
+
expect(subject.author_url).to eq(subject.author_url)
|
208
|
+
end
|
186
209
|
end
|
187
210
|
|
188
211
|
describe '#title' do
|
@@ -227,7 +250,7 @@ require 'spec_helper'
|
|
227
250
|
if api_key.nil?
|
228
251
|
is_expected.to eq Time.parse('Sat Apr 12 2008', Time.now.utc)
|
229
252
|
else
|
230
|
-
is_expected.to eq Time.parse('Sat Apr 12 22:
|
253
|
+
is_expected.to eq Time.parse('Sat Apr 12 22:34:48 UTC 2008',
|
231
254
|
Time.now.utc)
|
232
255
|
end
|
233
256
|
end
|
@@ -251,13 +274,25 @@ require 'spec_helper'
|
|
251
274
|
it { is_expected.to eq thumbnail_url }
|
252
275
|
end
|
253
276
|
|
277
|
+
describe '#thumbnail_large_2x' do
|
278
|
+
subject { super().thumbnail_large_2x }
|
279
|
+
thumbnail_url = 'https://i.ytimg.com/vi/mZqGqE0D0n4/sddefault.jpg'
|
280
|
+
it { is_expected.to eq thumbnail_url }
|
281
|
+
end
|
282
|
+
|
283
|
+
describe '#thumbnail_maxres' do
|
284
|
+
subject { super().thumbnail_maxres }
|
285
|
+
thumbnail_url = 'https://i.ytimg.com/vi/mZqGqE0D0n4/maxresdefault.jpg'
|
286
|
+
it { is_expected.to eq thumbnail_url }
|
287
|
+
end
|
288
|
+
|
254
289
|
describe '#view_count' do
|
255
290
|
subject { super().view_count }
|
256
291
|
it { is_expected.to be > 4000 }
|
257
292
|
end
|
258
293
|
end
|
259
294
|
|
260
|
-
context 'with video oQ49W_xKzKA'
|
295
|
+
context 'with video oQ49W_xKzKA' do
|
261
296
|
subject { VideoInfo.new('http://www.youtube.com/watch?v=oQ49W_xKzKA') }
|
262
297
|
|
263
298
|
it 'should properly apply arbitrary url attributes' do
|
@@ -266,7 +301,7 @@ require 'spec_helper'
|
|
266
301
|
end
|
267
302
|
end
|
268
303
|
|
269
|
-
context 'with video oQ49W_xKzKA'
|
304
|
+
context 'with video oQ49W_xKzKA' do
|
270
305
|
subject { VideoInfo.new('http://www.youtube.com/watch?v=oQ49W_xKzKA') }
|
271
306
|
|
272
307
|
describe '#provider' do
|
@@ -280,7 +315,7 @@ require 'spec_helper'
|
|
280
315
|
end
|
281
316
|
end
|
282
317
|
|
283
|
-
context 'with video Xp6CXF-Cesg'
|
318
|
+
context 'with video Xp6CXF-Cesg' do
|
284
319
|
subject { VideoInfo.new('http://www.youtube.com/watch?v=Xp6CXF-Cesg') }
|
285
320
|
|
286
321
|
describe '#provider' do
|
@@ -294,7 +329,7 @@ require 'spec_helper'
|
|
294
329
|
end
|
295
330
|
end
|
296
331
|
|
297
|
-
context 'with video VeasFckfMHY in user url'
|
332
|
+
context 'with video VeasFckfMHY in user url' do
|
298
333
|
video_url = 'http://www.youtube.com/user/EducatorVids3?v=VeasFckfMHY'
|
299
334
|
subject { VideoInfo.new(video_url) }
|
300
335
|
|
@@ -314,7 +349,7 @@ require 'spec_helper'
|
|
314
349
|
end
|
315
350
|
end
|
316
351
|
|
317
|
-
context 'with video VeasFckfMHY after params'
|
352
|
+
context 'with video VeasFckfMHY after params' do
|
318
353
|
video_url = 'http://www.youtube.com/watch?feature=player_profilepage&v=VeasFckfMHY'
|
319
354
|
subject { VideoInfo.new(video_url) }
|
320
355
|
|
@@ -334,7 +369,7 @@ require 'spec_helper'
|
|
334
369
|
end
|
335
370
|
end
|
336
371
|
|
337
|
-
context 'with video VeasFckfMHY in path'
|
372
|
+
context 'with video VeasFckfMHY in path' do
|
338
373
|
subject { VideoInfo.new('http://www.youtube.com/v/VeasFckfMHY') }
|
339
374
|
|
340
375
|
describe '#provider' do
|
@@ -348,7 +383,7 @@ require 'spec_helper'
|
|
348
383
|
end
|
349
384
|
end
|
350
385
|
|
351
|
-
context 'with video VeasFckfMHY in e path'
|
386
|
+
context 'with video VeasFckfMHY in e path' do
|
352
387
|
subject { VideoInfo.new('http://www.youtube.com/e/VeasFckfMHY') }
|
353
388
|
|
354
389
|
describe '#provider' do
|
@@ -362,7 +397,7 @@ require 'spec_helper'
|
|
362
397
|
end
|
363
398
|
end
|
364
399
|
|
365
|
-
context 'with video VeasFckfMHY in embed path'
|
400
|
+
context 'with video VeasFckfMHY in embed path' do
|
366
401
|
subject { VideoInfo.new('http://www.youtube.com/embed/VeasFckfMHY') }
|
367
402
|
|
368
403
|
describe '#provider' do
|
@@ -376,7 +411,7 @@ require 'spec_helper'
|
|
376
411
|
end
|
377
412
|
end
|
378
413
|
|
379
|
-
context 'with video JM9NgvjjVng in youtu.be url'
|
414
|
+
context 'with video JM9NgvjjVng in youtu.be url' do
|
380
415
|
subject { VideoInfo.new('http://youtu.be/JM9NgvjjVng') }
|
381
416
|
|
382
417
|
describe '#provider' do
|
@@ -390,7 +425,7 @@ require 'spec_helper'
|
|
390
425
|
end
|
391
426
|
end
|
392
427
|
|
393
|
-
context 'without http or www'
|
428
|
+
context 'without http or www' do
|
394
429
|
subject { VideoInfo.new('youtu.be/JM9NgvjjVng') }
|
395
430
|
|
396
431
|
describe '#provider' do
|
@@ -404,7 +439,7 @@ require 'spec_helper'
|
|
404
439
|
end
|
405
440
|
end
|
406
441
|
|
407
|
-
context 'with video url in text'
|
442
|
+
context 'with video url in text' do
|
408
443
|
url_in_text = '<a href="http://www.youtube.com/watch?v=mZqGqE0D0n4">' \
|
409
444
|
'http://www.youtube.com/watch?v=mZqGqE0D0n4</a>'
|
410
445
|
subject { VideoInfo.new(url_in_text) }
|
@@ -420,7 +455,7 @@ require 'spec_helper'
|
|
420
455
|
end
|
421
456
|
end
|
422
457
|
|
423
|
-
context 'with iframe attributes'
|
458
|
+
context 'with iframe attributes' do
|
424
459
|
subject { VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4') }
|
425
460
|
|
426
461
|
describe '#provider' do
|
@@ -436,7 +471,7 @@ require 'spec_helper'
|
|
436
471
|
end
|
437
472
|
end
|
438
473
|
|
439
|
-
context 'with arbitrary iframe_attributes'
|
474
|
+
context 'with arbitrary iframe_attributes' do
|
440
475
|
subject { VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4') }
|
441
476
|
|
442
477
|
describe '#provider' do
|
@@ -451,7 +486,7 @@ require 'spec_helper'
|
|
451
486
|
end
|
452
487
|
end
|
453
488
|
|
454
|
-
context 'with full screen video URLs'
|
489
|
+
context 'with full screen video URLs' do
|
455
490
|
subject { VideoInfo.new('http://www.youtube.com/v/mZqGqE0D0n4') }
|
456
491
|
|
457
492
|
describe '#provider' do
|
@@ -524,7 +559,7 @@ require 'spec_helper'
|
|
524
559
|
if api_key.nil?
|
525
560
|
is_expected.to eq Time.parse('Sat Apr 12 2008', Time.now.utc)
|
526
561
|
else
|
527
|
-
is_expected.to eq Time.parse('Sat Apr 12 22:
|
562
|
+
is_expected.to eq Time.parse('Sat Apr 12 22:34:48 UTC 2008',
|
528
563
|
Time.now.utc)
|
529
564
|
end
|
530
565
|
end
|
@@ -548,9 +583,16 @@ require 'spec_helper'
|
|
548
583
|
it { is_expected.to eq thumbnail_url }
|
549
584
|
end
|
550
585
|
|
586
|
+
describe '#thumbnail_large_2x' do
|
587
|
+
subject { super().thumbnail_large_2x }
|
588
|
+
thumbnail_url = 'https://i.ytimg.com/vi/mZqGqE0D0n4/sddefault.jpg'
|
589
|
+
it { is_expected.to eq thumbnail_url }
|
590
|
+
end
|
591
|
+
|
551
592
|
describe '#view_count' do
|
552
593
|
subject { super().view_count }
|
553
|
-
|
594
|
+
|
595
|
+
it { is_expected.to eq 7962 }
|
554
596
|
end
|
555
597
|
end
|
556
598
|
end
|