video_info 2.6.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (275) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/unit_test.yml +39 -0
  3. data/Guardfile +1 -1
  4. data/README.md +10 -21
  5. data/lib/video_info.rb +5 -4
  6. data/lib/video_info/provider.rb +17 -2
  7. data/lib/video_info/providers/dailymotion.rb +13 -0
  8. data/lib/video_info/providers/vimeo_api.rb +12 -12
  9. data/lib/video_info/providers/vimeo_scraper.rb +66 -16
  10. data/lib/video_info/providers/youtube.rb +12 -0
  11. data/lib/video_info/providers/youtube_api.rb +12 -13
  12. data/lib/video_info/providers/youtube_scraper.rb +44 -25
  13. data/lib/video_info/providers/youtubeplaylist_api.rb +15 -1
  14. data/lib/video_info/version.rb +1 -1
  15. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_invalid_video_url/_available_/1_2_2_1_1.yml +29 -36
  16. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_valid_video/_available_/1_2_1_1_1.yml +29 -34
  17. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/{_description → _author}/1_3_7_1.yml +35 -39
  18. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/{_duration → _author_thumbnail}/1_3_9_1.yml +35 -39
  19. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/{_keywords → _author_url}/1_3_8_1.yml +35 -39
  20. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_date/should_show_correct_date.yml +35 -39
  21. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/{_thumbnail_large/1_3_15_1.yml → _description/1_3_10_1.yml} +35 -39
  22. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_duration/1_3_12_1.yml +91 -0
  23. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_keywords/1_3_11_1.yml +91 -0
  24. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail/1_3_21_1.yml +91 -0
  25. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_large/1_3_18_1.yml +91 -0
  26. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_medium/1_3_17_1.yml +91 -0
  27. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/{_view_count → _thumbnail_small}/1_3_16_1.yml +35 -39
  28. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_title/1_3_6_1.yml +34 -38
  29. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_view_count/1_3_22_1.yml +91 -0
  30. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/_available_/1_2_3_1_1.yml +39 -852
  31. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/_available_/2_2_3_1_1.yml +30 -21
  32. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/_available_/1_2_2_1_1.yml +45 -854
  33. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/_available_/2_2_2_1_1.yml +30 -21
  34. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/_available_/1_2_1_1_1.yml +45 -2579
  35. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/_available_/2_2_1_1_1.yml +28 -79
  36. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/author/1_13_2_1.yml +130 -0
  37. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/author_thumbnail/1_13_3_1.yml +130 -0
  38. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/author_url/1_13_4_1.yml +132 -0
  39. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/available_/1_13_1_1.yml +130 -0
  40. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/date/1_13_7_1.yml +128 -0
  41. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/description/1_13_6_1.yml +131 -0
  42. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/duration/1_13_8_1.yml +130 -0
  43. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/height/1_13_10_1.yml +131 -0
  44. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/keywords/1_13_9_1.yml +128 -0
  45. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/thumbnail_large/1_13_14_1.yml +129 -0
  46. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/thumbnail_medium/1_13_13_1.yml +129 -0
  47. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/thumbnail_small/1_13_12_1.yml +129 -0
  48. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/title/1_13_5_1.yml +130 -0
  49. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/view_count/1_13_15_1.yml +129 -0
  50. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_unavailable_video/width/1_13_11_1.yml +129 -0
  51. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author/1_3_20_1.yml +158 -0
  52. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author/2_3_20_1.yml +80 -0
  53. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_thumbnail/1_3_19_1.yml +158 -0
  54. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_thumbnail/2_3_19_1.yml +85 -0
  55. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_url/1_3_21_1.yml +159 -0
  56. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_url/2_3_21_1.yml +80 -0
  57. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_date/should_have_correct_upload_date.yml +143 -1498
  58. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_description/1_3_7_1.yml +45 -1487
  59. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_description/2_3_7_1.yml +42 -30
  60. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_duration/1_3_9_1.yml +98 -1470
  61. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_duration/2_3_9_1.yml +45 -28
  62. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_height/1_3_11_1.yml +100 -1471
  63. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_height/2_3_11_1.yml +42 -30
  64. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_keywords/should_return_a_string_list_of_keywords.yml +144 -1499
  65. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail/1_3_18_1.yml +236 -0
  66. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail/2_3_18_1.yml +82 -0
  67. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_large/1_3_15_1.yml +176 -1470
  68. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_large/2_3_15_1.yml +43 -29
  69. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_medium/1_3_14_1.yml +177 -1472
  70. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_medium/2_3_14_1.yml +43 -27
  71. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_small/1_3_13_1.yml +176 -1470
  72. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_small/2_3_13_1.yml +43 -27
  73. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_title/1_3_6_1.yml +44 -1487
  74. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_title/2_3_6_1.yml +45 -28
  75. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_view_count/1_3_22_1.yml +158 -0
  76. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_view_count/2_3_22_1.yml +84 -0
  77. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_width/1_3_10_1.yml +99 -1473
  78. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_width/2_3_10_1.yml +43 -29
  79. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_141349194/thumbnail/1_12_1_1.yml +234 -0
  80. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_141349194/thumbnail/2_12_1_1.yml +78 -0
  81. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_141349194/thumbnail_large/1_12_2_1.yml +233 -0
  82. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_141349194/thumbnail_large/2_12_2_1.yml +78 -0
  83. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_141349194/thumbnail_medium/1_12_3_1.yml +235 -0
  84. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_141349194/thumbnail_medium/2_12_3_1.yml +73 -0
  85. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_141349194/thumbnail_small/1_12_4_1.yml +234 -0
  86. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_141349194/thumbnail_small/2_12_4_1.yml +77 -0
  87. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_invalid_video/_available_/1_2_2_1_1.yml +29 -25
  88. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_valid_video/_available_/1_2_1_1_1.yml +31 -25
  89. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_duration/1_4_7_1.yml +37 -32
  90. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_height/1_4_9_1.yml +37 -32
  91. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_large/1_4_12_1.yml +37 -31
  92. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_medium/1_4_11_1.yml +37 -31
  93. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_small/1_4_10_1.yml +37 -32
  94. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_title/1_4_6_1.yml +37 -31
  95. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_width/1_4_8_1.yml +37 -31
  96. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_duration/1_3_7_1.yml +36 -31
  97. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_height/1_3_9_1.yml +36 -29
  98. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail/1_3_15_1.yml +87 -0
  99. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_large/1_3_12_1.yml +36 -29
  100. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_medium/1_3_11_1.yml +36 -29
  101. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_small/1_3_10_1.yml +36 -31
  102. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_title/1_3_6_1.yml +36 -31
  103. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_width/1_3_8_1.yml +36 -29
  104. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_available_/1_2_2_1_1.yml +25 -482
  105. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_available_/2_2_2_1_1.yml +82 -24
  106. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_date/1_2_2_11_1.yml +24 -484
  107. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_date/2_2_2_11_1.yml +82 -24
  108. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_description/1_2_2_8_1.yml +22 -484
  109. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_description/2_2_2_8_1.yml +82 -24
  110. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_duration/1_2_2_10_1.yml +23 -483
  111. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_duration/2_2_2_10_1.yml +82 -24
  112. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_keywords/1_2_2_9_1.yml +26 -486
  113. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_keywords/2_2_2_9_1.yml +82 -24
  114. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_title/1_2_2_7_1.yml +26 -486
  115. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_title/2_2_2_7_1.yml +82 -24
  116. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/1_2_2_18_1.yml +59 -0
  117. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/2_2_2_18_1.yml +114 -0
  118. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/_available_/1_2_1_1_1.yml +25 -3896
  119. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/_available_/2_2_1_1_1.yml +153 -93
  120. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_removed_because_of_copyright_claim/_available_/1_2_3_1_1.yml +25 -544
  121. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_removed_because_of_copyright_claim/_available_/2_2_3_1_1.yml +80 -83
  122. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_a_video_without_description/_description/1_1_1_1.yml +59 -0
  123. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_date/should_return_date_video_was_posted.yml +180 -3843
  124. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_description/1_17_7_1.yml +20 -3968
  125. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_description/2_17_7_1.yml +153 -93
  126. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_duration/1_17_9_1.yml +23 -3946
  127. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_duration/2_17_9_1.yml +153 -93
  128. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_keywords/1_17_8_1.yml +25 -3950
  129. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_keywords/2_17_8_1.yml +153 -93
  130. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_title/1_17_6_1.yml +23 -3910
  131. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_title/2_17_6_1.yml +153 -93
  132. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_view_count/1_17_17_1.yml +59 -0
  133. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_view_count/2_17_17_1.yml +187 -0
  134. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author/1_3_6_1.yml +60 -3951
  135. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author/2_3_6_1.yml +153 -93
  136. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_thumbnail/1_3_7_1.yml +58 -3970
  137. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_thumbnail/2_3_7_1.yml +272 -149
  138. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_url/1_3_8_1.yml +22 -4043
  139. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_url/2_3_8_1.yml +272 -149
  140. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_url/can_be_called_twice_and_receive_the_same_value.yml +391 -0
  141. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_date/should_return_date_video_was_posted.yml +175 -3914
  142. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_description/1_3_10_1.yml +25 -3957
  143. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_description/2_3_10_1.yml +153 -93
  144. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_duration/1_3_12_1.yml +24 -3926
  145. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_duration/2_3_12_1.yml +153 -93
  146. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_keywords/1_3_11_1.yml +24 -3893
  147. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_keywords/2_3_11_1.yml +153 -93
  148. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_title/1_3_9_1.yml +23 -3938
  149. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_title/2_3_9_1.yml +153 -93
  150. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/1_3_21_1.yml +59 -0
  151. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/2_3_21_1.yml +187 -0
  152. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/_available_/1_2_2_1_1.yml +88 -30
  153. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_list_url/_available_/1_2_3_1_1.yml +121 -63
  154. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/_available_/1_2_1_1_1.yml +121 -63
  155. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author/1_3_21_1.yml +165 -0
  156. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_thumbnail/1_3_22_1.yml +274 -0
  157. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_url/1_3_23_1.yml +274 -0
  158. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_description/1_3_7_1.yml +132 -74
  159. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_keywords/1_3_8_1.yml +132 -74
  160. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail/1_3_18_1.yml +165 -0
  161. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large/1_3_15_1.yml +132 -74
  162. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large_2x/1_3_16_1.yml +165 -0
  163. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_maxres/1_3_17_1.yml +165 -0
  164. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_medium/1_3_14_1.yml +132 -74
  165. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_small/1_3_13_1.yml +132 -74
  166. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_title/1_3_6_1.yml +132 -74
  167. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_videos/returns_list_of_videos_in_playlist.yml +79 -234
  168. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_that_does_not_exist_in_embed_path/_videos/1_4_2_1.yml +82 -24
  169. data/spec/lib/video_info/providers/dailymotion_spec.rb +34 -4
  170. data/spec/lib/video_info/providers/vimeo_spec.rb +77 -16
  171. data/spec/lib/video_info/providers/wistia_spec.rb +26 -8
  172. data/spec/lib/video_info/providers/youtube_playlist_spec.rb +186 -176
  173. data/spec/lib/video_info/providers/youtube_scraper_spec.rb +14 -0
  174. data/spec/lib/video_info/providers/youtube_spec.rb +71 -29
  175. data/spec/lib/video_info_spec.rb +0 -4
  176. data/spec/spec_helper.rb +6 -1
  177. data/tmp/rspec_guard_result +25 -0
  178. data/video_info.gemspec +8 -8
  179. metadata +143 -222
  180. data/.travis.yml +0 -14
  181. data/lib/video_info/providers/vkontakte.rb +0 -194
  182. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_medium/1_3_14_1.yml +0 -95
  183. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_small/1_3_13_1.yml +0 -95
  184. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author/1_3_17_1.yml +0 -1530
  185. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author/2_3_17_1.yml +0 -68
  186. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_thumbnail/1_3_16_1.yml +0 -1530
  187. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_thumbnail/2_3_16_1.yml +0 -68
  188. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_url/1_3_18_1.yml +0 -1529
  189. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_url/2_3_18_1.yml +0 -68
  190. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_view_count/1_3_19_1.yml +0 -1530
  191. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_view_count/2_3_19_1.yml +0 -68
  192. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author/1_3_17_1.yml +0 -2559
  193. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author/2_3_17_1.yml +0 -159
  194. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_thumbnail/1_3_16_1.yml +0 -2559
  195. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_thumbnail/2_3_16_1.yml +0 -159
  196. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_url/1_3_18_1.yml +0 -2559
  197. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_url/2_3_18_1.yml +0 -159
  198. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_date/should_have_correct_upload_date.yml +0 -2714
  199. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_description/1_3_7_1.yml +0 -2692
  200. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_description/2_3_7_1.yml +0 -159
  201. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_duration/1_3_9_1.yml +0 -2829
  202. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_duration/2_3_9_1.yml +0 -159
  203. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_height/1_3_11_1.yml +0 -2828
  204. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_height/2_3_11_1.yml +0 -159
  205. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_keywords/should_return_a_string_list_of_keywords.yml +0 -2716
  206. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_large/1_3_15_1.yml +0 -2560
  207. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_large/2_3_15_1.yml +0 -159
  208. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_medium/1_3_14_1.yml +0 -2558
  209. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_medium/2_3_14_1.yml +0 -159
  210. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_small/1_3_13_1.yml +0 -2558
  211. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_small/2_3_13_1.yml +0 -159
  212. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_title/1_3_6_1.yml +0 -2961
  213. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_title/2_3_6_1.yml +0 -159
  214. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_view_count/1_3_19_1.yml +0 -2560
  215. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_view_count/2_3_19_1.yml +0 -159
  216. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_width/1_3_10_1.yml +0 -2560
  217. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_width/2_3_10_1.yml +0 -159
  218. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_hashes/available_/1_2_6_1_1.yml +0 -2996
  219. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_invalid_video/available_/1_2_2_1_1.yml +0 -46
  220. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_private_video/available_/1_2_3_1_1.yml +0 -865
  221. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_redirect/available_/1_2_4_1_1.yml +0 -666
  222. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_redirect_to_main_page_for_auth/available_/1_2_5_1_1.yml +0 -46
  223. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_valid_video/available_/1_2_1_1_1.yml +0 -2118
  224. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/author/1_5_14_1.yml +0 -518
  225. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/author_thumbnail/1_5_15_1.yml +0 -519
  226. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/author_url/1_5_16_1.yml +0 -520
  227. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/description/1_5_8_1.yml +0 -518
  228. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/duration/1_5_10_1.yml +0 -517
  229. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/embed_code/1_5_6_1.yml +0 -517
  230. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/embed_url/1_5_5_1.yml +0 -519
  231. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/height/1_5_12_1.yml +0 -517
  232. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/title/1_5_7_1.yml +0 -517
  233. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/view_count/1_5_13_1.yml +0 -521
  234. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/width/1_5_11_1.yml +0 -517
  235. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_https_/vk_com/id44052340_z_video61291456_159590018_2F2521d92730a272a9ea/author/1_3_7_1.yml +0 -399
  236. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_https_/vk_com/id44052340_z_video61291456_159590018_2F2521d92730a272a9ea/embed_code/1_3_6_1.yml +0 -399
  237. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_https_/vk_com/id44052340_z_video61291456_159590018_2F2521d92730a272a9ea/embed_url/1_3_5_1.yml +0 -399
  238. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_https_/vk_com/id44052340_z_video61291456_159590018_2F2521d92730a272a9ea/title/1_3_4_1.yml +0 -399
  239. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video-54799401_165822734/title/1_7_4_1.yml +0 -682
  240. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video3552522_171340713/embed_url/1_10_1_1.yml +0 -501
  241. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/description/1_6_8_1.yml +0 -449
  242. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/duration/1_6_10_1.yml +0 -449
  243. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_code/1_6_6_1.yml +0 -449
  244. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_url/1_6_5_1.yml +0 -449
  245. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/height/1_6_12_1.yml +0 -449
  246. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/title/1_6_7_1.yml +0 -449
  247. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/view_count/1_6_13_1.yml +0 -449
  248. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/width/1_6_11_1.yml +0 -449
  249. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author/1_4_5_1.yml +0 -527
  250. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author_thumbnail/1_4_6_1.yml +0 -527
  251. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author_url/1_4_7_1.yml +0 -527
  252. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/title/1_4_4_1.yml +0 -527
  253. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/1_2_2_15_1.yml +0 -516
  254. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/2_2_2_15_1.yml +0 -56
  255. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_view_count/1_17_16_1.yml +0 -3948
  256. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_view_count/2_17_16_1.yml +0 -127
  257. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/1_3_19_1.yml +0 -3950
  258. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/2_3_19_1.yml +0 -127
  259. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/_available_/2_2_2_1_1.yml +0 -62
  260. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_list_url/_available_/2_2_3_1_1.yml +0 -96
  261. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/_available_/2_2_1_1_1.yml +0 -96
  262. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author/1_3_18_1.yml +0 -107
  263. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author/2_3_18_1.yml +0 -107
  264. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_thumbnail/1_3_19_1.yml +0 -193
  265. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_thumbnail/2_3_19_1.yml +0 -193
  266. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_url/1_3_20_1.yml +0 -193
  267. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_url/2_3_20_1.yml +0 -193
  268. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_description/2_3_7_1.yml +0 -107
  269. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_keywords/2_3_8_1.yml +0 -107
  270. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large/2_3_15_1.yml +0 -107
  271. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_medium/2_3_14_1.yml +0 -107
  272. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_small/2_3_13_1.yml +0 -107
  273. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_title/2_3_6_1.yml +0 -107
  274. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_that_does_not_exist_in_embed_path/_videos/2_4_2_1.yml +0 -56
  275. data/spec/lib/video_info/providers/vkontakte_spec.rb +0 -242
