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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b33e589b59664cc725646602f9f4dc20466fdc7376e2d280abdc8e358c954fca
4
- data.tar.gz: edecc4f652cfa5bc6bf6850a0d2d7b618807f49a8cc8c923d5c76044cd2f053b
3
+ metadata.gz: a9564ba39bd175a28b2d3a012c7ae7f7b775ee9cfb48f9898b617ed90249cb5c
4
+ data.tar.gz: b9352efff0df637e5b7003a16b10bcb7d74a04a7c30f679deff23b8668c536d7
5
5
  SHA512:
6
- metadata.gz: 76792e4998b6e08fba07d67168d049cc4e75261df446d849e4f7bc02965c8a1902e00959a4d42ff5d930d7516d86fdb722db937f2060c5d24a8ce9c0b065fb3b
7
- data.tar.gz: dc4b9426882439bb7e662043a85285528e95b0fb66c3ca2cc59c894cdf0968db3c6183ee6a8070f292bf7fc75217b7b3fe89720d8b8b717ed00a30c6b8fe2265
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) [![Dependency Status](https://gemnasium.com/thibaudgg/video_info.svg)](https://gemnasium.com/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)
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
 
@@ -51,6 +51,7 @@ class VideoInfo
51
51
  :thumbnail_small,
52
52
  :thumbnail_medium,
53
53
  :thumbnail_large,
54
+ :thumbnail_large_2x,
54
55
  :thumbnail_maxres
55
56
  def_delegators :@provider, :embed_code, :embed_url
56
57
  def_delegators :@provider, :available?
@@ -42,6 +42,14 @@ class VideoInfo
42
42
  end
43
43
  end
44
44
 
45
+ def thumbnail_large_2x
46
+ nil
47
+ end
48
+
49
+ def thumbnail_maxres
50
+ nil
51
+ end
52
+
45
53
  private
46
54
 
47
55
  def _response_code
@@ -105,10 +105,6 @@ class VideoInfo
105
105
  nil
106
106
  end
107
107
 
108
- def thumbnail_maxres
109
- nil
110
- end
111
-
112
108
  private
113
109
 
114
110
  def _make_request(url, options)
@@ -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
- @channel_data ||= open(channel_url)
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
@@ -1,3 +1,3 @@
1
1
  class VideoInfo
2
- VERSION = '2.7.1'.freeze
2
+ VERSION = '2.8.0'.freeze
3
3
  end
@@ -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
- [nil, 'AIzaSyA6PYwSr1EnLFUFy1cZDk3Ifb0rxeJaeZ0'].each do |api_key|
4
- describe VideoInfo::Providers::YoutubePlaylist do
5
- before(:each) do
6
- api_key = 'AIzaSyA6PYwSr1EnLFUFy1cZDk3Ifb0rxeJaeZ0'
7
- VideoInfo.provider_api_keys = { youtube: api_key }
3
+ describe VideoInfo::Providers::YoutubePlaylist 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
- describe '.usable?' do
11
- subject { VideoInfo::Providers::YoutubePlaylist.usable?(url) }
17
+ context 'with youtube.com/playlist?list= url' do
18
+ let(:url) { 'http://www.youtube.com/playlist?list=PLA575C81A1FBC04CF' }
19
+ it { is_expected.to be_truthy }
20
+ end
12
21
 
13
- context 'with youtube.com/playlist?p= url' do
14
- let(:url) { 'http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF' }
15
- it { is_expected.to be_truthy }
16
- end
22
+ context 'with youtube.com url' do
23
+ let(:url) { 'http://www.youtube.com/watch?v=Xp6CXF' }
24
+ it { is_expected.to be_falsey }
25
+ end
26
+
27
+ context 'with other url' do
28
+ let(:url) { 'http://example.com/video1' }
29
+ it { is_expected.to be_falsey }
30
+ end
31
+ end
17
32
 
18
- context 'with youtube.com/playlist?list= url' do
19
- let(:url) { 'http://www.youtube.com/playlist?list=PLA575C81A1FBC04CF' }
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
- context 'with youtube.com url' do
24
- let(:url) { 'http://www.youtube.com/watch?v=Xp6CXF' }
25
- it { is_expected.to be_falsey }
26
- end
44
+ context 'with invalid playlist', :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
- context 'with other url' do
29
- let(:url) { 'http://example.com/video1' }
49
+ describe '#available?' do
50
+ subject { super().available? }
30
51
  it { is_expected.to be_falsey }
31
52
  end
32
53
  end
33
54
 
34
- describe '#available?' do
35
- context 'with valid playlist', :vcr do
36
- playlist_url = 'http://www.youtube.com/playlist?p=PLA575C81A1FBC04CF'
37
- subject { VideoInfo.new(playlist_url.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
- describe '#available?' do
40
- subject { super().available? }
41
- it { is_expected.to be_truthy }
42
- end
59
+ describe '#available?' do
60
+ subject { super().available? }
61
+ it { is_expected.to be_truthy }
43
62
  end
63
+ end
64
+ end
44
65
 
45
- context 'with invalid playlist', :vcr do
46
- invalid_playlist_url = 'http://www.youtube.com/playlist?' \
47
- 'p=PLA575C81A1FBC04CF_invalid'
48
- subject { VideoInfo.new(invalid_playlist_url) }
66
+ context 'with playlist PL9hW1uS6HUftLdHI6RIsaf', :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
- describe '#available?' do
51
- subject { super().available? }
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
- context 'with &list= url', :vcr do
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
- describe '#available?' do
61
- subject { super().available? }
62
- it { is_expected.to be_truthy }
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
- context 'with playlist PL9hW1uS6HUftLdHI6RIsaf', :vcr do
68
- let(:videos) do
69
- [
70
- VideoInfo.new('http://www.youtube.com/watch?v=Oi67QjrXy2w'),
71
- VideoInfo.new('http://www.youtube.com/watch?v=_Bt3-WsHfB0'),
72
- VideoInfo.new('http://www.youtube.com/watch?v=9g2U12SsRns'),
73
- VideoInfo.new('http://www.youtube.com/watch?v=8b0aEoxqqC0'),
74
- VideoInfo.new('http://www.youtube.com/watch?v=6c3mHikRz0I'),
75
- VideoInfo.new('http://www.youtube.com/watch?v=OQVHWsTHcoc')
76
- ]
77
- end
78
-
79
- playlist_url = 'http://www.youtube.com/playlist?' \
80
- 'p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
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
- describe '#provider' do
85
- subject { super().provider }
86
- it { is_expected.to eq 'YouTube' }
87
- end
93
+ describe '#url' do
94
+ subject { super().url }
95
+ it { is_expected.to eq playlist_url }
96
+ end
88
97
 
89
- describe '#playlist_id' do
90
- subject { super().playlist_id }
91
- it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
92
- end
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
- describe '#url' do
95
- subject { super().url }
96
- it { is_expected.to eq playlist_url }
97
- end
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
- describe '#embed_url' do
100
- subject { super().embed_url }
101
- embed_url = '//www.youtube.com/embed/videoseries' \
102
- '?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
103
- it { is_expected.to eq embed_url }
104
- end
114
+ describe '#title' do
115
+ subject { super().title }
116
+ it { is_expected.to eq 'YouTube Policy and Copyright' }
117
+ end
105
118
 
106
- describe '#embed_code' do
107
- subject { super().embed_code }
108
- embed_code = '<iframe src="//www.youtube.com/embed/videoseries' \
109
- '?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr" ' \
110
- 'frameborder="0" allowfullscreen="allowfullscreen">' \
111
- '</iframe>'
112
- it { is_expected.to eq embed_code }
113
- end
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
- describe '#title' do
116
- subject { super().title }
117
- it { is_expected.to eq 'YouTube Policy and Copyright' }
118
- end
126
+ describe '#keywords' do
127
+ subject { super().keywords }
128
+ it { is_expected.to be_nil }
129
+ end
119
130
 
120
- describe '#description' do
121
- subject { super().description }
122
- description_text = 'Learn more about copyright basics, flagging, ' \
123
- 'and the YouTube community.'
124
- it { is_expected.to eq description_text }
125
- end
131
+ describe '#duration' do
132
+ subject { super().duration }
133
+ it { is_expected.to be_nil }
134
+ end
126
135
 
127
- describe '#keywords' do
128
- subject { super().keywords }
129
- it { is_expected.to be_nil }
130
- end
136
+ describe '#width' do
137
+ subject { super().width }
138
+ it { is_expected.to be_nil }
139
+ end
131
140
 
132
- describe '#duration' do
133
- subject { super().duration }
134
- it { is_expected.to be_nil }
135
- end
141
+ describe '#height' do
142
+ subject { super().height }
143
+ it { is_expected.to be_nil }
144
+ end
136
145
 
137
- describe '#width' do
138
- subject { super().width }
139
- it { is_expected.to be_nil }
140
- end
146
+ describe '#date' do
147
+ subject { super().date }
148
+ it { is_expected.to be_nil }
149
+ end
141
150
 
142
- describe '#height' do
143
- subject { super().height }
144
- it { is_expected.to be_nil }
145
- end
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
- describe '#date' do
148
- subject { super().date }
149
- it { is_expected.to be_nil }
150
- end
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
- describe '#thumbnail_small' do
153
- subject { super().thumbnail_small }
154
- thumbnail_url = 'https://i.ytimg.com/vi/Oi67QjrXy2w/default.jpg'
155
- it { is_expected.to eq thumbnail_url }
156
- end
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
- describe '#thumbnail_medium' do
159
- subject { super().thumbnail_medium }
160
- thumbnail_url = 'https://i.ytimg.com/vi/Oi67QjrXy2w/mqdefault.jpg'
161
- it { is_expected.to eq thumbnail_url }
162
- end
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
- describe '#thumbnail_large' do
165
- subject { super().thumbnail_large }
166
- thumbnail_url = 'https://i.ytimg.com/vi/Oi67QjrXy2w/hqdefault.jpg'
167
- it { is_expected.to eq thumbnail_url }
168
- end
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
- describe '#thumbnail' do
171
- subject { super().thumbnail }
172
- thumbnail_url = 'https://i.ytimg.com/vi/Oi67QjrXy2w/hqdefault.jpg'
173
- it { is_expected.to eq thumbnail_url }
174
- end
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
- describe '#videos' do
177
- subject { super().videos }
178
- it 'returns list of videos in playlist' do
179
- pending('waiting for bug in Youtube API to be fixed')
180
- is_expected.to match_array(videos)
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
- describe '#view_count' do
185
- subject { super().view_count }
186
- it { is_expected.to be_nil }
187
- end
195
+ describe '#view_count' do
196
+ subject { super().view_count }
197
+ it { is_expected.to be_nil }
198
+ end
188
199
 
189
- describe '#author' do
190
- subject { super().author }
191
- it { is_expected.to eq 'YouTube Help' }
192
- end
200
+ describe '#author' do
201
+ subject { super().author }
202
+ it { is_expected.to eq 'YouTube Help' }
203
+ end
193
204
 
194
- describe '#author_thumbnail' do
195
- subject { super().author_thumbnail }
196
- author_thumbnail = 'https://yt3.ggpht.com/-ni_VaN38-AE/AAAAAAAAAAI/' \
197
- 'AAAAAAAAAAA/bJCTTfihBl0/s88-c-k-no-mo-rj-c0xffffff' \
198
- '/photo.jpg'
199
- it { is_expected.to eq author_thumbnail }
200
- end
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
- describe '#author_url' do
203
- subject { super().author_url }
204
- author_url = 'https://www.youtube.com/channel/UCMDQxm7cUx3yXkfeHa5zJIQ'
205
- it { is_expected.to eq author_url }
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
- context 'with playlist that does not exist in embed path', :vcr do
210
- playlist_url = 'http://www.youtube.com/embed/videoseries?' \
211
- 'list=PL0E8117603D70E10A'
212
- subject { VideoInfo.new(playlist_url) }
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
- describe '#playlist_id' do
215
- subject { super().playlist_id }
216
- it { is_expected.to eq 'PL0E8117603D70E10A' }
217
- end
225
+ describe '#playlist_id' do
226
+ subject { super().playlist_id }
227
+ it { is_expected.to eq 'PL0E8117603D70E10A' }
228
+ end
218
229
 
219
- describe '#videos' do
220
- subject { super().videos }
221
- it { is_expected.to eq [] }
222
- end
230
+ describe '#videos' do
231
+ subject { super().videos }
232
+ it { is_expected.to eq [] }
223
233
  end
234
+ end
224
235
 
225
- context 'with playlist valid playlist in embed path', :vcr do
226
- playlist_url = 'http://www.youtube.com/embed/videoseries' \
227
- '?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr'
228
- subject { VideoInfo.new(playlist_url) }
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
- describe '#playlist_id' do
231
- subject { super().playlist_id }
232
- it { is_expected.to eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
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
- it { is_expected.to eql author_url }
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.7.1
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-01-06 00:00:00.000000000 Z
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.0.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.