video_info 2.4.2 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +1 -3
  4. data/README.md +33 -2
  5. data/lib/video_info.rb +44 -2
  6. data/lib/video_info/provider.rb +21 -4
  7. data/lib/video_info/providers/vimeo.rb +81 -9
  8. data/lib/video_info/providers/vimeoplaylist.rb +14 -13
  9. data/lib/video_info/providers/vkontakte.rb +1 -1
  10. data/lib/video_info/providers/youtube.rb +20 -51
  11. data/lib/video_info/providers/youtube_api.rb +72 -0
  12. data/lib/video_info/providers/youtube_scraper.rb +99 -0
  13. data/lib/video_info/providers/youtubeplaylist.rb +28 -29
  14. data/lib/video_info/providers/youtubeplaylist_api.rb +57 -0
  15. data/lib/video_info/providers/youtubeplaylist_scraper.rb +47 -0
  16. data/lib/video_info/version.rb +1 -1
  17. data/spec/lib/video_info/providers/vimeo_playlist_spec.rb +19 -18
  18. data/spec/lib/video_info/providers/vimeo_spec.rb +45 -21
  19. data/spec/lib/video_info/providers/vkontakte_spec.rb +2 -2
  20. data/spec/lib/video_info/providers/youtube_api_spec.rb +392 -0
  21. data/spec/lib/video_info/providers/youtube_playlist_api_spec.rb +173 -0
  22. data/spec/lib/video_info/providers/youtube_playlist_spec.rb +6 -2
  23. data/spec/lib/video_info/providers/youtube_spec.rb +83 -6
  24. data/spec/lib/video_info_spec.rb +30 -0
  25. data/spec/spec_helper.rb +2 -0
  26. data/video_info.gemspec +4 -1
  27. metadata +55 -196
  28. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_This_video_does_not_exist_or_has_been_deleted_/_available_/.yml +0 -60
  29. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_valid_video/_available_/.yml +0 -59
  30. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_date/.yml +0 -62
  31. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_description/.yml +0 -62
  32. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_duration/.yml +0 -62
  33. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_keywords/.yml +0 -62
  34. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_large/.yml +0 -62
  35. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_medium/.yml +0 -62
  36. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_small/.yml +0 -62
  37. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_title/.yml +0 -62
  38. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_view_count/.yml +0 -62
  39. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/_available_/.yml +0 -119
  40. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/_available_/.yml +0 -72
  41. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/_available_/.yml +0 -76
  42. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_date/.yml +0 -83
  43. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_description/.yml +0 -83
  44. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_duration/.yml +0 -83
  45. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_height/.yml +0 -83
  46. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_keywords/.yml +0 -83
  47. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_large/.yml +0 -83
  48. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_medium/.yml +0 -83
  49. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_small/.yml +0 -83
  50. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_title/.yml +0 -83
  51. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_view_count/.yml +0 -83
  52. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_width/.yml +0 -83
  53. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/_available_/with_invalid_playlist/_available_/.yml +0 -72
  54. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/_available_/with_valid_playlist/_available_/.yml +0 -76
  55. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_description/.yml +0 -81
  56. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_thumbnail_large/.yml +0 -81
  57. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_thumbnail_medium/.yml +0 -81
  58. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_thumbnail_small/.yml +0 -81
  59. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_title/.yml +0 -81
  60. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_videos/.yml +0 -114
  61. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_hashes/available_/.yml +0 -2255
  62. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_invalid_video/available_/.yml +0 -46
  63. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_private_video/available_/.yml +0 -382
  64. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_redirect/available_/.yml +0 -210
  65. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_redirect_to_main_page_for_auth/available_/.yml +0 -46
  66. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_valid_video/available_/.yml +0 -1657
  67. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/description/.yml +0 -730
  68. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/duration/.yml +0 -731
  69. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/embed_code/.yml +0 -732
  70. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/embed_url/.yml +0 -732
  71. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/height/.yml +0 -732
  72. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/keywords/.yml +0 -732
  73. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/title/.yml +0 -731
  74. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/view_count/.yml +0 -731
  75. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/width/.yml +0 -728
  76. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video-54799401_165822734/title/.yml +0 -1226
  77. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/description/.yml +0 -997
  78. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/duration/.yml +0 -997
  79. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_code/.yml +0 -997
  80. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_url/.yml +0 -998
  81. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/height/.yml +0 -998
  82. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/keywords/.yml +0 -997
  83. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/title/.yml +0 -997
  84. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/view_count/.yml +0 -997
  85. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/width/.yml +0 -998
  86. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/title/.yml +0 -597
  87. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_invalid_video/_available_/.yml +0 -69
  88. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_valid_video/_available_/.yml +0 -71
  89. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_duration/.yml +0 -78
  90. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_height/.yml +0 -78
  91. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_large/.yml +0 -78
  92. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_medium/.yml +0 -78
  93. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_small/.yml +0 -78
  94. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_title/.yml +0 -78
  95. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_width/.yml +0 -78
  96. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_duration/.yml +0 -78
  97. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_height/.yml +0 -78
  98. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_large/.yml +0 -78
  99. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_medium/.yml +0 -78
  100. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_small/.yml +0 -78
  101. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_title/.yml +0 -78
  102. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_width/.yml +0 -78
  103. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/_available_/.yml +0 -56
  104. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_is_unavailable_video/_available_/.yml +0 -46
  105. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_no_longer_available_due_to_a_copyright_claim_video/_available_/.yml +0 -46
  106. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_date/.yml +0 -61
  107. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_description/.yml +0 -63
  108. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_duration/.yml +0 -63
  109. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_keywords/.yml +0 -63
  110. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_thumbnail_large/.yml +0 -61
  111. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_thumbnail_medium/.yml +0 -61
  112. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_thumbnail_small/.yml +0 -61
  113. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_title/.yml +0 -63
  114. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/.yml +0 -61
  115. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/_available_/.yml +0 -46
  116. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/_available_/.yml +0 -56
  117. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL0E8117603D70E10A_in_embed_path/_videos/.yml +0 -61
  118. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_description/.yml +0 -96
  119. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large/.yml +0 -96
  120. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_medium/.yml +0 -96
  121. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_small/.yml +0 -96
  122. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_title/.yml +0 -98
  123. data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_videos/.yml +0 -96