@@ -1,230 +1,240 @@
1
1
  require 'spec_helper'
2
2
 
3
- [nil, 'AIzaSyA6PYwSr1EnLFUFy1cZDk3Ifb0rxeJaeZ0'].each do |api_key|
4
- describe VideoInfo::Providers::YoutubePlaylist do
5
- before(:each) do
6
- api_key = 'AIzaSyA6PYwSr1EnLFUFy1cZDk3Ifb0rxeJaeZ0'
7
- VideoInfo.provider_api_keys = { youtube: api_key }
3
+ describe VideoInfo::Providers::YoutubePlaylist, :vcr do
4
+ before(:each) do
5
+ api_key = ENV["YOUTUBE_API_KEY"] || "youtube_api_key_123"
6
+ VideoInfo.provider_api_keys = { youtube: api_key }
7
+ end
8
+
9
+ describe '.usable?' do
10
+ subject { VideoInfo::Providers::YoutubePlaylist.usable?(url) }
11
+
12
+ context 'with youtube.com/playlist?p= url' do
13
+ let(:url) { 'http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF' }
14
+ it { is_expected.to be_truthy }
8
15
  end
9
16
 
10
- describe '.usable?' do
11
- subject { VideoInfo::Providers::YoutubePlaylist.usable?(url) }
17
+ context 'with youtube.com/playlist?list= url' do
18
+ let(:url) { 'http://www.youtube.com/playlist?list=PLA575C81A1FBC04CF' }
19
+ it { is_expected.to be_truthy }
20
+ end
12
21
 
