video_info 2.3.1 → 2.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/lib/video_info/providers/vimeo.rb +1 -1
- data/lib/video_info/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_This_video_does_not_exist_or_has_been_deleted_/{available_ → _available_}/.yml +12 -19
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_valid_video/{available_ → _available_}/.yml +10 -15
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/{view_count → _date}/.yml +12 -17
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/{keywords → _description}/.yml +12 -17
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/{date → _duration}/.yml +12 -17
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/{thumbnail_large → _keywords}/.yml +12 -17
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_large/.yml +58 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_medium/.yml +58 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_thumbnail_small/.yml +58 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_title/.yml +58 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/_view_count/.yml +58 -0
- data/spec/fixtures/vcr_cassettes/{VideoInfo_Providers_VimeoPlaylist/_available_/with_valid_playlist/available_ → VideoInfo_Providers_Vimeo/_available_/with_password_required_video/_available_}/.yml +28 -36
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/{available_ → _available_}/.yml +11 -11
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/{available_ → _available_}/.yml +13 -13
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_date/.yml +73 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_description/.yml +73 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_duration/.yml +73 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_height/.yml +73 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_keywords/.yml +73 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_large/.yml +73 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_medium/.yml +73 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_thumbnail_small/.yml +73 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_title/.yml +73 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_view_count/.yml +73 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/_width/.yml +73 -0
- data/spec/fixtures/vcr_cassettes/{VideoInfo_Providers_Vimeo/_available_/with_password_required_video/available_ → VideoInfo_Providers_VimeoPlaylist/_available_/with_invalid_playlist/_available_}/.yml +12 -12
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/_available_/with_valid_playlist/_available_/.yml +54 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_description/.yml +71 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_thumbnail_large/.yml +71 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_thumbnail_medium/.yml +71 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_thumbnail_small/.yml +71 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_title/.yml +71 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_1921098/_videos/.yml +104 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_invalid_video/_available_/.yml +46 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_valid_video/_available_/.yml +1137 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video-54799401_165822734/_title/.yml +1363 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/_description/.yml +1137 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/_duration/.yml +1137 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/_embed_code/.yml +1137 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/_embed_url/.yml +1137 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/_height/.yml +1137 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/_keywords/.yml +1137 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/_title/.yml +1137 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/_view_count/.yml +1137 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/_width/.yml +1137 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/{available_ → _available_}/.yml +9 -9
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_is_unavailable_video/{available_ → _available_}/.yml +6 -6
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_no_longer_available_due_to_a_copyright_claim_video/{available_ → _available_}/.yml +6 -6
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_date/.yml +61 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_description/.yml +61 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_duration/.yml +61 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_keywords/.yml +61 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_thumbnail_large/.yml +61 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_thumbnail_medium/.yml +61 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_thumbnail_small/.yml +61 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_title/.yml +61 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/_view_count/.yml +61 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/{available_ → _available_}/.yml +6 -6
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/{available_ → _available_}/.yml +9 -9
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL0E8117603D70E10A_in_embed_path/_videos/.yml +61 -0
- data/spec/fixtures/vcr_cassettes/{VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/title → VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_description}/.yml +27 -95
- data/spec/fixtures/vcr_cassettes/{VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/thumbnail_medium → VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_large}/.yml +31 -97
- data/spec/fixtures/vcr_cassettes/{VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/thumbnail_small → VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_medium}/.yml +31 -101
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_thumbnail_small/.yml +98 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_title/.yml +98 -0
- data/spec/fixtures/vcr_cassettes/{VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/description → VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/_videos}/.yml +27 -95
- data/spec/lib/video_info/providers/dailymotion_spec.rb +101 -23
- data/spec/lib/video_info/providers/vimeo_playlist_spec.rb +110 -32
- data/spec/lib/video_info/providers/vimeo_spec.rb +134 -29
- data/spec/lib/video_info/providers/vkontakte_spec.rb +95 -21
- data/spec/lib/video_info/providers/youtube_playlist_spec.rb +110 -25
- data/spec/lib/video_info/providers/youtube_spec.rb +206 -47
- data/spec/lib/video_info_spec.rb +20 -20
- data/spec/spec_helper.rb +1 -5
- data/video_info.gemspec +1 -0
- metadata +148 -178
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_video_is_unavailable_video/available_/.yml +0 -46
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_video_no_longer_available_due_to_a_copyright_claim_video/available_/.yml +0 -46
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/description/.yml +0 -63
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/duration/.yml +0 -63
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/thumbnail_medium/.yml +0 -63
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/thumbnail_small/.yml +0 -63
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/title/.yml +0 -63
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/date/.yml +0 -76
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/description/.yml +0 -76
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/duration/.yml +0 -76
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/height/.yml +0 -76
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/keywords/.yml +0 -76
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/thumbnail_large/.yml +0 -76
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/thumbnail_medium/.yml +0 -76
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/thumbnail_small/.yml +0 -76
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/title/.yml +0 -76
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/view_count/.yml +0 -76
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/width/.yml +0 -76
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/_available_/with_invalid_playlist/available_/.yml +0 -152
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/date/.yml +0 -75
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/duration/.yml +0 -75
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/height/.yml +0 -71
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/keywords/.yml +0 -75
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/thumbnail_large/.yml +0 -168
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/videos/.yml +0 -202
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/view_count/.yml +0 -71
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/width/.yml +0 -71
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_invalid_video/available_/.yml +0 -147
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_valid_video/available_/.yml +0 -1115
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/description/.yml +0 -1139
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/duration/.yml +0 -1139
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/embed_code/.yml +0 -1139
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/embed_url/.yml +0 -1139
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/height/.yml +0 -1139
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/keywords/.yml +0 -1139
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/title/.yml +0 -1139
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/view_count/.yml +0 -1139
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/width/.yml +0 -1139
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video-54799401_165822734/title/.yml +0 -1331
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/description/.yml +0 -1125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/duration/.yml +0 -1125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_code/.yml +0 -1125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_url/.yml +0 -1125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/height/.yml +0 -1125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/keywords/.yml +0 -1125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/title/.yml +0 -1084
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/view_count/.yml +0 -1125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/width/.yml +0 -1125
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/date/.yml +0 -61
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/description/.yml +0 -61
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/duration/.yml +0 -61
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/keywords/.yml +0 -63
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/thumbnail_large/.yml +0 -61
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/thumbnail_medium/.yml +0 -61
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/thumbnail_small/.yml +0 -61
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/title/.yml +0 -63
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/view_count/.yml +0 -61
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL0E8117603D70E10A_in_embed_path/videos/.yml +0 -61
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/.yml +0 -98
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/date/.yml +0 -98
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/description/.yml +0 -98
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/duration/.yml +0 -98
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/keywords/.yml +0 -98
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/thumbnail_large/.yml +0 -96
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/thumbnail_medium/.yml +0 -96
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/thumbnail_small/.yml +0 -98
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/title/.yml +0 -98
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/videos/.yml +0 -96
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/view_count/.yml +0 -98
@@ -7,61 +7,138 @@ describe VideoInfo::Providers::Vimeo do
|
|
7
7
|
|
8
8
|
context "with vimeo url" do
|
9
9
|
let(:url) { 'http://www.vimeo.com/898029' }
|
10
|
-
it {
|
10
|
+
it { is_expected.to be_truthy }
|
11
|
+
end
|
12
|
+
|
13
|
+
context "with Vimeo OnDemand url" do
|
14
|
+
let(:url) { 'https://vimeo.com/ondemand/less/101677664' }
|
15
|
+
it { is_expected.to be_truthy }
|
11
16
|
end
|
12
17
|
|
13
18
|
context "with vimeo album url" do
|
14
19
|
let(:url) { 'http://vimeo.com/album/2755718' }
|
15
|
-
it {
|
20
|
+
it { is_expected.to be_falsey }
|
16
21
|
end
|
17
22
|
|
18
23
|
context "with vimeo hubnub embed url" do
|
19
24
|
let(:url) { 'http://player.vimeo.com/hubnut/album/2755718' }
|
20
|
-
it {
|
25
|
+
it { is_expected.to be_falsey }
|
21
26
|
end
|
22
27
|
|
23
28
|
context "with other url" do
|
24
29
|
let(:url) { 'http://www.youtube.com/898029' }
|
25
|
-
it {
|
30
|
+
it { is_expected.to be_falsey }
|
26
31
|
end
|
27
32
|
end
|
28
33
|
|
29
34
|
describe "#available?" do
|
30
35
|
context "with valid video", :vcr do
|
31
36
|
subject { VideoInfo.new('http://www.vimeo.com/898029') }
|
32
|
-
|
37
|
+
|
38
|
+
describe '#available?' do
|
39
|
+
it { is_expected.to be_available }
|
40
|
+
end
|
33
41
|
end
|
34
42
|
|
35
43
|
context "with 'this video does not exist' video", :vcr do
|
36
44
|
subject { VideoInfo.new('http://vimeo.com/59312311') }
|
37
|
-
|
45
|
+
|
46
|
+
describe '#available?' do
|
47
|
+
it { is_expected.to_not be_available }
|
48
|
+
end
|
38
49
|
end
|
39
50
|
|
40
51
|
context "with 'password required' video", :vcr do
|
41
|
-
subject { VideoInfo.new('http://vimeo.com/
|
42
|
-
|
52
|
+
subject { VideoInfo.new('http://vimeo.com/74636562') }
|
53
|
+
|
54
|
+
describe '#available?' do
|
55
|
+
it { is_expected.to_not be_available }
|
56
|
+
end
|
43
57
|
end
|
44
58
|
end
|
45
59
|
|
46
60
|
context "with video 898029", :vcr do
|
47
61
|
subject { VideoInfo.new('http://www.vimeo.com/898029') }
|
48
62
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
63
|
+
describe '#provider' do
|
64
|
+
subject { super().provider }
|
65
|
+
it { is_expected.to eq 'Vimeo' }
|
66
|
+
end
|
67
|
+
|
68
|
+
describe '#video_id' do
|
69
|
+
subject { super().video_id }
|
70
|
+
it { is_expected.to eq '898029' }
|
71
|
+
end
|
72
|
+
|
73
|
+
describe '#url' do
|
74
|
+
subject { super().url }
|
75
|
+
it { is_expected.to eq 'http://www.vimeo.com/898029' }
|
76
|
+
end
|
77
|
+
|
78
|
+
describe '#embed_url' do
|
79
|
+
subject { super().embed_url }
|
80
|
+
it { is_expected.to eq '//player.vimeo.com/video/898029' }
|
81
|
+
end
|
82
|
+
|
83
|
+
describe '#embed_code' do
|
84
|
+
subject { super().embed_code }
|
85
|
+
it { is_expected.to eq '<iframe src="//player.vimeo.com/video/898029?autoplay=0&byline=0&portrait=0&title=0" frameborder="0"></iframe>' }
|
86
|
+
end
|
87
|
+
|
88
|
+
describe '#title' do
|
89
|
+
subject { super().title }
|
90
|
+
it { is_expected.to eq 'Cherry Bloom - King Of The Knife' }
|
91
|
+
end
|
92
|
+
|
93
|
+
describe '#description' do
|
94
|
+
subject { super().description }
|
95
|
+
it { is_expected.to eq 'The first video from the upcoming album Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net' }
|
96
|
+
end
|
97
|
+
|
98
|
+
describe '#keywords' do
|
99
|
+
subject { super().keywords }
|
100
|
+
it { is_expected.to eq 'cherry bloom, secret sounds, king of the knife, rock, alternative' }
|
101
|
+
end
|
102
|
+
|
103
|
+
describe '#duration' do
|
104
|
+
subject { super().duration }
|
105
|
+
it { is_expected.to eq 175 }
|
106
|
+
end
|
107
|
+
|
108
|
+
describe '#width' do
|
109
|
+
subject { super().width }
|
110
|
+
it { is_expected.to eq 640 }
|
111
|
+
end
|
112
|
+
|
113
|
+
describe '#height' do
|
114
|
+
subject { super().height }
|
115
|
+
it { is_expected.to eq 360 }
|
116
|
+
end
|
117
|
+
|
118
|
+
describe '#date' do
|
119
|
+
subject { super().date }
|
120
|
+
it { is_expected.to eq Time.parse('2008-04-14 13:10:39', Time.now.utc) }
|
121
|
+
end
|
122
|
+
|
123
|
+
describe '#thumbnail_small' do
|
124
|
+
subject { super().thumbnail_small }
|
125
|
+
it { is_expected.to eq 'http://i.vimeocdn.com/video/34373130_100x75.jpg' }
|
126
|
+
end
|
127
|
+
|
128
|
+
describe '#thumbnail_medium' do
|
129
|
+
subject { super().thumbnail_medium }
|
130
|
+
it { is_expected.to eq 'http://i.vimeocdn.com/video/34373130_200x150.jpg' }
|
131
|
+
end
|
132
|
+
|
133
|
+
describe '#thumbnail_large' do
|
134
|
+
subject { super().thumbnail_large }
|
135
|
+
it { is_expected.to eq 'http://i.vimeocdn.com/video/34373130_640.jpg' }
|
136
|
+
end
|
137
|
+
|
138
|
+
describe '#view_count' do
|
139
|
+
subject { super().view_count }
|
140
|
+
it { is_expected.to be > 4000 }
|
141
|
+
end
|
65
142
|
end
|
66
143
|
|
67
144
|
context "with video 898029 and url_attributes", :vcr do
|
@@ -80,22 +157,50 @@ describe VideoInfo::Providers::Vimeo do
|
|
80
157
|
context "with video 898029 in /group/ url", :vcr do
|
81
158
|
subject { VideoInfo.new('http://vimeo.com/groups/1234/videos/898029') }
|
82
159
|
|
83
|
-
|
84
|
-
|
160
|
+
describe '#provider' do
|
161
|
+
subject { super().provider }
|
162
|
+
it { is_expected.to eq 'Vimeo' }
|
163
|
+
end
|
164
|
+
|
165
|
+
describe '#video_id' do
|
166
|
+
subject { super().video_id }
|
167
|
+
it { is_expected.to eq '898029' }
|
168
|
+
end
|
85
169
|
end
|
86
170
|
|
87
171
|
context "with video 898029 in /group/ url", :vcr do
|
88
172
|
subject { VideoInfo.new('http://player.vimeo.com/video/898029') }
|
89
173
|
|
90
|
-
|
91
|
-
|
174
|
+
describe '#provider' do
|
175
|
+
subject { super().provider }
|
176
|
+
it { is_expected.to eq 'Vimeo' }
|
177
|
+
end
|
178
|
+
|
179
|
+
describe '#video_id' do
|
180
|
+
subject { super().video_id }
|
181
|
+
it { is_expected.to eq '898029' }
|
182
|
+
end
|
92
183
|
end
|
93
184
|
|
94
185
|
context "with video 898029 in text", :vcr do
|
95
186
|
subject { VideoInfo.new('<a href="http://www.vimeo.com/898029">http://www.vimeo.com/898029</a>') }
|
96
187
|
|
188
|
+
describe '#provider' do
|
189
|
+
subject { super().provider }
|
190
|
+
it { is_expected.to eq 'Vimeo' }
|
191
|
+
end
|
192
|
+
|
193
|
+
describe '#video_id' do
|
194
|
+
subject { super().video_id }
|
195
|
+
it { is_expected.to eq '898029' }
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
context "with video 101677664 in /ondemand/ url", :vcr do
|
200
|
+
subject { VideoInfo.new('https://vimeo.com/ondemand/less/101677664') }
|
201
|
+
|
97
202
|
its(:provider) { should eq 'Vimeo' }
|
98
|
-
its(:video_id) { should eq '
|
203
|
+
its(:video_id) { should eq '101677664' }
|
99
204
|
end
|
100
205
|
|
101
206
|
end
|
@@ -8,24 +8,32 @@ describe VideoInfo::Providers::Vkontakte do
|
|
8
8
|
|
9
9
|
context "with vkontakte url" do
|
10
10
|
let(:url) { 'http://vk.com/video39576223_108370515' }
|
11
|
-
it {
|
11
|
+
it { is_expected.to be_truthy }
|
12
12
|
end
|
13
13
|
|
14
14
|
context "with other url" do
|
15
15
|
let(:url) { 'http://www.youtube.com/898029' }
|
16
|
-
it {
|
16
|
+
it { is_expected.to be_falsey }
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
20
|
describe "#available?" do
|
21
21
|
context "with valid video", :vcr do
|
22
22
|
subject { VideoInfo.new('http://vk.com/video39576223_108370515') }
|
23
|
-
|
23
|
+
|
24
|
+
describe '#available?' do
|
25
|
+
subject { super().available? }
|
26
|
+
it { is_expected.to be_truthy }
|
27
|
+
end
|
24
28
|
end
|
25
29
|
|
26
30
|
context "with invalid video", :vcr do
|
27
31
|
subject { VideoInfo.new('http://vk.com/video39576223_invalid') }
|
28
|
-
|
32
|
+
|
33
|
+
describe '#available?' do
|
34
|
+
subject { super().available? }
|
35
|
+
it { is_expected.to be_falsey }
|
36
|
+
end
|
29
37
|
end
|
30
38
|
|
31
39
|
end
|
@@ -33,28 +41,94 @@ describe VideoInfo::Providers::Vkontakte do
|
|
33
41
|
context "with video video39576223_108370515", :vcr do
|
34
42
|
subject { VideoInfo.new('http://vk.com/video39576223_108370515') }
|
35
43
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
44
|
+
describe '#provider' do
|
45
|
+
subject { super().provider }
|
46
|
+
it { is_expected.to eq 'Vkontakte' }
|
47
|
+
end
|
48
|
+
|
49
|
+
describe '#video_owner' do
|
50
|
+
subject { super().video_owner }
|
51
|
+
it { is_expected.to eq '39576223' }
|
52
|
+
end
|
53
|
+
|
54
|
+
describe '#video_id' do
|
55
|
+
subject { super().video_id }
|
56
|
+
it { is_expected.to eq '108370515' }
|
57
|
+
end
|
58
|
+
|
59
|
+
describe '#url' do
|
60
|
+
subject { super().url }
|
61
|
+
it { is_expected.to eq 'http://vk.com/video39576223_108370515' }
|
62
|
+
end
|
63
|
+
|
64
|
+
describe '#embed_url' do
|
65
|
+
subject { super().embed_url }
|
66
|
+
it { is_expected.to eq '//vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af' }
|
67
|
+
end
|
68
|
+
|
69
|
+
describe '#embed_code' do
|
70
|
+
subject { super().embed_code }
|
71
|
+
it { is_expected.to eq '<iframe src="//vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
|
72
|
+
end
|
73
|
+
|
74
|
+
describe '#title' do
|
75
|
+
subject { super().title }
|
76
|
+
it { is_expected.to eq 'Я уточка))))) | VK' }
|
77
|
+
end
|
78
|
+
|
79
|
+
describe '#description' do
|
80
|
+
subject { super().description }
|
81
|
+
it { is_expected.to eq 'это ВЗРЫВ МОЗГА!!! Просто отвал башки...' }
|
82
|
+
end
|
83
|
+
|
84
|
+
describe '#keywords' do
|
85
|
+
subject { super().keywords }
|
86
|
+
it { is_expected.to eq 'это ВЗРЫВ МОЗГА!!! Просто отвал башки...' }
|
87
|
+
end
|
88
|
+
|
89
|
+
describe '#duration' do
|
90
|
+
subject { super().duration }
|
91
|
+
it { is_expected.to eq 183 }
|
92
|
+
end
|
93
|
+
|
94
|
+
describe '#width' do
|
95
|
+
subject { super().width }
|
96
|
+
it { is_expected.to eq 320 }
|
97
|
+
end
|
98
|
+
|
99
|
+
describe '#height' do
|
100
|
+
subject { super().height }
|
101
|
+
it { is_expected.to eq 240 }
|
102
|
+
end
|
103
|
+
|
104
|
+
describe '#view_count' do
|
105
|
+
subject { super().view_count }
|
106
|
+
it { is_expected.to be > 10 }
|
107
|
+
end
|
49
108
|
end
|
50
109
|
|
51
110
|
context "with video video-54799401_165822734", :vcr do
|
52
111
|
subject { VideoInfo.new('http://vk.com/video-54799401_165822734') }
|
53
112
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
113
|
+
describe '#provider' do
|
114
|
+
subject { super().provider }
|
115
|
+
it { is_expected.to eq 'Vkontakte' }
|
116
|
+
end
|
117
|
+
|
118
|
+
describe '#video_owner' do
|
119
|
+
subject { super().video_owner }
|
120
|
+
it { is_expected.to eq '-54799401' }
|
121
|
+
end
|
122
|
+
|
123
|
+
describe '#video_id' do
|
124
|
+
subject { super().video_id }
|
125
|
+
it { is_expected.to eq '165822734' }
|
126
|
+
end
|
127
|
+
|
128
|
+
describe '#title' do
|
129
|
+
subject { super().title }
|
130
|
+
it { is_expected.to eq 'SpaceGlasses are the future of computing | VK' }
|
131
|
+
end
|
58
132
|
end
|
59
133
|
|
60
134
|
end
|
@@ -7,29 +7,37 @@ describe VideoInfo::Providers::YoutubePlaylist do
|
|
7
7
|
|
8
8
|
context "with youtube.com/playlist url" do
|
9
9
|
let(:url) { 'http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF' }
|
10
|
-
it {
|
10
|
+
it { is_expected.to be_truthy }
|
11
11
|
end
|
12
12
|
|
13
13
|
context "with youtube.com url" do
|
14
14
|
let(:url) { 'http://www.youtube.com/watch?v=Xp6CXF' }
|
15
|
-
it {
|
15
|
+
it { is_expected.to be_falsey }
|
16
16
|
end
|
17
17
|
|
18
18
|
context "with other url" do
|
19
19
|
let(:url) { 'http://example.com/video1' }
|
20
|
-
it {
|
20
|
+
it { is_expected.to be_falsey }
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
24
|
describe "#available?" do
|
25
25
|
context "with valid playlist", :vcr do
|
26
26
|
subject { VideoInfo.new('http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF') }
|
27
|
-
|
27
|
+
|
28
|
+
describe '#available?' do
|
29
|
+
subject { super().available? }
|
30
|
+
it { is_expected.to be_truthy }
|
31
|
+
end
|
28
32
|
end
|
29
33
|
|
30
34
|
context "with invalid playlist", :vcr do
|
31
35
|
subject { VideoInfo.new('http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF_invalid') }
|
32
|
-
|
36
|
+
|
37
|
+
describe '#available?' do
|
38
|
+
subject { super().available? }
|
39
|
+
it { is_expected.to be_falsey }
|
40
|
+
end
|
33
41
|
end
|
34
42
|
end
|
35
43
|
|
@@ -45,36 +53,113 @@ describe VideoInfo::Providers::YoutubePlaylist do
|
|
45
53
|
}
|
46
54
|
subject { VideoInfo.new('http://www.youtube.com/playlist?p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr') }
|
47
55
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
56
|
+
describe '#provider' do
|
57
|
+
subject { super().provider }
|
58
|
+
it { is_expected.to eq 'YouTube' }
|
59
|
+
end
|
60
|
+
|
61
|
+
describe '#playlist_id' do
|
62
|
+
subject { super().playlist_id }
|
63
|
+
it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
|
64
|
+
end
|
65
|
+
|
66
|
+
describe '#url' do
|
67
|
+
subject { super().url }
|
68
|
+
it { is_expected.to eq 'http://www.youtube.com/playlist?p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
|
69
|
+
end
|
70
|
+
|
71
|
+
describe '#embed_url' do
|
72
|
+
subject { super().embed_url }
|
73
|
+
it { is_expected.to eq '//www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
|
74
|
+
end
|
75
|
+
|
76
|
+
describe '#embed_code' do
|
77
|
+
subject { super().embed_code }
|
78
|
+
it { is_expected.to eq '<iframe src="//www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
|
79
|
+
end
|
80
|
+
|
81
|
+
describe '#title' do
|
82
|
+
subject { super().title }
|
83
|
+
it { is_expected.to eq 'YouTube Policy and Copyright' }
|
84
|
+
end
|
85
|
+
|
86
|
+
describe '#description' do
|
87
|
+
subject { super().description }
|
88
|
+
it { is_expected.to eq 'Learn more about copyright basics, flagging, and the YouTube community.' }
|
89
|
+
end
|
90
|
+
|
91
|
+
describe '#keywords' do
|
92
|
+
subject { super().keywords }
|
93
|
+
it { is_expected.to be_nil }
|
94
|
+
end
|
95
|
+
|
96
|
+
describe '#duration' do
|
97
|
+
subject { super().duration }
|
98
|
+
it { is_expected.to be_nil }
|
99
|
+
end
|
100
|
+
|
101
|
+
describe '#width' do
|
102
|
+
subject { super().width }
|
103
|
+
it { is_expected.to be_nil }
|
104
|
+
end
|
105
|
+
|
106
|
+
describe '#height' do
|
107
|
+
subject { super().height }
|
108
|
+
it { is_expected.to be_nil }
|
109
|
+
end
|
110
|
+
|
111
|
+
describe '#date' do
|
112
|
+
subject { super().date }
|
113
|
+
it { is_expected.to be_nil }
|
114
|
+
end
|
115
|
+
|
116
|
+
describe '#thumbnail_small' do
|
117
|
+
subject { super().thumbnail_small }
|
118
|
+
it { is_expected.to eq 'https://i.ytimg.com/vi/8b0aEoxqqC0/default.jpg' }
|
119
|
+
end
|
120
|
+
|
121
|
+
describe '#thumbnail_medium' do
|
122
|
+
subject { super().thumbnail_medium }
|
123
|
+
it { is_expected.to eq 'https://i.ytimg.com/vi/8b0aEoxqqC0/mqdefault.jpg' }
|
124
|
+
end
|
125
|
+
|
126
|
+
describe '#thumbnail_large' do
|
127
|
+
subject { super().thumbnail_large }
|
128
|
+
it { is_expected.to eq 'https://i.ytimg.com/vi/8b0aEoxqqC0/hqdefault.jpg' }
|
129
|
+
end
|
130
|
+
|
131
|
+
describe '#videos' do
|
132
|
+
subject { super().videos }
|
133
|
+
it { is_expected.to match_array(videos) }
|
134
|
+
end
|
135
|
+
|
136
|
+
describe '#view_count' do
|
137
|
+
subject { super().view_count }
|
138
|
+
it { is_expected.to be_nil }
|
139
|
+
end
|
65
140
|
end
|
66
141
|
|
67
142
|
context "with playlist PL0E8117603D70E10A in embed path", :vcr do
|
68
143
|
subject { VideoInfo.new('http://www.youtube.com/embed/videoseries?list=PL0E8117603D70E10A') }
|
69
144
|
|
70
|
-
|
71
|
-
|
145
|
+
describe '#playlist_id' do
|
146
|
+
subject { super().playlist_id }
|
147
|
+
it { is_expected.to eq 'PL0E8117603D70E10A' }
|
148
|
+
end
|
149
|
+
|
150
|
+
describe '#videos' do
|
151
|
+
subject { super().videos }
|
152
|
+
it { is_expected.to eq [] }
|
153
|
+
end
|
72
154
|
end
|
73
155
|
|
74
156
|
context "with playlist PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr in embed path", :vcr do
|
75
157
|
subject { VideoInfo.new('http://www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr') }
|
76
158
|
|
77
|
-
|
159
|
+
describe '#playlist_id' do
|
160
|
+
subject { super().playlist_id }
|
161
|
+
it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
|
162
|
+
end
|
78
163
|
end
|
79
164
|
|
80
165
|
|