video_info 2.6.0 → 2.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (230) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -1
  3. data/.rubocop.yml +242 -1
  4. data/.travis.yml +9 -8
  5. data/CONTRIBUTING.md +11 -0
  6. data/Gemfile +1 -1
  7. data/Guardfile +1 -1
  8. data/README.md +34 -1
  9. data/lib/video_info.rb +22 -26
  10. data/lib/video_info/provider.rb +8 -10
  11. data/lib/video_info/providers/dailymotion.rb +6 -3
  12. data/lib/video_info/providers/vimeo.rb +3 -3
  13. data/lib/video_info/providers/vimeo_api.rb +13 -4
  14. data/lib/video_info/providers/vimeo_scraper.rb +33 -13
  15. data/lib/video_info/providers/vkontakte.rb +38 -14
  16. data/lib/video_info/providers/wistia.rb +2 -1
  17. data/lib/video_info/providers/youtube.rb +4 -2
  18. data/lib/video_info/providers/youtube_api.rb +38 -3
  19. data/lib/video_info/providers/youtube_scraper.rb +26 -12
  20. data/lib/video_info/providers/youtubeplaylist.rb +5 -2
  21. data/lib/video_info/providers/youtubeplaylist_api.rb +8 -1
  22. data/lib/video_info/providers/youtubeplaylist_scraper.rb +16 -3
  23. data/lib/video_info/version.rb +1 -1
  24. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_invalid_video_url/_available_/1_2_2_1_1.yml +89 -0
  25. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_valid_video/_available_/1_2_1_1_1.yml +92 -0
  26. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_date/should_show_correct_date.yml +95 -0
  27. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_description/1_3_7_1.yml +95 -0
  28. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_duration/1_3_9_1.yml +95 -0
  29. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_keywords/1_3_8_1.yml +95 -0
  30. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_large/1_3_15_1.yml +95 -0
  31. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_medium/1_3_14_1.yml +95 -0
  32. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_small/1_3_13_1.yml +95 -0
  33. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_title/1_3_6_1.yml +95 -0
  34. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_view_count/1_3_16_1.yml +95 -0
  35. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/_available_/1_2_3_1_1.yml +964 -0
  36. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/_available_/2_2_3_1_1.yml +59 -0
  37. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/_available_/1_2_2_1_1.yml +936 -0
  38. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/_available_/2_2_2_1_1.yml +61 -0
  39. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/_available_/1_2_1_1_1.yml +2692 -0
  40. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/_available_/2_2_1_1_1.yml +119 -0
  41. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author/1_3_17_1.yml +1530 -0
  42. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author/2_3_17_1.yml +68 -0
  43. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_thumbnail/1_3_16_1.yml +1530 -0
  44. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_thumbnail/2_3_16_1.yml +68 -0
  45. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_url/1_3_18_1.yml +1529 -0
  46. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_author_url/2_3_18_1.yml +68 -0
  47. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_date/should_have_correct_upload_date.yml +1595 -0
  48. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_description/1_3_7_1.yml +1602 -0
  49. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_description/2_3_7_1.yml +68 -0
  50. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_duration/1_3_9_1.yml +1530 -0
  51. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_duration/2_3_9_1.yml +68 -0
  52. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_height/1_3_11_1.yml +1529 -0
  53. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_height/2_3_11_1.yml +68 -0
  54. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_keywords/should_return_a_string_list_of_keywords.yml +1595 -0
  55. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_large/1_3_15_1.yml +1530 -0
  56. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_large/2_3_15_1.yml +68 -0
  57. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_medium/1_3_14_1.yml +1530 -0
  58. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_medium/2_3_14_1.yml +68 -0
  59. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_small/1_3_13_1.yml +1530 -0
  60. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_thumbnail_small/2_3_13_1.yml +68 -0
  61. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_title/1_3_6_1.yml +1602 -0
  62. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_title/2_3_6_1.yml +68 -0
  63. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_view_count/1_3_19_1.yml +1530 -0
  64. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_view_count/2_3_19_1.yml +68 -0
  65. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_width/1_3_10_1.yml +1530 -0
  66. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_136971428/_width/2_3_10_1.yml +68 -0
  67. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author/1_3_17_1.yml +2559 -0
  68. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author/2_3_17_1.yml +159 -0
  69. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_thumbnail/1_3_16_1.yml +2559 -0
  70. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_thumbnail/2_3_16_1.yml +159 -0
  71. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_url/1_3_18_1.yml +2559 -0
  72. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_author_url/2_3_18_1.yml +159 -0
  73. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_date/should_have_correct_upload_date.yml +2714 -0
  74. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_description/1_3_7_1.yml +2692 -0
  75. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_description/2_3_7_1.yml +159 -0
  76. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_duration/1_3_9_1.yml +2829 -0
  77. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_duration/2_3_9_1.yml +159 -0
  78. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_height/1_3_11_1.yml +2828 -0
  79. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_height/2_3_11_1.yml +159 -0
  80. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_keywords/should_return_a_string_list_of_keywords.yml +2716 -0
  81. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_large/1_3_15_1.yml +2560 -0
  82. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_large/2_3_15_1.yml +159 -0
  83. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_medium/1_3_14_1.yml +2558 -0
  84. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_medium/2_3_14_1.yml +159 -0
  85. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_small/1_3_13_1.yml +2558 -0
  86. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_small/2_3_13_1.yml +159 -0
  87. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_title/1_3_6_1.yml +2961 -0
  88. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_title/2_3_6_1.yml +159 -0
  89. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_view_count/1_3_19_1.yml +2560 -0
  90. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_view_count/2_3_19_1.yml +159 -0
  91. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_width/1_3_10_1.yml +2560 -0
  92. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_width/2_3_10_1.yml +159 -0
  93. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_hashes/available_/1_2_6_1_1.yml +2996 -0
  94. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_invalid_video/available_/1_2_2_1_1.yml +46 -0
  95. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_private_video/available_/1_2_3_1_1.yml +865 -0
  96. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_redirect/available_/1_2_4_1_1.yml +666 -0
  97. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_redirect_to_main_page_for_auth/available_/1_2_5_1_1.yml +46 -0
  98. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_valid_video/available_/1_2_1_1_1.yml +2118 -0
  99. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/author/1_5_14_1.yml +518 -0
  100. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/author_thumbnail/1_5_15_1.yml +519 -0
  101. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/author_url/1_5_16_1.yml +520 -0
  102. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/description/1_5_8_1.yml +518 -0
  103. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/duration/1_5_10_1.yml +517 -0
  104. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/embed_code/1_5_6_1.yml +517 -0
  105. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/embed_url/1_5_5_1.yml +519 -0
  106. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/height/1_5_12_1.yml +517 -0
  107. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/title/1_5_7_1.yml +517 -0
  108. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/view_count/1_5_13_1.yml +521 -0
  109. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_from_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/width/1_5_11_1.yml +517 -0
  110. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_https_/vk_com/id44052340_z_video61291456_159590018_2F2521d92730a272a9ea/author/1_3_7_1.yml +399 -0
  111. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_https_/vk_com/id44052340_z_video61291456_159590018_2F2521d92730a272a9ea/embed_code/1_3_6_1.yml +399 -0
  112. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_https_/vk_com/id44052340_z_video61291456_159590018_2F2521d92730a272a9ea/embed_url/1_3_5_1.yml +399 -0
  113. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_https_/vk_com/id44052340_z_video61291456_159590018_2F2521d92730a272a9ea/title/1_3_4_1.yml +399 -0
  114. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video-54799401_165822734/title/1_7_4_1.yml +682 -0
  115. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video3552522_171340713/embed_url/1_10_1_1.yml +501 -0
  116. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/description/1_6_8_1.yml +449 -0
  117. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/duration/1_6_10_1.yml +449 -0
  118. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_code/1_6_6_1.yml +449 -0
  119. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_url/1_6_5_1.yml +449 -0
  120. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/height/1_6_12_1.yml +449 -0
  121. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/title/1_6_7_1.yml +449 -0
  122. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/view_count/1_6_13_1.yml +449 -0
  123. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/width/1_6_11_1.yml +449 -0
  124. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author/1_4_5_1.yml +527 -0
  125. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author_thumbnail/1_4_6_1.yml +527 -0
  126. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/author_url/1_4_7_1.yml +527 -0
  127. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/title/1_4_4_1.yml +527 -0
  128. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_invalid_video/_available_/1_2_2_1_1.yml +71 -0
  129. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_valid_video/_available_/1_2_1_1_1.yml +73 -0
  130. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_duration/1_4_7_1.yml +80 -0
  131. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_height/1_4_9_1.yml +80 -0
  132. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_large/1_4_12_1.yml +80 -0
  133. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_medium/1_4_11_1.yml +80 -0
  134. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_small/1_4_10_1.yml +80 -0
  135. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_title/1_4_6_1.yml +80 -0
  136. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_width/1_4_8_1.yml +80 -0
  137. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_duration/1_3_7_1.yml +80 -0
  138. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_height/1_3_9_1.yml +80 -0
  139. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_large/1_3_12_1.yml +80 -0
  140. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_medium/1_3_11_1.yml +80 -0
  141. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_small/1_3_10_1.yml +80 -0
  142. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_title/1_3_6_1.yml +80 -0
  143. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_width/1_3_8_1.yml +80 -0
  144. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_available_/1_2_2_1_1.yml +516 -0
  145. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_available_/2_2_2_1_1.yml +56 -0
  146. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_date/1_2_2_11_1.yml +519 -0
  147. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_date/2_2_2_11_1.yml +56 -0
  148. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_description/1_2_2_8_1.yml +521 -0
  149. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_description/2_2_2_8_1.yml +56 -0
  150. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_duration/1_2_2_10_1.yml +519 -0
  151. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_duration/2_2_2_10_1.yml +56 -0
  152. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_keywords/1_2_2_9_1.yml +519 -0
  153. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_keywords/2_2_2_9_1.yml +56 -0
  154. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_title/1_2_2_7_1.yml +519 -0
  155. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_title/2_2_2_7_1.yml +56 -0
  156. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/1_2_2_15_1.yml +516 -0
  157. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_unavailable_video/_view_count/2_2_2_15_1.yml +56 -0
  158. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/_available_/1_2_1_1_1.yml +3930 -0
  159. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/_available_/2_2_1_1_1.yml +127 -0
  160. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_removed_because_of_copyright_claim/_available_/1_2_3_1_1.yml +578 -0
  161. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_removed_because_of_copyright_claim/_available_/2_2_3_1_1.yml +117 -0
  162. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_date/should_return_date_video_was_posted.yml +3912 -0
  163. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_description/1_17_7_1.yml +4007 -0
  164. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_description/2_17_7_1.yml +127 -0
  165. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_duration/1_17_9_1.yml +3982 -0
  166. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_duration/2_17_9_1.yml +127 -0
  167. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_keywords/1_17_8_1.yml +3984 -0
  168. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_keywords/2_17_8_1.yml +127 -0
  169. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_title/1_17_6_1.yml +3946 -0
  170. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_title/2_17_6_1.yml +127 -0
  171. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_view_count/1_17_16_1.yml +3948 -0
  172. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_full_screen_video_URLs/_view_count/2_17_16_1.yml +127 -0
  173. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author/1_3_6_1.yml +4006 -0
  174. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author/2_3_6_1.yml +127 -0
  175. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_thumbnail/1_3_7_1.yml +4027 -0
  176. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_thumbnail/2_3_7_1.yml +212 -0
  177. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_url/1_3_8_1.yml +4080 -0
  178. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_author_url/2_3_8_1.yml +212 -0
  179. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_date/should_return_date_video_was_posted.yml +3982 -0
  180. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_description/1_3_10_1.yml +3992 -0
  181. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_description/2_3_10_1.yml +127 -0
  182. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_duration/1_3_12_1.yml +3961 -0
  183. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_duration/2_3_12_1.yml +127 -0
  184. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_keywords/1_3_11_1.yml +3928 -0
  185. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_keywords/2_3_11_1.yml +127 -0
  186. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_title/1_3_9_1.yml +3974 -0
  187. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_title/2_3_9_1.yml +127 -0
  188. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/1_3_19_1.yml +3950 -0
  189. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/2_3_19_1.yml +127 -0
  190. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/_available_/1_2_2_1_1.yml +62 -0
  191. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/_available_/2_2_2_1_1.yml +62 -0
  192. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_list_url/_available_/1_2_3_1_1.yml +96 -0
  193. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_list_url/_available_/2_2_3_1_1.yml +96 -0
  194. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/_available_/1_2_1_1_1.yml +96 -0
  195. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/_available_/2_2_1_1_1.yml +96 -0
  196. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author/1_3_18_1.yml +107 -0
  197. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author/2_3_18_1.yml +107 -0
  198. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_thumbnail/1_3_19_1.yml +193 -0
  199. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_thumbnail/2_3_19_1.yml +193 -0
  200. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_url/1_3_20_1.yml +193 -0
  201. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_author_url/2_3_20_1.yml +193 -0
  202. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_description/1_3_7_1.yml +107 -0
  203. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_description/2_3_7_1.yml +107 -0
  204. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_keywords/1_3_8_1.yml +107 -0
  205. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_keywords/2_3_8_1.yml +107 -0
  206. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large/1_3_15_1.yml +107 -0
  207. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large/2_3_15_1.yml +107 -0
  208. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_medium/1_3_14_1.yml +107 -0
  209. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_medium/2_3_14_1.yml +107 -0
  210. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_small/1_3_13_1.yml +107 -0
  211. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_small/2_3_13_1.yml +107 -0
  212. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_title/1_3_6_1.yml +107 -0
  213. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_title/2_3_6_1.yml +107 -0
  214. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_videos/returns_list_of_videos_in_playlist.yml +267 -0
  215. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_that_does_not_exist_in_embed_path/_videos/1_4_2_1.yml +56 -0
  216. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_that_does_not_exist_in_embed_path/_videos/2_4_2_1.yml +56 -0
  217. data/spec/lib/video_info/provider_spec.rb +42 -22
  218. data/spec/lib/video_info/providers/dailymotion_spec.rb +41 -23
  219. data/spec/lib/video_info/providers/vimeo_spec.rb +212 -177
  220. data/spec/lib/video_info/providers/vkontakte_spec.rb +132 -63
  221. data/spec/lib/video_info/providers/wistia_spec.rb +34 -13
  222. data/spec/lib/video_info/providers/youtube_playlist_spec.rb +185 -139
  223. data/spec/lib/video_info/providers/youtube_spec.rb +400 -385
  224. data/spec/lib/video_info_spec.rb +27 -21
  225. data/video_info.gemspec +7 -10
  226. metadata +424 -87
  227. data/foo.txt +0 -33
  228. data/spec/lib/video_info/providers/vimeo_api_spec.rb +0 -242
  229. data/spec/lib/video_info/providers/youtube_api_spec.rb +0 -476
  230. data/spec/lib/video_info/providers/youtube_playlist_api_spec.rb +0 -187