13
- context 'with youtube.com/playlist?p= url' do
14
- let(:url) { 'http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF' }
15
- it { is_expected.to be_truthy }
16
- end
22
+ context 'with youtube.com url' do
23
+ let(:url) { 'http://www.youtube.com/watch?v=Xp6CXF' }
24
+ it { is_expected.to be_falsey }
25
+ end
26
+
27
+ context 'with other url' do
28
+ let(:url) { 'http://example.com/video1' }
29
+ it { is_expected.to be_falsey }
30
+ end
31
+ end
32
+
33
+ describe '#available?' do
34
+ context 'with valid playlist' do
35
+ playlist_url = 'http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF'
36
+ subject { VideoInfo.new(playlist_url.freeze) }
17
37
 
18
- context 'with youtube.com/playlist?list= url' do
19
- let(:url) { 'http://www.youtube.com/playlist?list=PLA575C81A1FBC04CF' }
38
+ describe '#available?' do
39
+ subject { super().available? }
20
40
  it { is_expected.to be_truthy }
21
41
  end
42
+ end
22
43
 
23
- context 'with youtube.com url' do
24
- let(:url) { 'http://www.youtube.com/watch?v=Xp6CXF' }
25
- it { is_expected.to be_falsey }
26
- end
44
+ context 'with invalid playlist' do
45
+ invalid_playlist_url = 'http://www.youtube.com/playlist?' \
46
+ 'p=PLA575C81A1FBC04CF_invalid'
47
+ subject { VideoInfo.new(invalid_playlist_url) }
27
48
 
