video_info 2.6.0 → 2.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/.rubocop.yml +242 -1
- data/.travis.yml +9 -8
- data/CONTRIBUTING.md +11 -0
- data/Gemfile +1 -1
- data/Guardfile +1 -1
- data/README.md +34 -1
- data/lib/video_info.rb +22 -26
- data/lib/video_info/provider.rb +8 -10
- data/lib/video_info/providers/dailymotion.rb +6 -3
- data/lib/video_info/providers/vimeo.rb +3 -3
- data/lib/video_info/providers/vimeo_api.rb +13 -4
- data/lib/video_info/providers/vimeo_scraper.rb +33 -13
- data/lib/video_info/providers/vkontakte.rb +38 -14
- data/lib/video_info/providers/wistia.rb +2 -1
- data/lib/video_info/providers/youtube.rb +4 -2
- data/lib/video_info/providers/youtube_api.rb +38 -3
- data/lib/video_info/providers/youtube_scraper.rb +26 -12
- data/lib/video_info/providers/youtubeplaylist.rb +5 -2
- data/lib/video_info/providers/youtubeplaylist_api.rb +8 -1
- data/lib/video_info/providers/youtubeplaylist_scraper.rb +16 -3
- 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 +89 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_valid_video/_available_/1_2_1_1_1.yml +92 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_date/should_show_correct_date.yml +95 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_description/1_3_7_1.yml +95 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_duration/1_3_9_1.yml +95 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_keywords/1_3_8_1.yml +95 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_large/1_3_15_1.yml +95 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_medium/1_3_14_1.yml +95 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_small/1_3_13_1.yml +95 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_title/1_3_6_1.yml +95 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_view_count/1_3_16_1.yml +95 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/_available_/1_2_3_1_1.yml +964 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/_available_/2_2_3_1_1.yml +59 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/_available_/1_2_2_1_1.yml +936 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/_available_/2_2_2_1_1.yml +61 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/_available_/1_2_1_1_1.yml +2692 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/_available_/2_2_1_1_1.yml +119 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author/1_3_17_1.yml +1530 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author/2_3_17_1.yml +68 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_thumbnail/1_3_16_1.yml +1530 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_thumbnail/2_3_16_1.yml +68 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_url/1_3_18_1.yml +1529 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_url/2_3_18_1.yml +68 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_date/should_have_correct_upload_date.yml +1595 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_description/1_3_7_1.yml +1602 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_description/2_3_7_1.yml +68 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_duration/1_3_9_1.yml +1530 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_duration/2_3_9_1.yml +68 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_height/1_3_11_1.yml +1529 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_height/2_3_11_1.yml +68 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_keywords/should_return_a_string_list_of_keywords.yml +1595 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_large/1_3_15_1.yml +1530 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_large/2_3_15_1.yml +68 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_medium/1_3_14_1.yml +1530 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_medium/2_3_14_1.yml +68 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_small/1_3_13_1.yml +1530 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_small/2_3_13_1.yml +68 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_title/1_3_6_1.yml +1602 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_title/2_3_6_1.yml +68 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_view_count/1_3_19_1.yml +1530 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_view_count/2_3_19_1.yml +68 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_width/1_3_10_1.yml +1530 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_width/2_3_10_1.yml +68 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author/1_3_17_1.yml +2559 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author/2_3_17_1.yml +159 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_thumbnail/1_3_16_1.yml +2559 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_thumbnail/2_3_16_1.yml +159 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_url/1_3_18_1.yml +2559 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_url/2_3_18_1.yml +159 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_date/should_have_correct_upload_date.yml +2714 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_description/1_3_7_1.yml +2692 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_description/2_3_7_1.yml +159 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_duration/1_3_9_1.yml +2829 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_duration/2_3_9_1.yml +159 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_height/1_3_11_1.yml +2828 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_height/2_3_11_1.yml +159 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_keywords/should_return_a_string_list_of_keywords.yml +2716 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_large/1_3_15_1.yml +2560 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_large/2_3_15_1.yml +159 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_medium/1_3_14_1.yml +2558 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_medium/2_3_14_1.yml +159 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_small/1_3_13_1.yml +2558 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_small/2_3_13_1.yml +159 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_title/1_3_6_1.yml +2961 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_title/2_3_6_1.yml +159 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_view_count/1_3_19_1.yml +2560 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_view_count/2_3_19_1.yml +159 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_width/1_3_10_1.yml +2560 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_width/2_3_10_1.yml +159 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_hashes/available_/1_2_6_1_1.yml +2996 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_invalid_video/available_/1_2_2_1_1.yml +46 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_private_video/available_/1_2_3_1_1.yml +865 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_redirect/available_/1_2_4_1_1.yml +666 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_redirect_to_main_page_for_auth/available_/1_2_5_1_1.yml +46 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_valid_video/available_/1_2_1_1_1.yml +2118 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/author/1_5_14_1.yml +518 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/author_thumbnail/1_5_15_1.yml +519 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/author_url/1_5_16_1.yml +520 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/description/1_5_8_1.yml +518 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/duration/1_5_10_1.yml +517 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/embed_code/1_5_6_1.yml +517 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/embed_url/1_5_5_1.yml +519 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/height/1_5_12_1.yml +517 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/title/1_5_7_1.yml +517 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/view_count/1_5_13_1.yml +521 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/width/1_5_11_1.yml +517 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_https_/vk_com/id44052340_z_video61291456_159590018_2F2521d92730a272a9ea/author/1_3_7_1.yml +399 -0
- 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 +399 -0
- 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 +399 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_https_/vk_com/id44052340_z_video61291456_159590018_2F2521d92730a272a9ea/title/1_3_4_1.yml +399 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video-54799401_165822734/title/1_7_4_1.yml +682 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video3552522_171340713/embed_url/1_10_1_1.yml +501 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/description/1_6_8_1.yml +449 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/duration/1_6_10_1.yml +449 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_code/1_6_6_1.yml +449 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_url/1_6_5_1.yml +449 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/height/1_6_12_1.yml +449 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/title/1_6_7_1.yml +449 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/view_count/1_6_13_1.yml +449 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/width/1_6_11_1.yml +449 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author/1_4_5_1.yml +527 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author_thumbnail/1_4_6_1.yml +527 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author_url/1_4_7_1.yml +527 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/title/1_4_4_1.yml +527 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_invalid_video/_available_/1_2_2_1_1.yml +71 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_valid_video/_available_/1_2_1_1_1.yml +73 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_duration/1_4_7_1.yml +80 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_height/1_4_9_1.yml +80 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_large/1_4_12_1.yml +80 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_medium/1_4_11_1.yml +80 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_small/1_4_10_1.yml +80 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_title/1_4_6_1.yml +80 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_width/1_4_8_1.yml +80 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_duration/1_3_7_1.yml +80 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_height/1_3_9_1.yml +80 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_large/1_3_12_1.yml +80 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_medium/1_3_11_1.yml +80 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_small/1_3_10_1.yml +80 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_title/1_3_6_1.yml +80 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_width/1_3_8_1.yml +80 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_available_/1_2_2_1_1.yml +516 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_available_/2_2_2_1_1.yml +56 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_date/1_2_2_11_1.yml +519 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_date/2_2_2_11_1.yml +56 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_description/1_2_2_8_1.yml +521 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_description/2_2_2_8_1.yml +56 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_duration/1_2_2_10_1.yml +519 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_duration/2_2_2_10_1.yml +56 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_keywords/1_2_2_9_1.yml +519 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_keywords/2_2_2_9_1.yml +56 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_title/1_2_2_7_1.yml +519 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_title/2_2_2_7_1.yml +56 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/1_2_2_15_1.yml +516 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/2_2_2_15_1.yml +56 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/_available_/1_2_1_1_1.yml +3930 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/_available_/2_2_1_1_1.yml +127 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_removed_because_of_copyright_claim/_available_/1_2_3_1_1.yml +578 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_removed_because_of_copyright_claim/_available_/2_2_3_1_1.yml +117 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_date/should_return_date_video_was_posted.yml +3912 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_description/1_17_7_1.yml +4007 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_description/2_17_7_1.yml +127 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_duration/1_17_9_1.yml +3982 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_duration/2_17_9_1.yml +127 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_keywords/1_17_8_1.yml +3984 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_keywords/2_17_8_1.yml +127 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_title/1_17_6_1.yml +3946 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_title/2_17_6_1.yml +127 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_view_count/1_17_16_1.yml +3948 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_view_count/2_17_16_1.yml +127 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author/1_3_6_1.yml +4006 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author/2_3_6_1.yml +127 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_thumbnail/1_3_7_1.yml +4027 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_thumbnail/2_3_7_1.yml +212 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_url/1_3_8_1.yml +4080 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_url/2_3_8_1.yml +212 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_date/should_return_date_video_was_posted.yml +3982 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_description/1_3_10_1.yml +3992 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_description/2_3_10_1.yml +127 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_duration/1_3_12_1.yml +3961 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_duration/2_3_12_1.yml +127 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_keywords/1_3_11_1.yml +3928 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_keywords/2_3_11_1.yml +127 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_title/1_3_9_1.yml +3974 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_title/2_3_9_1.yml +127 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/1_3_19_1.yml +3950 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/2_3_19_1.yml +127 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/_available_/1_2_2_1_1.yml +62 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/_available_/2_2_2_1_1.yml +62 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_list_url/_available_/1_2_3_1_1.yml +96 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_list_url/_available_/2_2_3_1_1.yml +96 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/_available_/1_2_1_1_1.yml +96 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/_available_/2_2_1_1_1.yml +96 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author/1_3_18_1.yml +107 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author/2_3_18_1.yml +107 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_thumbnail/1_3_19_1.yml +193 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_thumbnail/2_3_19_1.yml +193 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_url/1_3_20_1.yml +193 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_url/2_3_20_1.yml +193 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_description/1_3_7_1.yml +107 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_description/2_3_7_1.yml +107 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_keywords/1_3_8_1.yml +107 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_keywords/2_3_8_1.yml +107 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large/1_3_15_1.yml +107 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large/2_3_15_1.yml +107 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_medium/1_3_14_1.yml +107 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_medium/2_3_14_1.yml +107 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_small/1_3_13_1.yml +107 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_small/2_3_13_1.yml +107 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_title/1_3_6_1.yml +107 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_title/2_3_6_1.yml +107 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_videos/returns_list_of_videos_in_playlist.yml +267 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_that_does_not_exist_in_embed_path/_videos/1_4_2_1.yml +56 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_that_does_not_exist_in_embed_path/_videos/2_4_2_1.yml +56 -0
- data/spec/lib/video_info/provider_spec.rb +42 -22
- data/spec/lib/video_info/providers/dailymotion_spec.rb +41 -23
- data/spec/lib/video_info/providers/vimeo_spec.rb +212 -177
- data/spec/lib/video_info/providers/vkontakte_spec.rb +132 -63
- data/spec/lib/video_info/providers/wistia_spec.rb +34 -13
- data/spec/lib/video_info/providers/youtube_playlist_spec.rb +185 -139
- data/spec/lib/video_info/providers/youtube_spec.rb +400 -385
- data/spec/lib/video_info_spec.rb +27 -21
- data/video_info.gemspec +7 -10
- metadata +424 -87
- data/foo.txt +0 -33
- data/spec/lib/video_info/providers/vimeo_api_spec.rb +0 -242
- data/spec/lib/video_info/providers/youtube_api_spec.rb +0 -476
- data/spec/lib/video_info/providers/youtube_playlist_api_spec.rb +0 -187
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18c94c937caae05276816dd3ed8ebe10df074b0b
|
4
|
+
data.tar.gz: 61a33b65f281e74192fd355574616281b2ef2eb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06a186d5c3fea88716f226090c797a82bbee92f1180683b5963fc96684d87c37b2eb6b25b18a2016eeca714023c7c86f3c0b558dce3dbc0881bad507c4917d07
|
7
|
+
data.tar.gz: 99f37329ca0c12666afd6f58e9f68af88dc62fe8d62a67ec542a074569bdd1b311c1f21fd86a56eb20ee1a7be4f8a576ffdd372050f808b439e3d8bb9f69d201
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,2 +1,243 @@
|
|
1
|
-
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- "vendor/**/*"
|
4
|
+
- "db/schema.rb"
|
5
|
+
UseCache: false
|
6
|
+
Style/CollectionMethods:
|
7
|
+
Description: Preferred collection methods.
|
8
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
|
9
|
+
Enabled: true
|
10
|
+
PreferredMethods:
|
11
|
+
collect: map
|
12
|
+
collect!: map!
|
13
|
+
find: detect
|
14
|
+
find_all: select
|
15
|
+
reduce: inject
|
16
|
+
Style/DotPosition:
|
17
|
+
Description: Checks the position of the dot in multi-line method calls.
|
18
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
|
19
|
+
Enabled: true
|
20
|
+
EnforcedStyle: trailing
|
21
|
+
SupportedStyles:
|
22
|
+
- leading
|
23
|
+
- trailing
|
24
|
+
Style/FileName:
|
25
|
+
Description: Use snake_case for source file names.
|
26
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
|
27
|
+
Enabled: false
|
28
|
+
Exclude: []
|
29
|
+
Style/GuardClause:
|
30
|
+
Description: Check for conditionals that can be replaced with guard clauses
|
31
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
|
32
|
+
Enabled: false
|
33
|
+
MinBodyLength: 1
|
34
|
+
Style/IfUnlessModifier:
|
35
|
+
Description: Favor modifier if/unless usage when you have a single-line body.
|
36
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
|
37
|
+
Enabled: false
|
38
|
+
MaxLineLength: 80
|
39
|
+
Style/OptionHash:
|
40
|
+
Description: Don't use option hashes when you can use keyword arguments.
|
41
|
+
Enabled: false
|
42
|
+
Style/PercentLiteralDelimiters:
|
43
|
+
Description: Use `%`-literal delimiters consistently
|
44
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
|
45
|
+
Enabled: false
|
46
|
+
PreferredDelimiters:
|
47
|
+
"%": "()"
|
48
|
+
"%i": "()"
|
49
|
+
"%q": "()"
|
50
|
+
"%Q": "()"
|
51
|
+
"%r": "{}"
|
52
|
+
"%s": "()"
|
53
|
+
"%w": "()"
|
54
|
+
"%W": "()"
|
55
|
+
"%x": "()"
|
56
|
+
Style/PredicateName:
|
57
|
+
Description: Check the names of predicate methods.
|
58
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
|
59
|
+
Enabled: true
|
60
|
+
NamePrefix:
|
61
|
+
- is_
|
62
|
+
- has_
|
63
|
+
- have_
|
64
|
+
NamePrefixBlacklist:
|
65
|
+
- is_
|
66
|
+
Exclude:
|
67
|
+
- spec/**/*
|
68
|
+
Style/RaiseArgs:
|
69
|
+
Description: Checks the arguments passed to raise/fail.
|
70
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
|
71
|
+
Enabled: false
|
72
|
+
EnforcedStyle: exploded
|
73
|
+
SupportedStyles:
|
74
|
+
- compact
|
75
|
+
- exploded
|
76
|
+
Style/SignalException:
|
77
|
+
Description: Checks for proper usage of fail and raise.
|
78
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
|
79
|
+
Enabled: false
|
80
|
+
EnforcedStyle: semantic
|
81
|
+
SupportedStyles:
|
82
|
+
- only_raise
|
83
|
+
- only_fail
|
84
|
+
- semantic
|
85
|
+
Style/SingleLineBlockParams:
|
86
|
+
Description: Enforces the names of some block params.
|
87
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
|
88
|
+
Enabled: false
|
89
|
+
Methods:
|
90
|
+
- reduce:
|
91
|
+
- a
|
92
|
+
- e
|
93
|
+
- inject:
|
94
|
+
- a
|
95
|
+
- e
|
96
|
+
Style/SingleLineMethods:
|
97
|
+
Description: Avoid single-line methods.
|
98
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
|
99
|
+
Enabled: false
|
100
|
+
AllowIfMethodIsEmpty: true
|
101
|
+
Style/StringLiterals:
|
102
|
+
Description: Checks if uses of quotes match the configured preference.
|
103
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
|
104
|
+
Enabled: true
|
2
105
|
EnforcedStyle: single_quotes
|
106
|
+
SupportedStyles:
|
107
|
+
- single_quotes
|
108
|
+
- double_quotes
|
109
|
+
Style/StringLiteralsInInterpolation:
|
110
|
+
Description: Checks if uses of quotes inside expressions in interpolated strings
|
111
|
+
match the configured preference.
|
112
|
+
Enabled: true
|
113
|
+
EnforcedStyle: single_quotes
|
114
|
+
SupportedStyles:
|
115
|
+
- single_quotes
|
116
|
+
- double_quotes
|
117
|
+
Style/TrailingCommaInArguments:
|
118
|
+
Description: 'Checks for trailing comma in argument lists.'
|
119
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
120
|
+
Enabled: false
|
121
|
+
EnforcedStyleForMultiline: no_comma
|
122
|
+
SupportedStyles:
|
123
|
+
- comma
|
124
|
+
- consistent_comma
|
125
|
+
- no_comma
|
126
|
+
Style/TrailingCommaInLiteral:
|
127
|
+
Description: 'Checks for trailing comma in array and hash literals.'
|
128
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
129
|
+
Enabled: false
|
130
|
+
EnforcedStyleForMultiline: no_comma
|
131
|
+
SupportedStyles:
|
132
|
+
- comma
|
133
|
+
- consistent_comma
|
134
|
+
- no_comma
|
135
|
+
Metrics/AbcSize:
|
136
|
+
Description: A calculated magnitude based on number of assignments, branches, and
|
137
|
+
conditions.
|
138
|
+
Enabled: false
|
139
|
+
Max: 15
|
140
|
+
Metrics/ClassLength:
|
141
|
+
Description: Avoid classes longer than 100 lines of code.
|
142
|
+
Enabled: false
|
143
|
+
CountComments: false
|
144
|
+
Max: 100
|
145
|
+
Metrics/ModuleLength:
|
146
|
+
CountComments: false
|
147
|
+
Max: 100
|
148
|
+
Description: Avoid modules longer than 100 lines of code.
|
149
|
+
Enabled: false
|
150
|
+
Metrics/CyclomaticComplexity:
|
151
|
+
Description: A complexity metric that is strongly correlated to the number of test
|
152
|
+
cases needed to validate a method.
|
153
|
+
Enabled: false
|
154
|
+
Max: 6
|
155
|
+
Metrics/MethodLength:
|
156
|
+
Description: Avoid methods longer than 10 lines of code.
|
157
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
|
158
|
+
Enabled: false
|
159
|
+
CountComments: false
|
160
|
+
Max: 10
|
161
|
+
Metrics/ParameterLists:
|
162
|
+
Description: Avoid parameter lists longer than three or four parameters.
|
163
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
|
164
|
+
Enabled: false
|
165
|
+
Max: 5
|
166
|
+
CountKeywordArgs: true
|
167
|
+
Metrics/PerceivedComplexity:
|
168
|
+
Description: A complexity metric geared towards measuring complexity for a human
|
169
|
+
reader.
|
170
|
+
Enabled: false
|
171
|
+
Max: 7
|
172
|
+
Lint/AssignmentInCondition:
|
173
|
+
Description: Don't use assignment in conditions.
|
174
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
|
175
|
+
Enabled: false
|
176
|
+
AllowSafeAssignment: true
|
177
|
+
Style/InlineComment:
|
178
|
+
Description: Avoid inline comments.
|
179
|
+
Enabled: false
|
180
|
+
Style/AccessorMethodName:
|
181
|
+
Description: Check the naming of accessor methods for get_/set_.
|
182
|
+
Enabled: false
|
183
|
+
Style/Alias:
|
184
|
+
Description: Use alias_method instead of alias.
|
185
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
|
186
|
+
Enabled: false
|
187
|
+
Style/Documentation:
|
188
|
+
Description: Document classes and non-namespace modules.
|
189
|
+
Enabled: false
|
190
|
+
Style/DoubleNegation:
|
191
|
+
Description: Checks for uses of double negation (!!).
|
192
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
|
193
|
+
Enabled: false
|
194
|
+
Style/EachWithObject:
|
195
|
+
Description: Prefer `each_with_object` over `inject` or `reduce`.
|
196
|
+
Enabled: false
|
197
|
+
Style/EmptyLiteral:
|
198
|
+
Description: Prefer literals to Array.new/Hash.new/String.new.
|
199
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
|
200
|
+
Enabled: false
|
201
|
+
Style/ModuleFunction:
|
202
|
+
Description: Checks for usage of `extend self` in modules.
|
203
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
|
204
|
+
Enabled: false
|
205
|
+
Style/OneLineConditional:
|
206
|
+
Description: Favor the ternary operator(?:) over if/then/else/end constructs.
|
207
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
|
208
|
+
Enabled: false
|
209
|
+
Style/PerlBackrefs:
|
210
|
+
Description: Avoid Perl-style regex back references.
|
211
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
|
212
|
+
Enabled: false
|
213
|
+
Style/Send:
|
214
|
+
Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send`
|
215
|
+
may overlap with existing methods.
|
216
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-public-send
|
217
|
+
Enabled: false
|
218
|
+
Style/SpecialGlobalVars:
|
219
|
+
Description: Avoid Perl-style global variables.
|
220
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
|
221
|
+
Enabled: false
|
222
|
+
Style/VariableInterpolation:
|
223
|
+
Description: Don't interpolate global, instance and class variables directly in
|
224
|
+
strings.
|
225
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
|
226
|
+
Enabled: false
|
227
|
+
Style/WhenThen:
|
228
|
+
Description: Use when x then ... for one-line cases.
|
229
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
|
230
|
+
Enabled: false
|
231
|
+
Lint/EachWithObjectArgument:
|
232
|
+
Description: Check for immutable argument given to each_with_object.
|
233
|
+
Enabled: true
|
234
|
+
Lint/HandleExceptions:
|
235
|
+
Description: Don't suppress exception.
|
236
|
+
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
|
237
|
+
Enabled: false
|
238
|
+
Lint/LiteralInCondition:
|
239
|
+
Description: Checks of literals used in conditions.
|
240
|
+
Enabled: false
|
241
|
+
Lint/LiteralInInterpolation:
|
242
|
+
Description: Checks for literals used in interpolation.
|
243
|
+
Enabled: false
|
data/.travis.yml
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
language: ruby
|
2
2
|
sudo: false
|
3
|
-
|
3
|
+
dist: trusty
|
4
|
+
cache: bundler
|
4
5
|
rvm:
|
5
|
-
- 2.2.
|
6
|
-
-
|
7
|
-
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
- rvm: jruby
|
6
|
+
- 2.2.4
|
7
|
+
- 2.3.0
|
8
|
+
- jruby-head
|
9
|
+
- rbx-2
|
10
|
+
jdk:
|
11
|
+
- oraclejdk8
|
12
12
|
before_install:
|
13
|
+
- gem install bundler
|
13
14
|
- gem update bundler
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
Contributing
|
2
|
+
--------
|
3
|
+
|
4
|
+
The guidelines for contributions are as follows:
|
5
|
+
* Make sure you include comprehensive specs for new features and bug-fixes
|
6
|
+
* Make sure all of the specs pass by running `rspec` in the root project directory. Pull requests with failing tests will not be merged.
|
7
|
+
* Make sure there are no style issues by running `rubocop` in the root project directory. Pull requests with style issues will not be merged
|
8
|
+
* Optimally, you should create a separate branch to make rebasing with `master` simpler if other work gets merged in before your patch does.
|
9
|
+
* In bug reports, post the outputs of `VideoInfo::VERSION` and `ruby --version`
|
10
|
+
* In bug reports, provide detailed and clear reproduction steps. Optimally, provide some sample code.
|
11
|
+
* In bug reports, try to test against the `master` branch. If the bug does not exist in `master`, it is most likely known and a fix will be in the next release.
|
data/Gemfile
CHANGED
data/Guardfile
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# More info at http://github.com/guard/guard#readme
|
3
3
|
|
4
4
|
guard 'rspec', keep_failed: false do
|
5
|
-
watch('spec/spec_helper.rb') {
|
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})
|
8
8
|
end
|
data/README.md
CHANGED
@@ -4,7 +4,15 @@
|
|
4
4
|
|
5
5
|
Simple Ruby Gem to get video info from Dailymotion, VK, Vimeo, Wistia and YouTube (with playlist).
|
6
6
|
|
7
|
-
Tested against Ruby 2.
|
7
|
+
Tested against Ruby 2.3.0, 2.2.4, and the latest versions of JRuby & Rubinius.
|
8
|
+
|
9
|
+
Features
|
10
|
+
--------
|
11
|
+
* Simple, single-function API that returns a simple data structure
|
12
|
+
* Has a mere three gem dependencies
|
13
|
+
* Automatic fallback to scrapers when required API keys aren't provided
|
14
|
+
* Fetches metadata on the video, including title, duration, upload date, description, keywords, thumbnail, and dimensions
|
15
|
+
* Fetches metadata on the author, including name, thumbnail, and channel/profile URL
|
8
16
|
|
9
17
|
Install
|
10
18
|
--------
|
@@ -53,6 +61,9 @@ video = VideoInfo.new("http://vimeo.com/898029")
|
|
53
61
|
# video.provider => 'Vimeo'
|
54
62
|
# video.title => 'Cherry Bloom - King Of The Knife'
|
55
63
|
# video.description => 'The first video from the upcoming album Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net'
|
64
|
+
# video.author => 'Octave Zangs'
|
65
|
+
# video.author_thumbnail => 'https://i.vimeocdn.com/portrait/2577152_75x75.jpg'
|
66
|
+
# video.author_url => 'https://vimeo.com/octave'
|
56
67
|
# video.keywords => 'alternative, bloom, cherry, clip, drum, guitar, king, knife, of, Paris-Forum, rock, the, tremplin'
|
57
68
|
# video.duration => 175 (in seconds)
|
58
69
|
# video.date => Mon Apr 14 13:10:39 +0200 2008
|
@@ -78,11 +89,27 @@ video = VideoInfo.new("http://fast.wistia.com/embed/medias/pxonqr42is")
|
|
78
89
|
# video.embed_url => '//fast.wistia.net/embed/iframe/pxonqr42is'
|
79
90
|
# video.embed_code => "<iframe src='//fast.wistia.net/embed/iframe/pxonqr42is' frameborder='0'></iframe>"
|
80
91
|
|
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
|
+
|
81
105
|
video = VideoInfo.new("http://www.youtube.com/watch?v=mZqGqE0D0n4")
|
82
106
|
# video.available? => true
|
83
107
|
# video.video_id => 'mZqGqE0D0n4'
|
84
108
|
# video.provider => 'YouTube'
|
85
109
|
# video.title => 'Cherry Bloom - King Of The Knife'
|
110
|
+
# video.author => 'Cherry Bloom'
|
111
|
+
# video.author_thumbnail => 'https://yt3.ggpht.com/-7rhnfdQaI3k/AAAAAAAAAAI/AAAAAAAAAAA/eMJZ5HBukCQ/s88-c-k-no/photo.jpg'
|
112
|
+
# video.author_url => 'https://www.youtube.com/channel/UCzxQk-rZGowoqMBKxGD5jSA'
|
86
113
|
# video.description => 'The first video from the upcoming album Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net'
|
87
114
|
# video.duration => 175 (in seconds)
|
88
115
|
# video.date => Sat Apr 12 22:25:35 UTC 2008
|
@@ -97,12 +124,16 @@ playlist = VideoInfo.new("http://www.youtube.com/playlist?p=PL9hW1uS6HUftLdHI6RI
|
|
97
124
|
# playlist.playlist_id => 'PL9hW1uS6HUftLdHI6RIsaf'
|
98
125
|
# playlist.provider => 'YouTube'
|
99
126
|
# playlist.title => 'YouTube Policy and Copyright'
|
127
|
+
# playlist.author => 'YouTube Help'
|
128
|
+
# playlist.author_thumbnail => 'https://yt3.ggpht.com/-ni_VaN38-AE/AAAAAAAAAAI/AAAAAAAAAAA/bJCTTfihBl0/s100-c-k-no/photo.jpg'
|
129
|
+
# playlist.author_url => 'https://www.youtube.com/user/YouTubeHelp'
|
100
130
|
# playlist.thumbnail_small => 'http://i.ytimg.com/vi/8b0aEoxqqC0/default.jpg'
|
101
131
|
# playlist.thumbnail_medium => 'http://i.ytimg.com/vi/8b0aEoxqqC0/mqdefault.jpg'
|
102
132
|
# playlist.thumbnail_large => 'http://i.ytimg.com/vi/8b0aEoxqqC0/hqdefault.jpg'
|
103
133
|
# playlist.embed_url => 'http://www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
|
104
134
|
# playlist.embed_code => "<iframe src='//www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' frameborder='0' allowfullscreen='allowfullscreen'></iframe>"
|
105
135
|
# playlist.videos => [VideoInfo.new('http://www.youtube.com/watch?v=_Bt3-WsHfB0'), VideoInfo.new('http://www.youtube.com/watch?v=9g2U12SsRns'), VideoInfo.new('http://www.youtube.com/watch?v=8b0aEoxqqC0'), VideoInfo.new('http://www.youtube.com/watch?v=6c3mHikRz0I'), VideoInfo.new('http://www.youtube.com/watch?v=OQVHWsTHcoc')]
|
136
|
+
```
|
106
137
|
|
107
138
|
Options
|
108
139
|
-------
|
@@ -145,6 +176,7 @@ VideoInfo.disable_providers = [] # enable all providers
|
|
145
176
|
Note: `disable_providers` is case-insensitive. Attempting to use a disabled provider will raise a UrlError, just like attempting to use a
|
146
177
|
non-video URL.
|
147
178
|
|
179
|
+
|
148
180
|
Author
|
149
181
|
------
|
150
182
|
|
@@ -154,6 +186,7 @@ Maintainers
|
|
154
186
|
-----------
|
155
187
|
|
156
188
|
[Thibaud Guillaume-Gentil](https://github.com/thibaudgg) ([@thibaudgg](https://twitter.com/thibaudgg))
|
189
|
+
|
157
190
|
[Vincent Heuken](https://github.com/vheuken) ([@vheuken](https://github.com/vheuken))
|
158
191
|
|
159
192
|
Contributors
|
data/lib/video_info.rb
CHANGED
@@ -11,6 +11,22 @@ class VideoInfo
|
|
11
11
|
|
12
12
|
class << self
|
13
13
|
attr_writer :logger
|
14
|
+
attr_accessor :disable_providers, :provider_api_keys
|
15
|
+
|
16
|
+
def disable_providers
|
17
|
+
@disable_providers || []
|
18
|
+
end
|
19
|
+
|
20
|
+
def provider_api_keys
|
21
|
+
@provider_api_keys || {}
|
22
|
+
end
|
23
|
+
|
24
|
+
def provider_api_keys=(api_keys)
|
25
|
+
api_keys.keys.each do |key|
|
26
|
+
raise ArgumentError, 'Key must be a symbol!' unless key.is_a?(Symbol)
|
27
|
+
end
|
28
|
+
@provider_api_keys = api_keys
|
29
|
+
end
|
14
30
|
|
15
31
|
def logger
|
16
32
|
@logger ||= Logger.new($stdout).tap do |lgr|
|
@@ -24,18 +40,21 @@ class VideoInfo
|
|
24
40
|
PROVIDERS = %w[
|
25
41
|
Dailymotion Vkontakte Wistia
|
26
42
|
Vimeo Youtube YoutubePlaylist
|
27
|
-
]
|
43
|
+
].freeze
|
28
44
|
PROVIDERS.each { |p| require "video_info/providers/#{p.downcase}" }
|
29
45
|
|
30
46
|
def_delegators :@provider, :provider, :video_id, :video_owner, :url, :data
|
31
47
|
def_delegators :@provider, :title, :description, :keywords, :view_count
|
32
48
|
def_delegators :@provider, :date, :duration, :width, :height
|
33
49
|
def_delegators :@provider, :thumbnail
|
34
|
-
def_delegators :@provider,
|
50
|
+
def_delegators :@provider,
|
51
|
+
:thumbnail_small,
|
52
|
+
:thumbnail_medium,
|
53
|
+
:thumbnail_large
|
35
54
|
def_delegators :@provider, :embed_code, :embed_url
|
36
55
|
def_delegators :@provider, :available?
|
37
56
|
def_delegators :@provider, :playlist_id, :videos
|
38
|
-
def_delegators :@provider, :author, :author_thumbnail
|
57
|
+
def_delegators :@provider, :author, :author_thumbnail, :author_url
|
39
58
|
def_delegators :@provider, :data=
|
40
59
|
|
41
60
|
def initialize(url, options = {})
|
@@ -57,29 +76,6 @@ class VideoInfo
|
|
57
76
|
url == other.url && video_id == other.video_id
|
58
77
|
end
|
59
78
|
|
60
|
-
@@provider_api_keys = {}
|
61
|
-
|
62
|
-
def self.provider_api_keys
|
63
|
-
@@provider_api_keys
|
64
|
-
end
|
65
|
-
|
66
|
-
def self.provider_api_keys=(api_keys)
|
67
|
-
api_keys.keys.each do |key|
|
68
|
-
raise ArgumentError, 'Key must be a symbol!' unless key.is_a?(Symbol)
|
69
|
-
end
|
70
|
-
@@provider_api_keys = api_keys
|
71
|
-
end
|
72
|
-
|
73
|
-
@@disable_providers = []
|
74
|
-
|
75
|
-
def self.disable_providers
|
76
|
-
@@disable_providers
|
77
|
-
end
|
78
|
-
|
79
|
-
def self.disable_providers=(providers)
|
80
|
-
@@disable_providers = providers
|
81
|
-
end
|
82
|
-
|
83
79
|
def self.disabled_provider?(provider)
|
84
80
|
disable_providers.map(&:downcase).include?(provider.downcase)
|
85
81
|
end
|