@@ -3,144 +3,200 @@ require 'spec_helper'
3
3
  require 'webmock/rspec'
4
4
 
5
5
  describe VideoInfo::Providers::Vkontakte do
6
-
7
- describe ".usable?" do
6
+ describe '.usable?' do
8
7
  subject { VideoInfo::Providers::Vkontakte.usable?(url) }
9
8
 
10
- context "with vkontakte url" do
11
- context "old style", :vcr do
9
+ context 'with vkontakte url' do
10
+ context 'old style', :vcr do
12
11
  let(:url) { 'http://vk.com/video39576223_108370515' }
13
12
  it { should be_truthy }
14
13
  end
15
14
 
16
- context "new style", :vcr do
17
- let(:url) { 'https://vk.com/kirill.lyanoi?z=video2152699_168591741%2F56fd229a9dfe2dcdbe' }
15
+ context 'new style', :vcr do
16
+ let(:url) do
17
+ 'https://vk.com/kirill.lyanoi?z=video2152699' \
18
+ '_168591741%2F56fd229a9dfe2dcdbe'
19
+ end
18
20
  it { should be_truthy }
19
21
  end
20
22
  end
21
23
 
22
- context "with other url" do
24
+ context 'with other url' do
23
25
  let(:url) { 'http://www.youtube.com/898029' }
