video_info 2.2.2 → 2.3.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 +14 -2
- data/lib/video_info.rb +1 -1
- data/lib/video_info/providers/vimeo.rb +9 -9
- data/lib/video_info/providers/vimeoplaylist.rb +64 -0
- data/lib/video_info/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/_available_/with_invalid_playlist/available_/.yml +152 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/_available_/with_valid_playlist/available_/.yml +105 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/date/.yml +75 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/description/.yml +164 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/duration/.yml +75 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/height/.yml +71 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/keywords/.yml +75 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/thumbnail_large/.yml +168 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/thumbnail_medium/.yml +164 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/thumbnail_small/.yml +168 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/title/.yml +166 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/videos/.yml +202 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/view_count/.yml +71 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/width/.yml +71 -0
- data/spec/lib/video_info/providers/vimeo_playlist_spec.rb +78 -0
- data/spec/lib/video_info/providers/vimeo_spec.rb +10 -0
- metadata +33 -2
data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/videos/.yml
ADDED
@@ -0,0 +1,202 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://vimeo.com/api/v2/album/2755718/videos.json
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- VideoInfo/2.2.2
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- '*/*'
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Age:
|
22
|
+
- '1'
|
23
|
+
Date:
|
24
|
+
- Sat, 01 Mar 2014 00:28:23 GMT
|
25
|
+
Expires:
|
26
|
+
- Sat, 01 Mar 2014 00:29:23 GMT
|
27
|
+
Content-Length:
|
28
|
+
- '13346'
|
29
|
+
Connection:
|
30
|
+
- Keep-Alive
|
31
|
+
Via:
|
32
|
+
- 1.1 varnish
|
33
|
+
- dnet-dca
|
34
|
+
Etag:
|
35
|
+
- '"4c410bb57e9ae247e718c7c73a475786"'
|
36
|
+
Server:
|
37
|
+
- Apache
|
38
|
+
Access-Control-Allow-Origin:
|
39
|
+
- '*'
|
40
|
+
X-Ratelimit-Limit:
|
41
|
+
- '3600'
|
42
|
+
X-Ratelimit-Remaining:
|
43
|
+
- '3581'
|
44
|
+
X-Ratelimit-Reset:
|
45
|
+
- '1393635073'
|
46
|
+
Last-Modified:
|
47
|
+
- Fri, 28 Feb 2014 23:19:45 GMT
|
48
|
+
X-Ua-Compatible:
|
49
|
+
- IE=edge
|
50
|
+
X-Dns-Prefetch-Control:
|
51
|
+
- 'on'
|
52
|
+
Vary:
|
53
|
+
- Accept-Encoding
|
54
|
+
Content-Type:
|
55
|
+
- application/json
|
56
|
+
X-Varnish:
|
57
|
+
- '1960274180'
|
58
|
+
X-Varnish-Cache:
|
59
|
+
- '0'
|
60
|
+
X-Vserver:
|
61
|
+
- 10.90.128.197
|
62
|
+
body:
|
63
|
+
encoding: UTF-8
|
64
|
+
string: '[{"id":67977038,"title":"The Century Of Self: Happiness Machines (Episode1)","description":"The
|
65
|
+
Century of the Self is an award-winning British television documentary series
|
66
|
+
by Adam Curtis. It focuses on how the work of Sigmund Freud, Anna Freud, and
|
67
|
+
Edward Bernays influenced the way corporations and governments have analyzed,\u202d
|
68
|
+
dealt with, and controlled \u202cpeople. This series is banned on YouTube
|
69
|
+
because of the secrets it contains.<br \/>\r\n<br \/>\r\n\"This series is
|
70
|
+
about how those in power have used Freud''s theories to try and control the
|
71
|
+
dangerous crowd in an age of mass democracy.\" \u2014Adam Curtis'' introduction
|
72
|
+
to the first episode.<br \/>\r\n<br \/>\r\nSigmund Freud, the founder of psychoanalysis,
|
73
|
+
changed the perception of the human mind and its workings. The series describes
|
74
|
+
the propaganda that Western governments and corporations have utilized stemming
|
75
|
+
from Freud''s theories.<br \/>\r\n<br \/>\r\nFreud himself and his nephew
|
76
|
+
Edward Bernays, who was the first to use psychological techniques in public
|
77
|
+
relations, are discussed. Freud''s daughter Anna Freud, a pioneer of child
|
78
|
+
psychology, is mentioned in the second part, as is one of the main opponents
|
79
|
+
of Freud''s theories, Wilhelm Reich, in the third part.<br \/>\r\n<br \/>\r\nAlong
|
80
|
+
these general themes, The Century of the Self asks deeper questions about
|
81
|
+
the roots and methods of modern consumerism, representative democracy, commodification
|
82
|
+
and its implications. It also questions the modern way we see ourselves, the
|
83
|
+
attitudes to fashion and superficiality.<br \/>\r\n<br \/>\r\nThe business
|
84
|
+
and political world uses psychological techniques to read, create and fulfill
|
85
|
+
our desires, to make their products or speeches as pleasing as possible to
|
86
|
+
us. Curtis raises the question of the intentions and roots of this fact. Where
|
87
|
+
once the political process was about engaging people''s rational, conscious
|
88
|
+
minds, as well as facilitating their needs as a society, the documentary shows
|
89
|
+
how by employing the tactics of psychoanalysis, politicians appeal to irrational,
|
90
|
+
primitive impulses that have little apparent bearing on issues outside of
|
91
|
+
the narrow self-interest of a consumer population.<br \/>\r\n<br \/>\r\nPaul
|
92
|
+
Mazur, a leading Wall Street banker working for Lehman Brothers, is cited
|
93
|
+
as declaring: \"We must shift America from a needs- to a desires-culture.
|
94
|
+
People must be trained to desire, to want new things, even before the old
|
95
|
+
have been entirely consumed. [...] Man''s desires must overshadow his needs\".<br
|
96
|
+
\/>\r\n<br \/>\r\nIn Episode 4 the main subjects are Philip Gould and Matthew
|
97
|
+
Freud, the great-grandson of Sigmund, a PR consultant. They were part of the
|
98
|
+
efforts during the nineties to bring the Democrats in the US and New Labour
|
99
|
+
in the United Kingdom back into power. Adam Curtis explores the psychological
|
100
|
+
methods they have now massively introduced into politics. He also argues that
|
101
|
+
the eventual outcome strongly resembles Edward Bernays vision for the \"Democracity\"
|
102
|
+
during the 1939 New York World''s Fair.<br \/>\r\n<br \/>\r\nIt is widely
|
103
|
+
believed that the series was inspired and informed by a book written by the
|
104
|
+
American historian, Stuart Ewen, \"PR! A Social History of Spin\".","url":"http:\/\/vimeo.com\/67977038","upload_date":"2013-06-09
|
105
|
+
03:50:08","thumbnail_small":"http:\/\/b.vimeocdn.com\/ts\/440\/289\/440289906_100.jpg","thumbnail_medium":"http:\/\/b.vimeocdn.com\/ts\/440\/289\/440289906_200.jpg","thumbnail_large":"http:\/\/b.vimeocdn.com\/ts\/440\/289\/440289906_640.jpg","user_id":4246041,"user_name":"Roses
|
106
|
+
of Time","user_url":"http:\/\/vimeo.com\/rosesoftime","user_portrait_small":"http:\/\/b.vimeocdn.com\/ps\/612\/203\/6122037_30.jpg","user_portrait_medium":"http:\/\/b.vimeocdn.com\/ps\/612\/203\/6122037_75.jpg","user_portrait_large":"http:\/\/b.vimeocdn.com\/ps\/612\/203\/6122037_100.jpg","user_portrait_huge":"http:\/\/b.vimeocdn.com\/ps\/612\/203\/6122037_300.jpg","stats_number_of_likes":83,"stats_number_of_plays":22945,"stats_number_of_comments":2,"duration":3497,"width":640,"height":360,"tags":"Freud,
|
107
|
+
Bernays, Century of self, BBC, spin, politics, society, Adam Curtis, psychoanalysis,
|
108
|
+
consumerism, democracy","embed_privacy":"anywhere"},{"id":68843810,"title":"The
|
109
|
+
Century Of Self: Engineering Of Consent (Episode2)","description":"The Century
|
110
|
+
of the Self is an award-winning British television documentary series by Adam
|
111
|
+
Curtis. It focuses on how the work of Sigmund Freud, Anna Freud, and Edward
|
112
|
+
Bernays influenced the way corporations and governments have analyzed,\u202d
|
113
|
+
dealt with, and controlled \u202cpeople.<br \/>\r\n<br \/>\r\n\"This series
|
114
|
+
is about how those in power have used Freud''s theories to try and control
|
115
|
+
the dangerous crowd in an age of mass democracy.\" \u2014Adam Curtis'' introduction
|
116
|
+
to the first episode.<br \/>\r\n<br \/>\r\nSigmund Freud, the founder of psychoanalysis,
|
117
|
+
changed the perception of the human mind and its workings. The series describes
|
118
|
+
the propaganda that Western governments and corporations have utilized stemming
|
119
|
+
from Freud''s theories.<br \/>\r\n<br \/>\r\nFreud himself and his nephew
|
120
|
+
Edward Bernays, who was the first to use psychological techniques in public
|
121
|
+
relations, are discussed. Freud''s daughter Anna Freud, a pioneer of child
|
122
|
+
psychology, is mentioned in the second part, as is one of the main opponents
|
123
|
+
of Freud''s theories, Wilhelm Reich, in the third part.<br \/>\r\n<br \/>\r\nAlong
|
124
|
+
these general themes, The Century of the Self asks deeper questions about
|
125
|
+
the roots and methods of modern consumerism, representative democracy, commodification
|
126
|
+
and its implications. It also questions the modern way we see ourselves, the
|
127
|
+
attitudes to fashion and superficiality.<br \/>\r\n<br \/>\r\nThe business
|
128
|
+
and political world uses psychological techniques to read, create and fulfill
|
129
|
+
our desires, to make their products or speeches as pleasing as possible to
|
130
|
+
us. Curtis raises the question of the intentions and roots of this fact. Where
|
131
|
+
once the political process was about engaging people''s rational, conscious
|
132
|
+
minds, as well as facilitating their needs as a society, the documentary shows
|
133
|
+
how by employing the tactics of psychoanalysis, politicians appeal to irrational,
|
134
|
+
primitive impulses that have little apparent bearing on issues outside of
|
135
|
+
the narrow self-interest of a consumer population.<br \/>\r\n<br \/>\r\nPaul
|
136
|
+
Mazur, a leading Wall Street banker working for Lehman Brothers, is cited
|
137
|
+
as declaring: \"We must shift America from a needs- to a desires-culture.
|
138
|
+
People must be trained to desire, to want new things, even before the old
|
139
|
+
have been entirely consumed. [...] Man''s desires must overshadow his needs\".<br
|
140
|
+
\/>\r\n<br \/>\r\nIn Episode 4 the main subjects are Philip Gould and Matthew
|
141
|
+
Freud, the great-grandson of Sigmund, a PR consultant. They were part of the
|
142
|
+
efforts during the nineties to bring the Democrats in the US and New Labour
|
143
|
+
in the United Kingdom back into power. Adam Curtis explores the psychological
|
144
|
+
methods they have now massively introduced into politics. He also argues that
|
145
|
+
the eventual outcome strongly resembles Edward Bernays vision for the \"Democracity\"
|
146
|
+
during the 1939 New York World''s Fair.<br \/>\r\n<br \/>\r\nIt is widely
|
147
|
+
believed that the series was inspired and informed by a book written by the
|
148
|
+
American historian, Stuart Ewen, \"PR! A Social History of Spin\".","url":"http:\/\/vimeo.com\/68843810","upload_date":"2013-06-21
|
149
|
+
07:36:31","thumbnail_small":"http:\/\/b.vimeocdn.com\/ts\/441\/348\/441348049_100.jpg","thumbnail_medium":"http:\/\/b.vimeocdn.com\/ts\/441\/348\/441348049_200.jpg","thumbnail_large":"http:\/\/b.vimeocdn.com\/ts\/441\/348\/441348049_640.jpg","user_id":4246041,"user_name":"Roses
|
150
|
+
of Time","user_url":"http:\/\/vimeo.com\/rosesoftime","user_portrait_small":"http:\/\/b.vimeocdn.com\/ps\/612\/203\/6122037_30.jpg","user_portrait_medium":"http:\/\/b.vimeocdn.com\/ps\/612\/203\/6122037_75.jpg","user_portrait_large":"http:\/\/b.vimeocdn.com\/ps\/612\/203\/6122037_100.jpg","user_portrait_huge":"http:\/\/b.vimeocdn.com\/ps\/612\/203\/6122037_300.jpg","stats_number_of_likes":22,"stats_number_of_plays":4964,"stats_number_of_comments":0,"duration":3517,"width":640,"height":360,"tags":"The
|
151
|
+
Century Of Self, Engineering Of Consent, Episode 2, Part 2, Series, Adam Curtis,
|
152
|
+
BBC, Bernys, Freud, Spin, Consumerism, Democracy, Psychoanalysis, Politics,
|
153
|
+
Society","embed_privacy":"anywhere"},{"id":69949597,"title":"The Century Of
|
154
|
+
Self: There is a Policeman Inside All Our Heads (episode 3)","description":"","url":"http:\/\/vimeo.com\/69949597","upload_date":"2013-07-09
|
155
|
+
05:38:09","thumbnail_small":"http:\/\/b.vimeocdn.com\/ts\/442\/965\/442965473_100.jpg","thumbnail_medium":"http:\/\/b.vimeocdn.com\/ts\/442\/965\/442965473_200.jpg","thumbnail_large":"http:\/\/b.vimeocdn.com\/ts\/442\/965\/442965473_640.jpg","user_id":4246041,"user_name":"Roses
|
156
|
+
of Time","user_url":"http:\/\/vimeo.com\/rosesoftime","user_portrait_small":"http:\/\/b.vimeocdn.com\/ps\/612\/203\/6122037_30.jpg","user_portrait_medium":"http:\/\/b.vimeocdn.com\/ps\/612\/203\/6122037_75.jpg","user_portrait_large":"http:\/\/b.vimeocdn.com\/ps\/612\/203\/6122037_100.jpg","user_portrait_huge":"http:\/\/b.vimeocdn.com\/ps\/612\/203\/6122037_300.jpg","stats_number_of_likes":26,"stats_number_of_plays":4110,"stats_number_of_comments":0,"duration":3514,"width":640,"height":360,"tags":"","embed_privacy":"anywhere"},{"id":70388245,"title":"The
|
157
|
+
Century Of Self: Eight People Sipping Wine in Kettering (Episode 4)","description":"The
|
158
|
+
Century of the Self is an award-winning British television documentary series
|
159
|
+
by Adam Curtis. It focuses on how the work of Sigmund Freud, Anna Freud, and
|
160
|
+
Edward Bernays influenced the way corporations and governments have analyzed,\u202d
|
161
|
+
dealt with, and controlled \u202cpeople.<br \/>\n<br \/>\n\"This series is
|
162
|
+
about how those in power have used Freud''s theories to try and control the
|
163
|
+
dangerous crowd in an age of mass democracy.\" \u2014Adam Curtis'' introduction
|
164
|
+
to the first episode.<br \/>\n<br \/>\nSigmund Freud, the founder of psychoanalysis,
|
165
|
+
changed the perception of the human mind and its workings. The series describes
|
166
|
+
the propaganda that Western governments and corporations have utilized stemming
|
167
|
+
from Freud''s theories.<br \/>\n<br \/>\nFreud himself and his nephew Edward
|
168
|
+
Bernays, who was the first to use psychological techniques in public relations,
|
169
|
+
are discussed. Freud''s daughter Anna Freud, a pioneer of child psychology,
|
170
|
+
is mentioned in the second part, as is one of the main opponents of Freud''s
|
171
|
+
theories, Wilhelm Reich, in the third part.<br \/>\n<br \/>\nAlong these general
|
172
|
+
themes, The Century of the Self asks deeper questions about the roots and
|
173
|
+
methods of modern consumerism, representative democracy, commodification and
|
174
|
+
its implications. It also questions the modern way we see ourselves, the attitudes
|
175
|
+
to fashion and superficiality.<br \/>\n<br \/>\nThe business and political
|
176
|
+
world uses psychological techniques to read, create and fulfill our desires,
|
177
|
+
to make their products or speeches as pleasing as possible to us. Curtis raises
|
178
|
+
the question of the intentions and roots of this fact. Where once the political
|
179
|
+
process was about engaging people''s rational, conscious minds, as well as
|
180
|
+
facilitating their needs as a society, the documentary shows how by employing
|
181
|
+
the tactics of psychoanalysis, politicians appeal to irrational, primitive
|
182
|
+
impulses that have little apparent bearing on issues outside of the narrow
|
183
|
+
self-interest of a consumer population.<br \/>\n<br \/>\nPaul Mazur, a leading
|
184
|
+
Wall Street banker working for Lehman Brothers, is cited as declaring: \"We
|
185
|
+
must shift America from a needs- to a desires-culture. People must be trained
|
186
|
+
to desire, to want new things, even before the old have been entirely consumed.
|
187
|
+
[...] Man''s desires must overshadow his needs\".<br \/>\n<br \/>\nIn Episode
|
188
|
+
4 the main subjects are Philip Gould and Matthew Freud, the great-grandson
|
189
|
+
of Sigmund, a PR consultant. They were part of the efforts during the nineties
|
190
|
+
to bring the Democrats in the US and New Labour in the United Kingdom back
|
191
|
+
into power. Adam Curtis explores the psychological methods they have now massively
|
192
|
+
introduced into politics. He also argues that the eventual outcome strongly
|
193
|
+
resembles Edward Bernays vision for the \"Democracity\" during the 1939 New
|
194
|
+
York World''s Fair. It is widely believed that the series was inspired and
|
195
|
+
informed by a book written by the American historian, Stuart Ewen, \"PR! A
|
196
|
+
Social History of Spin\"","url":"http:\/\/vimeo.com\/70388245","upload_date":"2013-07-16
|
197
|
+
02:08:10","thumbnail_small":"http:\/\/b.vimeocdn.com\/ts\/443\/595\/443595474_100.jpg","thumbnail_medium":"http:\/\/b.vimeocdn.com\/ts\/443\/595\/443595474_200.jpg","thumbnail_large":"http:\/\/b.vimeocdn.com\/ts\/443\/595\/443595474_640.jpg","user_id":4246041,"user_name":"Roses
|
198
|
+
of Time","user_url":"http:\/\/vimeo.com\/rosesoftime","user_portrait_small":"http:\/\/b.vimeocdn.com\/ps\/612\/203\/6122037_30.jpg","user_portrait_medium":"http:\/\/b.vimeocdn.com\/ps\/612\/203\/6122037_75.jpg","user_portrait_large":"http:\/\/b.vimeocdn.com\/ps\/612\/203\/6122037_100.jpg","user_portrait_huge":"http:\/\/b.vimeocdn.com\/ps\/612\/203\/6122037_300.jpg","stats_number_of_likes":23,"stats_number_of_plays":3236,"stats_number_of_comments":1,"duration":3540,"width":640,"height":360,"tags":"Freud,
|
199
|
+
Century of Self, Adam Curtis","embed_privacy":"anywhere"}]'
|
200
|
+
http_version:
|
201
|
+
recorded_at: Sat, 01 Mar 2014 00:28:25 GMT
|
202
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,71 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://vimeo.com/api/v2/album/2755718/info.json
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- VideoInfo/2.2.2
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- '*/*'
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Age:
|
22
|
+
- '3'
|
23
|
+
Date:
|
24
|
+
- Sat, 01 Mar 2014 00:10:31 GMT
|
25
|
+
Expires:
|
26
|
+
- Sat, 01 Mar 2014 00:11:31 GMT
|
27
|
+
Content-Length:
|
28
|
+
- '641'
|
29
|
+
Connection:
|
30
|
+
- Keep-Alive
|
31
|
+
Via:
|
32
|
+
- 1.1 varnish
|
33
|
+
- dnet-dca
|
34
|
+
Etag:
|
35
|
+
- '"f9075c16b5f1158ce5ea0e7c4f82dad0"'
|
36
|
+
Server:
|
37
|
+
- Apache
|
38
|
+
Access-Control-Allow-Origin:
|
39
|
+
- '*'
|
40
|
+
X-Ratelimit-Limit:
|
41
|
+
- '3600'
|
42
|
+
X-Ratelimit-Remaining:
|
43
|
+
- '3583'
|
44
|
+
X-Ratelimit-Reset:
|
45
|
+
- '1393635073'
|
46
|
+
Last-Modified:
|
47
|
+
- Sat, 01 Mar 2014 00:07:48 GMT
|
48
|
+
X-Ua-Compatible:
|
49
|
+
- IE=edge
|
50
|
+
X-Dns-Prefetch-Control:
|
51
|
+
- 'on'
|
52
|
+
Vary:
|
53
|
+
- Accept-Encoding
|
54
|
+
Content-Type:
|
55
|
+
- application/json
|
56
|
+
X-Varnish:
|
57
|
+
- '1775290544'
|
58
|
+
X-Varnish-Cache:
|
59
|
+
- '0'
|
60
|
+
X-Vserver:
|
61
|
+
- 10.90.128.196
|
62
|
+
body:
|
63
|
+
encoding: UTF-8
|
64
|
+
string: '{"id":2755718,"created_on":"2014-02-28 18:18:21","last_modified":"2014-02-28
|
65
|
+
19:07:48","title":"The Century Of Self","description":"The Century of the
|
66
|
+
Self is an award-winning British television documentary series by Adam Curtis,
|
67
|
+
released in 2002.","url":"http:\/\/vimeo.com\/album\/2755718","thumbnail_small":"http:\/\/b.vimeocdn.com\/ts\/443\/595\/443595474_100.jpg","thumbnail_medium":"http:\/\/b.vimeocdn.com\/ts\/443\/595\/443595474_200.jpg","thumbnail_large":"http:\/\/b.vimeocdn.com\/ts\/443\/595\/443595474_640.jpg","total_videos":4,"user_id":2618747,"user_display_name":"Karl
|
68
|
+
Entwistle","user_url":"http:\/\/vimeo.com\/user2618747"}'
|
69
|
+
http_version:
|
70
|
+
recorded_at: Sat, 01 Mar 2014 00:10:36 GMT
|
71
|
+
recorded_with: VCR 2.8.0
|
data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/width/.yml
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://vimeo.com/api/v2/album/2755718/info.json
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- VideoInfo/2.2.2
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- '*/*'
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Age:
|
22
|
+
- '2'
|
23
|
+
Date:
|
24
|
+
- Sat, 01 Mar 2014 00:10:31 GMT
|
25
|
+
Expires:
|
26
|
+
- Sat, 01 Mar 2014 00:11:31 GMT
|
27
|
+
Content-Length:
|
28
|
+
- '641'
|
29
|
+
Connection:
|
30
|
+
- Keep-Alive
|
31
|
+
Via:
|
32
|
+
- 1.1 varnish
|
33
|
+
- dnet-dca
|
34
|
+
Etag:
|
35
|
+
- '"f9075c16b5f1158ce5ea0e7c4f82dad0"'
|
36
|
+
Server:
|
37
|
+
- Apache
|
38
|
+
Access-Control-Allow-Origin:
|
39
|
+
- '*'
|
40
|
+
X-Ratelimit-Limit:
|
41
|
+
- '3600'
|
42
|
+
X-Ratelimit-Remaining:
|
43
|
+
- '3583'
|
44
|
+
X-Ratelimit-Reset:
|
45
|
+
- '1393635073'
|
46
|
+
Last-Modified:
|
47
|
+
- Sat, 01 Mar 2014 00:07:48 GMT
|
48
|
+
X-Ua-Compatible:
|
49
|
+
- IE=edge
|
50
|
+
X-Dns-Prefetch-Control:
|
51
|
+
- 'on'
|
52
|
+
Vary:
|
53
|
+
- Accept-Encoding
|
54
|
+
Content-Type:
|
55
|
+
- application/json
|
56
|
+
X-Varnish:
|
57
|
+
- '1775290544'
|
58
|
+
X-Varnish-Cache:
|
59
|
+
- '0'
|
60
|
+
X-Vserver:
|
61
|
+
- 10.90.128.196
|
62
|
+
body:
|
63
|
+
encoding: UTF-8
|
64
|
+
string: '{"id":2755718,"created_on":"2014-02-28 18:18:21","last_modified":"2014-02-28
|
65
|
+
19:07:48","title":"The Century Of Self","description":"The Century of the
|
66
|
+
Self is an award-winning British television documentary series by Adam Curtis,
|
67
|
+
released in 2002.","url":"http:\/\/vimeo.com\/album\/2755718","thumbnail_small":"http:\/\/b.vimeocdn.com\/ts\/443\/595\/443595474_100.jpg","thumbnail_medium":"http:\/\/b.vimeocdn.com\/ts\/443\/595\/443595474_200.jpg","thumbnail_large":"http:\/\/b.vimeocdn.com\/ts\/443\/595\/443595474_640.jpg","total_videos":4,"user_id":2618747,"user_display_name":"Karl
|
68
|
+
Entwistle","user_url":"http:\/\/vimeo.com\/user2618747"}'
|
69
|
+
http_version:
|
70
|
+
recorded_at: Sat, 01 Mar 2014 00:10:34 GMT
|
71
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,78 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe VideoInfo::Providers::VimeoPlaylist do
|
4
|
+
|
5
|
+
describe ".usable?" do
|
6
|
+
subject { VideoInfo::Providers::VimeoPlaylist.usable?(url) }
|
7
|
+
|
8
|
+
context "with vimeo album url" do
|
9
|
+
let(:url) { 'http://vimeo.com/album/2755718' }
|
10
|
+
it { should be_true }
|
11
|
+
end
|
12
|
+
|
13
|
+
context "with vimeo hubnub embed url" do
|
14
|
+
let(:url) { 'http://player.vimeo.com/hubnut/album/2755718' }
|
15
|
+
it { should be_true }
|
16
|
+
end
|
17
|
+
|
18
|
+
context "with vimeo url" do
|
19
|
+
let(:url) { 'http://www.vimeo.com/898029' }
|
20
|
+
it { should be_false }
|
21
|
+
end
|
22
|
+
|
23
|
+
context "with other url" do
|
24
|
+
let(:url) { 'http://www.youtube.com/898029' }
|
25
|
+
it { should be_false }
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe "#available?" do
|
30
|
+
context "with valid playlist", :vcr do
|
31
|
+
subject { VideoInfo.new('http://vimeo.com/album/2755718') }
|
32
|
+
its(:available?) { should be_true }
|
33
|
+
end
|
34
|
+
|
35
|
+
context "with invalid playlist", :vcr do
|
36
|
+
subject { VideoInfo.new('http://vimeo.com/album/2') }
|
37
|
+
its(:available?) { should be_false }
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
context "with playlist 2755718", :vcr do
|
43
|
+
let(:videos) {
|
44
|
+
[
|
45
|
+
VideoInfo.new('http://vimeo.com/67977038'),
|
46
|
+
VideoInfo.new('http://vimeo.com/68843810'),
|
47
|
+
VideoInfo.new('http://vimeo.com/69949597'),
|
48
|
+
VideoInfo.new('http://vimeo.com/70388245')
|
49
|
+
]
|
50
|
+
}
|
51
|
+
subject { VideoInfo.new('http://vimeo.com/album/2755718') }
|
52
|
+
|
53
|
+
its(:provider) { should eq 'Vimeo' }
|
54
|
+
its(:playlist_id) { should eq '2755718' }
|
55
|
+
its(:url) { should eq 'http://vimeo.com/album/2755718' }
|
56
|
+
its(:embed_url) { should eq 'player.vimeo.com/hubnut/album/2755718' }
|
57
|
+
its(:embed_code) { should eq '<iframe src="http://player.vimeo.com/hubnut/album/2755718?autoplay=0&byline=0&portrait=0&title=0" frameborder="0"></iframe>' }
|
58
|
+
its(:title) { should eq 'The Century Of Self' }
|
59
|
+
its(:description) { should eq 'The Century of the Self is an award-winning British television documentary series by Adam Curtis, released in 2002.' }
|
60
|
+
its(:keywords) { should be_nil }
|
61
|
+
its(:duration) { should be_nil }
|
62
|
+
its(:width) { should be_nil }
|
63
|
+
its(:height) { should be_nil }
|
64
|
+
its(:date) { should be_nil }
|
65
|
+
its(:thumbnail_small) { should eq 'http://b.vimeocdn.com/ts/443/595/443595474_100.jpg' }
|
66
|
+
its(:thumbnail_medium) { should eq 'http://b.vimeocdn.com/ts/443/595/443595474_200.jpg' }
|
67
|
+
its(:thumbnail_large) { should eq 'http://b.vimeocdn.com/ts/443/595/443595474_640.jpg' }
|
68
|
+
its(:videos) { should match_array(videos) }
|
69
|
+
its(:view_count) { should be_nil }
|
70
|
+
end
|
71
|
+
|
72
|
+
context "with playlist 2755718 in embed path", :vcr do
|
73
|
+
subject { VideoInfo.new('http://player.vimeo.com/hubnut/album/2755718') }
|
74
|
+
|
75
|
+
its(:playlist_id) { should eq '2755718' }
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
@@ -10,6 +10,16 @@ describe VideoInfo::Providers::Vimeo do
|
|
10
10
|
it { should be_true }
|
11
11
|
end
|
12
12
|
|
13
|
+
context "with vimeo album url" do
|
14
|
+
let(:url) { 'http://vimeo.com/album/2755718' }
|
15
|
+
it { should be_false }
|
16
|
+
end
|
17
|
+
|
18
|
+
context "with vimeo hubnub embed url" do
|
19
|
+
let(:url) { 'http://player.vimeo.com/hubnut/album/2755718' }
|
20
|
+
it { should be_false }
|
21
|
+
end
|
22
|
+
|
13
23
|
context "with other url" do
|
14
24
|
let(:url) { 'http://www.youtube.com/898029' }
|
15
25
|
it { should be_false }
|
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.3.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: 2014-
|
11
|
+
date: 2014-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -139,6 +139,7 @@ files:
|
|
139
139
|
- lib/video_info/provider.rb
|
140
140
|
- lib/video_info/providers/dailymotion.rb
|
141
141
|
- lib/video_info/providers/vimeo.rb
|
142
|
+
- lib/video_info/providers/vimeoplaylist.rb
|
142
143
|
- lib/video_info/providers/vkontakte.rb
|
143
144
|
- lib/video_info/providers/youtube.rb
|
144
145
|
- lib/video_info/providers/youtubeplaylist.rb
|
@@ -170,6 +171,20 @@ files:
|
|
170
171
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/title/.yml
|
171
172
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/view_count/.yml
|
172
173
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/width/.yml
|
174
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/_available_/with_invalid_playlist/available_/.yml
|
175
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/_available_/with_valid_playlist/available_/.yml
|
176
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/date/.yml
|
177
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/description/.yml
|
178
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/duration/.yml
|
179
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/height/.yml
|
180
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/keywords/.yml
|
181
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/thumbnail_large/.yml
|
182
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/thumbnail_medium/.yml
|
183
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/thumbnail_small/.yml
|
184
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/title/.yml
|
185
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/videos/.yml
|
186
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/view_count/.yml
|
187
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/width/.yml
|
173
188
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_invalid_video/available_/.yml
|
174
189
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_valid_video/available_/.yml
|
175
190
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/description/.yml
|
@@ -219,6 +234,7 @@ files:
|
|
219
234
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/view_count/.yml
|
220
235
|
- spec/lib/video_info/provider_spec.rb
|
221
236
|
- spec/lib/video_info/providers/dailymotion_spec.rb
|
237
|
+
- spec/lib/video_info/providers/vimeo_playlist_spec.rb
|
222
238
|
- spec/lib/video_info/providers/vimeo_spec.rb
|
223
239
|
- spec/lib/video_info/providers/vkontakte_spec.rb
|
224
240
|
- spec/lib/video_info/providers/youtube_playlist_spec.rb
|
@@ -278,6 +294,20 @@ test_files:
|
|
278
294
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/title/.yml
|
279
295
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/view_count/.yml
|
280
296
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/width/.yml
|
297
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/_available_/with_invalid_playlist/available_/.yml
|
298
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/_available_/with_valid_playlist/available_/.yml
|
299
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/date/.yml
|
300
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/description/.yml
|
301
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/duration/.yml
|
302
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/height/.yml
|
303
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/keywords/.yml
|
304
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/thumbnail_large/.yml
|
305
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/thumbnail_medium/.yml
|
306
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/thumbnail_small/.yml
|
307
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/title/.yml
|
308
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/videos/.yml
|
309
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/view_count/.yml
|
310
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_VimeoPlaylist/with_playlist_2755718/width/.yml
|
281
311
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_invalid_video/available_/.yml
|
282
312
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_valid_video/available_/.yml
|
283
313
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/description/.yml
|
@@ -327,6 +357,7 @@ test_files:
|
|
327
357
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/view_count/.yml
|
328
358
|
- spec/lib/video_info/provider_spec.rb
|
329
359
|
- spec/lib/video_info/providers/dailymotion_spec.rb
|
360
|
+
- spec/lib/video_info/providers/vimeo_playlist_spec.rb
|
330
361
|
- spec/lib/video_info/providers/vimeo_spec.rb
|
331
362
|
- spec/lib/video_info/providers/vkontakte_spec.rb
|
332
363
|
- spec/lib/video_info/providers/youtube_playlist_spec.rb
|