28
- context 'with other url' do
29
- let(:url) { 'http://example.com/video1' }
49
+ describe '#available?' do
50
+ subject { super().available? }
30
51
  it { is_expected.to be_falsey }
31
52
  end
32
53
  end
33
54
 
34
- describe '#available?' do
35
- context 'with valid playlist', :vcr do
36
- playlist_url = 'http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF'
37
- subject { VideoInfo.new(playlist_url) }
55
+ context 'with &list= url' do
56
+ playlist_url = 'http://www.youtube.com/playlist?list=PLA575C81A1FBC04CF'
57
+ subject { VideoInfo.new(playlist_url) }
38
58
 
39
- describe '#available?' do
40
- subject { super().available? }
41
- it { is_expected.to be_truthy }
42
- end
59
+ describe '#available?' do
60
+ subject { super().available? }
61
+ it { is_expected.to be_truthy }
43
62
  end
63
+ end
64
+ end
44
65
 
45
- context 'with invalid playlist', :vcr do
46
- invalid_playlist_url = 'http://www.youtube.com/playlist?' \
47
- 'p=PLA575C81A1FBC04CF_invalid'
48
- subject { VideoInfo.new(invalid_playlist_url) }
66
+ context 'with playlist PL9hW1uS6HUftLdHI6RIsaf' do
67
+ let(:video_ids) do
68
+ [
69
+ "9g2U12SsRns", "AsqTAkLKb4M", "K681ILSXyUY", "OQVHWsTHcoc", "QtwplSG6VvM", "WK8qRNSmhEU", "XIoGq39abMk", "eKkv1C_O-QI", "lau14lhZpoU", "HvplY9BPKG8", "mTdNi9Mqiu8", "qAVwpBZ1HYA"
70
+ ]
71
+ end
49
72
 
50
- describe '#available?' do
51
- subject { super().available? }
52
- it { is_expected.to be_falsey }
53
- end
54
- end
73
+ playlist_url = 'http://www.youtube.com/playlist?' \
74
+ 'p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
55
75
 
56
- context 'with &list= url', :vcr do
57
- playlist_url = 'http://www.youtube.com/playlist?list=PLA575C81A1FBC04CF'
58
- subject { VideoInfo.new(playlist_url) }
76
+ subject { VideoInfo.new(playlist_url) }
59
77
 
60
- describe '#available?' do
61
- subject { super().available? }
62
- it { is_expected.to be_truthy }
63
- end
64
- end
78
+ describe '#provider' do
79
+ subject { super().provider }
80
+ it { is_expected.to eq 'YouTube' }
65
81
  end
66
82
 