24
26
  it { should be_falsey }
25
27
  end
26
28
 
27
- context "with invalid url" do
29
+ context 'with invalid url' do
28
30
  let(:url) { 'http://vk.com just random data' }
29
31
  it { should be_falsey }
30
32
  end
31
33
 
32
- context "with spaces at end" do
34
+ context 'with spaces at end' do
33
35
  let(:url) { 'http://vk.com/video39576223_108370515 ' }
34
36
  it { should be_truthy }
35
37
  end
36
38
 
37
- context "with spaces at start" do
39
+ context 'with spaces at start' do
38
40
  let(:url) { ' http://vk.com/video39576223_108370515' }
39
41
  it { should be_truthy }
40
42
  end
41
43
 
42
- context "with spaces around url" do
44
+ context 'with spaces around url' do
43
45
  let(:url) { ' http://vk.com/video39576223_108370515 ' }
44
46
  it { should be_truthy }
45
47
  end
46
48
  end
47
49
 
48
- describe "#available?" do
49
- context "with valid video", :vcr do
50
+ describe '#available?' do
51
+ context 'with valid video', :vcr do
50
52
  subject { VideoInfo.new('http://vk.com/video39576223_108370515') }
51
- its(:available?) { should be_truthy }
53
+ its(:available?) { should be_truthy }
52
54
  end