@@ -0,0 +1,173 @@
1
+ require 'spec_helper'
2
+
3
+ describe VideoInfo::Providers::YoutubePlaylist do
4
+ before(:each) do
5
+ VideoInfo.provider_api_keys = { youtube: 'AIzaSyA6PYwSr1EnLFUFy1cZDk3Ifb0rxeJaeZ0' }
6
+ end
7
+
8
+ describe ".usable?" do
9
+ subject { VideoInfo::Providers::YoutubePlaylist.usable?(url) }
10
+
11
+ context "with youtube.com/playlist url" do
12
+ let(:url) { 'http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF' }
13
+ it { is_expected.to be_truthy }
14
+ end
15
+
16
+ context "with youtube.com url" do
17
+ let(:url) { 'http://www.youtube.com/watch?v=Xp6CXF' }
18
+ it { is_expected.to be_falsey }
19
+ end
20
+
21
+ context "with other url" do
22
+ let(:url) { 'http://example.com/video1' }
23
+ it { is_expected.to be_falsey }
24
+ end
25
+ end
26
+
27
+ describe "#available?" do
28
+ context "with valid playlist", :vcr do
29
+ subject { VideoInfo.new('http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF') }
30
+
31
+ describe '#available?' do
32
+ subject { super().available? }
33
+ it { is_expected.to be_truthy }
34
+ end
35
+ end
36
+
37
+ context "with invalid playlist", :vcr do
38
+ subject { VideoInfo.new('http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF_invalid') }
39
+
40
+ describe '#available?' do
41
+ subject { super().available? }
42
+ it { is_expected.to be_falsey }
43
+ end
44
+ end
45
+ end
46
+
47
+ context "with playlist PL9hW1uS6HUftLdHI6RIsaf", :vcr do
48
+ let(:videos) {
49
+ [
50
+ VideoInfo.new('http://www.youtube.com/watch?v=Oi67QjrXy2w'),
51
+ VideoInfo.new('http://www.youtube.com/watch?v=_Bt3-WsHfB0'),
52
+ VideoInfo.new('http://www.youtube.com/watch?v=9g2U12SsRns'),
53
+ VideoInfo.new('http://www.youtube.com/watch?v=8b0aEoxqqC0'),
54
+ VideoInfo.new('http://www.youtube.com/watch?v=6c3mHikRz0I'),
55
+ VideoInfo.new('http://www.youtube.com/watch?v=OQVHWsTHcoc')
56
+ ]
57
+ }
58
+ subject { VideoInfo.new('http://www.youtube.com/playlist?p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr') }
59
+
60
+ describe '#provider' do
61
+ subject { super().provider }
62
+ it { is_expected.to eq 'YouTube' }
63
+ end
64
+
65
+ describe '#playlist_id' do
66
+ subject { super().playlist_id }
67
+ it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
68
+ end
69
+
70
+ describe '#url' do
71
+ subject { super().url }
72
+ it { is_expected.to eq 'http://www.youtube.com/playlist?p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
73
+ end
74
+
75
+ describe '#embed_url' do
76
+ subject { super().embed_url }
77
+ it { is_expected.to eq '//www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
78
+ end
79
+
80
+ describe '#embed_code' do
81
+ subject { super().embed_code }
82
+ it { is_expected.to eq '<iframe src="//www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
83
+ end
84
+
85
+ describe '#title' do
86
+ subject { super().title }
87
+ it { is_expected.to eq 'YouTube Policy and Copyright' }
88
+ end
89
+
90
+ describe '#description' do
91
+ subject { super().description }
92
+ it { is_expected.to eq 'Learn more about copyright basics, flagging, and the YouTube community.' }
93
+ end
94
+
95
+ describe '#keywords' do
96
+ subject { super().keywords }
97
+ it { is_expected.to be_nil }
98
+ end
99
+
100
+ describe '#duration' do
101
+ subject { super().duration }
102
+ it { is_expected.to be_nil }
103
+ end
104
+
105
+ describe '#width' do
106
+ subject { super().width }
107
+ it { is_expected.to be_nil }
108
+ end
109
+
110
+ describe '#height' do
111
+ subject { super().height }
112
+ it { is_expected.to be_nil }
113
+ end
114
+
115
+ describe '#date' do
116
+ subject { super().date }
117
+ it { is_expected.to be_nil }
118
+ end
119
+
120
+ describe '#thumbnail_small' do
121
+ subject { super().thumbnail_small }
122
+ it { is_expected.to eq 'https://i.ytimg.com/vi/8b0aEoxqqC0/default.jpg' }
123
+ end
124
+
125
+ describe '#thumbnail_medium' do
126
+ subject { super().thumbnail_medium }
127
+ it { is_expected.to eq 'https://i.ytimg.com/vi/8b0aEoxqqC0/mqdefault.jpg' }
128
+ end
129
+
130
+ describe '#thumbnail_large' do
131
+ subject { super().thumbnail_large }
132
+ it { is_expected.to eq 'https://i.ytimg.com/vi/8b0aEoxqqC0/hqdefault.jpg' }
133
+ end
134
+
135
+ describe '#videos' do
136
+ subject { super().videos }
137
+ it 'returns list of videos in playlist' do
138
+ pending("waiting for bug in Youtube API to be fixed")
139
+ is_expected.to match_array(videos)
140
+ end
141
+ end
142
+
143
+ describe '#view_count' do
144
+ subject { super().view_count }
145
+ it { is_expected.to be_nil }
146
+ end
147
+ end
148
+
149
+ context "with playlist PL0E8117603D70E10A in embed path", :vcr do
150
+ subject { VideoInfo.new('http://www.youtube.com/embed/videoseries?list=PL0E8117603D70E10A') }
151
+
152
+ describe '#playlist_id' do
153
+ subject { super().playlist_id }
154
+ it { is_expected.to eq 'PL0E8117603D70E10A' }
155
+ end
156
+
157
+ describe '#videos' do
158
+ subject { super().videos }
159
+ it { is_expected.to eq [] }
160
+ end
161
+ end
162
+
163
+ context "with playlist PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr in embed path", :vcr do
164
+ subject { VideoInfo.new('http://www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr') }
165
+
166
+ describe '#playlist_id' do
167
+ subject { super().playlist_id }
168
+ it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
169
+ end
170
+ end
171
+
172
+
173
+ end
@@ -1,6 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe VideoInfo::Providers::YoutubePlaylist do
4
+ before(:all) do
5
+ VideoInfo.provider_api_keys = {}
6
+ end
4
7
 
5
8
  describe ".usable?" do
6
9
  subject { VideoInfo::Providers::YoutubePlaylist.usable?(url) }
@@ -44,6 +47,7 @@ describe VideoInfo::Providers::YoutubePlaylist do
44
47
  context "with playlist PL9hW1uS6HUftLdHI6RIsaf", :vcr do
45
48
  let(:videos) {
46
49
  [
50
+ VideoInfo.new('http://www.youtube.com/watch?v=Oi67QjrXy2w'),
47
51
  VideoInfo.new('http://www.youtube.com/watch?v=_Bt3-WsHfB0'),
48
52
  VideoInfo.new('http://www.youtube.com/watch?v=9g2U12SsRns'),
49
53
  VideoInfo.new('http://www.youtube.com/watch?v=8b0aEoxqqC0'),
@@ -130,7 +134,7 @@ describe VideoInfo::Providers::YoutubePlaylist do
130
134
 
131
135
  describe '#videos' do
132
136
  subject { super().videos }
133
- it { is_expected.to match_array(videos) }
137
+ it { expect { subject}.to raise_error(NotImplementedError) }
134
138
  end
135
139
 
136
140
  describe '#view_count' do
@@ -149,7 +153,7 @@ describe VideoInfo::Providers::YoutubePlaylist do
149
153
 
150
154
  describe '#videos' do
151
155
  subject { super().videos }
152
- it { is_expected.to eq [] }
156
+ it { expect { subject }.to raise_error(NotImplementedError) }
153
157
  end
154
158
  end
155
159
 
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe VideoInfo::Providers::Youtube do
4
-
5
4
  describe ".usable?" do
6
5
  subject { VideoInfo::Providers::Youtube.usable?(url) }
7
6
 
@@ -43,6 +42,76 @@ describe VideoInfo::Providers::Youtube do
43
42
  subject { super().available? }
44
43
  it { is_expected.to be_falsey }
45
44
  end
45
+
46
+ describe '#provider' do
47
+ subject { super().provider }
48
+ it { is_expected.to eq 'YouTube' }
49
+ end
50
+
51
+ describe '#video_id' do
52
+ subject { super().video_id }
53
+ it { is_expected.to eq 'SUkXvWn1m7Q' }
54
+ end
55
+
56
+ describe '#url' do
57
+ subject { super().url }
58
+ it { is_expected.to eq 'http://www.youtube.com/watch?v=SUkXvWn1m7Q' }
59
+ end
60
+
61
+ describe '#embed_url' do
62
+ subject { super().embed_url }
63
+ it { is_expected.to eq '//www.youtube.com/embed/SUkXvWn1m7Q' }
64
+ end
65
+
66
+ describe '#embed_code' do
67
+ subject { super().embed_code }
68
+ it { is_expected.to eq '<iframe src="//www.youtube.com/embed/SUkXvWn1m7Q" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
69
+ end
70
+
71
+ describe '#title' do
72
+ subject { super().title }
73
+ it { is_expected.to eq nil }
74
+ end
75
+
76
+ describe '#description' do
77
+ subject { super().description }
78
+ it { is_expected.to eq nil }
79
+ end
80
+
81
+ describe '#keywords' do
82
+ subject { super().keywords }
83
+ it { is_expected.to be_nil }
84
+ end
85
+
86
+ describe '#duration' do
87
+ subject { super().duration }
88
+ it { is_expected.to eq 0 }
89
+ end
90
+
91
+ describe '#date' do
92
+ subject { super().date }
93
+ it { is_expected.to eq nil }
94
+ end
95
+
96
+ describe '#thumbnail_small' do
97
+ subject { super().thumbnail_small }
98
+ it { is_expected.to eq 'https://i.ytimg.com/vi/SUkXvWn1m7Q/default.jpg' }
99
+ end
100
+
101
+ describe '#thumbnail_medium' do
102
+ subject { super().thumbnail_medium }
103
+ it { is_expected.to eq 'https://i.ytimg.com/vi/SUkXvWn1m7Q/mqdefault.jpg' }
104
+ end
105
+
106
+ describe '#thumbnail_large' do
107
+ subject { super().thumbnail_large }
108
+ it { is_expected.to eq 'https://i.ytimg.com/vi/SUkXvWn1m7Q/hqdefault.jpg' }
109
+ end
110
+
111
+ describe '#view_count' do
112
+ subject { super().view_count }
113
+ it { is_expected.to be == 0 }
114
+ end
46
115
  end
47
116
 
48
117
  context "with 'video no longer available due to a copyright claim' video", :vcr do
@@ -95,7 +164,7 @@ describe VideoInfo::Providers::Youtube do
95
164
 
96
165
  describe '#keywords' do
97
166
  subject { super().keywords }
98
- it { is_expected.to be_nil }
167
+ it { is_expected.to eq %w(cherry bloom king of the knife guitar drum clip rock alternative tremplin Paris-Forum) }
99
168
  end
100
169
 
101
170
  describe '#duration' do
@@ -115,22 +184,22 @@ describe VideoInfo::Providers::Youtube do
115
184
 
116
185
  describe '#date' do
117
186
  subject { super().date }
118
- it { is_expected.to eq Time.parse('Sat Apr 12 22:25:35 UTC 2008', Time.now.utc) }
187
+ it { is_expected.to eq Time.parse('Sat Apr 12 2008', Time.now.utc) }
119
188
  end
120
189
 
121
190
  describe '#thumbnail_small' do
122
191
  subject { super().thumbnail_small }
123
- it { is_expected.to eq 'http://i.ytimg.com/vi/mZqGqE0D0n4/default.jpg' }
192
+ it { is_expected.to eq 'https://i.ytimg.com/vi/mZqGqE0D0n4/default.jpg' }
124
193
  end
125
194
 
126
195
  describe '#thumbnail_medium' do
127
196
  subject { super().thumbnail_medium }
128
- it { is_expected.to eq 'http://i.ytimg.com/vi/mZqGqE0D0n4/mqdefault.jpg' }
197
+ it { is_expected.to eq 'https://i.ytimg.com/vi/mZqGqE0D0n4/mqdefault.jpg' }
129
198
  end
130
199
 
131
200
  describe '#thumbnail_large' do
132
201
  subject { super().thumbnail_large }
133
- it { is_expected.to eq 'http://i.ytimg.com/vi/mZqGqE0D0n4/hqdefault.jpg' }
202
+ it { is_expected.to eq 'https://i.ytimg.com/vi/mZqGqE0D0n4/hqdefault.jpg' }
134
203
  end
135
204
 
136
205
  describe '#view_count' do
@@ -316,4 +385,12 @@ describe VideoInfo::Providers::Youtube do
316
385
  it { expect(subject.embed_code(iframe_attributes: { :'data-colorbox' => true })).to match(/data-colorbox="true"/) }
317
386
  end
318
387
 
388
+ context "URL without http:// or https://" do
389
+ subject { VideoInfo.new('www.youtube.com/watch?v=ylTY9WbMGDc') }
390
+
391
+ describe '#title' do
392
+ subject { super().title }
393
+ it { is_expected.to eq ('Deafheaven - Sunbather') }
394
+ end
395
+ end
319
396
  end
@@ -25,6 +25,29 @@ describe VideoInfo do
25
25
  end
26
26
  end
27
27
 
28
+ describe ".disable_providers" do
29
+ let(:youtube_url) { 'https://www.youtube.com/watch?v=mZqGqE0D0n4' }
30
+ let(:vimeo_url) { 'http://vimeo.com/86701482' }
31
+
32
+ it "does not attempt to use a provider marked as disabled" do
33
+ VideoInfo.disable_providers = %w[YouTube Vimeo]
34
+
35
+ expect { VideoInfo.new(youtube_url) }.to raise_error(VideoInfo::UrlError)
36
+ expect { VideoInfo.new(vimeo_url) }.to raise_error(VideoInfo::UrlError)
37
+
38
+ VideoInfo.disable_providers = []
39
+ end
40
+
41
+ it "is case insensitive" do
42
+ VideoInfo.disable_providers = %w[youTUBe VIMEO]
43
+
44
+ expect { VideoInfo.new(youtube_url) }.to raise_error(VideoInfo::UrlError)
45
+ expect { VideoInfo.new(vimeo_url) }.to raise_error(VideoInfo::UrlError)
46
+
47
+ VideoInfo.disable_providers = []
48
+ end
49
+ end
50
+
28
51
  describe ".usable?" do
29
52
  let(:url) { 'url' }
30
53
  let(:provider) { double('provider', new: true) }
@@ -47,6 +70,13 @@ describe VideoInfo do
47
70
  end
48
71
  end
49
72
 
73
+ describe ".provider_api_keys" do
74
+ it "raises an error if key isn't a symbol" do
75
+ expect { VideoInfo.provider_api_keys = { "Youtube" => "key" } }.to raise_error(ArgumentError)
76
+ expect { VideoInfo.provider_api_keys = { youtube: "key" } }.to_not raise_error
77
+ end
78
+ end
79
+
50
80
  describe "#==" do
51
81
  let(:vi_a) { VideoInfo.new('http://www.youtube.com/watch?v=AT_5xOGh6Ko') }
52
82
  let(:vi_b) { VideoInfo.new('http://www.youtube.com/watch?v=AT_5xOGh6Ko') }
@@ -14,6 +14,8 @@ VCR.configure do |config|
14
14
  record: :new_episodes,
15
15
  re_record_interval: 7 * 24 * 60 * 60
16
16
  }
17
+
18
+ config.allow_http_connections_when_no_cassette = true
17
19
  config.hook_into :webmock
18
20
  config.configure_rspec_metadata!
19
21
  end
@@ -21,8 +21,11 @@ Gem::Specification.new do |s|
21
21
  s.required_ruby_version = '>= 1.9.3'
22
22
 
23
23
  s.add_dependency 'addressable'
24
- s.add_dependency 'multi_json'
24
+ s.add_dependency 'multi_json', '~> 1.11'
25
25
  s.add_dependency 'htmlentities'
26
+ s.add_dependency 'iso8601'
27
+ s.add_dependency 'oga'
28
+ s.add_dependency 'open_uri_redirections'
26
29
 
27
30
  s.add_development_dependency 'bundler', '>= 1.3.5'
28
31
  s.add_development_dependency 'rake'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: video_info
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.2
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibaud Guillaume-Gentil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-16 00:00:00.000000000 Z
11
+ date: 2015-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -26,6 +26,20 @@ dependencies:
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: multi_json
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.11'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.11'
41
+ - !ruby/object:Gem::Dependency
42
+ name: htmlentities
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - ">="
@@ -39,7 +53,35 @@ dependencies:
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
- name: htmlentities
56
+ name: iso8601
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: oga
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: open_uri_redirections
43
85
  requirement: !ruby/object:Gem::Requirement
44
86
  requirements:
45
87
  - - ">="
@@ -159,110 +201,20 @@ files:
159
201
  - lib/video_info/providers/vkontakte.rb
160
202
  - lib/video_info/providers/wistia.rb
161
203
  - lib/video_info/providers/youtube.rb
204
+ - lib/video_info/providers/youtube_api.rb
205
+ - lib/video_info/providers/youtube_scraper.rb
162
206
  - lib/video_info/providers/youtubeplaylist.rb
207
+ - lib/video_info/providers/youtubeplaylist_api.rb
208
+ - lib/video_info/providers/youtubeplaylist_scraper.rb
163
209
  - lib/video_info/version.rb
164
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_This_video_does_not_exist_or_has_been_deleted_/_available_/.yml
165
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_valid_video/_available_/.yml
166
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_date/.yml
167
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_description/.yml
168
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_duration/.yml
169
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_keywords/.yml
170
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_large/.yml
171
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_medium/.yml
172
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_small/.yml
173
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_title/.yml
174
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_view_count/.yml
175
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/_available_/.yml
176
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/_available_/.yml
177
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/_available_/.yml
178
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_date/.yml
179
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_description/.yml
180
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_duration/.yml
181
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_height/.yml
182
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_keywords/.yml
183
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_large/.yml
184
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_medium/.yml
185
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_small/.yml
186
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_title/.yml
187
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_view_count/.yml
188
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_width/.yml
189
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/_available_/with_invalid_playlist/_available_/.yml
190
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/_available_/with_valid_playlist/_available_/.yml
191
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_description/.yml
192
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_thumbnail_large/.yml
193
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_thumbnail_medium/.yml
194
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_thumbnail_small/.yml
195
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_title/.yml
196
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_videos/.yml
197
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_hashes/available_/.yml
198
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_invalid_video/available_/.yml
199
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_private_video/available_/.yml
200
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_redirect/available_/.yml
201
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_redirect_to_main_page_for_auth/available_/.yml
202
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_valid_video/available_/.yml
203
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/description/.yml
204
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/duration/.yml
205
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/embed_code/.yml
206
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/embed_url/.yml
207
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/height/.yml
208
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/keywords/.yml
209
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/title/.yml
210
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/view_count/.yml
211
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/width/.yml
212
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video-54799401_165822734/title/.yml
213
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/description/.yml
214
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/duration/.yml
215
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_code/.yml
216
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_url/.yml
217
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/height/.yml
218
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/keywords/.yml
219
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/title/.yml
220
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/view_count/.yml
221
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/width/.yml
222
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/title/.yml
223
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_invalid_video/_available_/.yml
224
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_valid_video/_available_/.yml
225
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_duration/.yml
226
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_height/.yml
227
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_large/.yml
228
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_medium/.yml
229
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_small/.yml
230
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_title/.yml
231
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_width/.yml
232
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_duration/.yml
233
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_height/.yml
234
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_large/.yml
235
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_medium/.yml
236
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_small/.yml
237
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_title/.yml
238
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_width/.yml
239
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/_available_/.yml
240
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_is_unavailable_video/_available_/.yml
241
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_no_longer_available_due_to_a_copyright_claim_video/_available_/.yml
242
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_date/.yml
243
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_description/.yml
244
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_duration/.yml
245
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_keywords/.yml
246
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_thumbnail_large/.yml
247
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_thumbnail_medium/.yml
248
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_thumbnail_small/.yml
249
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_title/.yml
250
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/.yml
251
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/_available_/.yml
252
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/_available_/.yml
253
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL0E8117603D70E10A_in_embed_path/_videos/.yml
254
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_description/.yml
255
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large/.yml
256
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_medium/.yml
257
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_small/.yml
258
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_title/.yml
259
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_videos/.yml
260
210
  - spec/lib/video_info/provider_spec.rb
261
211
  - spec/lib/video_info/providers/dailymotion_spec.rb
262
212
  - spec/lib/video_info/providers/vimeo_playlist_spec.rb
263
213
  - spec/lib/video_info/providers/vimeo_spec.rb
264
214
  - spec/lib/video_info/providers/vkontakte_spec.rb
265
215
  - spec/lib/video_info/providers/wistia_spec.rb
216
+ - spec/lib/video_info/providers/youtube_api_spec.rb
217
+ - spec/lib/video_info/providers/youtube_playlist_api_spec.rb
266
218
  - spec/lib/video_info/providers/youtube_playlist_spec.rb
267
219
  - spec/lib/video_info/providers/youtube_spec.rb
268
220
  - spec/lib/video_info_spec.rb
@@ -288,114 +240,21 @@ required_rubygems_version: !ruby/object:Gem::Requirement
288
240
  version: '0'
289
241
  requirements: []
290
242
  rubyforge_project:
291
- rubygems_version: 2.2.2
243
+ rubygems_version: 2.4.8
292
244
  signing_key:
293
245
  specification_version: 4
294
246
  summary: Dailymotion, Vimeo, VK and YouTube info parser.
295
247
  test_files:
296
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_This_video_does_not_exist_or_has_been_deleted_/_available_/.yml
297
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_valid_video/_available_/.yml
298
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_date/.yml
299
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_description/.yml
300
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_duration/.yml
301
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_keywords/.yml
302
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_large/.yml
303
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_medium/.yml
304
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_small/.yml
305
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_title/.yml
306
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_view_count/.yml
307
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/_available_/.yml
308
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/_available_/.yml
309
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/_available_/.yml
310
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_date/.yml
311
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_description/.yml
312
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_duration/.yml
313
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_height/.yml
314
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_keywords/.yml
315
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_large/.yml
316
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_medium/.yml
317
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_small/.yml
318
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_title/.yml
319
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_view_count/.yml
320
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_width/.yml
321
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/_available_/with_invalid_playlist/_available_/.yml
322
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/_available_/with_valid_playlist/_available_/.yml
323
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_description/.yml
324
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_thumbnail_large/.yml
325
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_thumbnail_medium/.yml
326
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_thumbnail_small/.yml
327
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_title/.yml
328
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_videos/.yml
329
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_hashes/available_/.yml
330
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_invalid_video/available_/.yml
331
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_private_video/available_/.yml
332
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_redirect/available_/.yml
333
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_redirect_to_main_page_for_auth/available_/.yml
334
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_valid_video/available_/.yml
335
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/description/.yml
336
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/duration/.yml
337
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/embed_code/.yml
338
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/embed_url/.yml
339
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/height/.yml
340
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/keywords/.yml
341
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/title/.yml
342
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/view_count/.yml
343
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_kirill_lyanoi_z_video2152699_168591741_2F56fd229a9dfe2dcdbe/width/.yml
344
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video-54799401_165822734/title/.yml
345
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/description/.yml
346
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/duration/.yml
347
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_code/.yml
348
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_url/.yml
349
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/height/.yml
350
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/keywords/.yml
351
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/title/.yml
352
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/view_count/.yml
353
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/width/.yml
354
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_videos43640822_/video43640822_168790809/title/.yml
355
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_invalid_video/_available_/.yml
356
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/_available_/with_valid_video/_available_/.yml
357
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_duration/.yml
358
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_height/.yml
359
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_large/.yml
360
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_medium/.yml
361
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_thumbnail_small/.yml
362
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_title/.yml
363
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_pxonqr42is/_width/.yml
364
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_duration/.yml
365
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_height/.yml
366
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_large/.yml
367
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_medium/.yml
368
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_thumbnail_small/.yml
369
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_title/.yml
370
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Wistia/with_video_rs1me54mpw/_width/.yml
371
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/_available_/.yml
372
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_is_unavailable_video/_available_/.yml
373
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_no_longer_available_due_to_a_copyright_claim_video/_available_/.yml
374
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_date/.yml
375
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_description/.yml
376
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_duration/.yml
377
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_keywords/.yml
378
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_thumbnail_large/.yml
379
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_thumbnail_medium/.yml
380
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_thumbnail_small/.yml
381
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_title/.yml
382
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/.yml
383
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/_available_/.yml
384
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/_available_/.yml
385
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL0E8117603D70E10A_in_embed_path/_videos/.yml
386
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_description/.yml
387
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large/.yml
388
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_medium/.yml
389
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_small/.yml
390
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_title/.yml
391
- - spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_videos/.yml
392
248
  - spec/lib/video_info/provider_spec.rb
393
249
  - spec/lib/video_info/providers/dailymotion_spec.rb
394
250
  - spec/lib/video_info/providers/vimeo_playlist_spec.rb
395
251
  - spec/lib/video_info/providers/vimeo_spec.rb
396
252
  - spec/lib/video_info/providers/vkontakte_spec.rb
397
253
  - spec/lib/video_info/providers/wistia_spec.rb
254
+ - spec/lib/video_info/providers/youtube_api_spec.rb
255
+ - spec/lib/video_info/providers/youtube_playlist_api_spec.rb
398
256
  - spec/lib/video_info/providers/youtube_playlist_spec.rb
399
257
  - spec/lib/video_info/providers/youtube_spec.rb
400
258
  - spec/lib/video_info_spec.rb
401
259
  - spec/spec_helper.rb
260
+ has_rdoc: