video_info 2.7.1 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (246) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/unit_test.yml +42 -0
  3. data/Guardfile +1 -1
  4. data/README.md +8 -19
  5. data/lib/video_info/provider.rb +11 -2
  6. data/lib/video_info/providers/vimeo_api.rb +9 -3
  7. data/lib/video_info/providers/vimeo_scraper.rb +12 -2
  8. data/lib/video_info/providers/youtube.rb +8 -0
  9. data/lib/video_info/providers/youtube_api.rb +1 -2
  10. data/lib/video_info/providers/youtube_scraper.rb +43 -25
  11. data/lib/video_info/providers/youtubeplaylist_api.rb +15 -1
  12. data/lib/video_info/version.rb +1 -1
  13. data/lib/video_info.rb +3 -3
  14. data/tmp/rspec_guard_result +25 -0
  15. data/video_info.gemspec +5 -6
  16. metadata +16 -472
  17. data/.travis.yml +0 -21
  18. data/lib/video_info/providers/vkontakte.rb +0 -212
  19. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_invalid_video_url/_available_/1_2_2_1_1.yml +0 -93
  20. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_valid_video/_available_/1_2_1_1_1.yml +0 -96
  21. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_author/1_3_7_1.yml +0 -100
  22. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_author_thumbnail/1_3_9_1.yml +0 -100
  23. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_author_url/1_3_8_1.yml +0 -100
  24. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_date/should_show_correct_date.yml +0 -100
  25. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_description/1_3_10_1.yml +0 -100
  26. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_duration/1_3_12_1.yml +0 -100
  27. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_keywords/1_3_11_1.yml +0 -100
  28. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail/1_3_19_1.yml +0 -100
  29. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_large/1_3_18_1.yml +0 -100
  30. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_medium/1_3_17_1.yml +0 -100
  31. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_small/1_3_16_1.yml +0 -100
  32. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_title/1_3_6_1.yml +0 -100
  33. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_view_count/1_3_20_1.yml +0 -100
  34. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/_available_/1_2_3_1_1.yml +0 -150
  35. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/_available_/2_2_3_1_1.yml +0 -65
  36. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/_available_/1_2_2_1_1.yml +0 -124
  37. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/_available_/2_2_2_1_1.yml +0 -67
  38. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/_available_/1_2_1_1_1.yml +0 -150
  39. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/_available_/2_2_1_1_1.yml +0 -67
  40. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/author/1_13_2_1.yml +0 -128
  41. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/author_thumbnail/1_13_3_1.yml +0 -128
  42. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/author_url/1_13_4_1.yml +0 -128
  43. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/available_/1_13_1_1.yml +0 -128
  44. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/date/1_13_7_1.yml +0 -128
  45. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/description/1_13_6_1.yml +0 -128
  46. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/duration/1_13_8_1.yml +0 -128
  47. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/height/1_13_10_1.yml +0 -128
  48. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/keywords/1_13_9_1.yml +0 -128
  49. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/thumbnail_large/1_13_14_1.yml +0 -128
  50. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/thumbnail_medium/1_13_13_1.yml +0 -128
  51. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/thumbnail_small/1_13_12_1.yml +0 -128
  52. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/title/1_13_5_1.yml +0 -128
  53. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/view_count/1_13_15_1.yml +0 -128
  54. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/width/1_13_11_1.yml +0 -128
  55. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author/1_3_18_1.yml +0 -150
  56. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author/2_3_18_1.yml +0 -79
  57. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_thumbnail/1_3_17_1.yml +0 -150
  58. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_thumbnail/2_3_17_1.yml +0 -79
  59. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_url/1_3_19_1.yml +0 -150
  60. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_url/2_3_19_1.yml +0 -79
  61. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_date/should_have_correct_upload_date.yml +0 -226
  62. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_description/1_3_7_1.yml +0 -150
  63. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_description/2_3_7_1.yml +0 -79
  64. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_duration/1_3_9_1.yml +0 -150
  65. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_duration/2_3_9_1.yml +0 -79
  66. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_height/1_3_11_1.yml +0 -150
  67. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_height/2_3_11_1.yml +0 -79
  68. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_keywords/should_return_a_string_list_of_keywords.yml +0 -226
  69. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail/1_3_16_1.yml +0 -222
  70. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail/2_3_16_1.yml +0 -79
  71. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_large/1_3_15_1.yml +0 -222
  72. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_large/2_3_15_1.yml +0 -79
  73. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_medium/1_3_14_1.yml +0 -222
  74. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_medium/2_3_14_1.yml +0 -79
  75. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_small/1_3_13_1.yml +0 -222
  76. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_small/2_3_13_1.yml +0 -79
  77. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_title/1_3_6_1.yml +0 -150
  78. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_title/2_3_6_1.yml +0 -79
  79. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_view_count/1_3_20_1.yml +0 -150
  80. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_view_count/2_3_20_1.yml +0 -79
  81. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_width/1_3_10_1.yml +0 -150
  82. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_width/2_3_10_1.yml +0 -79
  83. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_193970014/thumbnail/1_12_1_1.yml +0 -222
  84. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_193970014/thumbnail/2_12_1_1.yml +0 -75
  85. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_193970014/thumbnail_large/1_12_2_1.yml +0 -222
  86. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_193970014/thumbnail_large/2_12_2_1.yml +0 -75
  87. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_193970014/thumbnail_medium/1_12_3_1.yml +0 -222
  88. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_193970014/thumbnail_medium/2_12_3_1.yml +0 -75
  89. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_193970014/thumbnail_small/1_12_4_1.yml +0 -222
  90. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_193970014/thumbnail_small/2_12_4_1.yml +0 -75
  91. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_hashes/available_/1_2_6_1_1.yml +0 -86
  92. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_invalid_video/available_/1_2_2_1_1.yml +0 -50
  93. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_private_video/available_/1_2_3_1_1.yml +0 -132
  94. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_redirect/available_/1_2_4_1_1.yml +0 -134
  95. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_redirect_to_main_page_for_auth/available_/1_2_5_1_1.yml +0 -85
  96. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_valid_video/available_/1_2_1_1_1.yml +0 -87
  97. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/author/1_5_14_1.yml +0 -48
  98. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/author_thumbnail/1_5_15_1.yml +0 -48
  99. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/author_url/1_5_16_1.yml +0 -48
  100. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/description/1_5_8_1.yml +0 -48
  101. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/duration/1_5_10_1.yml +0 -48
  102. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/embed_code/1_5_6_1.yml +0 -48
  103. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/embed_url/1_5_5_1.yml +0 -48
  104. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/height/1_5_12_1.yml +0 -48
  105. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/thumbnail_small/1_5_18_1.yml +0 -48
  106. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/title/1_5_7_1.yml +0 -48
  107. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/view_count/1_5_13_1.yml +0 -48
  108. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/width/1_5_11_1.yml +0 -50
  109. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_https_/vk_com/id44052340_z_video61291456_159590018_2F2521d92730a272a9ea/author/1_3_7_1.yml +0 -48
  110. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_https_/vk_com/id44052340_z_video61291456_159590018_2F2521d92730a272a9ea/embed_code/1_3_6_1.yml +0 -48
  111. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_https_/vk_com/id44052340_z_video61291456_159590018_2F2521d92730a272a9ea/embed_url/1_3_5_1.yml +0 -48
  112. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_https_/vk_com/id44052340_z_video61291456_159590018_2F2521d92730a272a9ea/title/1_3_4_1.yml +0 -48
  113. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video-54799401_165822734/title/1_7_4_1.yml +0 -48
  114. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video3552522_171340713/embed_url/1_10_1_1.yml +0 -48
  115. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_161598544/description/1_6_8_1.yml +0 -48
  116. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_161598544/duration/1_6_10_1.yml +0 -48
  117. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_161598544/embed_code/1_6_6_1.yml +0 -48
  118. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_161598544/embed_url/1_6_5_1.yml +0 -48
  119. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_161598544/height/1_6_12_1.yml +0 -48
  120. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_161598544/title/1_6_7_1.yml +0 -48
  121. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_161598544/view_count/1_6_13_1.yml +0 -48
  122. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_161598544/width/1_6_11_1.yml +0 -48
  123. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author/1_4_5_1.yml +0 -48
  124. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author_thumbnail/1_4_6_1.yml +0 -48
  125. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author_url/1_4_7_1.yml +0 -48
  126. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/title/1_4_4_1.yml +0 -48
  127. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_invalid_video/_available_/1_2_2_1_1.yml +0 -67
  128. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_valid_video/_available_/1_2_1_1_1.yml +0 -69
  129. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_duration/1_4_7_1.yml +0 -77
  130. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_height/1_4_9_1.yml +0 -77
  131. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_large/1_4_12_1.yml +0 -77
  132. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_medium/1_4_11_1.yml +0 -77
  133. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_small/1_4_10_1.yml +0 -77
  134. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_title/1_4_6_1.yml +0 -77
  135. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_width/1_4_8_1.yml +0 -77
  136. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_duration/1_3_7_1.yml +0 -77
  137. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_height/1_3_9_1.yml +0 -77
  138. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail/1_3_13_1.yml +0 -77
  139. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_large/1_3_12_1.yml +0 -77
  140. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_medium/1_3_11_1.yml +0 -77
  141. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_small/1_3_10_1.yml +0 -77
  142. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_title/1_3_6_1.yml +0 -77
  143. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_width/1_3_8_1.yml +0 -77
  144. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/foo/_available/1_2_2_1_1.yml +0 -1447
  145. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/foo/_available/2_2_2_1_1.yml +0 -156
  146. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_available_/1_2_2_1_1.yml +0 -481
  147. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_available_/1_2_3_1_1.yml +0 -485
  148. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_available_/2_2_2_1_1.yml +0 -54
  149. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_available_/2_2_3_1_1.yml +0 -54
  150. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_date/1_2_2_11_1.yml +0 -481
  151. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_date/1_2_3_11_1.yml +0 -481
  152. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_date/2_2_2_11_1.yml +0 -54
  153. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_date/2_2_3_11_1.yml +0 -54
  154. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_description/1_2_2_8_1.yml +0 -483
  155. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_description/1_2_3_8_1.yml +0 -483
  156. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_description/2_2_2_8_1.yml +0 -54
  157. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_description/2_2_3_8_1.yml +0 -54
  158. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_duration/1_2_2_10_1.yml +0 -485
  159. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_duration/1_2_3_10_1.yml +0 -484
  160. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_duration/2_2_2_10_1.yml +0 -54
  161. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_duration/2_2_3_10_1.yml +0 -54
  162. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_keywords/1_2_2_9_1.yml +0 -485
  163. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_keywords/1_2_3_9_1.yml +0 -484
  164. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_keywords/2_2_2_9_1.yml +0 -54
  165. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_keywords/2_2_3_9_1.yml +0 -54
  166. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_title/1_2_2_7_1.yml +0 -481
  167. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_title/1_2_3_7_1.yml +0 -484
  168. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_title/2_2_2_7_1.yml +0 -54
  169. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_title/2_2_3_7_1.yml +0 -54
  170. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/1_2_2_17_1.yml +0 -485
  171. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/1_2_3_17_1.yml +0 -485
  172. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/2_2_2_17_1.yml +0 -54
  173. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/2_2_3_17_1.yml +0 -54
  174. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/_available_/1_2_1_1_1.yml +0 -56
  175. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/_available_/2_2_1_1_1.yml +0 -125
  176. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_removed_because_of_copyright_claim/_available_/1_2_3_1_1.yml +0 -483
  177. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_removed_because_of_copyright_claim/_available_/1_2_4_1_1.yml +0 -484
  178. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_removed_because_of_copyright_claim/_available_/2_2_3_1_1.yml +0 -54
  179. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_removed_because_of_copyright_claim/_available_/2_2_4_1_1.yml +0 -54
  180. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_date/should_return_date_video_was_posted.yml +0 -178
  181. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_description/1_17_7_1.yml +0 -56
  182. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_description/2_17_7_1.yml +0 -125
  183. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_duration/1_17_9_1.yml +0 -56
  184. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_duration/2_17_9_1.yml +0 -125
  185. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_keywords/1_17_8_1.yml +0 -56
  186. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_keywords/2_17_8_1.yml +0 -125
  187. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_title/1_17_6_1.yml +0 -56
  188. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_title/2_17_6_1.yml +0 -125
  189. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_view_count/1_17_16_1.yml +0 -56
  190. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_view_count/2_17_16_1.yml +0 -125
  191. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author/1_3_6_1.yml +0 -56
  192. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author/2_3_6_1.yml +0 -125
  193. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_thumbnail/1_3_7_1.yml +0 -56
  194. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_thumbnail/2_3_7_1.yml +0 -208
  195. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_url/1_3_8_1.yml +0 -56
  196. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_url/2_3_8_1.yml +0 -208
  197. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_date/should_return_date_video_was_posted.yml +0 -178
  198. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_description/1_3_10_1.yml +0 -56
  199. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_description/2_3_10_1.yml +0 -125
  200. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_duration/1_3_12_1.yml +0 -56
  201. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_duration/2_3_12_1.yml +0 -125
  202. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_keywords/1_3_11_1.yml +0 -56
  203. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_keywords/2_3_11_1.yml +0 -125
  204. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_title/1_3_9_1.yml +0 -56
  205. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_title/2_3_9_1.yml +0 -125
  206. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/1_3_20_1.yml +0 -56
  207. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/2_3_20_1.yml +0 -125
  208. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/_available_/1_2_2_1_1.yml +0 -60
  209. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/_available_/2_2_2_1_1.yml +0 -60
  210. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_list_url/_available_/1_2_3_1_1.yml +0 -94
  211. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_list_url/_available_/2_2_3_1_1.yml +0 -94
  212. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/_available_/1_2_1_1_1.yml +0 -94
  213. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/_available_/2_2_1_1_1.yml +0 -94
  214. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author/1_3_19_1.yml +0 -105
  215. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author/2_3_19_1.yml +0 -105
  216. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_thumbnail/1_3_20_1.yml +0 -189
  217. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_thumbnail/2_3_20_1.yml +0 -189
  218. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_url/1_3_21_1.yml +0 -189
  219. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_url/2_3_21_1.yml +0 -189
  220. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_description/1_3_7_1.yml +0 -105
  221. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_description/2_3_7_1.yml +0 -105
  222. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_keywords/1_3_8_1.yml +0 -105
  223. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_keywords/2_3_8_1.yml +0 -105
  224. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail/1_3_16_1.yml +0 -105
  225. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail/2_3_16_1.yml +0 -105
  226. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large/1_3_15_1.yml +0 -105
  227. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large/2_3_15_1.yml +0 -105
  228. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_medium/1_3_14_1.yml +0 -105
  229. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_medium/2_3_14_1.yml +0 -105
  230. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_small/1_3_13_1.yml +0 -105
  231. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_small/2_3_13_1.yml +0 -105
  232. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_title/1_3_6_1.yml +0 -105
  233. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_title/2_3_6_1.yml +0 -105
  234. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_videos/returns_list_of_videos_in_playlist.yml +0 -265
  235. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_that_does_not_exist_in_embed_path/_videos/1_4_2_1.yml +0 -54
  236. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_that_does_not_exist_in_embed_path/_videos/2_4_2_1.yml +0 -54
  237. data/spec/lib/video_info/provider_spec.rb +0 -80
  238. data/spec/lib/video_info/providers/dailymotion_spec.rb +0 -194
  239. data/spec/lib/video_info/providers/vimeo_spec.rb +0 -328
  240. data/spec/lib/video_info/providers/vkontakte_spec.rb +0 -236
  241. data/spec/lib/video_info/providers/wistia_spec.rb +0 -197
  242. data/spec/lib/video_info/providers/youtube_playlist_spec.rb +0 -236
  243. data/spec/lib/video_info/providers/youtube_scraper_spec.rb +0 -12
  244. data/spec/lib/video_info/providers/youtube_spec.rb +0 -575
  245. data/spec/lib/video_info_spec.rb +0 -106
  246. data/spec/spec_helper.rb +0 -26