53
55
 
54
- context "with invalid video", :vcr do
56
+ context 'with invalid video', :vcr do
55
57
  subject { VideoInfo.new('http://vk.com/video39576223_invalid') }
56
- its(:available?) { should be_falsey }
58
+ its(:available?) { should be_falsey }
57
59
  end
58
60
 
59
- context "with private video", :vcr do
61
+ context 'with private video', :vcr do
60
62
  subject { VideoInfo.new('http://vk.com/video39576223_166315543') }
61
- its(:available?) { should be_falsey }
63
+ its(:available?) { should be_falsey }
62
64
  end
63
65
 
64
- context "with redirect", :vcr do
65
- subject { VideoInfo.new('http://vk.com/polinka_zh?z=video186965901_168185427%2Fbfb2bd2e674031520a') }
66
- its(:available?) { should be_truthy }
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 }
67
71
  end
68
72
 
69
- context "with redirect to main page for auth", :vcr do
70
- subject { VideoInfo.new('http://vk.com/video?z=video1472940_169081944%2Falbum1472940') }
71
- its(:available?) { should be_falsey }
73
+ context 'with redirect to main page for auth', :vcr do
74
+ video_url = 'http://vk.com/video?z=video1472940_169081944%2Falbum1472940'
75
+ subject { VideoInfo.new(video_url) }
76
+ its(:available?) { should be_falsey }
72
77
  end
73
78
 
74
- context "with hashes", :vcr do
75
- subject { VideoInfo.new('https://vk.com/videos43640822#/video43640822_168790809') }
76
- its(:available?) { should be_truthy }
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 }
77
83
  end
78
-
79
84
  end
80
85
 
81
- context "with video https://vk.com/id44052340?z=video61291456_159590018%2F2521d92730a272a9ea", :vcr do
82
- subject { VideoInfo.new('https://vk.com/id44052340?z=video61291456_159590018%2F2521d92730a272a9ea') }
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'
83
98
 
84
99
  its(:provider) { should eq 'Vkontakte' }
85
100
  its(:video_owner) { should eq '61291456' }
86
101
  its(:video_id) { should eq '159590018' }
87
102
  its(:title) { should eq 'Happy Birthday To You' }
88
- its(:embed_url) { should eq '//vk.com/video_ext.php?oid=61291456&id=159590018&hash=68174b2af560c54c' }
89
- its(:embed_code) { should eq '<iframe src="//vk.com/video_ext.php?oid=61291456&id=159590018&hash=68174b2af560c54c" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
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('Танька Малеш')) }
90
106
  end
91
107
 
92
- context "with video videos43640822#/video43640822_168790809", :vcr do
93
- subject { VideoInfo.new('https://vk.com/videos43640822#/video43640822_168790809') }
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.vk.me/c604531/v604531822' \
113
+ '/2beb/JrLWCWTA7y0.jpg'
114
+ video_title = 'UDC open cup 2014/ 3 place / Saley Daria (solo)'
94
115
 
95
116
  its(:provider) { should eq 'Vkontakte' }
96
117
  its(:video_owner) { should eq '43640822' }
97
118
  its(:video_id) { should eq '168790809' }
98
- its(:title) { should eq 'UDC open cup 2014/ 3 place / Saley Daria (solo)' }
119
+ its(:title) { should eq video_title }
120
+ its(:author) { should eq('Dasha Saley').or(eq('Даша Салей')) }
121
+ its(:author_thumbnail) { should eq author_thumbnail }
122
+ its(:author_url) { should eq 'https://vk.com/dariasaley' }
99
123
  end
100
124
 
101
- context "with video kirill.lyanoi?z=video2152699_168591741%2F56fd229a9dfe2dcdbe", :vcr do
102
- subject { VideoInfo.new('https://vk.com/kirill.lyanoi?z=video2152699_168591741%2F56fd229a9dfe2dcdbe') }
125
+ context 'with video from kirill.lyanoi?z=' \
126
+ 'video2152699_168591741%2F56fd229a9dfe2dcdbe', :vcr do
127
+ video_url = 'https://vk.com/kirill.lyanoi?' \
128
+ 'z=video2152699_168591741%2F56fd229a9dfe2dcdbe'
129
+ subject { VideoInfo.new(video_url) }
130
+
131
+ author_thumbnail = 'https://pp.vk.me/c623824/v623824699' \
132
+ '/55575/CCQZ29l0B9k.jpg'
133
+ description_text = 'BEAT SOUL STEP ★ Project818 Russian ' \
134
+ 'Dance Championship ★ 1-2 мая, Москва 2014'
135
+ video_title = 'BEAT SOUL STEP — RDC14 Project818 Russian ' \
136
+ 'Dance Championship, May 1-2, Moscow 2014'
137
+ embed_code = '<iframe src="https://www.youtube.com/embed/' \
138
+ '4Thws5wq5GI?enablejsapi=1&autoplay=0&start=0' \
139
+ '&autohide=1&wmode=opaque&showinfo=0&origin=' \
140
+ 'https://vk.com&fs=1&rel=0&cc_load_policy=0' \
141
+ '&iv_load_policy=3" frameborder="0" ' \
142
+ 'allowfullscreen="allowfullscreen"></iframe>'
143
+ embed_url = 'https://www.youtube.com/embed/4Thws5wq5GI?enablejsapi=1' \
144
+ '&autoplay=0&start=0&autohide=1&wmode=opaque&showinfo=0' \
145
+ '&origin=https://vk.com&fs=1&rel=0&cc_load_policy=0' \
146
+ '&iv_load_policy=3'
147
+ author = 'Kirill Lyanoy'
148
+ author_alt = 'Кирилл Льяной'
103
149
 