67
- context 'with playlist PL9hW1uS6HUftLdHI6RIsaf', :vcr do
68
- let(:videos) do
69
- [
70
- VideoInfo.new('http://www.youtube.com/watch?v=Oi67QjrXy2w'),
71
- VideoInfo.new('http://www.youtube.com/watch?v=_Bt3-WsHfB0'),
72
- VideoInfo.new('http://www.youtube.com/watch?v=9g2U12SsRns'),
73
- VideoInfo.new('http://www.youtube.com/watch?v=8b0aEoxqqC0'),
74
- VideoInfo.new('http://www.youtube.com/watch?v=6c3mHikRz0I'),
75
- VideoInfo.new('http://www.youtube.com/watch?v=OQVHWsTHcoc')
76
- ]
77
- end
78
-
79
- playlist_url = 'http://www.youtube.com/playlist?' \
80
- 'p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
83
+ describe '#playlist_id' do
84
+ subject { super().playlist_id }
85
+ it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
86
+ end
81
87
 
82
- subject { VideoInfo.new(playlist_url) }
88
+ describe '#url' do
89
+ subject { super().url }
90
+ it { is_expected.to eq playlist_url }
91
+ end
83
92
 
84
- describe '#provider' do
85
- subject { super().provider }
86
- it { is_expected.to eq 'YouTube' }
87
- end
93
+ describe '#embed_url' do
94
+ subject { super().embed_url }
95
+ embed_url = '//www.youtube.com/embed/videoseries' \
96
+ '?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
97
+ it { is_expected.to eq embed_url }
98
+ end
88
99
 
89
- describe '#playlist_id' do
90
- subject { super().playlist_id }
91
- it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
92
- end
100
+ describe '#embed_code' do
101
+ subject { super().embed_code }
102
+ embed_code = '<iframe src="//www.youtube.com/embed/videoseries' \
103
+ '?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr" ' \
104
+ 'frameborder="0" allowfullscreen="allowfullscreen">' \
105
+ '</iframe>'
106
+ it { is_expected.to eq embed_code }
107
+ end
93
108
 
94
- describe '#url' do
95
- subject { super().url }
96
- it { is_expected.to eq playlist_url }
97
- end
109
+ describe '#title' do
110
+ subject { super().title }
111
+ it { is_expected.to eq 'YouTube Policy and Copyright' }
112
+ end
98
113
 
99
- describe '#embed_url' do
100
- subject { super().embed_url }
101
- embed_url = '//www.youtube.com/embed/videoseries' \
102
- '?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
103
- it { is_expected.to eq embed_url }
104
- end
114
+ describe '#description' do
115
+ subject { super().description }
116
+ description_text = 'Learn more about copyright basics, flagging, ' \
117
+ 'and the YouTube community.'
118
+ it { is_expected.to eq description_text }
119
+ end
105
120
 
106
- describe '#embed_code' do
107
- subject { super().embed_code }
108
- embed_code = '<iframe src="//www.youtube.com/embed/videoseries' \
109
- '?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr" ' \
110
- 'frameborder="0" allowfullscreen="allowfullscreen">' \
111
- '</iframe>'
112
- it { is_expected.to eq embed_code }
113
- end
121
+ describe '#keywords' do
122
+ subject { super().keywords }
123
+ it { is_expected.to be_nil }
124
+ end
114
125
 
115
- describe '#title' do
116
- subject { super().title }
117
- it { is_expected.to eq 'YouTube Policy and Copyright' }
118
- end
126
+ describe '#duration' do
127
+ subject { super().duration }
128
+ it { is_expected.to be_nil }
129
+ end
119
130
 
120
- describe '#description' do
121
- subject { super().description }
122
- description_text = 'Learn more about copyright basics, flagging, ' \
123
- 'and the YouTube community.'
124
- it { is_expected.to eq description_text }
125
- end
131
+ describe '#width' do
132
+ subject { super().width }
133
+ it { is_expected.to be_nil }
134
+ end
126
135
 
127
- describe '#keywords' do
128
- subject { super().keywords }
129
- it { is_expected.to be_nil }
130
- end
136
+ describe '#height' do
137
+ subject { super().height }
138
+ it { is_expected.to be_nil }
139
+ end
131
140
 
132
- describe '#duration' do
133
- subject { super().duration }
134
- it { is_expected.to be_nil }
135
- end
141
+ describe '#date' do
142
+ subject { super().date }
143
+ it { is_expected.to be_nil }
144
+ end
136
145
 
137
- describe '#width' do
138
- subject { super().width }
139
- it { is_expected.to be_nil }
140
- end
146
+ describe '#thumbnail_small' do
147
+ subject { super().thumbnail_small }
148
+ thumbnail_url = 'https://i.ytimg.com/vi/9g2U12SsRns/default.jpg'
149
+ it { is_expected.to eq thumbnail_url }
150
+ end
141
151
 
142
- describe '#height' do
143
- subject { super().height }
144
- it { is_expected.to be_nil }
145
- end
152
+ describe '#thumbnail_medium' do
153
+ subject { super().thumbnail_medium }
154
+ thumbnail_url = 'https://i.ytimg.com/vi/9g2U12SsRns/mqdefault.jpg'
155
+ it { is_expected.to eq thumbnail_url }
156
+ end
146
157
 
147
- describe '#date' do
148
- subject { super().date }
149
- it { is_expected.to be_nil }
150
- end
158
+ describe '#thumbnail_large' do
159
+ subject { super().thumbnail_large }
160
+ thumbnail_url = 'https://i.ytimg.com/vi/9g2U12SsRns/hqdefault.jpg'
161
+ it { is_expected.to eq thumbnail_url }
162
+ end
151
163
 
152
- describe '#thumbnail_small' do
153
- subject { super().thumbnail_small }
154
- thumbnail_url = 'https://i.ytimg.com/vi/8b0aEoxqqC0/default.jpg'
155
- it { is_expected.to eq thumbnail_url }
156
- end
164
+ describe '#thumbnail_large_2x' do
165
+ subject { super().thumbnail_large_2x }
166
+ thumbnail_url = 'https://i.ytimg.com/vi/9g2U12SsRns/sddefault.jpg'
167
+ it { is_expected.to eq thumbnail_url }
168
+ end
157
169
 
