video_info 2.7.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/unit_test.yml +42 -0
- data/Guardfile +1 -1
- data/README.md +8 -19
- data/lib/video_info/provider.rb +11 -2
- data/lib/video_info/providers/vimeo_api.rb +9 -3
- data/lib/video_info/providers/vimeo_scraper.rb +12 -2
- data/lib/video_info/providers/youtube.rb +8 -0
- data/lib/video_info/providers/youtube_api.rb +1 -2
- data/lib/video_info/providers/youtube_scraper.rb +43 -25
- data/lib/video_info/providers/youtubeplaylist_api.rb +15 -1
- data/lib/video_info/version.rb +1 -1
- data/lib/video_info.rb +3 -3
- data/tmp/rspec_guard_result +25 -0
- data/video_info.gemspec +5 -6
- metadata +16 -472
- data/.travis.yml +0 -21
- data/lib/video_info/providers/vkontakte.rb +0 -212
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_invalid_video_url/_available_/1_2_2_1_1.yml +0 -93
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_valid_video/_available_/1_2_1_1_1.yml +0 -96
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_author/1_3_7_1.yml +0 -100
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_author_thumbnail/1_3_9_1.yml +0 -100
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_author_url/1_3_8_1.yml +0 -100
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_date/should_show_correct_date.yml +0 -100
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_description/1_3_10_1.yml +0 -100
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_duration/1_3_12_1.yml +0 -100
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_keywords/1_3_11_1.yml +0 -100
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail/1_3_19_1.yml +0 -100
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_large/1_3_18_1.yml +0 -100
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_medium/1_3_17_1.yml +0 -100
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_small/1_3_16_1.yml +0 -100
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_title/1_3_6_1.yml +0 -100
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_view_count/1_3_20_1.yml +0 -100
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/_available_/1_2_3_1_1.yml +0 -150
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/_available_/2_2_3_1_1.yml +0 -65
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/_available_/1_2_2_1_1.yml +0 -124
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/_available_/2_2_2_1_1.yml +0 -67
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/_available_/1_2_1_1_1.yml +0 -150
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/_available_/2_2_1_1_1.yml +0 -67
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/author/1_13_2_1.yml +0 -128
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/author_thumbnail/1_13_3_1.yml +0 -128
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/author_url/1_13_4_1.yml +0 -128
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/available_/1_13_1_1.yml +0 -128
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/date/1_13_7_1.yml +0 -128
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/description/1_13_6_1.yml +0 -128
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/duration/1_13_8_1.yml +0 -128
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/height/1_13_10_1.yml +0 -128
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/keywords/1_13_9_1.yml +0 -128
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/thumbnail_large/1_13_14_1.yml +0 -128
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/thumbnail_medium/1_13_13_1.yml +0 -128
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/thumbnail_small/1_13_12_1.yml +0 -128
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/title/1_13_5_1.yml +0 -128
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/view_count/1_13_15_1.yml +0 -128
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/width/1_13_11_1.yml +0 -128
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author/1_3_18_1.yml +0 -150
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author/2_3_18_1.yml +0 -79
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_thumbnail/1_3_17_1.yml +0 -150
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_thumbnail/2_3_17_1.yml +0 -79
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_url/1_3_19_1.yml +0 -150
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_url/2_3_19_1.yml +0 -79
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_date/should_have_correct_upload_date.yml +0 -226
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_description/1_3_7_1.yml +0 -150
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_description/2_3_7_1.yml +0 -79
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_duration/1_3_9_1.yml +0 -150
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_duration/2_3_9_1.yml +0 -79
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_height/1_3_11_1.yml +0 -150
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_height/2_3_11_1.yml +0 -79
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_keywords/should_return_a_string_list_of_keywords.yml +0 -226
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail/1_3_16_1.yml +0 -222
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail/2_3_16_1.yml +0 -79
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_large/1_3_15_1.yml +0 -222
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_large/2_3_15_1.yml +0 -79
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_medium/1_3_14_1.yml +0 -222
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_medium/2_3_14_1.yml +0 -79
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_small/1_3_13_1.yml +0 -222
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_small/2_3_13_1.yml +0 -79
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_title/1_3_6_1.yml +0 -150
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_title/2_3_6_1.yml +0 -79
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_view_count/1_3_20_1.yml +0 -150
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_view_count/2_3_20_1.yml +0 -79
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_width/1_3_10_1.yml +0 -150
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_width/2_3_10_1.yml +0 -79
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_193970014/thumbnail/1_12_1_1.yml +0 -222
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_193970014/thumbnail/2_12_1_1.yml +0 -75
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_193970014/thumbnail_large/1_12_2_1.yml +0 -222
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_193970014/thumbnail_large/2_12_2_1.yml +0 -75
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_193970014/thumbnail_medium/1_12_3_1.yml +0 -222
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_193970014/thumbnail_medium/2_12_3_1.yml +0 -75
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_193970014/thumbnail_small/1_12_4_1.yml +0 -222
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_193970014/thumbnail_small/2_12_4_1.yml +0 -75
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_hashes/available_/1_2_6_1_1.yml +0 -86
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_invalid_video/available_/1_2_2_1_1.yml +0 -50
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_private_video/available_/1_2_3_1_1.yml +0 -132
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_redirect/available_/1_2_4_1_1.yml +0 -134
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_redirect_to_main_page_for_auth/available_/1_2_5_1_1.yml +0 -85
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_valid_video/available_/1_2_1_1_1.yml +0 -87
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/author/1_5_14_1.yml +0 -48
- 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 -48
- 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 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/description/1_5_8_1.yml +0 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/duration/1_5_10_1.yml +0 -48
- 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 -48
- 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 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/height/1_5_12_1.yml +0 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/thumbnail_small/1_5_18_1.yml +0 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/title/1_5_7_1.yml +0 -48
- 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 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/width/1_5_11_1.yml +0 -50
- 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 -48
- 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 -48
- 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 -48
- 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 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video-54799401_165822734/title/1_7_4_1.yml +0 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video3552522_171340713/embed_url/1_10_1_1.yml +0 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_161598544/description/1_6_8_1.yml +0 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_161598544/duration/1_6_10_1.yml +0 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_161598544/embed_code/1_6_6_1.yml +0 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_161598544/embed_url/1_6_5_1.yml +0 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_161598544/height/1_6_12_1.yml +0 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_161598544/title/1_6_7_1.yml +0 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_161598544/view_count/1_6_13_1.yml +0 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_161598544/width/1_6_11_1.yml +0 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author/1_4_5_1.yml +0 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author_thumbnail/1_4_6_1.yml +0 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author_url/1_4_7_1.yml +0 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/title/1_4_4_1.yml +0 -48
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_invalid_video/_available_/1_2_2_1_1.yml +0 -67
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_valid_video/_available_/1_2_1_1_1.yml +0 -69
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_duration/1_4_7_1.yml +0 -77
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_height/1_4_9_1.yml +0 -77
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_large/1_4_12_1.yml +0 -77
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_medium/1_4_11_1.yml +0 -77
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_small/1_4_10_1.yml +0 -77
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_title/1_4_6_1.yml +0 -77
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_width/1_4_8_1.yml +0 -77
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_duration/1_3_7_1.yml +0 -77
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_height/1_3_9_1.yml +0 -77
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail/1_3_13_1.yml +0 -77
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_large/1_3_12_1.yml +0 -77
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_medium/1_3_11_1.yml +0 -77
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_small/1_3_10_1.yml +0 -77
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_title/1_3_6_1.yml +0 -77
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_width/1_3_8_1.yml +0 -77
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/foo/_available/1_2_2_1_1.yml +0 -1447
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/foo/_available/2_2_2_1_1.yml +0 -156
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_available_/1_2_2_1_1.yml +0 -481
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_available_/1_2_3_1_1.yml +0 -485
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_available_/2_2_2_1_1.yml +0 -54
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_available_/2_2_3_1_1.yml +0 -54
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_date/1_2_2_11_1.yml +0 -481
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_date/1_2_3_11_1.yml +0 -481
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_date/2_2_2_11_1.yml +0 -54
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_date/2_2_3_11_1.yml +0 -54
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_description/1_2_2_8_1.yml +0 -483
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_description/1_2_3_8_1.yml +0 -483
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_description/2_2_2_8_1.yml +0 -54
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_description/2_2_3_8_1.yml +0 -54
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_duration/1_2_2_10_1.yml +0 -485
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_duration/1_2_3_10_1.yml +0 -484
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_duration/2_2_2_10_1.yml +0 -54
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_duration/2_2_3_10_1.yml +0 -54
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_keywords/1_2_2_9_1.yml +0 -485
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_keywords/1_2_3_9_1.yml +0 -484
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_keywords/2_2_2_9_1.yml +0 -54
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_keywords/2_2_3_9_1.yml +0 -54
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_title/1_2_2_7_1.yml +0 -481
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_title/1_2_3_7_1.yml +0 -484
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_title/2_2_2_7_1.yml +0 -54
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_title/2_2_3_7_1.yml +0 -54
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/1_2_2_17_1.yml +0 -485
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/1_2_3_17_1.yml +0 -485
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/2_2_2_17_1.yml +0 -54
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/2_2_3_17_1.yml +0 -54
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/_available_/1_2_1_1_1.yml +0 -56
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/_available_/2_2_1_1_1.yml +0 -125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_removed_because_of_copyright_claim/_available_/1_2_3_1_1.yml +0 -483
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_removed_because_of_copyright_claim/_available_/1_2_4_1_1.yml +0 -484
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_removed_because_of_copyright_claim/_available_/2_2_3_1_1.yml +0 -54
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_removed_because_of_copyright_claim/_available_/2_2_4_1_1.yml +0 -54
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_date/should_return_date_video_was_posted.yml +0 -178
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_description/1_17_7_1.yml +0 -56
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_description/2_17_7_1.yml +0 -125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_duration/1_17_9_1.yml +0 -56
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_duration/2_17_9_1.yml +0 -125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_keywords/1_17_8_1.yml +0 -56
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_keywords/2_17_8_1.yml +0 -125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_title/1_17_6_1.yml +0 -56
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_title/2_17_6_1.yml +0 -125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_view_count/1_17_16_1.yml +0 -56
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_view_count/2_17_16_1.yml +0 -125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author/1_3_6_1.yml +0 -56
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author/2_3_6_1.yml +0 -125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_thumbnail/1_3_7_1.yml +0 -56
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_thumbnail/2_3_7_1.yml +0 -208
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_url/1_3_8_1.yml +0 -56
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_url/2_3_8_1.yml +0 -208
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_date/should_return_date_video_was_posted.yml +0 -178
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_description/1_3_10_1.yml +0 -56
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_description/2_3_10_1.yml +0 -125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_duration/1_3_12_1.yml +0 -56
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_duration/2_3_12_1.yml +0 -125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_keywords/1_3_11_1.yml +0 -56
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_keywords/2_3_11_1.yml +0 -125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_title/1_3_9_1.yml +0 -56
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_title/2_3_9_1.yml +0 -125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/1_3_20_1.yml +0 -56
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/2_3_20_1.yml +0 -125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/_available_/1_2_2_1_1.yml +0 -60
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/_available_/2_2_2_1_1.yml +0 -60
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_list_url/_available_/1_2_3_1_1.yml +0 -94
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_list_url/_available_/2_2_3_1_1.yml +0 -94
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/_available_/1_2_1_1_1.yml +0 -94
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/_available_/2_2_1_1_1.yml +0 -94
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author/1_3_19_1.yml +0 -105
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author/2_3_19_1.yml +0 -105
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_thumbnail/1_3_20_1.yml +0 -189
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_thumbnail/2_3_20_1.yml +0 -189
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_url/1_3_21_1.yml +0 -189
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_url/2_3_21_1.yml +0 -189
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_description/1_3_7_1.yml +0 -105
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_description/2_3_7_1.yml +0 -105
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_keywords/1_3_8_1.yml +0 -105
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_keywords/2_3_8_1.yml +0 -105
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail/1_3_16_1.yml +0 -105
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail/2_3_16_1.yml +0 -105
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large/1_3_15_1.yml +0 -105
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large/2_3_15_1.yml +0 -105
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_medium/1_3_14_1.yml +0 -105
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_medium/2_3_14_1.yml +0 -105
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_small/1_3_13_1.yml +0 -105
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_small/2_3_13_1.yml +0 -105
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_title/1_3_6_1.yml +0 -105
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_title/2_3_6_1.yml +0 -105
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_videos/returns_list_of_videos_in_playlist.yml +0 -265
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_that_does_not_exist_in_embed_path/_videos/1_4_2_1.yml +0 -54
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_that_does_not_exist_in_embed_path/_videos/2_4_2_1.yml +0 -54
- data/spec/lib/video_info/provider_spec.rb +0 -80
- data/spec/lib/video_info/providers/dailymotion_spec.rb +0 -194
- data/spec/lib/video_info/providers/vimeo_spec.rb +0 -328
- data/spec/lib/video_info/providers/vkontakte_spec.rb +0 -236
- data/spec/lib/video_info/providers/wistia_spec.rb +0 -197
- data/spec/lib/video_info/providers/youtube_playlist_spec.rb +0 -236
- data/spec/lib/video_info/providers/youtube_scraper_spec.rb +0 -12
- data/spec/lib/video_info/providers/youtube_spec.rb +0 -575
- data/spec/lib/video_info_spec.rb +0 -106
- data/spec/spec_helper.rb +0 -26
@@ -1,197 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
require 'spec_helper'
|
3
|
-
|
4
|
-
describe VideoInfo::Providers::Wistia do
|
5
|
-
describe '.usable?' do
|
6
|
-
subject { VideoInfo::Providers::Wistia.usable?(url) }
|
7
|
-
|
8
|
-
context 'with wistia url' do
|
9
|
-
let(:url) { 'http://fast.wistia.net/embed/iframe/rs1me54mpw' }
|
10
|
-
it { is_expected.to be_truthy }
|
11
|
-
end
|
12
|
-
|
13
|
-
context 'with other url' do
|
14
|
-
let(:url) { 'http://www.youtube.com/898029' }
|
15
|
-
it { is_expected.to be_falsey }
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
describe '#available?' do
|
20
|
-
context 'with valid video', :vcr do
|
21
|
-
video_url = 'http://fast.wistia.net/embed/iframe/rs1me54mpw'
|
22
|
-
subject { VideoInfo.new(video_url.freeze) }
|
23
|
-
|
24
|
-
describe '#available?' do
|
25
|
-
subject { super().available? }
|
26
|
-
it { is_expected.to be_truthy }
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
context 'with invalid video', :vcr do
|
31
|
-
subject { VideoInfo.new('http://fast.wistia.net/embed/iframe/no_video') }
|
32
|
-
|
33
|
-
describe '#available?' do
|
34
|
-
subject { super().available? }
|
35
|
-
it { is_expected.to be_falsey }
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
context 'with video rs1me54mpw', :vcr do
|
41
|
-
subject { VideoInfo.new('http://fast.wistia.net/embed/iframe/rs1me54mpw') }
|
42
|
-
|
43
|
-
describe '#provider' do
|
44
|
-
subject { super().provider }
|
45
|
-
it { is_expected.to eq 'Wistia' }
|
46
|
-
end
|
47
|
-
|
48
|
-
describe '#video_id' do
|
49
|
-
subject { super().video_id }
|
50
|
-
it { is_expected.to eq 'rs1me54mpw' }
|
51
|
-
end
|
52
|
-
|
53
|
-
describe '#url' do
|
54
|
-
subject { super().url }
|
55
|
-
it { is_expected.to eq 'http://fast.wistia.net/embed/iframe/rs1me54mpw' }
|
56
|
-
end
|
57
|
-
|
58
|
-
describe '#embed_url' do
|
59
|
-
subject { super().embed_url }
|
60
|
-
it { is_expected.to eq '//fast.wistia.net/embed/iframe/rs1me54mpw' }
|
61
|
-
end
|
62
|
-
|
63
|
-
describe '#embed_code' do
|
64
|
-
subject { super().embed_code }
|
65
|
-
embed_code = '<iframe src="//fast.wistia.net/embed/iframe/rs1me54mpw" '\
|
66
|
-
'frameborder="0"></iframe>'
|
67
|
-
it { is_expected.to eq embed_code }
|
68
|
-
end
|
69
|
-
|
70
|
-
describe '#title' do
|
71
|
-
subject { super().title }
|
72
|
-
it { is_expected.to eq 'Lance Kalish - Yes To Group' }
|
73
|
-
end
|
74
|
-
|
75
|
-
describe '#duration' do
|
76
|
-
subject { super().duration }
|
77
|
-
it { is_expected.to eq 1214.83 }
|
78
|
-
end
|
79
|
-
|
80
|
-
describe '#width' do
|
81
|
-
subject { super().width }
|
82
|
-
it { is_expected.to eq 960 }
|
83
|
-
end
|
84
|
-
|
85
|
-
describe '#height' do
|
86
|
-
subject { super().height }
|
87
|
-
it { is_expected.to eq 540 }
|
88
|
-
end
|
89
|
-
|
90
|
-
describe '#thumbnail_small' do
|
91
|
-
subject { super().thumbnail_small }
|
92
|
-
thumbnail_url = 'https://embed-ssl.wistia.com/deliveries/' \
|
93
|
-
'dc005e6a7583a25c4b7c284c08afc42fb67fdb95.jpg' \
|
94
|
-
'?image_crop_resized=960x540'
|
95
|
-
it { is_expected.to eq thumbnail_url }
|
96
|
-
end
|
97
|
-
|
98
|
-
describe '#thumbnail_medium' do
|
99
|
-
subject { super().thumbnail_small }
|
100
|
-
thumbnail_url = 'https://embed-ssl.wistia.com/deliveries/' \
|
101
|
-
'dc005e6a7583a25c4b7c284c08afc42fb67fdb95.jpg?' \
|
102
|
-
'image_crop_resized=960x540'
|
103
|
-
it { is_expected.to eq thumbnail_url }
|
104
|
-
end
|
105
|
-
|
106
|
-
describe '#thumbnail_large' do
|
107
|
-
subject { super().thumbnail_small }
|
108
|
-
thumbnail_url = 'https://embed-ssl.wistia.com/deliveries/' \
|
109
|
-
'dc005e6a7583a25c4b7c284c08afc42fb67fdb95.jpg' \
|
110
|
-
'?image_crop_resized=960x540'
|
111
|
-
it { is_expected.to eq thumbnail_url }
|
112
|
-
end
|
113
|
-
|
114
|
-
describe '#thumbnail' do
|
115
|
-
subject { super().thumbnail }
|
116
|
-
thumbnail_url = 'https://embed-ssl.wistia.com/deliveries/' \
|
117
|
-
'dc005e6a7583a25c4b7c284c08afc42fb67fdb95.jpg' \
|
118
|
-
'?image_crop_resized=960x540'
|
119
|
-
it { is_expected.to eq thumbnail_url }
|
120
|
-
end
|
121
|
-
end
|
122
|
-
|
123
|
-
context 'with video pxonqr42is', :vcr do
|
124
|
-
subject { VideoInfo.new('http://fast.wistia.com/embed/medias/pxonqr42is') }
|
125
|
-
|
126
|
-
describe '#provider' do
|
127
|
-
subject { super().provider }
|
128
|
-
it { is_expected.to eq 'Wistia' }
|
129
|
-
end
|
130
|
-
|
131
|
-
describe '#video_id' do
|
132
|
-
subject { super().video_id }
|
133
|
-
it { is_expected.to eq 'pxonqr42is' }
|
134
|
-
end
|
135
|
-
|
136
|
-
describe '#url' do
|
137
|
-
subject { super().url }
|
138
|
-
it { is_expected.to eq 'http://fast.wistia.com/embed/medias/pxonqr42is' }
|
139
|
-
end
|
140
|
-
|
141
|
-
describe '#embed_url' do
|
142
|
-
subject { super().embed_url }
|
143
|
-
it { is_expected.to eq '//fast.wistia.net/embed/iframe/pxonqr42is' }
|
144
|
-
end
|
145
|
-
|
146
|
-
describe '#embed_code' do
|
147
|
-
subject { super().embed_code }
|
148
|
-
embed_code = '<iframe src="//fast.wistia.net/embed/iframe/pxonqr42is" ' \
|
149
|
-
'frameborder="0"></iframe>'
|
150
|
-
it { is_expected.to eq embed_code }
|
151
|
-
end
|
152
|
-
|
153
|
-
describe '#title' do
|
154
|
-
subject { super().title }
|
155
|
-
it { is_expected.to eq 'Understanding Analytics' }
|
156
|
-
end
|
157
|
-
|
158
|
-
describe '#duration' do
|
159
|
-
subject { super().duration }
|
160
|
-
it { is_expected.to eq 250.0 }
|
161
|
-
end
|
162
|
-
|
163
|
-
describe '#width' do
|
164
|
-
subject { super().width }
|
165
|
-
it { is_expected.to eq 960 }
|
166
|
-
end
|
167
|
-
|
168
|
-
describe '#height' do
|
169
|
-
subject { super().height }
|
170
|
-
it { is_expected.to eq 540 }
|
171
|
-
end
|
172
|
-
|
173
|
-
describe '#thumbnail_small' do
|
174
|
-
subject { super().thumbnail_small }
|
175
|
-
thumbnail_url = 'https://embed-ssl.wistia.com/deliveries/' \
|
176
|
-
'0fccbdc60ade35723f79f1c002bc61b135b610fa.jpg' \
|
177
|
-
'?image_crop_resized=960x540'
|
178
|
-
it { is_expected.to eq thumbnail_url }
|
179
|
-
end
|
180
|
-
|
181
|
-
describe '#thumbnail_medium' do
|
182
|
-
subject { super().thumbnail_small }
|
183
|
-
thumbnail_url = 'https://embed-ssl.wistia.com/deliveries/' \
|
184
|
-
'0fccbdc60ade35723f79f1c002bc61b135b610fa.jpg' \
|
185
|
-
'?image_crop_resized=960x540'
|
186
|
-
it { is_expected.to eq thumbnail_url }
|
187
|
-
end
|
188
|
-
|
189
|
-
describe '#thumbnail_large' do
|
190
|
-
subject { super().thumbnail_small }
|
191
|
-
thumbnail_url = 'https://embed-ssl.wistia.com/deliveries/' \
|
192
|
-
'0fccbdc60ade35723f79f1c002bc61b135b610fa.jpg' \
|
193
|
-
'?image_crop_resized=960x540'
|
194
|
-
it { is_expected.to eq thumbnail_url }
|
195
|
-
end
|
196
|
-
end
|
197
|
-
end
|
@@ -1,236 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
[nil, 'AIzaSyA6PYwSr1EnLFUFy1cZDk3Ifb0rxeJaeZ0'].each do |api_key|
|
4
|
-
describe VideoInfo::Providers::YoutubePlaylist do
|
5
|
-
before(:each) do
|
6
|
-
api_key = 'AIzaSyA6PYwSr1EnLFUFy1cZDk3Ifb0rxeJaeZ0'
|
7
|
-
VideoInfo.provider_api_keys = { youtube: api_key }
|
8
|
-
end
|
9
|
-
|
10
|
-
describe '.usable?' do
|
11
|
-
subject { VideoInfo::Providers::YoutubePlaylist.usable?(url) }
|
12
|
-
|
13
|
-
context 'with youtube.com/playlist?p= url' do
|
14
|
-
let(:url) { 'http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF' }
|
15
|
-
it { is_expected.to be_truthy }
|
16
|
-
end
|
17
|
-
|
18
|
-
context 'with youtube.com/playlist?list= url' do
|
19
|
-
let(:url) { 'http://www.youtube.com/playlist?list=PLA575C81A1FBC04CF' }
|
20
|
-
it { is_expected.to be_truthy }
|
21
|
-
end
|
22
|
-
|
23
|
-
context 'with youtube.com url' do
|
24
|
-
let(:url) { 'http://www.youtube.com/watch?v=Xp6CXF' }
|
25
|
-
it { is_expected.to be_falsey }
|
26
|
-
end
|
27
|
-
|
28
|
-
context 'with other url' do
|
29
|
-
let(:url) { 'http://example.com/video1' }
|
30
|
-
it { is_expected.to be_falsey }
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
describe '#available?' do
|
35
|
-
context 'with valid playlist', :vcr do
|
36
|
-
playlist_url = 'http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF'
|
37
|
-
subject { VideoInfo.new(playlist_url.freeze) }
|
38
|
-
|
39
|
-
describe '#available?' do
|
40
|
-
subject { super().available? }
|
41
|
-
it { is_expected.to be_truthy }
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
context 'with invalid playlist', :vcr do
|
46
|
-
invalid_playlist_url = 'http://www.youtube.com/playlist?' \
|
47
|
-
'p=PLA575C81A1FBC04CF_invalid'
|
48
|
-
subject { VideoInfo.new(invalid_playlist_url) }
|
49
|
-
|
50
|
-
describe '#available?' do
|
51
|
-
subject { super().available? }
|
52
|
-
it { is_expected.to be_falsey }
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
context 'with &list= url', :vcr do
|
57
|
-
playlist_url = 'http://www.youtube.com/playlist?list=PLA575C81A1FBC04CF'
|
58
|
-
subject { VideoInfo.new(playlist_url) }
|
59
|
-
|
60
|
-
describe '#available?' do
|
61
|
-
subject { super().available? }
|
62
|
-
it { is_expected.to be_truthy }
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
context 'with playlist PL9hW1uS6HUftLdHI6RIsaf', :vcr do
|
68
|
-
let(:videos) do
|
69
|
-
[
|
70
|
-
VideoInfo.new('http://www.youtube.com/watch?v=Oi67QjrXy2w'),
|
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'
|
81
|
-
|
82
|
-
subject { VideoInfo.new(playlist_url) }
|
83
|
-
|
84
|
-
describe '#provider' do
|
85
|
-
subject { super().provider }
|
86
|
-
it { is_expected.to eq 'YouTube' }
|
87
|
-
end
|
88
|
-
|
89
|
-
describe '#playlist_id' do
|
90
|
-
subject { super().playlist_id }
|
91
|
-
it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
|
92
|
-
end
|
93
|
-
|
94
|
-
describe '#url' do
|
95
|
-
subject { super().url }
|
96
|
-
it { is_expected.to eq playlist_url }
|
97
|
-
end
|
98
|
-
|
99
|
-
describe '#embed_url' do
|
100
|
-
subject { super().embed_url }
|
101
|
-
embed_url = '//www.youtube.com/embed/videoseries' \
|
102
|
-
'?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
|
103
|
-
it { is_expected.to eq embed_url }
|
104
|
-
end
|
105
|
-
|
106
|
-
describe '#embed_code' do
|
107
|
-
subject { super().embed_code }
|
108
|
-
embed_code = '<iframe src="//www.youtube.com/embed/videoseries' \
|
109
|
-
'?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr" ' \
|
110
|
-
'frameborder="0" allowfullscreen="allowfullscreen">' \
|
111
|
-
'</iframe>'
|
112
|
-
it { is_expected.to eq embed_code }
|
113
|
-
end
|
114
|
-
|
115
|
-
describe '#title' do
|
116
|
-
subject { super().title }
|
117
|
-
it { is_expected.to eq 'YouTube Policy and Copyright' }
|
118
|
-
end
|
119
|
-
|
120
|
-
describe '#description' do
|
121
|
-
subject { super().description }
|
122
|
-
description_text = 'Learn more about copyright basics, flagging, ' \
|
123
|
-
'and the YouTube community.'
|
124
|
-
it { is_expected.to eq description_text }
|
125
|
-
end
|
126
|
-
|
127
|
-
describe '#keywords' do
|
128
|
-
subject { super().keywords }
|
129
|
-
it { is_expected.to be_nil }
|
130
|
-
end
|
131
|
-
|
132
|
-
describe '#duration' do
|
133
|
-
subject { super().duration }
|
134
|
-
it { is_expected.to be_nil }
|
135
|
-
end
|
136
|
-
|
137
|
-
describe '#width' do
|
138
|
-
subject { super().width }
|
139
|
-
it { is_expected.to be_nil }
|
140
|
-
end
|
141
|
-
|
142
|
-
describe '#height' do
|
143
|
-
subject { super().height }
|
144
|
-
it { is_expected.to be_nil }
|
145
|
-
end
|
146
|
-
|
147
|
-
describe '#date' do
|
148
|
-
subject { super().date }
|
149
|
-
it { is_expected.to be_nil }
|
150
|
-
end
|
151
|
-
|
152
|
-
describe '#thumbnail_small' do
|
153
|
-
subject { super().thumbnail_small }
|
154
|
-
thumbnail_url = 'https://i.ytimg.com/vi/Oi67QjrXy2w/default.jpg'
|
155
|
-
it { is_expected.to eq thumbnail_url }
|
156
|
-
end
|
157
|
-
|
158
|
-
describe '#thumbnail_medium' do
|
159
|
-
subject { super().thumbnail_medium }
|
160
|
-
thumbnail_url = 'https://i.ytimg.com/vi/Oi67QjrXy2w/mqdefault.jpg'
|
161
|
-
it { is_expected.to eq thumbnail_url }
|
162
|
-
end
|
163
|
-
|
164
|
-
describe '#thumbnail_large' do
|
165
|
-
subject { super().thumbnail_large }
|
166
|
-
thumbnail_url = 'https://i.ytimg.com/vi/Oi67QjrXy2w/hqdefault.jpg'
|
167
|
-
it { is_expected.to eq thumbnail_url }
|
168
|
-
end
|
169
|
-
|
170
|
-
describe '#thumbnail' do
|
171
|
-
subject { super().thumbnail }
|
172
|
-
thumbnail_url = 'https://i.ytimg.com/vi/Oi67QjrXy2w/hqdefault.jpg'
|
173
|
-
it { is_expected.to eq thumbnail_url }
|
174
|
-
end
|
175
|
-
|
176
|
-
describe '#videos' do
|
177
|
-
subject { super().videos }
|
178
|
-
it 'returns list of videos in playlist' do
|
179
|
-
pending('waiting for bug in Youtube API to be fixed')
|
180
|
-
is_expected.to match_array(videos)
|
181
|
-
end
|
182
|
-
end
|
183
|
-
|
184
|
-
describe '#view_count' do
|
185
|
-
subject { super().view_count }
|
186
|
-
it { is_expected.to be_nil }
|
187
|
-
end
|
188
|
-
|
189
|
-
describe '#author' do
|
190
|
-
subject { super().author }
|
191
|
-
it { is_expected.to eq 'YouTube Help' }
|
192
|
-
end
|
193
|
-
|
194
|
-
describe '#author_thumbnail' do
|
195
|
-
subject { super().author_thumbnail }
|
196
|
-
author_thumbnail = 'https://yt3.ggpht.com/-ni_VaN38-AE/AAAAAAAAAAI/' \
|
197
|
-
'AAAAAAAAAAA/bJCTTfihBl0/s88-c-k-no-mo-rj-c0xffffff' \
|
198
|
-
'/photo.jpg'
|
199
|
-
it { is_expected.to eq author_thumbnail }
|
200
|
-
end
|
201
|
-
|
202
|
-
describe '#author_url' do
|
203
|
-
subject { super().author_url }
|
204
|
-
author_url = 'https://www.youtube.com/channel/UCMDQxm7cUx3yXkfeHa5zJIQ'
|
205
|
-
it { is_expected.to eq author_url }
|
206
|
-
end
|
207
|
-
end
|
208
|
-
|
209
|
-
context 'with playlist that does not exist in embed path', :vcr do
|
210
|
-
playlist_url = 'http://www.youtube.com/embed/videoseries?' \
|
211
|
-
'list=PL0E8117603D70E10A'
|
212
|
-
subject { VideoInfo.new(playlist_url) }
|
213
|
-
|
214
|
-
describe '#playlist_id' do
|
215
|
-
subject { super().playlist_id }
|
216
|
-
it { is_expected.to eq 'PL0E8117603D70E10A' }
|
217
|
-
end
|
218
|
-
|
219
|
-
describe '#videos' do
|
220
|
-
subject { super().videos }
|
221
|
-
it { is_expected.to eq [] }
|
222
|
-
end
|
223
|
-
end
|
224
|
-
|
225
|
-
context 'with playlist valid playlist in embed path', :vcr do
|
226
|
-
playlist_url = 'http://www.youtube.com/embed/videoseries' \
|
227
|
-
'?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
|
228
|
-
subject { VideoInfo.new(playlist_url) }
|
229
|
-
|
230
|
-
describe '#playlist_id' do
|
231
|
-
subject { super().playlist_id }
|
232
|
-
it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
|
233
|
-
end
|
234
|
-
end
|
235
|
-
end
|
236
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe VideoInfo::Providers::Youtube do
|
4
|
-
context 'with video WVsj2pS-zFY' do
|
5
|
-
subject { VideoInfo.new('http://www.youtube.com/watch?v=WVsj2pS-zFY') }
|
6
|
-
|
7
|
-
describe '#description' do
|
8
|
-
subject { super().description }
|
9
|
-
it { is_expected.to eq nil }
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|