104
150
  its(:provider) { should eq 'Vkontakte' }
105
151
  its(:video_owner) { should eq '2152699' }
106
152
  its(:video_id) { should eq '168591741' }
107
- its(:url) { should eq 'https://vk.com/kirill.lyanoi?z=video2152699_168591741%2F56fd229a9dfe2dcdbe' }
108
- its(:embed_url) { should eq '//vk.com/video_ext.php?oid=2152699&id=168591741&hash=' }
109
- its(:embed_code) { should eq '<iframe src="//vk.com/video_ext.php?oid=2152699&id=168591741&hash=" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
110
- its(:title) { should eq 'BEAT SOUL STEP — RDC14 Project818 Russian Dance Championship, May 1-2, Moscow 2014' }
111
- its(:description) { should start_with 'BEAT SOUL STEP ★ Project818 Russian Dance Championship ★ 1-2 мая, Москва 2014' }
112
- its(:keywords) { should start_with 'BEAT SOUL STEP ★ Project818 Russian Dance Championship ★ 1-2 мая, Москва 2014' }
153
+ its(:url) { should eq video_url }
154
+ its(:embed_url) { should eq embed_url }
155
+ its(:embed_code) { should eq embed_code }
156
+ its(:title) { should eq video_title }
157
+ its(:description) { should start_with description_text }
158
+ its(:keywords) { should be_nil }
113
159
  its(:duration) { should eq 299 }
114
160
  its(:width) { should eq 0 }
115
161
  its(:height) { should eq 0 }
116
162
  its(:view_count) { should be > 10 }
163
+ its(:author) { should eq(author).or(eq(author_alt)) }
164
+ its(:author_thumbnail) { should eq author_thumbnail }
165
+ its(:author_url) { should eq 'https://vk.com/lyanoi.kirill' }
117
166
  end
118
167
 
119
- context "with video video39576223_108370515", :vcr do
168
+ context 'with video video39576223_108370515', :vcr do
120
169
  subject { VideoInfo.new('http://vk.com/video39576223_108370515') }
121
170
 
122
- its(:provider) { should eq 'Vkontakte' }
123
- its(:video_owner) { should eq '39576223' }
124
- its(:video_id) { should eq '108370515' }
125
- its(:url) { should eq 'http://vk.com/video39576223_108370515' }
126
- its(:embed_url) { should eq '//vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af' }
127
- its(:embed_code) { should eq '<iframe src="//vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
128
- its(:title) { should eq 'Я уточка)))))' }
129
- its(:description) { should eq 'это ВЗРЫВ МОЗГА!!!<br>Просто отвал башки...' }
130
- its(:keywords) { should eq 'это ВЗРЫВ МОЗГА!!!<br>Просто отвал башки...' }
131
- its(:duration) { should eq 183 }
132
- its(:width) { should eq 320 }
133
- its(:height) { should eq 240 }
134
- its(:view_count) { should be > 10 }
171
+ description_text = 'это ВЗРЫВ МОЗГА!!!<br>Просто отвал башки...'
172
+ embed_url = '//vk.com/video_ext.php?oid=39576223&' \
173
+ 'id=108370515&hash=15184dbd085c47af'
174
+ embed_code = '<iframe src="//vk.com/video_ext.php?oid=39576223&' \
175
+ 'id=108370515&hash=15184dbd085c47af" frameborder="0" ' \
176
+ 'allowfullscreen="allowfullscreen"></iframe>'
177
+
178
+ its(:provider) { should eq 'Vkontakte' }
179
+ its(:video_owner) { should eq '39576223' }
180
+ its(:video_id) { should eq '108370515' }
181
+ its(:url) { should eq 'http://vk.com/video39576223_108370515' }
182
+ its(:embed_url) { should eq embed_url }
183
+ its(:embed_code) { should eq embed_code }
184
+ its(:title) { should eq 'Я уточка)))))' }
185
+ its(:description) { should eq description_text }
186
+ its(:keywords) { should be_nil }
187
+ its(:duration) { should eq 183 }
188
+ its(:width) { should eq 320 }
189
+ its(:height) { should eq 240 }
190
+ its(:view_count) { should be > 10 }
135
191
  end
136
192
 
137
- context "with video video-54799401_165822734", :vcr do
193
+ context 'with video video-54799401_165822734', :vcr do
138
194
  subject { VideoInfo.new('http://vk.com/video-54799401_165822734') }
139
195
 
140
- its(:provider) { should eq 'Vkontakte' }
141
- its(:video_owner) { should eq '-54799401' }
142
- its(:video_id) { should eq '165822734' }
143
- its(:title) { should eq 'SpaceGlasses are the future of computing' }
196
+ its(:provider) { should eq 'Vkontakte' }
197
+ its(:video_owner) { should eq '-54799401' }
198
+ its(:video_id) { should eq '165822734' }
199
+ its(:title) { should eq 'SpaceGlasses are the future of computing' }
144
200
  end
145
201
 
146
202
  context 'with valid video and connection timeout' do
@@ -162,7 +218,8 @@ describe VideoInfo::Providers::Vkontakte do
162
218
 
163
219
  describe '#title' do
164
220
  before do
165
- stub_request(:any, /.*vk.com.*/).to_raise(OpenURI::HTTPError.new('error', :nop))
221
+ stub = stub_request(:any, /.*vk.com.*/)
222
+ stub.to_raise(OpenURI::HTTPError.new('error', :nop))
166
223
  end
167
224
 
168
225
  it 'raises VideoInfo::HttpError exception' do
@@ -170,4 +227,16 @@ describe VideoInfo::Providers::Vkontakte do
170
227
  end
171
228
  end
172
229
  end
230
+
231
+ context 'with video video3552522_171340713', :vcr do
232
+ subject { VideoInfo.new('http://vk.com/video3552522_171340713') }
233
+
234
+ embed_url = 'https://www.youtube.com/embed/C3_e-e6qoSg?' \
235
+ 'enablejsapi=1&autoplay=0&start=0&autohide=1' \
236
+ '&wmode=opaque&showinfo=0&origin=' \
237
+ 'https://vk.com&fs=1&rel=0&cc_load_policy=0' \
238
+ '&iv_load_policy=3'
239
+
240
+ its(:embed_url) { should eq embed_url }
241
+ end
173
242
  end
@@ -2,7 +2,6 @@
2
2
  require 'spec_helper'
3
3
 
4
4
  describe VideoInfo::Providers::Wistia do
5
-
6
5
  describe '.usable?' do
7
6
  subject { VideoInfo::Providers::Wistia.usable?(url) }
8
7
 
@@ -19,7 +18,8 @@ describe VideoInfo::Providers::Wistia do
19
18
 
20
19
  describe '#available?' do
21
20
  context 'with valid video', :vcr do
22
- subject { VideoInfo.new('http://fast.wistia.net/embed/iframe/rs1me54mpw') }
21
+ video_url = 'http://fast.wistia.net/embed/iframe/rs1me54mpw'
22
+ subject { VideoInfo.new(video_url) }
23
23
 
24
24
  describe '#available?' do
25
25
  subject { super().available? }
@@ -35,7 +35,6 @@ describe VideoInfo::Providers::Wistia do
35
35
  it { is_expected.to be_falsey }
36
36
  end
37
37
  end
38
-
39
38
  end
40
39
 
41
40
  context 'with video rs1me54mpw', :vcr do
@@ -63,7 +62,9 @@ describe VideoInfo::Providers::Wistia do
63
62
 
64
63
  describe '#embed_code' do
65
64
  subject { super().embed_code }
66
- it { is_expected.to eq '<iframe src="//fast.wistia.net/embed/iframe/rs1me54mpw" frameborder="0"></iframe>' }
65
+ embed_code = '<iframe src="//fast.wistia.net/embed/iframe/rs1me54mpw" '\
66
+ 'frameborder="0"></iframe>'
67
+ it { is_expected.to eq embed_code }
67
68
  end
68
69
 
69
70
  describe '#title' do
@@ -88,17 +89,26 @@ describe VideoInfo::Providers::Wistia do
88
89
 
89
90
  describe '#thumbnail_small' do
90
91
  subject { super().thumbnail_small }
91
- it { is_expected.to eq 'https://embed-ssl.wistia.com/deliveries/dc005e6a7583a25c4b7c284c08afc42fb67fdb95.jpg?image_crop_resized=960x540' }
92
+ thumbnail_url = 'https://embed-ssl.wistia.com/deliveries/' \
93
+ 'dc005e6a7583a25c4b7c284c08afc42fb67fdb95.jpg' \
94
+ '?image_crop_resized=960x540'
95
+ it { is_expected.to eq thumbnail_url }
92
96
  end
93
97
 
94
98
  describe '#thumbnail_medium' do
95
99
  subject { super().thumbnail_small }
96
- it { is_expected.to eq 'https://embed-ssl.wistia.com/deliveries/dc005e6a7583a25c4b7c284c08afc42fb67fdb95.jpg?image_crop_resized=960x540' }
100
+ thumbnail_url = 'https://embed-ssl.wistia.com/deliveries/' \
101
+ 'dc005e6a7583a25c4b7c284c08afc42fb67fdb95.jpg?' \
102
+ 'image_crop_resized=960x540'
103
+ it { is_expected.to eq thumbnail_url }
97
104
  end
98
-
105
+
99
106
  describe '#thumbnail_large' do
100
107
  subject { super().thumbnail_small }
101
- it { is_expected.to eq 'https://embed-ssl.wistia.com/deliveries/dc005e6a7583a25c4b7c284c08afc42fb67fdb95.jpg?image_crop_resized=960x540' }
108
+ thumbnail_url = 'https://embed-ssl.wistia.com/deliveries/' \
109
+ 'dc005e6a7583a25c4b7c284c08afc42fb67fdb95.jpg' \
110
+ '?image_crop_resized=960x540'
111
+ it { is_expected.to eq thumbnail_url }
102
112
  end
103
113
  end
104
114
 
@@ -127,7 +137,9 @@ describe VideoInfo::Providers::Wistia do
127
137
 
128
138
  describe '#embed_code' do
129
139
  subject { super().embed_code }
130
- it { is_expected.to eq '<iframe src="//fast.wistia.net/embed/iframe/pxonqr42is" frameborder="0"></iframe>' }
140
+ embed_code = '<iframe src="//fast.wistia.net/embed/iframe/pxonqr42is" ' \
141
+ 'frameborder="0"></iframe>'
142
+ it { is_expected.to eq embed_code }
131
143
  end
132
144
 
133
145
  describe '#title' do
@@ -149,20 +161,29 @@ describe VideoInfo::Providers::Wistia do
149
161
  subject { super().height }
150
162
  it { is_expected.to eq 568 }
151
163
  end
152
-
164
+
153
165
  describe '#thumbnail_small' do
154
166
  subject { super().thumbnail_small }
155
- it { is_expected.to eq 'https://embed-ssl.wistia.com/deliveries/0fccbdc60ade35723f79f1c002bc61b135b610fa.jpg?image_crop_resized=960x540' }
167
+ thumbnail_url = 'https://embed-ssl.wistia.com/deliveries/' \
168
+ '0fccbdc60ade35723f79f1c002bc61b135b610fa.jpg' \
169
+ '?image_crop_resized=960x540'
170
+ it { is_expected.to eq thumbnail_url }
156
171
  end
157
172
 
158
173
  describe '#thumbnail_medium' do
159
174
  subject { super().thumbnail_small }
160
- it { is_expected.to eq 'https://embed-ssl.wistia.com/deliveries/0fccbdc60ade35723f79f1c002bc61b135b610fa.jpg?image_crop_resized=960x540' }
175
+ thumbnail_url = 'https://embed-ssl.wistia.com/deliveries/' \
176
+ '0fccbdc60ade35723f79f1c002bc61b135b610fa.jpg' \
177
+ '?image_crop_resized=960x540'
178
+ it { is_expected.to eq thumbnail_url }
161
179
  end
162
180
 
163
181
  describe '#thumbnail_large' do
164
182
  subject { super().thumbnail_small }
165
- it { is_expected.to eq 'https://embed-ssl.wistia.com/deliveries/0fccbdc60ade35723f79f1c002bc61b135b610fa.jpg?image_crop_resized=960x540' }
183
+ thumbnail_url = 'https://embed-ssl.wistia.com/deliveries/' \
184
+ '0fccbdc60ade35723f79f1c002bc61b135b610fa.jpg' \
185
+ '?image_crop_resized=960x540'
186
+ it { is_expected.to eq thumbnail_url }
166
187
  end
167
188
  end
168
189
  end
@@ -1,184 +1,230 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe VideoInfo::Providers::YoutubePlaylist do
4
- before(:all) do
5
- VideoInfo.provider_api_keys = {}
6
- end
3
+ [nil, 'AIzaSyA6PYwSr1EnLFUFy1cZDk3Ifb0rxeJaeZ0'].each do |api_key|
4
+ describe VideoInfo::Providers::YoutubePlaylist do
5
+ before(:each) do
6
+ api_key = 'AIzaSyA6PYwSr1EnLFUFy1cZDk3Ifb0rxeJaeZ0'
7
+ VideoInfo.provider_api_keys = { youtube: api_key }
8
+ end
7
9
 
8
- describe ".usable?" do
9
- subject { VideoInfo::Providers::YoutubePlaylist.usable?(url) }
10
+ describe '.usable?' do
11
+ subject { VideoInfo::Providers::YoutubePlaylist.usable?(url) }
10
12
 
11
- context "with youtube.com/playlist?p= url" do
12
- let(:url) { 'http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF' }
13
- it { is_expected.to be_truthy }
14
- end
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
15
17
 
16
- context "with youtube.com/playlist?list= url" do
17
- let(:url) { 'http://www.youtube.com/playlist?list=PLA575C81A1FBC04CF' }
18
- it { is_expected.to be_truthy }
19
- end
18
+ context 'with youtube.com/playlist?list= url' do
19
+ let(:url) { 'http://www.youtube.com/playlist?list=PLA575C81A1FBC04CF' }
20
+ it { is_expected.to be_truthy }
21
+ end
20
22
 
21
- context "with youtube.com url" do
22
- let(:url) { 'http://www.youtube.com/watch?v=Xp6CXF' }
23
- it { is_expected.to be_falsey }
24
- end
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
25
27
 
26
- context "with other url" do
27
- let(:url) { 'http://example.com/video1' }
28
- it { is_expected.to be_falsey }
28
+ context 'with other url' do
29
+ let(:url) { 'http://example.com/video1' }
30
+ it { is_expected.to be_falsey }
31
+ end
29
32
  end
30
- end
31
33
 
32
- describe "#available?" do
33
- context "with valid playlist", :vcr do
34
- subject { VideoInfo.new('http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF') }
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) }
35
38
 