158
- describe '#thumbnail_medium' do
159
- subject { super().thumbnail_medium }
160
- thumbnail_url = 'https://i.ytimg.com/vi/8b0aEoxqqC0/mqdefault.jpg'
161
- it { is_expected.to eq thumbnail_url }
162
- end
170
+ describe '#thumbnail_maxres' do
171
+ subject { super().thumbnail_maxres }
172
+ thumbnail_url = 'https://i.ytimg.com/vi/9g2U12SsRns/maxresdefault.jpg'
173
+ it { is_expected.to eq thumbnail_url }
174
+ end
163
175
 
164
- describe '#thumbnail_large' do
165
- subject { super().thumbnail_large }
166
- thumbnail_url = 'https://i.ytimg.com/vi/8b0aEoxqqC0/hqdefault.jpg'
167
- it { is_expected.to eq thumbnail_url }
168
- end
176
+ describe '#thumbnail' do
177
+ subject { super().thumbnail }
178
+ thumbnail_url = 'https://i.ytimg.com/vi/9g2U12SsRns/default.jpg'
179
+ it { is_expected.to eq thumbnail_url }
180
+ end
169
181
 
170
- describe '#videos' do
171
- subject { super().videos }
172
- it 'returns list of videos in playlist' do
173
- pending('waiting for bug in Youtube API to be fixed')
174
- is_expected.to match_array(videos)
175
- end
182
+ describe '#videos' do
183
+ subject { super().videos.map(&:video_id) }
184
+ it 'returns list of videos in playlist' do
185
+ is_expected.to match_array(video_ids)
176
186
  end
187
+ end
177
188
 
178
- describe '#view_count' do
179
- subject { super().view_count }
180
- it { is_expected.to be_nil }
181
- end
189
+ describe '#view_count' do
190
+ subject { super().view_count }
191
+ it { is_expected.to be_nil }
192
+ end
182
193
 
183
- describe '#author' do
184
- subject { super().author }
185
- it { is_expected.to eq 'YouTube Help' }
186
- end
194
+ describe '#author' do
195
+ subject { super().author }
196
+ it { is_expected.to eq 'TeamYouTube [Help]' }
197
+ end
187
198
 
188
- describe '#author_thumbnail' do
189
- subject { super().author_thumbnail }
190
- author_thumbnail = 'https://yt3.ggpht.com/-ni_VaN38-AE/AAAAAAAAAAI/' \
191
- 'AAAAAAAAAAA/bJCTTfihBl0/s88-c-k-no-rj-c0xffffff' \
192
- '/photo.jpg'
193
- it { is_expected.to eq author_thumbnail }
194
- end
199
+ describe '#author_thumbnail' do
200
+ subject { super().author_thumbnail }
201
+ author_thumbnail = 'https://yt3.ggpht.com/a/' \
202
+ 'AATXAJwyEv0uEyk3JLskjLiUCqSVzsGmpWw2icLfBOBzWg' \
203
+ '=s88-c-k-c0x00ffffff-no-rj'
204
+ it { is_expected.to eq author_thumbnail }
205
+ end
195
206
 
196
- describe '#author_url' do
197
- subject { super().author_url }
198
- author_url = 'https://www.youtube.com/channel/UCMDQxm7cUx3yXkfeHa5zJIQ'
199
- it { is_expected.to eq author_url }
200
- end
207
+ describe '#author_url' do
208
+ subject { super().author_url }
209
+ author_url = 'https://www.youtube.com/channel/UCMDQxm7cUx3yXkfeHa5zJIQ'
210
+ it { is_expected.to eq author_url }
201
211
  end
212
+ end
202
213
 
203
- context 'with playlist that does not exist in embed path', :vcr do
204
- playlist_url = 'http://www.youtube.com/embed/videoseries?' \
205
- 'list=PL0E8117603D70E10A'
206
- subject { VideoInfo.new(playlist_url) }
214
+ context 'with playlist that does not exist in embed path' do
215
+ playlist_url = 'http://www.youtube.com/embed/videoseries?' \
216
+ 'list=PL0E8117603D70E10A'
217
+ subject { VideoInfo.new(playlist_url) }
207
218
 
208
- describe '#playlist_id' do
209
- subject { super().playlist_id }
210
- it { is_expected.to eq 'PL0E8117603D70E10A' }
211
- end
219
+ describe '#playlist_id' do
220
+ subject { super().playlist_id }
221
+ it { is_expected.to eq 'PL0E8117603D70E10A' }
222
+ end
212
223
 
213
- describe '#videos' do
214
- subject { super().videos }
215
- it { is_expected.to eq [] }
216
- end
224
+ describe '#videos' do
225
+ subject { super().videos }
226
+ it { is_expected.to eq [] }
217
227
  end
228
+ end
218
229
 
219
- context 'with playlist valid playlist in embed path', :vcr do
220
- playlist_url = 'http://www.youtube.com/embed/videoseries' \
221
- '?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
222
- subject { VideoInfo.new(playlist_url) }
230
+ context 'with playlist valid playlist in embed path' do
231
+ playlist_url = 'http://www.youtube.com/embed/videoseries' \
232
+ '?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
233
+ subject { VideoInfo.new(playlist_url) }
223
234
 
224
- describe '#playlist_id' do
225
- subject { super().playlist_id }
226
- it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
227
- end
235
+ describe '#playlist_id' do
236
+ subject { super().playlist_id }
237
+ it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
228
238
  end
229
239
  end
230
240
  end
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+
3
+ describe VideoInfo::Providers::Youtube do
4
+ before { VideoInfo.provider_api_keys = {} }
5
+
6
+ context 'with a video without description', :vcr do
7
+ subject { VideoInfo.new('http://www.youtube.com/watch?v=WVsj2pS-zFY') }
8
+
9
+ describe '#description' do
10
+ subject { super().description }
11
+ it { is_expected.to eq " " }
12
+ end
13
+ end
14
+ end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
- [nil, 'AIzaSyA6PYwSr1EnLFUFy1cZDk3Ifb0rxeJaeZ0'].each do |api_key|
4
- describe VideoInfo::Providers::Youtube do
3
+ [nil, ENV["YOUTUBE_API_KEY"] || "youtube_api_key_123"].each do |api_key|
4
+ describe VideoInfo::Providers::Youtube, :vcr do
5
5
  before(:all) do
