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.
Files changed (230) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -1
  3. data/.rubocop.yml +242 -1
  4. data/.travis.yml +9 -8
  5. data/CONTRIBUTING.md +11 -0
  6. data/Gemfile +1 -1
  7. data/Guardfile +1 -1
  8. data/README.md +34 -1
  9. data/lib/video_info.rb +22 -26
  10. data/lib/video_info/provider.rb +8 -10
  11. data/lib/video_info/providers/dailymotion.rb +6 -3
  12. data/lib/video_info/providers/vimeo.rb +3 -3
  13. data/lib/video_info/providers/vimeo_api.rb +13 -4
  14. data/lib/video_info/providers/vimeo_scraper.rb +33 -13
  15. data/lib/video_info/providers/vkontakte.rb +38 -14
  16. data/lib/video_info/providers/wistia.rb +2 -1
  17. data/lib/video_info/providers/youtube.rb +4 -2
  18. data/lib/video_info/providers/youtube_api.rb +38 -3
  19. data/lib/video_info/providers/youtube_scraper.rb +26 -12
  20. data/lib/video_info/providers/youtubeplaylist.rb +5 -2
  21. data/lib/video_info/providers/youtubeplaylist_api.rb +8 -1
  22. data/lib/video_info/providers/youtubeplaylist_scraper.rb +16 -3
  23. data/lib/video_info/version.rb +1 -1
  24. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_invalid_video_url/_available_/1_2_2_1_1.yml +89 -0
  25. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_valid_video/_available_/1_2_1_1_1.yml +92 -0
  26. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_date/should_show_correct_date.yml +95 -0
  27. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_description/1_3_7_1.yml +95 -0
  28. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_duration/1_3_9_1.yml +95 -0
  29. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_keywords/1_3_8_1.yml +95 -0
  30. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_large/1_3_15_1.yml +95 -0
  31. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_medium/1_3_14_1.yml +95 -0
  32. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_small/1_3_13_1.yml +95 -0
  33. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_title/1_3_6_1.yml +95 -0
  34. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_view_count/1_3_16_1.yml +95 -0
  35. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/_available_/1_2_3_1_1.yml +964 -0
  36. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/_available_/2_2_3_1_1.yml +59 -0
  37. 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
  38. 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
  39. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/_available_/1_2_1_1_1.yml +2692 -0
  40. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/_available_/2_2_1_1_1.yml +119 -0
  41. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author/1_3_17_1.yml +1530 -0
  42. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author/2_3_17_1.yml +68 -0
  43. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_thumbnail/1_3_16_1.yml +1530 -0
  44. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_thumbnail/2_3_16_1.yml +68 -0
  45. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_url/1_3_18_1.yml +1529 -0
  46. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_url/2_3_18_1.yml +68 -0
  47. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_date/should_have_correct_upload_date.yml +1595 -0
  48. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_description/1_3_7_1.yml +1602 -0
  49. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_description/2_3_7_1.yml +68 -0
  50. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_duration/1_3_9_1.yml +1530 -0
  51. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_duration/2_3_9_1.yml +68 -0
  52. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_height/1_3_11_1.yml +1529 -0
  53. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_height/2_3_11_1.yml +68 -0
  54. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_keywords/should_return_a_string_list_of_keywords.yml +1595 -0
  55. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_large/1_3_15_1.yml +1530 -0
  56. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_large/2_3_15_1.yml +68 -0
  57. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_medium/1_3_14_1.yml +1530 -0
  58. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_medium/2_3_14_1.yml +68 -0
  59. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_small/1_3_13_1.yml +1530 -0
  60. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_small/2_3_13_1.yml +68 -0
  61. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_title/1_3_6_1.yml +1602 -0
  62. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_title/2_3_6_1.yml +68 -0
  63. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_view_count/1_3_19_1.yml +1530 -0
  64. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_view_count/2_3_19_1.yml +68 -0
  65. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_width/1_3_10_1.yml +1530 -0
  66. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_width/2_3_10_1.yml +68 -0
  67. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author/1_3_17_1.yml +2559 -0
  68. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author/2_3_17_1.yml +159 -0
  69. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_thumbnail/1_3_16_1.yml +2559 -0
  70. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_thumbnail/2_3_16_1.yml +159 -0
  71. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_url/1_3_18_1.yml +2559 -0
  72. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_url/2_3_18_1.yml +159 -0
  73. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_date/should_have_correct_upload_date.yml +2714 -0
  74. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_description/1_3_7_1.yml +2692 -0
  75. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_description/2_3_7_1.yml +159 -0
  76. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_duration/1_3_9_1.yml +2829 -0
  77. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_duration/2_3_9_1.yml +159 -0
  78. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_height/1_3_11_1.yml +2828 -0
  79. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_height/2_3_11_1.yml +159 -0
  80. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_keywords/should_return_a_string_list_of_keywords.yml +2716 -0
  81. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_large/1_3_15_1.yml +2560 -0
  82. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_large/2_3_15_1.yml +159 -0
  83. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_medium/1_3_14_1.yml +2558 -0
  84. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_medium/2_3_14_1.yml +159 -0
  85. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_small/1_3_13_1.yml +2558 -0
  86. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_small/2_3_13_1.yml +159 -0
  87. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_title/1_3_6_1.yml +2961 -0
  88. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_title/2_3_6_1.yml +159 -0
  89. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_view_count/1_3_19_1.yml +2560 -0
  90. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_view_count/2_3_19_1.yml +159 -0
  91. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_width/1_3_10_1.yml +2560 -0
  92. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_width/2_3_10_1.yml +159 -0
  93. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_hashes/available_/1_2_6_1_1.yml +2996 -0
  94. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_invalid_video/available_/1_2_2_1_1.yml +46 -0
  95. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_private_video/available_/1_2_3_1_1.yml +865 -0
  96. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_redirect/available_/1_2_4_1_1.yml +666 -0
  97. 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
  98. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_valid_video/available_/1_2_1_1_1.yml +2118 -0
  99. 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
  100. 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
  101. 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
  102. 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
  103. 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
  104. 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
  105. 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
  106. 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
  107. 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
  108. 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
  109. 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
  110. 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
  111. 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
  112. 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
  113. 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
  114. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video-54799401_165822734/title/1_7_4_1.yml +682 -0
  115. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video3552522_171340713/embed_url/1_10_1_1.yml +501 -0
  116. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/description/1_6_8_1.yml +449 -0
  117. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/duration/1_6_10_1.yml +449 -0
  118. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_code/1_6_6_1.yml +449 -0
  119. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_url/1_6_5_1.yml +449 -0
  120. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/height/1_6_12_1.yml +449 -0
  121. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/title/1_6_7_1.yml +449 -0
  122. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/view_count/1_6_13_1.yml +449 -0
  123. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/width/1_6_11_1.yml +449 -0
  124. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author/1_4_5_1.yml +527 -0
  125. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author_thumbnail/1_4_6_1.yml +527 -0
  126. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author_url/1_4_7_1.yml +527 -0
  127. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/title/1_4_4_1.yml +527 -0
  128. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_invalid_video/_available_/1_2_2_1_1.yml +71 -0
  129. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_valid_video/_available_/1_2_1_1_1.yml +73 -0
  130. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_duration/1_4_7_1.yml +80 -0
  131. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_height/1_4_9_1.yml +80 -0
  132. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_large/1_4_12_1.yml +80 -0
  133. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_medium/1_4_11_1.yml +80 -0
  134. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_small/1_4_10_1.yml +80 -0
  135. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_title/1_4_6_1.yml +80 -0
  136. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_width/1_4_8_1.yml +80 -0
  137. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_duration/1_3_7_1.yml +80 -0
  138. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_height/1_3_9_1.yml +80 -0
  139. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_large/1_3_12_1.yml +80 -0
  140. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_medium/1_3_11_1.yml +80 -0
  141. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_small/1_3_10_1.yml +80 -0
  142. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_title/1_3_6_1.yml +80 -0
  143. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_width/1_3_8_1.yml +80 -0
  144. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_available_/1_2_2_1_1.yml +516 -0
  145. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_available_/2_2_2_1_1.yml +56 -0
  146. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_date/1_2_2_11_1.yml +519 -0
  147. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_date/2_2_2_11_1.yml +56 -0
  148. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_description/1_2_2_8_1.yml +521 -0
  149. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_description/2_2_2_8_1.yml +56 -0
  150. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_duration/1_2_2_10_1.yml +519 -0
  151. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_duration/2_2_2_10_1.yml +56 -0
  152. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_keywords/1_2_2_9_1.yml +519 -0
  153. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_keywords/2_2_2_9_1.yml +56 -0
  154. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_title/1_2_2_7_1.yml +519 -0
  155. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_title/2_2_2_7_1.yml +56 -0
  156. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/1_2_2_15_1.yml +516 -0
  157. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/2_2_2_15_1.yml +56 -0
  158. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/_available_/1_2_1_1_1.yml +3930 -0
  159. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/_available_/2_2_1_1_1.yml +127 -0
  160. 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
  161. 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
  162. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_date/should_return_date_video_was_posted.yml +3912 -0
  163. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_description/1_17_7_1.yml +4007 -0
  164. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_description/2_17_7_1.yml +127 -0
  165. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_duration/1_17_9_1.yml +3982 -0
  166. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_duration/2_17_9_1.yml +127 -0
  167. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_keywords/1_17_8_1.yml +3984 -0
  168. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_keywords/2_17_8_1.yml +127 -0
  169. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_title/1_17_6_1.yml +3946 -0
  170. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_title/2_17_6_1.yml +127 -0
  171. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_view_count/1_17_16_1.yml +3948 -0
  172. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_view_count/2_17_16_1.yml +127 -0
  173. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author/1_3_6_1.yml +4006 -0
  174. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author/2_3_6_1.yml +127 -0
  175. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_thumbnail/1_3_7_1.yml +4027 -0
  176. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_thumbnail/2_3_7_1.yml +212 -0
  177. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_url/1_3_8_1.yml +4080 -0
  178. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_url/2_3_8_1.yml +212 -0
  179. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_date/should_return_date_video_was_posted.yml +3982 -0
  180. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_description/1_3_10_1.yml +3992 -0
  181. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_description/2_3_10_1.yml +127 -0
  182. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_duration/1_3_12_1.yml +3961 -0
  183. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_duration/2_3_12_1.yml +127 -0
  184. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_keywords/1_3_11_1.yml +3928 -0
  185. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_keywords/2_3_11_1.yml +127 -0
  186. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_title/1_3_9_1.yml +3974 -0
  187. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_title/2_3_9_1.yml +127 -0
  188. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/1_3_19_1.yml +3950 -0
  189. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/2_3_19_1.yml +127 -0
  190. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/_available_/1_2_2_1_1.yml +62 -0
  191. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/_available_/2_2_2_1_1.yml +62 -0
  192. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_list_url/_available_/1_2_3_1_1.yml +96 -0
  193. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_list_url/_available_/2_2_3_1_1.yml +96 -0
  194. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/_available_/1_2_1_1_1.yml +96 -0
  195. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/_available_/2_2_1_1_1.yml +96 -0
  196. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author/1_3_18_1.yml +107 -0
  197. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author/2_3_18_1.yml +107 -0
  198. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_thumbnail/1_3_19_1.yml +193 -0
  199. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_thumbnail/2_3_19_1.yml +193 -0
  200. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_url/1_3_20_1.yml +193 -0
  201. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_url/2_3_20_1.yml +193 -0
  202. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_description/1_3_7_1.yml +107 -0
  203. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_description/2_3_7_1.yml +107 -0
  204. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_keywords/1_3_8_1.yml +107 -0
  205. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_keywords/2_3_8_1.yml +107 -0
  206. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large/1_3_15_1.yml +107 -0
  207. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large/2_3_15_1.yml +107 -0
  208. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_medium/1_3_14_1.yml +107 -0
  209. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_medium/2_3_14_1.yml +107 -0
  210. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_small/1_3_13_1.yml +107 -0
  211. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_small/2_3_13_1.yml +107 -0
  212. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_title/1_3_6_1.yml +107 -0
  213. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_title/2_3_6_1.yml +107 -0
  214. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_videos/returns_list_of_videos_in_playlist.yml +267 -0
  215. 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
  216. 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
  217. data/spec/lib/video_info/provider_spec.rb +42 -22
  218. data/spec/lib/video_info/providers/dailymotion_spec.rb +41 -23
  219. data/spec/lib/video_info/providers/vimeo_spec.rb +212 -177
  220. data/spec/lib/video_info/providers/vkontakte_spec.rb +132 -63
  221. data/spec/lib/video_info/providers/wistia_spec.rb +34 -13
  222. data/spec/lib/video_info/providers/youtube_playlist_spec.rb +185 -139
  223. data/spec/lib/video_info/providers/youtube_spec.rb +400 -385
  224. data/spec/lib/video_info_spec.rb +27 -21
  225. data/video_info.gemspec +7 -10
  226. metadata +424 -87
  227. data/foo.txt +0 -33
  228. data/spec/lib/video_info/providers/vimeo_api_spec.rb +0 -242
  229. data/spec/lib/video_info/providers/youtube_api_spec.rb +0 -476
  230. 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: b2cda17be09315cfde97837ef1d83079603b078c