36
- describe '#available?' do
37
- subject { super().available? }
38
- it { is_expected.to be_truthy }
39
+ describe '#available?' do
40
+ subject { super().available? }
41
+ it { is_expected.to be_truthy }
42
+ end
39
43
  end
40
- end
41
44
 
42
- context "with invalid playlist", :vcr do
43
- subject { VideoInfo.new('http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF_invalid') }
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) }
44
49
 
45
- describe '#available?' do
46
- subject { super().available? }
47
- it { is_expected.to be_falsey }
50
+ describe '#available?' do
51
+ subject { super().available? }
52
+ it { is_expected.to be_falsey }
53
+ end
48
54
  end
49
- end
50
55
 
51
- context "with &list= url", :vcr do
52
- subject { VideoInfo.new('http://www.youtube.com/playlist?list=PLA575C81A1FBC04CF') }
56
+ context 'with &list= url', :vcr do
57
+ playlist_url = 'http://www.youtube.com/playlist?list=PLA575C81A1FBC04CF'
58
+ subject { VideoInfo.new(playlist_url) }
53
59
 
54
- describe '#available?' do
55
- subject { super().available? }
56
- it { is_expected.to be_truthy }
60
+ describe '#available?' do
61
+ subject { super().available? }
62
+ it { is_expected.to be_truthy }
63
+ end
57
64
  end
