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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d284395b3e33312982e53c42752ddd128eddb4209e1302efd4d80d680e9340be
|
4
|
+
data.tar.gz: 2cbe0d15902de1afd0ae88ee88f8a98a319040870c772c0e187fb6a94c99d9e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c08b7769cea3b02f17133c9f7c12ab880de56361296777d3220c7ece3b9c8285edf1eab67c36f193acc6d66d08b7e64352f70ce1ebbb0ed78e727f9ba967b1c3
|
7
|
+
data.tar.gz: ef0efee0d8a41dba4bbd4ccd980e728242603cce3d31d72362a8869ba219d327abd52422481a26974946789358c8b0e683667fecd06f0822fab23762561cf05f
|
@@ -0,0 +1,39 @@
|
|
1
|
+
name: Ruby Unit Tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
pull_request:
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
build:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
strategy:
|
13
|
+
matrix:
|
14
|
+
ruby: [ '2.5', '2.6', '2.7' ]
|
15
|
+
|
16
|
+
name: Ruby ${{ matrix.ruby }}
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v2
|
19
|
+
- uses: actions/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby }}
|
22
|
+
- name: Cache gems
|
23
|
+
uses: actions/cache@v2
|
24
|
+
env:
|
25
|
+
cache-name: cache-gems
|
26
|
+
with:
|
27
|
+
path: vendor/bundle
|
28
|
+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
29
|
+
restore-keys: |
|
30
|
+
${{ runner.os }}-gems-
|
31
|
+
- name: Set bundle config path
|
32
|
+
run: |
|
33
|
+
bundle config path vendor/bundle
|
34
|
+
- name: Install dependencies
|
35
|
+
run: |
|
36
|
+
bundle install
|
37
|
+
- name: Ruby Unit tests
|
38
|
+
run: |
|
39
|
+
bundle exec rspec
|
data/Guardfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# A sample Guardfile
|
2
2
|
# More info at http://github.com/guard/guard#readme
|
3
3
|
|
4
|
-
guard 'rspec',
|
4
|
+
guard 'rspec', cmd: "bundle exec rspec" do
|
5
5
|
watch('spec/spec_helper.rb') { 'spec' }
|
6
6
|
watch(%r{lib/(.+)\.rb}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
7
7
|
watch(%r{spec/.+_spec\.rb})
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# VideoInfo
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/video_info.svg)](http://badge.fury.io/rb/video_info) [![Build Status](https://
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/video_info.svg)](http://badge.fury.io/rb/video_info) [![Build Status](https://github.com/thibaudgg/video_info/workflows/Ruby%20Unit%20Tests/badge.svg?branch=master)](https://github.com/thibaudgg/video_info/actions?query=workflow%3A%22Ruby+Unit+Tests%22) [![Code Climate](https://codeclimate.com/github/thibaudgg/video_info.svg)](https://codeclimate.com/github/thibaudgg/video_info) [![Coverage Status](https://coveralls.io/repos/thibaudgg/video_info/badge.svg?branch=master)](https://coveralls.io/r/thibaudgg/video_info) [![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)
|
4
4
|
|
5
|
-
Simple Ruby Gem to get video info from Dailymotion,
|
5
|
+
Simple Ruby Gem to get video info from Dailymotion, Vimeo, Wistia and YouTube (with playlist).
|
6
6
|
|
7
|
-
Tested against Ruby 2.
|
7
|
+
Tested against Ruby 2.5.x, 2.6.x and 2.7.x.
|
8
8
|
|
9
9
|
Features
|
10
10
|
--------
|
@@ -28,10 +28,12 @@ Usage
|
|
28
28
|
|
29
29
|
Youtube and Vimeo have recently updated their APIs to require API keys.
|
30
30
|
|
31
|
-
Scrapers has been implemented for both Youtube and Vimeo. However, the Youtube scraper can only get the date the video was posted, while the API is able to get the date and the exact time the video was posted. You may also wish to use the API to protect against potential HTML changes that could break the
|
31
|
+
Scrapers has been implemented for both Youtube and Vimeo. However, the Youtube scraper can only get the date the video was posted, while the API is able to get the date and the exact time the video was posted. You may also wish to use the API to protect against potential HTML changes that could break the scrapers.
|
32
32
|
|
33
33
|
To get a Youtube API key, [follow the instructions here](https://developers.google.com/youtube/registering_an_application)
|
34
34
|
|
35
|
+
After generating a Youtube API key it is necessary to enable the YouTube Data API for the project which your API key was generated [enable Youtube Data API here](https://console.developers.google.com/apis/library/youtube.googleapis.com)
|
36
|
+
|
35
37
|
To get a Vimeo API key, [follow the instructions here](https://developer.vimeo.com/api/start)
|
36
38
|
|
37
39
|
To set the API keys, do the following:
|
@@ -89,19 +91,6 @@ video = VideoInfo.new("http://fast.wistia.com/embed/medias/pxonqr42is")
|
|
89
91
|
# video.embed_url => '//fast.wistia.net/embed/iframe/pxonqr42is'
|
90
92
|
# video.embed_code => "<iframe src='//fast.wistia.net/embed/iframe/pxonqr42is' frameborder='0'></iframe>"
|
91
93
|
|
92
|
-
video = VideoInfo.new('http://vk.com/video39576223_108370515')
|
93
|
-
# video.available? => true
|
94
|
-
# video.provider => "Vkontakte"
|
95
|
-
# video.video_id => "108370515"
|
96
|
-
# video.author => "Alexander Maslov"
|
97
|
-
# video.author_thumbnail => "https://pp.vk.me/c624521/v624521223/3c288/lVcVW7LNnrQ.jpg"
|
98
|
-
# video.author_url => "https://vk.com/videos39576223"
|
99
|
-
# video.title => "Я уточка)))))"
|
100
|
-
# video.description => "это ВЗРЫВ МОЗГА!!!<br>Просто отвал башки..."
|
101
|
-
# video.duration => 183 (in seconds)
|
102
|
-
# video.embed_url => "//vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af"
|
103
|
-
# video.embed_code => "<iframe src=\"//vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"></iframe>"
|
104
|
-
|
105
94
|
video = VideoInfo.new("http://www.youtube.com/watch?v=mZqGqE0D0n4")
|
106
95
|
# video.available? => true
|
107
96
|
# video.video_id => 'mZqGqE0D0n4'
|
@@ -161,7 +150,7 @@ You can also include an `iframe_attributes` or `url_attributes` hash to the `emb
|
|
161
150
|
VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4').embed_code(iframe_attributes: { width: 800, height: 600, 'data-key' => 'value' })
|
162
151
|
=> '<iframe src="//www.youtube.com/embed/mZqGqE0D0n4" frameborder="0" allowfullscreen="allowfullscreen" width="800" height="600" data-key="value"></iframe>'
|
163
152
|
|
164
|
-
|
153
|
+
VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4').embed_code(url_attributes: { autoplay: 1 })
|
165
154
|
=> '<iframe src="//www.youtube.com/embed/mZqGqE0D0n4?autoplay=1" frameborder="0" allowfullscreen="allowfullscreen"></iframe>'
|
166
155
|
```
|
167
156
|
|
@@ -185,9 +174,9 @@ Author
|
|
185
174
|
Maintainers
|
186
175
|
-----------
|
187
176
|
|
188
|
-
[Thibaud Guillaume-Gentil](https://github.com/thibaudgg) ([@thibaudgg](https://twitter.com/thibaudgg))
|
189
|
-
|
190
|
-
[
|
177
|
+
- [Thibaud Guillaume-Gentil](https://github.com/thibaudgg) ([@thibaudgg](https://twitter.com/thibaudgg))
|
178
|
+
- [Vincent Heuken](https://github.com/vheuken) ([@vheuken](https://github.com/vheuken))
|
179
|
+
- [João Vieira](https://github.com/joaocv3) ([@joaocv3](https://github.com/joaocv3))
|
191
180
|
|
192
181
|
Contributors
|
193
182
|
------------
|
data/lib/video_info.rb
CHANGED
@@ -10,8 +10,7 @@ class VideoInfo
|
|
10
10
|
class HttpError < Error; end
|
11
11
|
|
12
12
|
class << self
|
13
|
-
attr_writer :logger
|
14
|
-
attr_accessor :disable_providers, :provider_api_keys
|
13
|
+
attr_writer :logger, :disable_providers
|
15
14
|
|
16
15
|
def disable_providers
|
17
16
|
@disable_providers || []
|
@@ -38,7 +37,7 @@ class VideoInfo
|
|
38
37
|
extend Forwardable
|
39
38
|
|
40
39
|
PROVIDERS = %w[
|
41
|
-
Dailymotion
|
40
|
+
Dailymotion Wistia
|
42
41
|
Vimeo Youtube YoutubePlaylist
|
43
42
|
].freeze
|
44
43
|
PROVIDERS.each { |p| require "video_info/providers/#{p.downcase}" }
|
@@ -50,7 +49,9 @@ class VideoInfo
|
|
50
49
|
def_delegators :@provider,
|
51
50
|
:thumbnail_small,
|
52
51
|
:thumbnail_medium,
|
53
|
-
:thumbnail_large
|
52
|
+
:thumbnail_large,
|
53
|
+
:thumbnail_large_2x,
|
54
|
+
:thumbnail_maxres
|
54
55
|
def_delegators :@provider, :embed_code, :embed_url
|
55
56
|
def_delegators :@provider, :available?
|
56
57
|
def_delegators :@provider, :playlist_id, :videos
|
data/lib/video_info/provider.rb
CHANGED
@@ -4,7 +4,8 @@ require 'uri'
|
|
4
4
|
|
5
5
|
class VideoInfo
|
6
6
|
class Provider
|
7
|
-
attr_accessor :url, :options, :iframe_attributes, :video_id
|
7
|
+
attr_accessor :url, :options, :iframe_attributes, :video_id
|
8
|
+
attr_writer :data
|
8
9
|
|
9
10
|
def initialize(url, options = {})
|
10
11
|
@options = _clean_options(options)
|
@@ -36,6 +37,20 @@ class VideoInfo
|
|
36
37
|
!%w[403 404 400].include?(_response_code)
|
37
38
|
end
|
38
39
|
|
40
|
+
def thumbnail
|
41
|
+
if defined?(thumbnail_large)
|
42
|
+
thumbnail_large
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def thumbnail_large_2x
|
47
|
+
nil
|
48
|
+
end
|
49
|
+
|
50
|
+
def thumbnail_maxres
|
51
|
+
nil
|
52
|
+
end
|
53
|
+
|
39
54
|
private
|
40
55
|
|
41
56
|
def _response_code
|
@@ -95,7 +110,7 @@ class VideoInfo
|
|
95
110
|
end
|
96
111
|
|
97
112
|
def _set_data_from_api_impl(api_url)
|
98
|
-
uri = open(api_url, options)
|
113
|
+
uri = URI.open(api_url, options)
|
99
114
|
JSON.load(uri.read)
|
100
115
|
end
|
101
116
|
|
@@ -17,6 +17,18 @@ class VideoInfo
|
|
17
17
|
define_method(method) { nil }
|
18
18
|
end
|
19
19
|
|
20
|
+
def author
|
21
|
+
data['owner.screenname']
|
22
|
+
end
|
23
|
+
|
24
|
+
def author_url
|
25
|
+
data['owner.url']
|
26
|
+
end
|
27
|
+
|
28
|
+
def author_thumbnail
|
29
|
+
data['owner.avatar_60_url']
|
30
|
+
end
|
31
|
+
|
20
32
|
def keywords
|
21
33
|
data['tags']
|
22
34
|
end
|
@@ -71,6 +83,7 @@ class VideoInfo
|
|
71
83
|
"https://#{_api_base}#{_api_path}?" \
|
72
84
|
'fields=id,title,description,duration,created_time,' \
|
73
85
|
'url,views_total,tags,thumbnail_url,thumbnail_720_url,' \
|
86
|
+
'owner.url,owner.screenname,owner.avatar_60_url,' \
|
74
87
|
'thumbnail_240_url,thumbnail_60_url'
|
75
88
|
end
|
76
89
|
|
@@ -39,25 +39,16 @@ class VideoInfo
|
|
39
39
|
@thumbnail_id ||= _parse_picture_id(_video['pictures']['uri'])
|
40
40
|
end
|
41
41
|
|
42
|
-
def thumbnail(width = 200, height = nil)
|
43
|
-
base_uri = "https://i.vimeocdn.com/video/#{thumbnail_id}"
|
44
|
-
if height
|
45
|
-
base_uri + "_#{width}x#{height}.jpg"
|
46
|
-
else
|
47
|
-
base_uri + "_#{width}.jpg"
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
42
|
def thumbnail_small
|
52
|
-
|
43
|
+
generate_thumbnail(100, 75)
|
53
44
|
end
|
54
45
|
|
55
46
|
def thumbnail_medium
|
56
|
-
|
47
|
+
generate_thumbnail(200, 150)
|
57
48
|
end
|
58
49
|
|
59
50
|
def thumbnail_large
|
60
|
-
|
51
|
+
generate_thumbnail(640)
|
61
52
|
end
|
62
53
|
|
63
54
|
def keywords
|
@@ -78,6 +69,15 @@ class VideoInfo
|
|
78
69
|
|
79
70
|
private
|
80
71
|
|
72
|
+
def generate_thumbnail(width = 200, height = nil)
|
73
|
+
base_uri = "https://i.vimeocdn.com/video/#{thumbnail_id}"
|
74
|
+
if height
|
75
|
+
base_uri + "_#{width}x#{height}.jpg"
|
76
|
+
else
|
77
|
+
base_uri + "_#{width}.jpg"
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
81
|
def _clean_options(options)
|
82
82
|
headers = [super, _authorization_headers, _api_version_headers]
|
83
83
|
headers.inject(&:merge)
|
@@ -1,15 +1,23 @@
|
|
1
1
|
require 'oga'
|
2
2
|
require 'open-uri'
|
3
3
|
require 'json'
|
4
|
+
require 'openssl'
|
5
|
+
require 'cgi'
|
4
6
|
|
5
7
|
class VideoInfo
|
6
8
|
module Providers
|
7
9
|
module VimeoScraper
|
8
10
|
def author
|
9
|
-
|
11
|
+
if available?
|
12
|
+
json_info['author']['name']
|
13
|
+
end
|
10
14
|
end
|
11
15
|
|
12
16
|
def author_thumbnail
|
17
|
+
unless available?
|
18
|
+
return nil
|
19
|
+
end
|
20
|
+
|
13
21
|
split_point = 'window.vimeo.clip_page_config ='
|
14
22
|
script_tags = data.css('script')
|
15
23
|
|
@@ -27,7 +35,9 @@ class VideoInfo
|
|
27
35
|
end
|
28
36
|
|
29
37
|
def author_url
|
30
|
-
|
38
|
+
if available?
|
39
|
+
json_info['author']['url']
|
40
|
+
end
|
31
41
|
end
|
32
42
|
|
33
43
|
def available?
|
@@ -36,9 +46,9 @@ class VideoInfo
|
|
36
46
|
if data.nil?
|
37
47
|
is_available = false
|
38
48
|
elsif is_available
|
39
|
-
|
49
|
+
password_elements = data.css('.exception_title--password')
|
40
50
|
|
41
|
-
|
51
|
+
unless password_elements.empty?
|
42
52
|
is_available = false
|
43
53
|
end
|
44
54
|
end
|
@@ -55,16 +65,24 @@ class VideoInfo
|
|
55
65
|
end
|
56
66
|
|
57
67
|
def date
|
58
|
-
|
59
|
-
|
68
|
+
if available?
|
69
|
+
upload_date = json_info['uploadDate']
|
70
|
+
ISO8601::DateTime.new(upload_date).to_time
|
71
|
+
end
|
60
72
|
end
|
61
73
|
|
62
74
|
def duration
|
63
|
-
|
64
|
-
|
75
|
+
if available?
|
76
|
+
duration = json_info['duration']
|
77
|
+
ISO8601::Duration.new(duration).to_seconds.to_i
|
78
|
+
end
|
65
79
|
end
|
66
80
|
|
67
81
|
def keywords
|
82
|
+
unless available?
|
83
|
+
return nil
|
84
|
+
end
|
85
|
+
|
68
86
|
if json_info['keywords']
|
69
87
|
json_info['keywords']
|
70
88
|
else
|
@@ -73,31 +91,53 @@ class VideoInfo
|
|
73
91
|
end
|
74
92
|
|
75
93
|
def height
|
76
|
-
|
94
|
+
if available?
|
95
|
+
json_info['height']
|
96
|
+
end
|
77
97
|
end
|
78
98
|
|
79
99
|
def width
|
80
|
-
|
100
|
+
if available?
|
101
|
+
json_info['width']
|
102
|
+
end
|
81
103
|
end
|
82
104
|
|
83
105
|
def thumbnail_small
|
84
|
-
|
106
|
+
if available?
|
107
|
+
thumbnail_url.split('_')[0] + '_100x75.jpg'
|
108
|
+
end
|
85
109
|
end
|
86
110
|
|
87
111
|
def thumbnail_medium
|
88
|
-
|
112
|
+
if available?
|
113
|
+
thumbnail_url.split('_')[0] + '_200x150.jpg'
|
114
|
+
end
|
89
115
|
end
|
90
116
|
|
91
117
|
def thumbnail_large
|
92
|
-
|
118
|
+
if available?
|
119
|
+
thumbnail_url.split('_')[0] + '_640.jpg'
|
120
|
+
end
|
93
121
|
end
|
94
122
|
|
95
123
|
def view_count
|
96
|
-
|
124
|
+
if available?
|
125
|
+
user_interaction_count(interaction_type: "http://schema.org/WatchAction")
|
126
|
+
end
|
97
127
|
end
|
98
128
|
|
99
129
|
private
|
100
130
|
|
131
|
+
def user_interaction_count(interaction_type:)
|
132
|
+
interaction_statistic.find do |stat|
|
133
|
+
stat["interactionType"] == interaction_type
|
134
|
+
end["userInteractionCount"]
|
135
|
+
end
|
136
|
+
|
137
|
+
def interaction_statistic
|
138
|
+
json_info["interactionStatistic"]
|
139
|
+
end
|
140
|
+
|
101
141
|
def json_info
|
102
142
|
@json_info ||= JSON.parse(data.css('script').detect do |n|
|
103
143
|
type = n.attr('type')
|
@@ -111,7 +151,17 @@ class VideoInfo
|
|
111
151
|
end
|
112
152
|
|
113
153
|
def thumbnail_url
|
114
|
-
@thumbnail_url ||=
|
154
|
+
@thumbnail_url ||= remove_overlay(meta_node_value('og:image'))
|
155
|
+
end
|
156
|
+
|
157
|
+
def remove_overlay(url)
|
158
|
+
uri = URI.parse(url)
|
159
|
+
|
160
|
+
if uri.path == '/filter/overlay'
|
161
|
+
CGI::parse(uri.query)['src0'][0]
|
162
|
+
else
|
163
|
+
url
|
164
|
+
end
|
115
165
|
end
|
116
166
|
|
117
167
|
def meta_nodes
|
@@ -135,7 +185,7 @@ class VideoInfo
|
|
135
185
|
end
|
136
186
|
|
137
187
|
def _set_data_from_api_impl(api_url)
|
138
|
-
Oga.parse_html(open(api_url.to_s).read)
|
188
|
+
Oga.parse_html(URI.open(api_url.to_s).read)
|
139
189
|
|
140
190
|
rescue OpenURI::HTTPError
|
141
191
|
nil
|
@@ -44,6 +44,14 @@ class VideoInfo
|
|
44
44
|
"https://i.ytimg.com/vi/#{video_id}/hqdefault.jpg"
|
45
45
|
end
|
46
46
|
|
47
|
+
def thumbnail_large_2x
|
48
|
+
"https://i.ytimg.com/vi/#{video_id}/sddefault.jpg"
|
49
|
+
end
|
50
|
+
|
51
|
+
def thumbnail_maxres
|
52
|
+
"https://i.ytimg.com/vi/#{video_id}/maxresdefault.jpg"
|
53
|
+
end
|
54
|
+
|
47
55
|
private
|
48
56
|
|
49
57
|
def _url_regex
|
@@ -58,6 +66,10 @@ class VideoInfo
|
|
58
66
|
def _default_url_attributes
|
59
67
|
{}
|
60
68
|
end
|
69
|
+
|
70
|
+
def resize_thumb(url, size)
|
71
|
+
url.gsub(/(https:\/\/yt3.ggpht.com\/.*\/.*=s)([0-9]*)(.*)/, "\\1#{size}\\3")
|
72
|
+
end
|
61
73
|
end
|
62
74
|
end
|
63
75
|
end
|