6
6
  VideoInfo.provider_api_keys = { youtube: api_key }
7
7
  end
@@ -31,8 +31,8 @@ require 'spec_helper'
31
31
  end
32
32
 
33
33
  describe '#available?' do
34
- context 'with valid video', :vcr do
35
- subject { VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4') }
34
+ context 'with valid video' do
35
+ subject { VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4'.freeze) }
36
36
 
37
37
  describe '#available?' do
38
38
  subject { super().available? }
@@ -40,7 +40,7 @@ require 'spec_helper'
40
40
  end
41
41
  end
42
42
 
43
- context 'with unavailable video', :vcr do
43
+ context 'with unavailable video' do
44
44
  subject { VideoInfo.new('http://www.youtube.com/watch?v=SUkXvWn1m7Q') }
45
45
 
46
46
  describe '#available?' do
@@ -119,13 +119,31 @@ require 'spec_helper'
119
119
  it { is_expected.to eq thumbnail_url }
120
120
  end
121
121
 
122
+ describe '#thumbnail_large_2x' do
123
+ subject { super().thumbnail_large_2x }
124
+ thumbnail_url = 'https://i.ytimg.com/vi/SUkXvWn1m7Q/sddefault.jpg'
125
+ it { is_expected.to eq thumbnail_url }
126
+ end
127
+
128
+ describe '#thumbnail_maxres' do
129
+ subject { super().thumbnail_maxres }
130
+ thumbnail_url = 'https://i.ytimg.com/vi/SUkXvWn1m7Q/maxresdefault.jpg'
131
+ it { is_expected.to eq thumbnail_url }
132
+ end
133
+
134
+ describe '#thumbnail' do
135
+ subject { super().thumbnail }
136
+ thumbnail_url = 'https://i.ytimg.com/vi/SUkXvWn1m7Q/hqdefault.jpg'
137
+ it { is_expected.to eq thumbnail_url }
138
+ end
139
+
122
140
  describe '#view_count' do
123
141
  subject { super().view_count }
124
142
  it { is_expected.to be == 0 }
125
143
  end
126
144
  end
127
145
 
128
- context 'with video removed because of copyright claim', :vcr do
146
+ context 'with video removed because of copyright claim' do
129
147
  subject { VideoInfo.new('http://www.youtube.com/watch?v=ffClNhwx0KU') }
130
148
 
131
149
  describe '#available?' do
@@ -135,7 +153,7 @@ require 'spec_helper'
135
153
  end
136
154
  end
137
155
 
138
- context 'with video mZqGqE0D0n4', :vcr do
156
+ context 'with video mZqGqE0D0n4' do
139
157
  subject { VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4') }
140
158
 
141
159
  describe '#provider' do
@@ -173,16 +191,21 @@ require 'spec_helper'
173
191
 
174
192
  describe '#author_thumbnail' do
175
193
  subject { super().author_thumbnail }
176
- author_thumbnail = 'https://yt3.ggpht.com/-7rhnfdQaI3k/AAAAAAAAAAI/' \
177
- 'AAAAAAAAAAA/eMJZ5HBukCQ/s88-c-k-no-rj-c0xffffff' \
178
- '/photo.jpg'
194
+ author_thumbnail = 'https://yt3.ggpht.com/a/' \
195
+ 'AATXAJyf5l8p3WQvOx-Q0o8ssGmIL-K5taxKHv5ZEEYc' \
196
+ '=s88-c-k-c0x00ffffff-no-rj'
197
+
179
198
  it { is_expected.to eql author_thumbnail }
180
199
  end
181
200
 
182
201
  describe '#author_url' do
183
- subject { super().author_url }
184
202
  author_url = 'https://www.youtube.com/channel/UCzxQk-rZGowoqMBKxGD5jSA'
185
- it { is_expected.to eql author_url }
203
+
204
+ it { expect(subject.author_url).to eql(author_url) }
205
+
206
+ it 'can be called twice and receive the same value' do
207
+ expect(subject.author_url).to eq(subject.author_url)
208
+ end
186
209
  end
187
210
 
188
211
  describe '#title' do
@@ -227,7 +250,7 @@ require 'spec_helper'
227
250
  if api_key.nil?
228
251
  is_expected.to eq Time.parse('Sat Apr 12 2008', Time.now.utc)
229
252
  else
230
- is_expected.to eq Time.parse('Sat Apr 12 22:25:35 UTC 2008',
253
+ is_expected.to eq Time.parse('Sat Apr 12 22:34:48 UTC 2008',
231
254
  Time.now.utc)
232
255
  end
233
256
  end
@@ -251,13 +274,25 @@ require 'spec_helper'
251
274
  it { is_expected.to eq thumbnail_url }
252
275
  end
253
276
 
277
+ describe '#thumbnail_large_2x' do
278
+ subject { super().thumbnail_large_2x }
279
+ thumbnail_url = 'https://i.ytimg.com/vi/mZqGqE0D0n4/sddefault.jpg'
280
+ it { is_expected.to eq thumbnail_url }
281
+ end
282
+
283
+ describe '#thumbnail_maxres' do
284
+ subject { super().thumbnail_maxres }
285
+ thumbnail_url = 'https://i.ytimg.com/vi/mZqGqE0D0n4/maxresdefault.jpg'
286
+ it { is_expected.to eq thumbnail_url }
287
+ end
288
+
254
289
  describe '#view_count' do
255
290
  subject { super().view_count }
256
291
  it { is_expected.to be > 4000 }
257
292
  end
258
293
  end
259
294
 
260
- context 'with video oQ49W_xKzKA', :vcr do
295
+ context 'with video oQ49W_xKzKA' do
261
296
  subject { VideoInfo.new('http://www.youtube.com/watch?v=oQ49W_xKzKA') }
262
297
 
263
298
  it 'should properly apply arbitrary url attributes' do
@@ -266,7 +301,7 @@ require 'spec_helper'
266
301
  end
267
302
  end
268
303
 
269
- context 'with video oQ49W_xKzKA', :vcr do
304
+ context 'with video oQ49W_xKzKA' do
270
305
  subject { VideoInfo.new('http://www.youtube.com/watch?v=oQ49W_xKzKA') }
271
306
 
272
307
  describe '#provider' do
@@ -280,7 +315,7 @@ require 'spec_helper'
280
315
  end
281
316
  end
282
317
 
283
- context 'with video Xp6CXF-Cesg', :vcr do
318
+ context 'with video Xp6CXF-Cesg' do
284
319
  subject { VideoInfo.new('http://www.youtube.com/watch?v=Xp6CXF-Cesg') }
285
320
 
286
321
  describe '#provider' do
@@ -294,7 +329,7 @@ require 'spec_helper'
294
329
  end
295
330
  end
296
331
 
297
- context 'with video VeasFckfMHY in user url', :vcr do
332
+ context 'with video VeasFckfMHY in user url' do
298
333
  video_url = 'http://www.youtube.com/user/EducatorVids3?v=VeasFckfMHY'
299
334
  subject { VideoInfo.new(video_url) }
300
335
 
@@ -314,7 +349,7 @@ require 'spec_helper'
314
349
  end
315
350
  end
316
351
 
317
- context 'with video VeasFckfMHY after params', :vcr do
352
+ context 'with video VeasFckfMHY after params' do
318
353
  video_url = 'http://www.youtube.com/watch?feature=player_profilepage&v=VeasFckfMHY'
319
354
  subject { VideoInfo.new(video_url) }
320
355
 
@@ -334,7 +369,7 @@ require 'spec_helper'
334
369
  end
335
370
  end
336
371
 
337
- context 'with video VeasFckfMHY in path', :vcr do
372
+ context 'with video VeasFckfMHY in path' do
338
373
  subject { VideoInfo.new('http://www.youtube.com/v/VeasFckfMHY') }
339
374
 
340
375
  describe '#provider' do
@@ -348,7 +383,7 @@ require 'spec_helper'
348
383
  end
349
384
  end
350
385
 
351
- context 'with video VeasFckfMHY in e path', :vcr do
386
+ context 'with video VeasFckfMHY in e path' do
352
387
  subject { VideoInfo.new('http://www.youtube.com/e/VeasFckfMHY') }
353
388
 
354
389
  describe '#provider' do
@@ -362,7 +397,7 @@ require 'spec_helper'
362
397
  end
363
398
  end
364
399
 
365
- context 'with video VeasFckfMHY in embed path', :vcr do
400
+ context 'with video VeasFckfMHY in embed path' do
366
401
  subject { VideoInfo.new('http://www.youtube.com/embed/VeasFckfMHY') }
367
402
 
368
403
  describe '#provider' do
@@ -376,7 +411,7 @@ require 'spec_helper'
376
411
  end
377
412
  end
378
413
 
379
- context 'with video JM9NgvjjVng in youtu.be url', :vcr do
414
+ context 'with video JM9NgvjjVng in youtu.be url' do
380
415
  subject { VideoInfo.new('http://youtu.be/JM9NgvjjVng') }
381
416
 
382
417
  describe '#provider' do
@@ -390,7 +425,7 @@ require 'spec_helper'
390
425
  end
391
426
  end
392
427
 
393
- context 'without http or www', :vcr do
428
+ context 'without http or www' do
394
429
  subject { VideoInfo.new('youtu.be/JM9NgvjjVng') }
395
430
 
396
431
  describe '#provider' do
@@ -404,7 +439,7 @@ require 'spec_helper'
404
439
  end
405
440
  end
406
441
 
407
- context 'with video url in text', :vcr do
442
+ context 'with video url in text' do
408
443
  url_in_text = '<a href="http://www.youtube.com/watch?v=mZqGqE0D0n4">' \
409
444
  'http://www.youtube.com/watch?v=mZqGqE0D0n4</a>'
410
445
  subject { VideoInfo.new(url_in_text) }
@@ -420,7 +455,7 @@ require 'spec_helper'
420
455
  end
421
456
  end
422
457
 
423
- context 'with iframe attributes', :vcr do
458
+ context 'with iframe attributes' do
424
459
  subject { VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4') }
425
460
 
426
461
  describe '#provider' do
@@ -436,7 +471,7 @@ require 'spec_helper'
436
471
  end
437
472
  end
438
473
 
439
- context 'with arbitrary iframe_attributes', :vcr do
474
+ context 'with arbitrary iframe_attributes' do
440
475
  subject { VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4') }
441
476
 
442
477
  describe '#provider' do
@@ -451,7 +486,7 @@ require 'spec_helper'
451
486
  end
452
487
  end
453
488
 
454
- context 'with full screen video URLs', :vcr do
489
+ context 'with full screen video URLs' do
455
490
  subject { VideoInfo.new('http://www.youtube.com/v/mZqGqE0D0n4') }
456
491
 
457
492
  describe '#provider' do
@@ -524,7 +559,7 @@ require 'spec_helper'
524
559
  if api_key.nil?
525
560
  is_expected.to eq Time.parse('Sat Apr 12 2008', Time.now.utc)
526
561
  else
527
- is_expected.to eq Time.parse('Sat Apr 12 22:25:35 UTC 2008',
562
+ is_expected.to eq Time.parse('Sat Apr 12 22:34:48 UTC 2008',
528
563
  Time.now.utc)
529
564
  end
530
565
  end
@@ -548,9 +583,16 @@ require 'spec_helper'
548
583
  it { is_expected.to eq thumbnail_url }
549
584
  end
550
585
 
586
+ describe '#thumbnail_large_2x' do
587
+ subject { super().thumbnail_large_2x }
588
+ thumbnail_url = 'https://i.ytimg.com/vi/mZqGqE0D0n4/sddefault.jpg'
589
+ it { is_expected.to eq thumbnail_url }
590
+ end
591
+
551
592
  describe '#view_count' do
552
593
  subject { super().view_count }
553
- it { is_expected.to be > 4000 }
594
+
595
+ it { is_expected.to eq 7962 }
554
596
  end
555
597
  end
556
598
  end