58
65
  end
59
- end
60
66
 
61
- context "with playlist PL9hW1uS6HUftLdHI6RIsaf", :vcr do
62
- let(:videos) {
63
- [
64
- VideoInfo.new('http://www.youtube.com/watch?v=Oi67QjrXy2w'),
65
- VideoInfo.new('http://www.youtube.com/watch?v=_Bt3-WsHfB0'),
66
- VideoInfo.new('http://www.youtube.com/watch?v=9g2U12SsRns'),
67
- VideoInfo.new('http://www.youtube.com/watch?v=8b0aEoxqqC0'),
68
- VideoInfo.new('http://www.youtube.com/watch?v=6c3mHikRz0I'),
69
- VideoInfo.new('http://www.youtube.com/watch?v=OQVHWsTHcoc')
70
- ]
71
- }
72
- subject { VideoInfo.new('http://www.youtube.com/playlist?p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr') }
73
-
74
- describe '#provider' do
75
- subject { super().provider }
76
- it { is_expected.to eq 'YouTube' }
77
- end
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
78
 
79
- describe '#playlist_id' do
80
- subject { super().playlist_id }
81
- it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
82
- end
79
+ playlist_url = 'http://www.youtube.com/playlist?' \
80
+ 'p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
83
81
 
84
- describe '#url' do
85
- subject { super().url }
86
- it { is_expected.to eq 'http://www.youtube.com/playlist?p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
87
- end
82
+ subject { VideoInfo.new(playlist_url) }
88
83
 
89
- describe '#embed_url' do
90
- subject { super().embed_url }
91
- it { is_expected.to eq '//www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
92
- end
84
+ describe '#provider' do
85
+ subject { super().provider }
86
+ it { is_expected.to eq 'YouTube' }
87
+ end
93
88
 
94
- describe '#embed_code' do
95
- subject { super().embed_code }
96
- it { is_expected.to eq '<iframe src="//www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
97
- end
89
+ describe '#playlist_id' do
90
+ subject { super().playlist_id }
91
+ it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
92
+ end
98
93
 
99
- describe '#title' do
100
- subject { super().title }
101
- it { is_expected.to eq 'YouTube Policy and Copyright' }
102
- end
94
+ describe '#url' do
95
+ subject { super().url }
96
+ it { is_expected.to eq playlist_url }
97
+ end
103
98
 
104
- describe '#description' do
105
- subject { super().description }
106
- it { is_expected.to eq 'Learn more about copyright basics, flagging, and the YouTube community.' }
107
- end
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
108
105
 
109
- describe '#keywords' do
110
- subject { super().keywords }
111
- it { is_expected.to be_nil }
112
- end
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
113
114
 
114
- describe '#duration' do
115
- subject { super().duration }
116
- it { is_expected.to be_nil }
117
- end
115
+ describe '#title' do
116
+ subject { super().title }
117
+ it { is_expected.to eq 'YouTube Policy and Copyright' }
118
+ end
118
119
 
119
- describe '#width' do
120
- subject { super().width }
121
- it { is_expected.to be_nil }
122
- end
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
123
126
 
124
- describe '#height' do
125
- subject { super().height }
126
- it { is_expected.to be_nil }
127
- end
127
+ describe '#keywords' do
128
+ subject { super().keywords }
129
+ it { is_expected.to be_nil }
130
+ end
128
131
 
129
- describe '#date' do
130
- subject { super().date }
131
- it { is_expected.to be_nil }
132
- end
132
+ describe '#duration' do
133
+ subject { super().duration }
134
+ it { is_expected.to be_nil }
135
+ end
133
136
 
134
- describe '#thumbnail_small' do
135
- subject { super().thumbnail_small }
136
- it { is_expected.to eq 'https://i.ytimg.com/vi/8b0aEoxqqC0/default.jpg' }
137
- end
137
+ describe '#width' do
138
+ subject { super().width }
139
+ it { is_expected.to be_nil }
140
+ end
138
141
 
139
- describe '#thumbnail_medium' do
140
- subject { super().thumbnail_medium }
141
- it { is_expected.to eq 'https://i.ytimg.com/vi/8b0aEoxqqC0/mqdefault.jpg' }
142
- end
142
+ describe '#height' do
143
+ subject { super().height }
144
+ it { is_expected.to be_nil }
145
+ end
143
146
 
144
- describe '#thumbnail_large' do
145
- subject { super().thumbnail_large }
146
- it { is_expected.to eq 'https://i.ytimg.com/vi/8b0aEoxqqC0/hqdefault.jpg' }
147
- end
147
+ describe '#date' do
148
+ subject { super().date }
149
+ it { is_expected.to be_nil }
150
+ end
148
151
 
149
- describe '#videos' do
150
- subject { super().videos }
151
- it { expect { subject }.to raise_error(NotImplementedError) }
152
- end
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
153
157
 
154
- describe '#view_count' do
155
- subject { super().view_count }
156
- it { is_expected.to be_nil }
157
- end
158
- end
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
159
163
 
160
- context "with playlist PL0E8117603D70E10A in embed path", :vcr do
161
- subject { VideoInfo.new('http://www.youtube.com/embed/videoseries?list=PL0E8117603D70E10A') }
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
162
169
 
163
- describe '#playlist_id' do
164
- subject { super().playlist_id }
165
- it { is_expected.to eq 'PL0E8117603D70E10A' }
166
- end
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
176
+ end
167
177
 
168
- describe '#videos' do
169
- subject { super().videos }
170
- it { expect { subject }.to raise_error(NotImplementedError) }
178
+ describe '#view_count' do
179
+ subject { super().view_count }
180
+ it { is_expected.to be_nil }
181
+ end
182
+
183
+ describe '#author' do
184
+ subject { super().author }
185
+ it { is_expected.to eq 'YouTube Help' }
186
+ end
187
+
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
195
+
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
171
201
  end
172
- end
173
202
 
174
- context "with playlist PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr in embed path", :vcr do
175
- subject { VideoInfo.new('http://www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr') }
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) }
207
+
208
+ describe '#playlist_id' do
209
+ subject { super().playlist_id }
210
+ it { is_expected.to eq 'PL0E8117603D70E10A' }
211
+ end
176
212
 
177
- describe '#playlist_id' do
178
- subject { super().playlist_id }
179
- it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
213
+ describe '#videos' do
214
+ subject { super().videos }
215
+ it { is_expected.to eq [] }
216
+ end
180
217
  end
181
- end
182
218
 
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) }
183
223
 
224
+ describe '#playlist_id' do
225
+ subject { super().playlist_id }
226
+ it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
227
+ end
228
+ end
229
+ end
184
230
  end