4
- data.tar.gz: 348006204240253cb21171460f6ece7233a7a7bb
3
+ metadata.gz: 18c94c937caae05276816dd3ed8ebe10df074b0b
4
+ data.tar.gz: 61a33b65f281e74192fd355574616281b2ef2eb9
5
5
  SHA512:
6
- metadata.gz: 8a9698723a90069f7384a468dc2e4e7966dd24a45fa089d9db4fd12875fcbd692b883479cd7b35799e47a4fea45044a738d3289742cac52a380eb180620b5974
7
- data.tar.gz: 9790babb47a770171278319207be12d69186e42b7cda66ab2914f3b62d127600584ef88d1711836a037aab44cb98d2602b587ca1bd4d0d2bbda427b172583924
6
+ metadata.gz: 06a186d5c3fea88716f226090c797a82bbee92f1180683b5963fc96684d87c37b2eb6b25b18a2016eeca714023c7c86f3c0b558dce3dbc0881bad507c4917d07
7
+ data.tar.gz: 99f37329ca0c12666afd6f58e9f68af88dc62fe8d62a67ec542a074569bdd1b311c1f21fd86a56eb20ee1a7be4f8a576ffdd372050f808b439e3d8bb9f69d201
data/.gitignore CHANGED
@@ -18,7 +18,6 @@ coverage
18
18
  rdoc
19
19
  pkg
20
20
  Gemfile.lock
21
- spec/fixtures/
22
21
  *.gem
23
22
 
24
23
  ## PROJECT::SPECIFIC
@@ -1,2 +1,243 @@
1
- StringLiterals:
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
@@ -1,13 +1,14 @@
1
1
  language: ruby
2
2
  sudo: false
3
- bundler_args: --without tool
3
+ dist: trusty
4
+ cache: bundler
4
5
  rvm:
5
- - 2.2.0
6
- - jruby
7
- - rbx
8
- matrix:
9
- allow_failures:
10
- - rvm: rbx
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
@@ -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
@@ -1,4 +1,4 @@
1
- source "http://rubygems.org"
1
+ source 'http://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in video_info.gemspec
4
4
  gemspec
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') { "spec" }
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.2.0 and the latest versions of JRuby & Rubinius.
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
@@ -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, :thumbnail_small, :thumbnail_medium, :thumbnail_large
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