video_info 2.7.1 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/video_info.rb +1 -0
- data/lib/video_info/provider.rb +8 -0
- data/lib/video_info/providers/vkontakte.rb +0 -4
- data/lib/video_info/providers/youtube.rb +4 -0
- data/lib/video_info/providers/youtube_api.rb +1 -2
- data/lib/video_info/version.rb +1 -1
- data/spec/lib/video_info/providers/dailymotion_spec.rb +10 -0
- data/spec/lib/video_info/providers/vimeo_spec.rb +10 -0
- data/spec/lib/video_info/providers/wistia_spec.rb +10 -0
- data/spec/lib/video_info/providers/youtube_playlist_spec.rb +192 -182
- data/spec/lib/video_info/providers/youtube_spec.rb +24 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9564ba39bd175a28b2d3a012c7ae7f7b775ee9cfb48f9898b617ed90249cb5c
|
4
|
+
data.tar.gz: b9352efff0df637e5b7003a16b10bcb7d74a04a7c30f679deff23b8668c536d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e811d6b7a7f1331353ded5f0b043b4a6062186e7f39e2e9e91508b1ae9bb2cbe2b8a972f9187c53269334edf1618759b7dedc48a058fc010f21018ae1a0d804
|
7
|
+
data.tar.gz: f98bbc307aa03a09a9b1e7c57ec9fc716cc847785481eb8d9491eb87de0fda3d277103dbbe88cb17d072598082ee30303484b38f5549a0ddf1349f764b32811e
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# VideoInfo
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/video_info.svg)](http://badge.fury.io/rb/video_info) [![Build Status](https://travis-ci.org/thibaudgg/video_info.svg?branch=master)](https://travis-ci.org/thibaudgg/video_info) [![
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/video_info.svg)](http://badge.fury.io/rb/video_info) [![Build Status](https://travis-ci.org/thibaudgg/video_info.svg?branch=master)](https://travis-ci.org/thibaudgg/video_info) [![Code Climate](https://codeclimate.com/github/thibaudgg/video_info.svg)](https://codeclimate.com/github/thibaudgg/video_info) [![Coverage Status](https://coveralls.io/repos/thibaudgg/video_info/badge.svg?branch=master)](https://coveralls.io/r/thibaudgg/video_info) [![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)
|
4
|
+
|
5
|
+
:exclamation: VideoInfo is no more actively maintained, please [contact me](mailto:thibaud@thibaud.gg) if you're interested in helping.
|
4
6
|
|
5
7
|
Simple Ruby Gem to get video info from Dailymotion, VK, Vimeo, Wistia and YouTube (with playlist).
|
6
8
|
|
data/lib/video_info.rb
CHANGED
data/lib/video_info/provider.rb
CHANGED
@@ -44,6 +44,10 @@ class VideoInfo
|
|
44
44
|
"https://i.ytimg.com/vi/#{video_id}/hqdefault.jpg"
|
45
45
|
end
|
46
46
|
|
47
|
+
def thumbnail_large_2x
|
48
|
+
"https://i.ytimg.com/vi/#{video_id}/sddefault.jpg"
|
49
|
+
end
|
50
|
+
|
47
51
|
def thumbnail_maxres
|
48
52
|
"https://i.ytimg.com/vi/#{video_id}/maxresdefault.jpg"
|
49
53
|
end
|
@@ -83,8 +83,7 @@ class VideoInfo
|
|
83
83
|
|
84
84
|
def _channel_info
|
85
85
|
channel_url = _channel_api_url(_video_snippet['channelId'])
|
86
|
-
@
|
87
|
-
JSON.load(@channel_data.read)
|
86
|
+
@_channel_info ||= JSON.load(open(channel_url).read)
|
88
87
|
end
|
89
88
|
|
90
89
|
def _channel_snippet
|
data/lib/video_info/version.rb
CHANGED
@@ -144,6 +144,16 @@ describe VideoInfo::Providers::Dailymotion do
|
|
144
144
|
it { is_expected.to eq 'http://s2.dmcdn.net/BgWxI/x720-YcV.jpg' }
|
145
145
|
end
|
146
146
|
|
147
|
+
describe '#thumbnail_large_2x' do
|
148
|
+
subject { super().thumbnail_large_2x }
|
149
|
+
it { is_expected.to be_nil }
|
150
|
+
end
|
151
|
+
|
152
|
+
describe '#thumbnail_maxres' do
|
153
|
+
subject { super().thumbnail_maxres }
|
154
|
+
it { is_expected.to be_nil }
|
155
|
+
end
|
156
|
+
|
147
157
|
describe '#thumbnail' do
|
148
158
|
subject { super().thumbnail }
|
149
159
|
it { is_expected.to eq 'http://s2.dmcdn.net/BgWxI/x720-YcV.jpg' }
|
@@ -164,6 +164,16 @@ require 'spec_helper'
|
|
164
164
|
it { is_expected.to eq thumbnail_url }
|
165
165
|
end
|
166
166
|
|
167
|
+
describe '#thumbnail_large_2x' do
|
168
|
+
subject { super().thumbnail_large_2x }
|
169
|
+
it { is_expected.to be_nil }
|
170
|
+
end
|
171
|
+
|
172
|
+
describe '#thumbnail_maxres' do
|
173
|
+
subject { super().thumbnail_maxres }
|
174
|
+
it { is_expected.to be_nil }
|
175
|
+
end
|
176
|
+
|
167
177
|
describe '#thumbnail' do
|
168
178
|
subject { super().thumbnail }
|
169
179
|
thumbnail_url = 'https://i.vimeocdn.com/video/531688239_640.jpg'
|
@@ -111,6 +111,16 @@ describe VideoInfo::Providers::Wistia do
|
|
111
111
|
it { is_expected.to eq thumbnail_url }
|
112
112
|
end
|
113
113
|
|
114
|
+
describe '#thumbnail_large_2x' do
|
115
|
+
subject { super().thumbnail_large_2x }
|
116
|
+
it { is_expected.to be_nil }
|
117
|
+
end
|
118
|
+
|
119
|
+
describe '#thumbnail_maxres' do
|
120
|
+
subject { super().thumbnail_maxres }
|
121
|
+
it { is_expected.to be_nil }
|
122
|
+
end
|
123
|
+
|
114
124
|
describe '#thumbnail' do
|
115
125
|
subject { super().thumbnail }
|
116
126
|
thumbnail_url = 'https://embed-ssl.wistia.com/deliveries/' \
|
@@ -1,236 +1,246 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
describe VideoInfo::Providers::YoutubePlaylist do
|
4
|
+
before(:each) do
|
5
|
+
api_key = 'AIzaSyA6PYwSr1EnLFUFy1cZDk3Ifb0rxeJaeZ0'
|
6
|
+
VideoInfo.provider_api_keys = { youtube: api_key }
|
7
|
+
end
|
8
|
+
|
9
|
+
describe '.usable?' do
|
10
|
+
subject { VideoInfo::Providers::YoutubePlaylist.usable?(url) }
|
11
|
+
|
12
|
+
context 'with youtube.com/playlist?p= url' do
|
13
|
+
let(:url) { 'http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF' }
|
14
|
+
it { is_expected.to be_truthy }
|
8
15
|
end
|
9
16
|
|
10
|
-
|
11
|
-
|
17
|
+
context 'with youtube.com/playlist?list= url' do
|
18
|
+
let(:url) { 'http://www.youtube.com/playlist?list=PLA575C81A1FBC04CF' }
|
19
|
+
it { is_expected.to be_truthy }
|
20
|
+
end
|
12
21
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
22
|
+
context 'with youtube.com url' do
|
23
|
+
let(:url) { 'http://www.youtube.com/watch?v=Xp6CXF' }
|
24
|
+
it { is_expected.to be_falsey }
|
25
|
+
end
|
26
|
+
|
27
|
+
context 'with other url' do
|
28
|
+
let(:url) { 'http://example.com/video1' }
|
29
|
+
it { is_expected.to be_falsey }
|
30
|
+
end
|
31
|
+
end
|
17
32
|
|
18
|
-
|
19
|
-
|
33
|
+
describe '#available?' do
|
34
|
+
context 'with valid playlist', :vcr do
|
35
|
+
playlist_url = 'http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF'
|
36
|
+
subject { VideoInfo.new(playlist_url.freeze) }
|
37
|
+
|
38
|
+
describe '#available?' do
|
39
|
+
subject { super().available? }
|
20
40
|
it { is_expected.to be_truthy }
|
21
41
|
end
|
42
|
+
end
|
22
43
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
44
|
+
context 'with invalid playlist', :vcr do
|
45
|
+
invalid_playlist_url = 'http://www.youtube.com/playlist?' \
|
46
|
+
'p=PLA575C81A1FBC04CF_invalid'
|
47
|
+
subject { VideoInfo.new(invalid_playlist_url) }
|
27
48
|
|
28
|
-
|
29
|
-
|
49
|
+
describe '#available?' do
|
50
|
+
subject { super().available? }
|
30
51
|
it { is_expected.to be_falsey }
|
31
52
|
end
|
32
53
|
end
|
33
54
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
subject { VideoInfo.new(playlist_url.freeze) }
|
55
|
+
context 'with &list= url', :vcr do
|
56
|
+
playlist_url = 'http://www.youtube.com/playlist?list=PLA575C81A1FBC04CF'
|
57
|
+
subject { VideoInfo.new(playlist_url) }
|
38
58
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
end
|
59
|
+
describe '#available?' do
|
60
|
+
subject { super().available? }
|
61
|
+
it { is_expected.to be_truthy }
|
43
62
|
end
|
63
|
+
end
|
64
|
+
end
|
44
65
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
66
|
+
context 'with playlist PL9hW1uS6HUftLdHI6RIsaf', :vcr do
|
67
|
+
let(:videos) do
|
68
|
+
[
|
69
|
+
VideoInfo.new('http://www.youtube.com/watch?v=Oi67QjrXy2w'),
|
70
|
+
VideoInfo.new('http://www.youtube.com/watch?v=_Bt3-WsHfB0'),
|
71
|
+
VideoInfo.new('http://www.youtube.com/watch?v=9g2U12SsRns'),
|
72
|
+
VideoInfo.new('http://www.youtube.com/watch?v=8b0aEoxqqC0'),
|
73
|
+
VideoInfo.new('http://www.youtube.com/watch?v=6c3mHikRz0I'),
|
74
|
+
VideoInfo.new('http://www.youtube.com/watch?v=OQVHWsTHcoc')
|
75
|
+
]
|
76
|
+
end
|
49
77
|
|
50
|
-
|
51
|
-
|
52
|
-
it { is_expected.to be_falsey }
|
53
|
-
end
|
54
|
-
end
|
78
|
+
playlist_url = 'http://www.youtube.com/playlist?' \
|
79
|
+
'p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
|
55
80
|
|
56
|
-
|
57
|
-
playlist_url = 'http://www.youtube.com/playlist?list=PLA575C81A1FBC04CF'
|
58
|
-
subject { VideoInfo.new(playlist_url) }
|
81
|
+
subject { VideoInfo.new(playlist_url) }
|
59
82
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
end
|
64
|
-
end
|
83
|
+
describe '#provider' do
|
84
|
+
subject { super().provider }
|
85
|
+
it { is_expected.to eq 'YouTube' }
|
65
86
|
end
|
66
87
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
VideoInfo.new('http://www.youtube.com/watch?v=_Bt3-WsHfB0'),
|
72
|
-
VideoInfo.new('http://www.youtube.com/watch?v=9g2U12SsRns'),
|
73
|
-
VideoInfo.new('http://www.youtube.com/watch?v=8b0aEoxqqC0'),
|
74
|
-
VideoInfo.new('http://www.youtube.com/watch?v=6c3mHikRz0I'),
|
75
|
-
VideoInfo.new('http://www.youtube.com/watch?v=OQVHWsTHcoc')
|
76
|
-
]
|
77
|
-
end
|
78
|
-
|
79
|
-
playlist_url = 'http://www.youtube.com/playlist?' \
|
80
|
-
'p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
|
81
|
-
|
82
|
-
subject { VideoInfo.new(playlist_url) }
|
88
|
+
describe '#playlist_id' do
|
89
|
+
subject { super().playlist_id }
|
90
|
+
it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
|
91
|
+
end
|
83
92
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
93
|
+
describe '#url' do
|
94
|
+
subject { super().url }
|
95
|
+
it { is_expected.to eq playlist_url }
|
96
|
+
end
|
88
97
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
98
|
+
describe '#embed_url' do
|
99
|
+
subject { super().embed_url }
|
100
|
+
embed_url = '//www.youtube.com/embed/videoseries' \
|
101
|
+
'?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
|
102
|
+
it { is_expected.to eq embed_url }
|
103
|
+
end
|
93
104
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
105
|
+
describe '#embed_code' do
|
106
|
+
subject { super().embed_code }
|
107
|
+
embed_code = '<iframe src="//www.youtube.com/embed/videoseries' \
|
108
|
+
'?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr" ' \
|
109
|
+
'frameborder="0" allowfullscreen="allowfullscreen">' \
|
110
|
+
'</iframe>'
|
111
|
+
it { is_expected.to eq embed_code }
|
112
|
+
end
|
98
113
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
it { is_expected.to eq embed_url }
|
104
|
-
end
|
114
|
+
describe '#title' do
|
115
|
+
subject { super().title }
|
116
|
+
it { is_expected.to eq 'YouTube Policy and Copyright' }
|
117
|
+
end
|
105
118
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
it { is_expected.to eq embed_code }
|
113
|
-
end
|
119
|
+
describe '#description' do
|
120
|
+
subject { super().description }
|
121
|
+
description_text = 'Learn more about copyright basics, flagging, ' \
|
122
|
+
'and the YouTube community.'
|
123
|
+
it { is_expected.to eq description_text }
|
124
|
+
end
|
114
125
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
126
|
+
describe '#keywords' do
|
127
|
+
subject { super().keywords }
|
128
|
+
it { is_expected.to be_nil }
|
129
|
+
end
|
119
130
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
it { is_expected.to eq description_text }
|
125
|
-
end
|
131
|
+
describe '#duration' do
|
132
|
+
subject { super().duration }
|
133
|
+
it { is_expected.to be_nil }
|
134
|
+
end
|
126
135
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
136
|
+
describe '#width' do
|
137
|
+
subject { super().width }
|
138
|
+
it { is_expected.to be_nil }
|
139
|
+
end
|
131
140
|
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
141
|
+
describe '#height' do
|
142
|
+
subject { super().height }
|
143
|
+
it { is_expected.to be_nil }
|
144
|
+
end
|
136
145
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
146
|
+
describe '#date' do
|
147
|
+
subject { super().date }
|
148
|
+
it { is_expected.to be_nil }
|
149
|
+
end
|
141
150
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
151
|
+
describe '#thumbnail_small' do
|
152
|
+
subject { super().thumbnail_small }
|
153
|
+
thumbnail_url = 'https://i.ytimg.com/vi/Oi67QjrXy2w/default.jpg'
|
154
|
+
it { is_expected.to eq thumbnail_url }
|
155
|
+
end
|
146
156
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
157
|
+
describe '#thumbnail_medium' do
|
158
|
+
subject { super().thumbnail_medium }
|
159
|
+
thumbnail_url = 'https://i.ytimg.com/vi/Oi67QjrXy2w/mqdefault.jpg'
|
160
|
+
it { is_expected.to eq thumbnail_url }
|
161
|
+
end
|
151
162
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
163
|
+
describe '#thumbnail_large' do
|
164
|
+
subject { super().thumbnail_large }
|
165
|
+
thumbnail_url = 'https://i.ytimg.com/vi/Oi67QjrXy2w/hqdefault.jpg'
|
166
|
+
it { is_expected.to eq thumbnail_url }
|
167
|
+
end
|
157
168
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
169
|
+
describe '#thumbnail_large_2x' do
|
170
|
+
subject { super().thumbnail_large_2x }
|
171
|
+
thumbnail_url = 'https://i.ytimg.com/vi/Oi67QjrXy2w/sddefault.jpg'
|
172
|
+
it { is_expected.to eq thumbnail_url }
|
173
|
+
end
|
163
174
|
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
175
|
+
describe '#thumbnail_maxres' do
|
176
|
+
subject { super().thumbnail_maxres }
|
177
|
+
thumbnail_url = 'https://i.ytimg.com/vi/Oi67QjrXy2w/maxresdefault.jpg'
|
178
|
+
it { is_expected.to eq thumbnail_url }
|
179
|
+
end
|
169
180
|
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
181
|
+
describe '#thumbnail' do
|
182
|
+
subject { super().thumbnail }
|
183
|
+
thumbnail_url = 'https://i.ytimg.com/vi/Oi67QjrXy2w/hqdefault.jpg'
|
184
|
+
it { is_expected.to eq thumbnail_url }
|
185
|
+
end
|
175
186
|
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
end
|
187
|
+
describe '#videos' do
|
188
|
+
subject { super().videos }
|
189
|
+
it 'returns list of videos in playlist' do
|
190
|
+
pending('waiting for bug in Youtube API to be fixed')
|
191
|
+
is_expected.to match_array(videos)
|
182
192
|
end
|
193
|
+
end
|
183
194
|
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
195
|
+
describe '#view_count' do
|
196
|
+
subject { super().view_count }
|
197
|
+
it { is_expected.to be_nil }
|
198
|
+
end
|
188
199
|
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
200
|
+
describe '#author' do
|
201
|
+
subject { super().author }
|
202
|
+
it { is_expected.to eq 'YouTube Help' }
|
203
|
+
end
|
193
204
|
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
205
|
+
describe '#author_thumbnail' do
|
206
|
+
subject { super().author_thumbnail }
|
207
|
+
author_thumbnail = 'https://yt3.ggpht.com/-ni_VaN38-AE/AAAAAAAAAAI/' \
|
208
|
+
'AAAAAAAAAAA/bJCTTfihBl0/s88-c-k-no-mo-rj-c0xffffff' \
|
209
|
+
'/photo.jpg'
|
210
|
+
it { is_expected.to eq author_thumbnail }
|
211
|
+
end
|
201
212
|
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
end
|
213
|
+
describe '#author_url' do
|
214
|
+
subject { super().author_url }
|
215
|
+
author_url = 'https://www.youtube.com/channel/UCMDQxm7cUx3yXkfeHa5zJIQ'
|
216
|
+
it { is_expected.to eq author_url }
|
207
217
|
end
|
218
|
+
end
|
208
219
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
220
|
+
context 'with playlist that does not exist in embed path', :vcr do
|
221
|
+
playlist_url = 'http://www.youtube.com/embed/videoseries?' \
|
222
|
+
'list=PL0E8117603D70E10A'
|
223
|
+
subject { VideoInfo.new(playlist_url) }
|
213
224
|
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
225
|
+
describe '#playlist_id' do
|
226
|
+
subject { super().playlist_id }
|
227
|
+
it { is_expected.to eq 'PL0E8117603D70E10A' }
|
228
|
+
end
|
218
229
|
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
end
|
230
|
+
describe '#videos' do
|
231
|
+
subject { super().videos }
|
232
|
+
it { is_expected.to eq [] }
|
223
233
|
end
|
234
|
+
end
|
224
235
|
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
236
|
+
context 'with playlist valid playlist in embed path', :vcr do
|
237
|
+
playlist_url = 'http://www.youtube.com/embed/videoseries' \
|
238
|
+
'?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
|
239
|
+
subject { VideoInfo.new(playlist_url) }
|
229
240
|
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
end
|
241
|
+
describe '#playlist_id' do
|
242
|
+
subject { super().playlist_id }
|
243
|
+
it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
|
234
244
|
end
|
235
245
|
end
|
236
246
|
end
|
@@ -119,6 +119,12 @@ require 'spec_helper'
|
|
119
119
|
it { is_expected.to eq thumbnail_url }
|
120
120
|
end
|
121
121
|
|
122
|
+
describe '#thumbnail_large_2x' do
|
123
|
+
subject { super().thumbnail_large_2x }
|
124
|
+
thumbnail_url = 'https://i.ytimg.com/vi/SUkXvWn1m7Q/sddefault.jpg'
|
125
|
+
it { is_expected.to eq thumbnail_url }
|
126
|
+
end
|
127
|
+
|
122
128
|
describe '#thumbnail_maxres' do
|
123
129
|
subject { super().thumbnail_maxres }
|
124
130
|
thumbnail_url = 'https://i.ytimg.com/vi/SUkXvWn1m7Q/maxresdefault.jpg'
|
@@ -192,9 +198,13 @@ require 'spec_helper'
|
|
192
198
|
end
|
193
199
|
|
194
200
|
describe '#author_url' do
|
195
|
-
subject { super().author_url }
|
196
201
|
author_url = 'https://www.youtube.com/channel/UCzxQk-rZGowoqMBKxGD5jSA'
|
197
|
-
|
202
|
+
|
203
|
+
it { expect(subject.author_url).to eql(author_url) }
|
204
|
+
|
205
|
+
it 'can be called twice and receive the same value' do
|
206
|
+
expect(subject.author_url).to eq(subject.author_url)
|
207
|
+
end
|
198
208
|
end
|
199
209
|
|
200
210
|
describe '#title' do
|
@@ -263,6 +273,12 @@ require 'spec_helper'
|
|
263
273
|
it { is_expected.to eq thumbnail_url }
|
264
274
|
end
|
265
275
|
|
276
|
+
describe '#thumbnail_large_2x' do
|
277
|
+
subject { super().thumbnail_large_2x }
|
278
|
+
thumbnail_url = 'https://i.ytimg.com/vi/mZqGqE0D0n4/sddefault.jpg'
|
279
|
+
it { is_expected.to eq thumbnail_url }
|
280
|
+
end
|
281
|
+
|
266
282
|
describe '#thumbnail_maxres' do
|
267
283
|
subject { super().thumbnail_maxres }
|
268
284
|
thumbnail_url = 'https://i.ytimg.com/vi/mZqGqE0D0n4/maxresdefault.jpg'
|
@@ -566,6 +582,12 @@ require 'spec_helper'
|
|
566
582
|
it { is_expected.to eq thumbnail_url }
|
567
583
|
end
|
568
584
|
|
585
|
+
describe '#thumbnail_large_2x' do
|
586
|
+
subject { super().thumbnail_large_2x }
|
587
|
+
thumbnail_url = 'https://i.ytimg.com/vi/mZqGqE0D0n4/sddefault.jpg'
|
588
|
+
it { is_expected.to eq thumbnail_url }
|
589
|
+
end
|
590
|
+
|
569
591
|
describe '#view_count' do
|
570
592
|
subject { super().view_count }
|
571
593
|
it { is_expected.to be > 4000 }
|
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
|
+
version: 2.8.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: 2020-
|
11
|
+
date: 2020-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: iso8601
|
@@ -429,7 +429,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
429
429
|
- !ruby/object:Gem::Version
|
430
430
|
version: '0'
|
431
431
|
requirements: []
|
432
|
-
rubygems_version: 3.
|
432
|
+
rubygems_version: 3.1.2
|
433
433
|
signing_key:
|
434
434
|
specification_version: 4
|
435
435
|
summary: Dailymotion, Vimeo, VK and YouTube info parser.
|