@@ -1,328 +0,0 @@
1
- require 'spec_helper'
2
-
3
- [nil, '6b66b015a3504793b4f541d878f46ff6'].each do |api_key|
4
- describe VideoInfo::Providers::Vimeo do
5
- before(:all) do
6
- VideoInfo.provider_api_keys = { vimeo: api_key }
7
- end
8
-
9
- describe '.usable?' do
10
- subject { VideoInfo::Providers::Vimeo.usable?(url) }
11
-
12
- context 'with vimeo url' do
13
- let(:url) { 'http://www.vimeo.com/898029' }
14
- it { is_expected.to be_truthy }
15
- end
16
-
17
- context 'with Vimeo OnDemand url' do
18
- let(:url) { 'https://vimeo.com/ondemand/less/101677664' }
19
- it { is_expected.to be_truthy }
20
- end
21
-
22
- context 'with Vimeo Channels url' do
23
- let(:url) { 'https://vimeo.com/channels/any_channel/111431415' }
24
- it { is_expected.to be_truthy }
25
- end
26
-
27
- context 'with Vimeo Review url' do
28
- video_url = 'https://vimeo.com/user39798190/review/126641548/8a56234e32'
29
- let(:url) { video_url }
30
- it { is_expected.to be_truthy }
31
- end
32
-
33
- context 'with vimeo album url' do
34
- let(:url) { 'http://vimeo.com/album/2755718' }
35
- it { is_expected.to be_falsey }
36
- end
37
-
38
- context 'with vimeo hubnub embed url' do
39
- let(:url) { 'http://player.vimeo.com/hubnut/album/2755718' }
40
- it { is_expected.to be_falsey }
41
- end
42
-
43
- context 'with other url' do
44
- let(:url) { 'http://www.youtube.com/898029' }
45
- it { is_expected.to be_falsey }
46
- end
47
- end
48
-
49
- describe '#available?' do
50
- context 'with valid video', :vcr do
51
- subject { VideoInfo.new('http://vimeo.com/98605382'.freeze) }
52
-
53
- describe '#available?' do
54
- it { is_expected.to be_available }
55
- end
56
- end
57
-
58
- context "with 'this video does not exist' video", :vcr do
59
- subject { VideoInfo.new('http://vimeo.com/59312311') }
60
-
61
- describe '#available?' do
62
- it { is_expected.to_not be_available }
63
- end
64
- end
65
-
66
- context "with 'password required' video", :vcr do
67
- subject { VideoInfo.new('http://vimeo.com/74636562') }
68
-
69
- describe '#available?' do
70
- it { is_expected.to_not be_available }
71
- end
72
- end
73
- end
74
-
75
- context 'with video 136971428', :vcr do
76
- subject { VideoInfo.new('https://vimeo.com/136971428') }
77
-
78
- describe '#provider' do
79
- subject { super().provider }
80
- it { is_expected.to eq 'Vimeo' }
81
- end
82
-
83
- describe '#video_id' do
84
- subject { super().video_id }
85
- it { is_expected.to eq '136971428' }
86
- end
87
-
88
- describe '#url' do
89
- subject { super().url }
90
- it { is_expected.to eq 'https://vimeo.com/136971428' }
91
- end
92
-
93
- describe '#embed_url' do
94
- subject { super().embed_url }
95
- it { is_expected.to eq '//player.vimeo.com/video/136971428' }
96
- end
97
-
98
- describe '#embed_code' do
99
- subject { super().embed_code }
100
- embed_code = '<iframe src="//player.vimeo.com/video/136971428?' \
101
- 'title=0&byline=0&portrait=0&autoplay=0" ' \
102
- 'frameborder="0"></iframe>'
103
- it { is_expected.to eq embed_code }
104
- end
105
-
106
- describe '#title' do
107
- subject { super().title }
108
- it { is_expected.to eq "Deafheaven - 'New Bermuda' Trailer" }
109
- end
110
-
111
- describe '#description' do
112
- subject { super().description }
113
- description = "'New Bermuda,' the upcoming album from Deafheaven, " \
114
- 'is available October 2nd'
115
- it { is_expected.to eq description }
116
- end
117
-
118
- describe '#keywords' do
119
- subject { super().keywords }
120
- it 'should return a string list of keywords' do
121
- keywords_list = []
122
- is_expected.to eq keywords_list
123
- end
124
- end
125
-
126
- describe '#duration' do
127
- subject { super().duration }
128
- it { is_expected.to eq 59 }
129
- end
130
-
131
- describe '#width' do
132
- subject { super().width }
133
- it { is_expected.to eq 1280 }
134
- end
135
-
136
- describe '#height' do
137
- subject { super().height }
138
- it { is_expected.to eq 720 }
139
- end
140
-
141
- describe '#date' do
142
- subject { super().date }
143
- it 'should have correct upload date' do
144
- is_expected.to eq Time.parse('2015-08-21T21:37:43+00:00',
145
- Time.now.utc).utc
146
- end
147
- end
148
-
149
- describe '#thumbnail_small' do
150
- subject { super().thumbnail_small }
151
- thumbnail_url = 'https://i.vimeocdn.com/video/531688239_100x75.jpg'
152
- it { is_expected.to eq thumbnail_url }
153
- end
154
-
155
- describe '#thumbnail_medium' do
156
- subject { super().thumbnail_medium }
157
- thumbnail_url = 'https://i.vimeocdn.com/video/531688239_200x150.jpg'
158
- it { is_expected.to eq thumbnail_url }
159
- end
160
-
161
- describe '#thumbnail_large' do
162
- subject { super().thumbnail_large }
163
- thumbnail_url = 'https://i.vimeocdn.com/video/531688239_640.jpg'
164
- it { is_expected.to eq thumbnail_url }
165
- end
166
-
167
- describe '#thumbnail' do
168
- subject { super().thumbnail }
169
- thumbnail_url = 'https://i.vimeocdn.com/video/531688239_640.jpg'
170
- it { is_expected.to eq thumbnail_url }
171
- end
172
-
173
- describe '#author_thumbnail' do
174
- subject { super().author_thumbnail }
175
-
176
- #
177
- # For some reason, the scraper returns an image URL without
178
- # a file extension. This will likely change in the future.
179
- #
180
-
181
- thumbnail_url = 'https://i.vimeocdn.com/portrait/14790276_75x75'
182
-
183
- if api_key
184
- thumbnail_url += '.jpg'
185
- end
186
-
187
- it { is_expected.to eq thumbnail_url }
188
- end
189
-
190
- describe '#author' do
191
- subject { super().author }
192
- it { is_expected.to eq 'Anti Records' }
193
- end
194
-
195
- describe '#author_url' do
196
- subject { super().author_url }
197
- it { is_expected.to eq 'https://vimeo.com/antirecords' }
198
- end
199
-
200
- describe '#view_count' do
201
- subject { super().view_count }
202
- it { is_expected.to be > 80 }
203
- end
204
- end
205
-
206
- context 'with video 898029 and url_attributes', :vcr do
207
- subject { VideoInfo.new('http://www.vimeo.com/898029') }
208
-
209
- it 'should add URL attribute' do
210
- attributes = { autoplay: 1 }
211
- embed_code = subject.embed_code(url_attributes: attributes)
212
- expect(embed_code).to match(/autoplay=1/)
213
- end
214
- end
215
-
216
- context 'with video 898029 and iframe_attributes', :vcr do
217
- subject { VideoInfo.new('http://www.vimeo.com/898029') }
218
-
219
- it 'should have proper dimensions' do
220
- dimensions = { width: 800, height: 600 }
221
- embed_code = subject.embed_code(iframe_attributes: dimensions)
222
- expect(embed_code).to match(/width="800"/)
223
- expect(embed_code).to match(/height="600"/)
224
- end
225
- end
226
-
227
- context 'with video 898029 in /group/ url', :vcr do
228
- subject { VideoInfo.new('http://vimeo.com/groups/1234/videos/898029') }
229
-
230
- describe '#provider' do
231
- subject { super().provider }
232
- it { is_expected.to eq 'Vimeo' }
233
- end
234
-
235
- describe '#video_id' do
236
- subject { super().video_id }
237
- it { is_expected.to eq '898029' }
238
- end
239
- end
240
-
241
- context 'with video 898029 in /group/ url', :vcr do
242
- subject { VideoInfo.new('http://player.vimeo.com/video/898029') }
243
-
244
- describe '#provider' do
245
- subject { super().provider }
246
- it { is_expected.to eq 'Vimeo' }
247
- end
248
-
249
- describe '#video_id' do
250
- subject { super().video_id }
251
- it { is_expected.to eq '898029' }
252
- end
253
- end
254
-
255
- context 'with video 898029 in text', :vcr do
256
- video_url_in_text = '<a href="http://www.vimeo.com/898029">' \
257
- 'http://www.vimeo.com/898029</a>'
258
- subject { VideoInfo.new(video_url_in_text) }
259
-
260
- describe '#provider' do
261
- subject { super().provider }
262
- it { is_expected.to eq 'Vimeo' }
263
- end
264
-
265
- describe '#video_id' do
266
- subject { super().video_id }
267
- it { is_expected.to eq '898029' }
268
- end
269
- end
270
-
271
- context 'with video 101677664 in /ondemand/ url', :vcr do
272
- subject { VideoInfo.new('https://vimeo.com/ondemand/less/101677664') }
273
-
274
- its(:provider) { should eq 'Vimeo' }
275
- its(:video_id) { should eq '101677664' }
276
- end
277
-
278
- context 'with video 111431415 in /channels/*/ url', :vcr do
279
- video_url = 'https://vimeo.com/channels/some_channel1/111431415'
280
- subject { VideoInfo.new(video_url) }
281
-
282
- its(:provider) { should eq 'Vimeo' }
283
- its(:video_id) { should eq '111431415' }
284
- end
285
-
286
- context 'with video 126641548 in /user*/review/126641548/* url', :vcr do
287
- video_url = 'http://www.vimeo.com/user39798190/review/126641548/8a56234e32'
288
- subject { VideoInfo.new(video_url) }
289
-
290
- its(:provider) { should eq 'Vimeo' }
291
- its(:video_id) { should eq '126641548' }
292
- end
293
-
294
- context 'with video 193970014', :vcr do
295
- video_url = 'https://vimeo.com/193970014'
296
- subject { VideoInfo.new(video_url) }
297
-
298
- its(:thumbnail) { should eq 'https://i.vimeocdn.com/video/607241994_640.jpg' }
299
- its(:thumbnail_large) { should eq 'https://i.vimeocdn.com/video/607241994_640.jpg' }
300
- its(:thumbnail_medium) { should eq 'https://i.vimeocdn.com/video/607241994_200x150.jpg' }
301
- its(:thumbnail_small) { should eq 'https://i.vimeocdn.com/video/607241994_100x75.jpg' }
302
-
303
- end
304
-
305
- context 'with unavailable video', :vcr do
306
- if api_key.nil?
307
- video_url = 'https://vimeo.com/0812455'
308
- subject { VideoInfo.new(video_url) }
309
-
310
- its(:available?) { should be false }
311
- its(:author) { should be nil }
312
- its(:author_thumbnail) { should be nil }
313
- its(:author_url) { should be nil }
314
- its(:title) { should be nil }
315
- its(:description) { should be nil }
316
- its(:date) { should be nil }
317
- its(:duration) { should be nil }
318
- its(:keywords) { should be nil }
319
- its(:height) { should be nil }
320
- its(:width) { should be nil }
321
- its(:thumbnail_small) { should be nil }
322
- its(:thumbnail_medium) { should be nil }
323
- its(:thumbnail_large) { should be nil }
324
- its(:view_count) { should be nil }
325
- end
326
- end
327
- end
328
- end
@@ -1,236 +0,0 @@
1
- # encoding: UTF-8
2
- require 'spec_helper'
3
- require 'webmock/rspec'
4
-
5
- describe VideoInfo::Providers::Vkontakte do
6
- describe '.usable?' do
7
- subject { VideoInfo::Providers::Vkontakte.usable?(url) }
8
-
9
- context 'with vkontakte url' do
10
- context 'old style', :vcr do
11
- let(:url) { 'http://vk.com/video39576223_108370515' }
12
- it { should be_truthy }
13
- end
14
-
15
- context 'new style', :vcr do
16
- let(:url) do
17
- 'https://vk.com/kirill.lyanoi?z=video2152699' \
18
- '_168591741%2F56fd229a9dfe2dcdbe'
19
- end
20
- it { should be_truthy }
21
- end
22
- end
23
-
24
- context 'with other url' do
25
- let(:url) { 'http://www.youtube.com/898029' }
26
- it { should be_falsey }
27
- end
28
-
29
- context 'with invalid url' do
30
- let(:url) { 'http://vk.com just random data' }
31
- it { should be_falsey }
32
- end
33
-
34
- context 'with spaces at end' do
35
- let(:url) { 'http://vk.com/video39576223_108370515 ' }
36
- it { should be_truthy }
37
- end
38
-
39
- context 'with spaces at start' do
40
- let(:url) { ' http://vk.com/video39576223_108370515' }
41
- it { should be_truthy }
42
- end
43
-
44
- context 'with spaces around url' do
45
- let(:url) { ' http://vk.com/video39576223_108370515 ' }
46
- it { should be_truthy }
47
- end
48
- end
49
-
50
- describe '#available?' do
51
- context 'with valid video', :vcr do
52
- subject { VideoInfo.new('https://vk.com/videos39576223?z=video39576223_165607445%2Fpl_39576223_-2'.freeze) }
53
- its(:available?) { should be_truthy }
54
- end
55
-
56
- context 'with invalid video', :vcr do
57
- subject { VideoInfo.new('http://vk.com/video39576223_invalid') }
58
- its(:available?) { should be_falsey }
59
- end
60
-
61
- context 'with private video', :vcr do
62
- subject { VideoInfo.new('http://vk.com/video39576223_166315543') }
63
- its(:available?) { should be_falsey }
64
- end
65
-
66
- context 'with redirect', :vcr do
67
- video_url = 'http://vk.com/polinka_zh?z=' \
68
- 'video186965901_168185427%2Fbfb2bd2e674031520a'
69
- subject { VideoInfo.new(video_url) }
70
- its(:available?) { should be_truthy }
71
- end
72
-
73
- context 'with redirect to main page for auth', :vcr do
74
- video_url = 'https://vk.com/video?z=video39576223_166315543%2Fpl_cat_updates'
75
- subject { VideoInfo.new(video_url) }
76
- its(:available?) { should be_falsey }
77
- end
78
-
79
- context 'with hashes', :vcr do
80
- video_url = 'https://vk.com/videos43640822#/video43640822_168790809'
81
- subject { VideoInfo.new(video_url) }
82
- its(:available?) { should be_truthy }
83
- end
84
- end
85
-
86
- context 'with video https://vk.com/id44052340?z=' \
87
- 'video61291456_159590018%2F2521d92730a272a9ea', :vcr do
88
- video_url = 'https://vk.com/id44052340?z=' \
89
- 'video61291456_159590018%2F2521d92730a272a9ea'
90
-
91
- subject { VideoInfo.new(video_url) }
92
-
93
- embed_code = '<iframe src="//vk.com/video_ext.php?oid=61291456&' \
94
- 'id=159590018&hash=68174b2af560c54c" frameborder="0" ' \
95
- 'allowfullscreen="allowfullscreen"></iframe>'
96
- embed_url = '//vk.com/video_ext.php?oid=61291456&' \
97
- 'id=159590018&hash=68174b2af560c54c'
98
-
99
- its(:provider) { should eq 'Vkontakte' }
100
- its(:video_owner) { should eq '61291456' }
101
- its(:video_id) { should eq '159590018' }
102
- its(:title) { should eq 'Happy Birthday To You' }
103
- its(:embed_url) { should eq embed_url }
104
- its(:embed_code) { should eq embed_code }
105
- its(:author) { should eq('Tanka Malesh').or(eq('Танька Малеш')) }
106
- end
107
-
108
- context 'with video videos43640822#/video43640822_168790809', :vcr do
109
- video_url = 'https://vk.com/videos43640822#/video43640822_168790809'
110
- subject { VideoInfo.new(video_url) }
111
-
112
- author_thumbnail = 'https://pp.userapi.com/c837422/v837422822/93c8/00oqd-3BS9U.jpg'
113
- video_title = 'UDC open cup 2014/ 3 place / Saley Daria (solo)'
114
-
115
- its(:provider) { should eq 'Vkontakte' }
116
- its(:video_owner) { should eq '43640822' }
117
- its(:video_id) { should eq '168790809' }
118
- its(:title) { should eq video_title }
119
- its(:author) { should eq('Dasha Saley').or(eq('Даша Салей')) }
120
- its(:author_thumbnail) { should eq author_thumbnail }
121
- its(:author_url) { should eq 'https://vk.com/dariasaley' }
122
- end
123
-
124
- context 'with video from kirill.lyanoi?z=' \
125
- 'video2152699_168591741%2F56fd229a9dfe2dcdbe', :vcr do
126
- video_url = 'https://vk.com/kirill.lyanoi?' \
127
- 'z=video2152699_168591741%2F56fd229a9dfe2dcdbe'
128
- subject { VideoInfo.new(video_url) }
129
-
130
- author_thumbnail = 'https://pp.userapi.com/c623824/v623824699/55575/CCQZ29l0B9k.jpg'
131
- thumbnail_small = 'https://pp.userapi.com/c617831/u96123303/video/l_27e4ff5c.jpg'
132
- description_text = 'BEAT SOUL STEP ★ Project818 Russian ' \
133
- 'Dance Championship ★ 1-2 мая, Москва 2014'
134
- video_title = 'BEAT SOUL STEP — RDC14 Project818 Russian ' \
135
- 'Dance Championship, May 1-2, Moscow 2014'
136
- embed_code = '<iframe src="//vk.com/video_ext.php?oid=2152699' \
137
- '&id=168591741&hash=ea1d3db98818125d" frameborder="0" ' \
138
- 'allowfullscreen="allowfullscreen"></iframe>'
139
- embed_url = '//vk.com/video_ext.php?oid=2152699&id=168591741' \
140
- '&hash=ea1d3db98818125d'
141
- author = 'Kirill Lyanoy'
142
- author_alt = 'Кирилл Льяной'
143
-
144
- its(:provider) { should eq 'Vkontakte' }
145
- its(:video_owner) { should eq '2152699' }
146
- its(:video_id) { should eq '168591741' }
147
- its(:url) { should eq video_url }
148
- its(:embed_url) { should eq embed_url }
149
- its(:embed_code) { should eq embed_code }
150
- its(:title) { should eq video_title }
151
- its(:description) { should start_with description_text }
152
- its(:keywords) { should be_nil }
153
- its(:duration) { should eq 299 }
154
- its(:width) { should eq 960 }
155
- its(:height) { should eq 540 }
156
- its(:view_count) { should be > 10 }
157
- its(:author) { should eq(author).or(eq(author_alt)) }
158
- its(:author_thumbnail) { should eq author_thumbnail }
159
- its(:author_url) { should eq 'https://vk.com/lyanoi.kirill' }
160
- its(:thumbnail) { should be_nil }
161
- its(:thumbnail_small) { should eq thumbnail_small }
162
- end
163
-
164
- context 'with video video39576223_161598544', :vcr do
165
- subject { VideoInfo.new('https://vk.com/video39576223_161598544') }
166
-
167
- title_text = 'Harry Partridge - Skyrim (русская озвучка)'
168
- description_text = 'Тут могло быть описание'
169
- embed_url = '//vk.com/video_ext.php?oid=39576223&' \
170
- 'id=161598544&hash=f7140d579b7f53e4'
171
- embed_code = '<iframe src="//vk.com/video_ext.php?oid=39576223' \
172
- '&id=161598544&hash=f7140d579b7f53e4" frameborder="0"' \
173
- ' allowfullscreen="allowfullscreen"></iframe>'
174
-
175
- its(:provider) { should eq 'Vkontakte' }
176
- its(:video_owner) { should eq '39576223' }
177
- its(:video_id) { should eq '161598544' }
178
- its(:url) { should eq 'https://vk.com/video39576223_161598544' }
179
- its(:embed_url) { should eq embed_url }
180
- its(:embed_code) { should eq embed_code }
181
- its(:title) { should eq title_text }
182
- its(:description) { should eq description_text }
183
- its(:keywords) { should be_nil }
184
- its(:duration) { should eq 85 }
185
- its(:width) { should eq 960 }
186
- its(:height) { should eq 540 }
187
- its(:view_count) { should be > 10 }
188
- end
189
-
190
- context 'with video video-54799401_165822734', :vcr do
191
- subject { VideoInfo.new('http://vk.com/video-54799401_165822734') }
192
-
193
- its(:provider) { should eq 'Vkontakte' }
194
- its(:video_owner) { should eq '-54799401' }
195
- its(:video_id) { should eq '165822734' }
196
- its(:title) { should eq 'SpaceGlasses are the future of computing' }
197
- end
198
-
199
- context 'with valid video and connection timeout' do
200
- subject { VideoInfo.new('http://vk.com/video-54799401_165822734') }
201
-
202
- describe '#title' do
203
- before do
204
- stub_request(:any, /.*vk.com.*/).to_timeout
205
- end
206
-
207
- it 'raises VideoInfo::HttpError exception' do
208
- expect { subject.title }.to raise_error VideoInfo::HttpError
209
- end
210
- end
211
- end
212
-
213
- context 'with valid video and OpenURI::HTTPError exception' do
214
- subject { VideoInfo.new('http://vk.com/video-54799401_165822734') }
215
-
216
- describe '#title' do
217
- before do
218
- stub = stub_request(:any, /.*vk.com.*/)
219
- stub.to_raise(OpenURI::HTTPError.new('error', :nop))
220
- end
221
-
222
- it 'raises VideoInfo::HttpError exception' do
223
- expect { subject.title }.to raise_error VideoInfo::HttpError
224
- end
225
- end
226
- end
227
-
228
- context 'with video video3552522_171340713', :vcr do
229
- subject { VideoInfo.new('http://vk.com/video3552522_171340713') }
230
-
231
- embed_url = '//vk.com/video_ext.php?oid=3552522&id=171340713' \
232
- '&hash=9826caf9bf171494'
233
-
234
- its(:embed_url) { should eq embed_url }
235
- end
236
- end