video_info 2.0.2 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -2
- data/README.md +2 -0
- data/lib/video_info.rb +1 -0
- data/lib/video_info/provider.rb +13 -0
- data/lib/video_info/providers/vimeo.rb +9 -1
- data/lib/video_info/providers/vkontakte.rb +16 -0
- data/lib/video_info/providers/youtube.rb +9 -1
- data/lib/video_info/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/available_/.yml +50 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/available_/.yml +50 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/available_/.yml +54 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/date/.yml +33 -26
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/description/.yml +32 -27
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/duration/.yml +32 -27
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/height/.yml +31 -26
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/keywords/.yml +32 -27
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/thumbnail_large/.yml +30 -25
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/thumbnail_medium/.yml +30 -25
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/thumbnail_small/.yml +31 -26
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/title/.yml +31 -26
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/view_count/.yml +31 -26
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/width/.yml +31 -26
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_invalid_video/available_/.yml +147 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_valid_video/available_/.yml +1115 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video-54799401_165822734/title/.yml +1255 -1701
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/description/.yml +1070 -1110
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/duration/.yml +1070 -1110
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_code/.yml +1072 -1112
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_url/.yml +1072 -1112
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/height/.yml +1070 -1110
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/keywords/.yml +1070 -1110
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/title/.yml +1029 -1110
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/view_count/.yml +1070 -1110
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/width/.yml +1070 -1110
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/available_/.yml +56 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_is_unavailable_video/available_/.yml +46 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_no_longer_available_due_to_a_copyright_claim_video/available_/.yml +46 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/date/.yml +16 -18
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/description/.yml +17 -19
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/duration/.yml +16 -18
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/keywords/.yml +19 -19
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/thumbnail_large/.yml +16 -18
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/thumbnail_medium/.yml +16 -18
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/thumbnail_small/.yml +16 -18
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/title/.yml +16 -16
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/view_count/.yml +16 -18
- data/spec/lib/video_info/providers/vimeo_spec.rb +17 -0
- data/spec/lib/video_info/providers/vkontakte_spec.rb +15 -2
- data/spec/lib/video_info/providers/youtube_spec.rb +18 -1
- metadata +39 -23
@@ -8,11 +8,11 @@ http_interactions:
|
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
|
-
- VideoInfo/2.0.
|
11
|
+
- VideoInfo/2.0.2
|
12
12
|
Accept-Encoding:
|
13
13
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
14
|
Accept:
|
15
|
-
-
|
15
|
+
- "*/*"
|
16
16
|
response:
|
17
17
|
status:
|
18
18
|
code: 200
|
@@ -22,22 +22,20 @@ http_interactions:
|
|
22
22
|
- CH
|
23
23
|
Content-Type:
|
24
24
|
- application/json;charset=UTF-8
|
25
|
-
Access-Control-Allow-Origin:
|
26
|
-
- '*'
|
27
25
|
Expires:
|
28
|
-
-
|
26
|
+
- Thu, 20 Feb 2014 12:43:26 GMT
|
29
27
|
Date:
|
30
|
-
-
|
28
|
+
- Thu, 20 Feb 2014 12:43:26 GMT
|
31
29
|
Cache-Control:
|
32
30
|
- private, max-age=300, no-transform
|
33
31
|
Vary:
|
34
|
-
-
|
32
|
+
- "*"
|
35
33
|
Gdata-Version:
|
36
34
|
- '2.1'
|
37
35
|
Etag:
|
38
|
-
- W/"
|
36
|
+
- W/"CEQDQX47eCp7I2A9Wh9SF0U."
|
39
37
|
Last-Modified:
|
40
|
-
-
|
38
|
+
- Fri, 07 Feb 2014 14:12:50 GMT
|
41
39
|
X-Content-Type-Options:
|
42
40
|
- nosniff
|
43
41
|
X-Frame-Options:
|
@@ -45,19 +43,19 @@ http_interactions:
|
|
45
43
|
X-Xss-Protection:
|
46
44
|
- 1; mode=block
|
47
45
|
Content-Length:
|
48
|
-
- '
|
46
|
+
- '4594'
|
49
47
|
Server:
|
50
48
|
- GSE
|
51
49
|
Alternate-Protocol:
|
52
50
|
- 80:quic
|
53
51
|
body:
|
54
52
|
encoding: UTF-8
|
55
|
-
string:
|
56
|
-
Bloom - King Of The Knife"}
|
57
|
-
Bloom"}
|
58
|
-
Bloom"}]
|
59
|
-
Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net"
|
60
|
-
Bloom - King Of The Knife"
|
53
|
+
string: "{\"version\":\"1.0\",\"encoding\":\"UTF-8\",\"entry\":{\"xmlns\":\"http://www.w3.org/2005/Atom\",\"xmlns$media\":\"http://search.yahoo.com/mrss/\",\"xmlns$gd\":\"http://schemas.google.com/g/2005\",\"xmlns$yt\":\"http://gdata.youtube.com/schemas/2007\",\"gd$etag\":\"W/\\\"CEQDQX47eCp7I2A9Wh9SF0U.\\\"\",\"id\":{\"$t\":\"tag:youtube.com,2008:video:mZqGqE0D0n4\"},\"published\":{\"$t\":\"2008-04-12T22:25:35.000Z\"},\"updated\":{\"$t\":\"2014-02-07T14:12:50.000Z\"},\"category\":[{\"scheme\":\"http://schemas.google.com/g/2005#kind\",\"term\":\"http://gdata.youtube.com/schemas/2007#video\"},{\"scheme\":\"http://gdata.youtube.com/schemas/2007/categories.cat\",\"term\":\"Music\",\"label\":\"Music\"}],\"title\":{\"$t\":\"Cherry
|
54
|
+
Bloom - King Of The Knife\"},\"content\":{\"type\":\"application/x-shockwave-flash\",\"src\":\"http://www.youtube.com/v/mZqGqE0D0n4?version=3&f=videos&app=youtube_gdata\"},\"link\":[{\"rel\":\"alternate\",\"type\":\"text/html\",\"href\":\"http://www.youtube.com/watch?v=mZqGqE0D0n4&feature=youtube_gdata\"},{\"rel\":\"http://gdata.youtube.com/schemas/2007#video.related\",\"type\":\"application/atom+xml\",\"href\":\"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4/related?v=2\"},{\"rel\":\"http://gdata.youtube.com/schemas/2007#mobile\",\"type\":\"text/html\",\"href\":\"http://m.youtube.com/details?v=mZqGqE0D0n4\"},{\"rel\":\"http://gdata.youtube.com/schemas/2007#uploader\",\"type\":\"application/atom+xml\",\"href\":\"http://gdata.youtube.com/feeds/api/users/zxQk-rZGowoqMBKxGD5jSA?v=2\"},{\"rel\":\"self\",\"type\":\"application/atom+xml\",\"href\":\"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4?v=2\"}],\"author\":[{\"name\":{\"$t\":\"Cherry
|
55
|
+
Bloom\"},\"uri\":{\"$t\":\"http://gdata.youtube.com/feeds/api/users/cherrybloomband\"},\"yt$userId\":{\"$t\":\"zxQk-rZGowoqMBKxGD5jSA\"}}],\"yt$accessControl\":[{\"action\":\"comment\",\"permission\":\"allowed\"},{\"action\":\"commentVote\",\"permission\":\"allowed\"},{\"action\":\"videoRespond\",\"permission\":\"moderated\"},{\"action\":\"rate\",\"permission\":\"allowed\"},{\"action\":\"embed\",\"permission\":\"allowed\"},{\"action\":\"list\",\"permission\":\"allowed\"},{\"action\":\"autoPlay\",\"permission\":\"allowed\"},{\"action\":\"syndicate\",\"permission\":\"allowed\"}],\"gd$comments\":{\"gd$feedLink\":{\"rel\":\"http://gdata.youtube.com/schemas/2007#comments\",\"href\":\"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4/comments?v=2\",\"countHint\":15}},\"media$group\":{\"media$category\":[{\"$t\":\"Music\",\"label\":\"Music\",\"scheme\":\"http://gdata.youtube.com/schemas/2007/categories.cat\"}],\"media$content\":[{\"url\":\"http://www.youtube.com/v/mZqGqE0D0n4?version=3&f=videos&app=youtube_gdata\",\"type\":\"application/x-shockwave-flash\",\"medium\":\"video\",\"isDefault\":\"true\",\"expression\":\"full\",\"duration\":176,\"yt$format\":5},{\"url\":\"rtsp://r5---sn-4g57kuez.c.youtube.com/CiILENy73wIaGQl-0gNNqIaamRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp\",\"type\":\"video/3gpp\",\"medium\":\"video\",\"expression\":\"full\",\"duration\":176,\"yt$format\":1},{\"url\":\"rtsp://r5---sn-4g57kuez.c.youtube.com/CiILENy73wIaGQl-0gNNqIaamRMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp\",\"type\":\"video/3gpp\",\"medium\":\"video\",\"expression\":\"full\",\"duration\":176,\"yt$format\":6}],\"media$credit\":[{\"$t\":\"cherrybloomband\",\"role\":\"uploader\",\"scheme\":\"urn:youtube\",\"yt$display\":\"Cherry
|
56
|
+
Bloom\"}],\"media$description\":{\"$t\":\"The first video from the upcoming
|
57
|
+
album Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net\",\"type\":\"plain\"},\"media$keywords\":{},\"media$license\":{\"$t\":\"youtube\",\"type\":\"text/html\",\"href\":\"http://www.youtube.com/t/terms\"},\"media$player\":{\"url\":\"http://www.youtube.com/watch?v=mZqGqE0D0n4&feature=youtube_gdata_player\"},\"media$thumbnail\":[{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/default.jpg\",\"height\":90,\"width\":120,\"time\":\"00:01:28\",\"yt$name\":\"default\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/mqdefault.jpg\",\"height\":180,\"width\":320,\"yt$name\":\"mqdefault\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/hqdefault.jpg\",\"height\":360,\"width\":480,\"yt$name\":\"hqdefault\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/1.jpg\",\"height\":90,\"width\":120,\"time\":\"00:00:44\",\"yt$name\":\"start\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/2.jpg\",\"height\":90,\"width\":120,\"time\":\"00:01:28\",\"yt$name\":\"middle\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/3.jpg\",\"height\":90,\"width\":120,\"time\":\"00:02:12\",\"yt$name\":\"end\"}],\"media$title\":{\"$t\":\"Cherry
|
58
|
+
Bloom - King Of The Knife\",\"type\":\"plain\"},\"yt$duration\":{\"seconds\":\"176\"},\"yt$uploaded\":{\"$t\":\"2008-04-12T22:25:35.000Z\"},\"yt$uploaderId\":{\"$t\":\"UCzxQk-rZGowoqMBKxGD5jSA\"},\"yt$videoid\":{\"$t\":\"mZqGqE0D0n4\"}},\"gd$rating\":{\"average\":4.8297873,\"max\":5,\"min\":1,\"numRaters\":47,\"rel\":\"http://schemas.google.com/g/2005#overall\"},\"yt$statistics\":{\"favoriteCount\":\"0\",\"viewCount\":\"6390\"},\"yt$rating\":{\"numDislikes\":\"2\",\"numLikes\":\"45\"}}}"
|
61
59
|
http_version:
|
62
|
-
recorded_at:
|
63
|
-
recorded_with: VCR 2.
|
60
|
+
recorded_at: Thu, 20 Feb 2014 12:43:26 GMT
|
61
|
+
recorded_with: VCR 2.8.0
|
@@ -8,11 +8,11 @@ http_interactions:
|
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
|
-
- VideoInfo/2.0.
|
11
|
+
- VideoInfo/2.0.2
|
12
12
|
Accept-Encoding:
|
13
13
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
14
|
Accept:
|
15
|
-
-
|
15
|
+
- "*/*"
|
16
16
|
response:
|
17
17
|
status:
|
18
18
|
code: 200
|
@@ -22,22 +22,20 @@ http_interactions:
|
|
22
22
|
- CH
|
23
23
|
Content-Type:
|
24
24
|
- application/json;charset=UTF-8
|
25
|
-
Access-Control-Allow-Origin:
|
26
|
-
- '*'
|
27
25
|
Expires:
|
28
|
-
-
|
26
|
+
- Thu, 20 Feb 2014 12:43:26 GMT
|
29
27
|
Date:
|
30
|
-
-
|
28
|
+
- Thu, 20 Feb 2014 12:43:26 GMT
|
31
29
|
Cache-Control:
|
32
30
|
- private, max-age=300, no-transform
|
33
31
|
Vary:
|
34
|
-
-
|
32
|
+
- "*"
|
35
33
|
Gdata-Version:
|
36
34
|
- '2.1'
|
37
35
|
Etag:
|
38
|
-
- W/"
|
36
|
+
- W/"CEQDQX47eCp7I2A9Wh9SF0U."
|
39
37
|
Last-Modified:
|
40
|
-
-
|
38
|
+
- Fri, 07 Feb 2014 14:12:50 GMT
|
41
39
|
X-Content-Type-Options:
|
42
40
|
- nosniff
|
43
41
|
X-Frame-Options:
|
@@ -45,19 +43,19 @@ http_interactions:
|
|
45
43
|
X-Xss-Protection:
|
46
44
|
- 1; mode=block
|
47
45
|
Content-Length:
|
48
|
-
- '
|
46
|
+
- '4594'
|
49
47
|
Server:
|
50
48
|
- GSE
|
51
49
|
Alternate-Protocol:
|
52
50
|
- 80:quic
|
53
51
|
body:
|
54
52
|
encoding: UTF-8
|
55
|
-
string:
|
56
|
-
Bloom - King Of The Knife"}
|
57
|
-
Bloom"}
|
58
|
-
Bloom"}]
|
59
|
-
Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net"
|
60
|
-
Bloom - King Of The Knife"
|
53
|
+
string: "{\"version\":\"1.0\",\"encoding\":\"UTF-8\",\"entry\":{\"xmlns\":\"http://www.w3.org/2005/Atom\",\"xmlns$media\":\"http://search.yahoo.com/mrss/\",\"xmlns$gd\":\"http://schemas.google.com/g/2005\",\"xmlns$yt\":\"http://gdata.youtube.com/schemas/2007\",\"gd$etag\":\"W/\\\"CEQDQX47eCp7I2A9Wh9SF0U.\\\"\",\"id\":{\"$t\":\"tag:youtube.com,2008:video:mZqGqE0D0n4\"},\"published\":{\"$t\":\"2008-04-12T22:25:35.000Z\"},\"updated\":{\"$t\":\"2014-02-07T14:12:50.000Z\"},\"category\":[{\"scheme\":\"http://schemas.google.com/g/2005#kind\",\"term\":\"http://gdata.youtube.com/schemas/2007#video\"},{\"scheme\":\"http://gdata.youtube.com/schemas/2007/categories.cat\",\"term\":\"Music\",\"label\":\"Music\"}],\"title\":{\"$t\":\"Cherry
|
54
|
+
Bloom - King Of The Knife\"},\"content\":{\"type\":\"application/x-shockwave-flash\",\"src\":\"http://www.youtube.com/v/mZqGqE0D0n4?version=3&f=videos&app=youtube_gdata\"},\"link\":[{\"rel\":\"alternate\",\"type\":\"text/html\",\"href\":\"http://www.youtube.com/watch?v=mZqGqE0D0n4&feature=youtube_gdata\"},{\"rel\":\"http://gdata.youtube.com/schemas/2007#video.related\",\"type\":\"application/atom+xml\",\"href\":\"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4/related?v=2\"},{\"rel\":\"http://gdata.youtube.com/schemas/2007#mobile\",\"type\":\"text/html\",\"href\":\"http://m.youtube.com/details?v=mZqGqE0D0n4\"},{\"rel\":\"http://gdata.youtube.com/schemas/2007#uploader\",\"type\":\"application/atom+xml\",\"href\":\"http://gdata.youtube.com/feeds/api/users/zxQk-rZGowoqMBKxGD5jSA?v=2\"},{\"rel\":\"self\",\"type\":\"application/atom+xml\",\"href\":\"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4?v=2\"}],\"author\":[{\"name\":{\"$t\":\"Cherry
|
55
|
+
Bloom\"},\"uri\":{\"$t\":\"http://gdata.youtube.com/feeds/api/users/cherrybloomband\"},\"yt$userId\":{\"$t\":\"zxQk-rZGowoqMBKxGD5jSA\"}}],\"yt$accessControl\":[{\"action\":\"comment\",\"permission\":\"allowed\"},{\"action\":\"commentVote\",\"permission\":\"allowed\"},{\"action\":\"videoRespond\",\"permission\":\"moderated\"},{\"action\":\"rate\",\"permission\":\"allowed\"},{\"action\":\"embed\",\"permission\":\"allowed\"},{\"action\":\"list\",\"permission\":\"allowed\"},{\"action\":\"autoPlay\",\"permission\":\"allowed\"},{\"action\":\"syndicate\",\"permission\":\"allowed\"}],\"gd$comments\":{\"gd$feedLink\":{\"rel\":\"http://gdata.youtube.com/schemas/2007#comments\",\"href\":\"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4/comments?v=2\",\"countHint\":15}},\"media$group\":{\"media$category\":[{\"$t\":\"Music\",\"label\":\"Music\",\"scheme\":\"http://gdata.youtube.com/schemas/2007/categories.cat\"}],\"media$content\":[{\"url\":\"http://www.youtube.com/v/mZqGqE0D0n4?version=3&f=videos&app=youtube_gdata\",\"type\":\"application/x-shockwave-flash\",\"medium\":\"video\",\"isDefault\":\"true\",\"expression\":\"full\",\"duration\":176,\"yt$format\":5},{\"url\":\"rtsp://r5---sn-4g57kuez.c.youtube.com/CiILENy73wIaGQl-0gNNqIaamRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp\",\"type\":\"video/3gpp\",\"medium\":\"video\",\"expression\":\"full\",\"duration\":176,\"yt$format\":1},{\"url\":\"rtsp://r5---sn-4g57kuez.c.youtube.com/CiILENy73wIaGQl-0gNNqIaamRMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp\",\"type\":\"video/3gpp\",\"medium\":\"video\",\"expression\":\"full\",\"duration\":176,\"yt$format\":6}],\"media$credit\":[{\"$t\":\"cherrybloomband\",\"role\":\"uploader\",\"scheme\":\"urn:youtube\",\"yt$display\":\"Cherry
|
56
|
+
Bloom\"}],\"media$description\":{\"$t\":\"The first video from the upcoming
|
57
|
+
album Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net\",\"type\":\"plain\"},\"media$keywords\":{},\"media$license\":{\"$t\":\"youtube\",\"type\":\"text/html\",\"href\":\"http://www.youtube.com/t/terms\"},\"media$player\":{\"url\":\"http://www.youtube.com/watch?v=mZqGqE0D0n4&feature=youtube_gdata_player\"},\"media$thumbnail\":[{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/default.jpg\",\"height\":90,\"width\":120,\"time\":\"00:01:28\",\"yt$name\":\"default\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/mqdefault.jpg\",\"height\":180,\"width\":320,\"yt$name\":\"mqdefault\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/hqdefault.jpg\",\"height\":360,\"width\":480,\"yt$name\":\"hqdefault\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/1.jpg\",\"height\":90,\"width\":120,\"time\":\"00:00:44\",\"yt$name\":\"start\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/2.jpg\",\"height\":90,\"width\":120,\"time\":\"00:01:28\",\"yt$name\":\"middle\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/3.jpg\",\"height\":90,\"width\":120,\"time\":\"00:02:12\",\"yt$name\":\"end\"}],\"media$title\":{\"$t\":\"Cherry
|
58
|
+
Bloom - King Of The Knife\",\"type\":\"plain\"},\"yt$duration\":{\"seconds\":\"176\"},\"yt$uploaded\":{\"$t\":\"2008-04-12T22:25:35.000Z\"},\"yt$uploaderId\":{\"$t\":\"UCzxQk-rZGowoqMBKxGD5jSA\"},\"yt$videoid\":{\"$t\":\"mZqGqE0D0n4\"}},\"gd$rating\":{\"average\":4.8297873,\"max\":5,\"min\":1,\"numRaters\":47,\"rel\":\"http://schemas.google.com/g/2005#overall\"},\"yt$statistics\":{\"favoriteCount\":\"0\",\"viewCount\":\"6390\"},\"yt$rating\":{\"numDislikes\":\"2\",\"numLikes\":\"45\"}}}"
|
61
59
|
http_version:
|
62
|
-
recorded_at:
|
63
|
-
recorded_with: VCR 2.
|
60
|
+
recorded_at: Thu, 20 Feb 2014 12:43:26 GMT
|
61
|
+
recorded_with: VCR 2.8.0
|
data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/title/.yml
CHANGED
@@ -8,11 +8,11 @@ http_interactions:
|
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
|
-
- VideoInfo/2.0.
|
11
|
+
- VideoInfo/2.0.2
|
12
12
|
Accept-Encoding:
|
13
13
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
14
|
Accept:
|
15
|
-
-
|
15
|
+
- "*/*"
|
16
16
|
response:
|
17
17
|
status:
|
18
18
|
code: 200
|
@@ -23,21 +23,21 @@ http_interactions:
|
|
23
23
|
Content-Type:
|
24
24
|
- application/json; charset=UTF-8
|
25
25
|
Access-Control-Allow-Origin:
|
26
|
-
-
|
26
|
+
- "*"
|
27
27
|
Expires:
|
28
|
-
-
|
28
|
+
- Thu, 20 Feb 2014 12:43:26 GMT
|
29
29
|
Date:
|
30
|
-
-
|
30
|
+
- Thu, 20 Feb 2014 12:43:26 GMT
|
31
31
|
Cache-Control:
|
32
32
|
- private, max-age=300, no-transform
|
33
33
|
Vary:
|
34
|
-
-
|
34
|
+
- "*"
|
35
35
|
Gdata-Version:
|
36
36
|
- '2.1'
|
37
37
|
Etag:
|
38
|
-
- W/"
|
38
|
+
- W/"CEQDQX47eCp7I2A9Wh9SF0U."
|
39
39
|
Last-Modified:
|
40
|
-
-
|
40
|
+
- Fri, 07 Feb 2014 14:12:50 GMT
|
41
41
|
Transfer-Encoding:
|
42
42
|
- chunked
|
43
43
|
X-Content-Type-Options:
|
@@ -52,12 +52,12 @@ http_interactions:
|
|
52
52
|
- 80:quic
|
53
53
|
body:
|
54
54
|
encoding: UTF-8
|
55
|
-
string:
|
56
|
-
Bloom - King Of The Knife"}
|
57
|
-
Bloom"}
|
58
|
-
Bloom"}]
|
59
|
-
Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net"
|
60
|
-
Bloom - King Of The Knife"
|
55
|
+
string: "{\"version\":\"1.0\",\"encoding\":\"UTF-8\",\"entry\":{\"xmlns\":\"http://www.w3.org/2005/Atom\",\"xmlns$media\":\"http://search.yahoo.com/mrss/\",\"xmlns$gd\":\"http://schemas.google.com/g/2005\",\"xmlns$yt\":\"http://gdata.youtube.com/schemas/2007\",\"gd$etag\":\"W/\\\"CEQDQX47eCp7I2A9Wh9SF0U.\\\"\",\"id\":{\"$t\":\"tag:youtube.com,2008:video:mZqGqE0D0n4\"},\"published\":{\"$t\":\"2008-04-12T22:25:35.000Z\"},\"updated\":{\"$t\":\"2014-02-07T14:12:50.000Z\"},\"category\":[{\"scheme\":\"http://schemas.google.com/g/2005#kind\",\"term\":\"http://gdata.youtube.com/schemas/2007#video\"},{\"scheme\":\"http://gdata.youtube.com/schemas/2007/categories.cat\",\"term\":\"Music\",\"label\":\"Music\"}],\"title\":{\"$t\":\"Cherry
|
56
|
+
Bloom - King Of The Knife\"},\"content\":{\"type\":\"application/x-shockwave-flash\",\"src\":\"http://www.youtube.com/v/mZqGqE0D0n4?version=3&f=videos&app=youtube_gdata\"},\"link\":[{\"rel\":\"alternate\",\"type\":\"text/html\",\"href\":\"http://www.youtube.com/watch?v=mZqGqE0D0n4&feature=youtube_gdata\"},{\"rel\":\"http://gdata.youtube.com/schemas/2007#video.related\",\"type\":\"application/atom+xml\",\"href\":\"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4/related?v=2\"},{\"rel\":\"http://gdata.youtube.com/schemas/2007#mobile\",\"type\":\"text/html\",\"href\":\"http://m.youtube.com/details?v=mZqGqE0D0n4\"},{\"rel\":\"http://gdata.youtube.com/schemas/2007#uploader\",\"type\":\"application/atom+xml\",\"href\":\"http://gdata.youtube.com/feeds/api/users/zxQk-rZGowoqMBKxGD5jSA?v=2\"},{\"rel\":\"self\",\"type\":\"application/atom+xml\",\"href\":\"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4?v=2\"}],\"author\":[{\"name\":{\"$t\":\"Cherry
|
57
|
+
Bloom\"},\"uri\":{\"$t\":\"http://gdata.youtube.com/feeds/api/users/cherrybloomband\"},\"yt$userId\":{\"$t\":\"zxQk-rZGowoqMBKxGD5jSA\"}}],\"yt$accessControl\":[{\"action\":\"comment\",\"permission\":\"allowed\"},{\"action\":\"commentVote\",\"permission\":\"allowed\"},{\"action\":\"videoRespond\",\"permission\":\"moderated\"},{\"action\":\"rate\",\"permission\":\"allowed\"},{\"action\":\"embed\",\"permission\":\"allowed\"},{\"action\":\"list\",\"permission\":\"allowed\"},{\"action\":\"autoPlay\",\"permission\":\"allowed\"},{\"action\":\"syndicate\",\"permission\":\"allowed\"}],\"gd$comments\":{\"gd$feedLink\":{\"rel\":\"http://gdata.youtube.com/schemas/2007#comments\",\"href\":\"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4/comments?v=2\",\"countHint\":15}},\"media$group\":{\"media$category\":[{\"$t\":\"Music\",\"label\":\"Music\",\"scheme\":\"http://gdata.youtube.com/schemas/2007/categories.cat\"}],\"media$content\":[{\"url\":\"http://www.youtube.com/v/mZqGqE0D0n4?version=3&f=videos&app=youtube_gdata\",\"type\":\"application/x-shockwave-flash\",\"medium\":\"video\",\"isDefault\":\"true\",\"expression\":\"full\",\"duration\":176,\"yt$format\":5},{\"url\":\"rtsp://r5---sn-4g57kuez.c.youtube.com/CiILENy73wIaGQl-0gNNqIaamRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp\",\"type\":\"video/3gpp\",\"medium\":\"video\",\"expression\":\"full\",\"duration\":176,\"yt$format\":1},{\"url\":\"rtsp://r5---sn-4g57kuez.c.youtube.com/CiILENy73wIaGQl-0gNNqIaamRMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp\",\"type\":\"video/3gpp\",\"medium\":\"video\",\"expression\":\"full\",\"duration\":176,\"yt$format\":6}],\"media$credit\":[{\"$t\":\"cherrybloomband\",\"role\":\"uploader\",\"scheme\":\"urn:youtube\",\"yt$display\":\"Cherry
|
58
|
+
Bloom\"}],\"media$description\":{\"$t\":\"The first video from the upcoming
|
59
|
+
album Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net\",\"type\":\"plain\"},\"media$keywords\":{},\"media$license\":{\"$t\":\"youtube\",\"type\":\"text/html\",\"href\":\"http://www.youtube.com/t/terms\"},\"media$player\":{\"url\":\"http://www.youtube.com/watch?v=mZqGqE0D0n4&feature=youtube_gdata_player\"},\"media$thumbnail\":[{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/default.jpg\",\"height\":90,\"width\":120,\"time\":\"00:01:28\",\"yt$name\":\"default\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/mqdefault.jpg\",\"height\":180,\"width\":320,\"yt$name\":\"mqdefault\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/hqdefault.jpg\",\"height\":360,\"width\":480,\"yt$name\":\"hqdefault\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/1.jpg\",\"height\":90,\"width\":120,\"time\":\"00:00:44\",\"yt$name\":\"start\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/2.jpg\",\"height\":90,\"width\":120,\"time\":\"00:01:28\",\"yt$name\":\"middle\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/3.jpg\",\"height\":90,\"width\":120,\"time\":\"00:02:12\",\"yt$name\":\"end\"}],\"media$title\":{\"$t\":\"Cherry
|
60
|
+
Bloom - King Of The Knife\",\"type\":\"plain\"},\"yt$duration\":{\"seconds\":\"176\"},\"yt$uploaded\":{\"$t\":\"2008-04-12T22:25:35.000Z\"},\"yt$uploaderId\":{\"$t\":\"UCzxQk-rZGowoqMBKxGD5jSA\"},\"yt$videoid\":{\"$t\":\"mZqGqE0D0n4\"}},\"gd$rating\":{\"average\":4.8297873,\"max\":5,\"min\":1,\"numRaters\":47,\"rel\":\"http://schemas.google.com/g/2005#overall\"},\"yt$statistics\":{\"favoriteCount\":\"0\",\"viewCount\":\"6390\"},\"yt$rating\":{\"numDislikes\":\"2\",\"numLikes\":\"45\"}}}"
|
61
61
|
http_version:
|
62
|
-
recorded_at:
|
63
|
-
recorded_with: VCR 2.
|
62
|
+
recorded_at: Thu, 20 Feb 2014 12:43:25 GMT
|
63
|
+
recorded_with: VCR 2.8.0
|
data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/view_count/.yml
CHANGED
@@ -8,11 +8,11 @@ http_interactions:
|
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
10
|
User-Agent:
|
11
|
-
- VideoInfo/2.0.
|
11
|
+
- VideoInfo/2.0.2
|
12
12
|
Accept-Encoding:
|
13
13
|
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
14
|
Accept:
|
15
|
-
-
|
15
|
+
- "*/*"
|
16
16
|
response:
|
17
17
|
status:
|
18
18
|
code: 200
|
@@ -22,22 +22,20 @@ http_interactions:
|
|
22
22
|
- CH
|
23
23
|
Content-Type:
|
24
24
|
- application/json;charset=UTF-8
|
25
|
-
Access-Control-Allow-Origin:
|
26
|
-
- '*'
|
27
25
|
Expires:
|
28
|
-
-
|
26
|
+
- Thu, 20 Feb 2014 12:43:26 GMT
|
29
27
|
Date:
|
30
|
-
-
|
28
|
+
- Thu, 20 Feb 2014 12:43:26 GMT
|
31
29
|
Cache-Control:
|
32
30
|
- private, max-age=300, no-transform
|
33
31
|
Vary:
|
34
|
-
-
|
32
|
+
- "*"
|
35
33
|
Gdata-Version:
|
36
34
|
- '2.1'
|
37
35
|
Etag:
|
38
|
-
- W/"
|
36
|
+
- W/"CEQDQX47eCp7I2A9Wh9SF0U."
|
39
37
|
Last-Modified:
|
40
|
-
-
|
38
|
+
- Fri, 07 Feb 2014 14:12:50 GMT
|
41
39
|
X-Content-Type-Options:
|
42
40
|
- nosniff
|
43
41
|
X-Frame-Options:
|
@@ -45,19 +43,19 @@ http_interactions:
|
|
45
43
|
X-Xss-Protection:
|
46
44
|
- 1; mode=block
|
47
45
|
Content-Length:
|
48
|
-
- '
|
46
|
+
- '4594'
|
49
47
|
Server:
|
50
48
|
- GSE
|
51
49
|
Alternate-Protocol:
|
52
50
|
- 80:quic
|
53
51
|
body:
|
54
52
|
encoding: UTF-8
|
55
|
-
string:
|
56
|
-
Bloom - King Of The Knife"}
|
57
|
-
Bloom"}
|
58
|
-
Bloom"}]
|
59
|
-
Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net"
|
60
|
-
Bloom - King Of The Knife"
|
53
|
+
string: "{\"version\":\"1.0\",\"encoding\":\"UTF-8\",\"entry\":{\"xmlns\":\"http://www.w3.org/2005/Atom\",\"xmlns$media\":\"http://search.yahoo.com/mrss/\",\"xmlns$gd\":\"http://schemas.google.com/g/2005\",\"xmlns$yt\":\"http://gdata.youtube.com/schemas/2007\",\"gd$etag\":\"W/\\\"CEQDQX47eCp7I2A9Wh9SF0U.\\\"\",\"id\":{\"$t\":\"tag:youtube.com,2008:video:mZqGqE0D0n4\"},\"published\":{\"$t\":\"2008-04-12T22:25:35.000Z\"},\"updated\":{\"$t\":\"2014-02-07T14:12:50.000Z\"},\"category\":[{\"scheme\":\"http://schemas.google.com/g/2005#kind\",\"term\":\"http://gdata.youtube.com/schemas/2007#video\"},{\"scheme\":\"http://gdata.youtube.com/schemas/2007/categories.cat\",\"term\":\"Music\",\"label\":\"Music\"}],\"title\":{\"$t\":\"Cherry
|
54
|
+
Bloom - King Of The Knife\"},\"content\":{\"type\":\"application/x-shockwave-flash\",\"src\":\"http://www.youtube.com/v/mZqGqE0D0n4?version=3&f=videos&app=youtube_gdata\"},\"link\":[{\"rel\":\"alternate\",\"type\":\"text/html\",\"href\":\"http://www.youtube.com/watch?v=mZqGqE0D0n4&feature=youtube_gdata\"},{\"rel\":\"http://gdata.youtube.com/schemas/2007#video.related\",\"type\":\"application/atom+xml\",\"href\":\"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4/related?v=2\"},{\"rel\":\"http://gdata.youtube.com/schemas/2007#mobile\",\"type\":\"text/html\",\"href\":\"http://m.youtube.com/details?v=mZqGqE0D0n4\"},{\"rel\":\"http://gdata.youtube.com/schemas/2007#uploader\",\"type\":\"application/atom+xml\",\"href\":\"http://gdata.youtube.com/feeds/api/users/zxQk-rZGowoqMBKxGD5jSA?v=2\"},{\"rel\":\"self\",\"type\":\"application/atom+xml\",\"href\":\"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4?v=2\"}],\"author\":[{\"name\":{\"$t\":\"Cherry
|
55
|
+
Bloom\"},\"uri\":{\"$t\":\"http://gdata.youtube.com/feeds/api/users/cherrybloomband\"},\"yt$userId\":{\"$t\":\"zxQk-rZGowoqMBKxGD5jSA\"}}],\"yt$accessControl\":[{\"action\":\"comment\",\"permission\":\"allowed\"},{\"action\":\"commentVote\",\"permission\":\"allowed\"},{\"action\":\"videoRespond\",\"permission\":\"moderated\"},{\"action\":\"rate\",\"permission\":\"allowed\"},{\"action\":\"embed\",\"permission\":\"allowed\"},{\"action\":\"list\",\"permission\":\"allowed\"},{\"action\":\"autoPlay\",\"permission\":\"allowed\"},{\"action\":\"syndicate\",\"permission\":\"allowed\"}],\"gd$comments\":{\"gd$feedLink\":{\"rel\":\"http://gdata.youtube.com/schemas/2007#comments\",\"href\":\"http://gdata.youtube.com/feeds/api/videos/mZqGqE0D0n4/comments?v=2\",\"countHint\":15}},\"media$group\":{\"media$category\":[{\"$t\":\"Music\",\"label\":\"Music\",\"scheme\":\"http://gdata.youtube.com/schemas/2007/categories.cat\"}],\"media$content\":[{\"url\":\"http://www.youtube.com/v/mZqGqE0D0n4?version=3&f=videos&app=youtube_gdata\",\"type\":\"application/x-shockwave-flash\",\"medium\":\"video\",\"isDefault\":\"true\",\"expression\":\"full\",\"duration\":176,\"yt$format\":5},{\"url\":\"rtsp://r5---sn-4g57kuez.c.youtube.com/CiILENy73wIaGQl-0gNNqIaamRMYDSANFEgGUgZ2aWRlb3MM/0/0/0/video.3gp\",\"type\":\"video/3gpp\",\"medium\":\"video\",\"expression\":\"full\",\"duration\":176,\"yt$format\":1},{\"url\":\"rtsp://r5---sn-4g57kuez.c.youtube.com/CiILENy73wIaGQl-0gNNqIaamRMYESARFEgGUgZ2aWRlb3MM/0/0/0/video.3gp\",\"type\":\"video/3gpp\",\"medium\":\"video\",\"expression\":\"full\",\"duration\":176,\"yt$format\":6}],\"media$credit\":[{\"$t\":\"cherrybloomband\",\"role\":\"uploader\",\"scheme\":\"urn:youtube\",\"yt$display\":\"Cherry
|
56
|
+
Bloom\"}],\"media$description\":{\"$t\":\"The first video from the upcoming
|
57
|
+
album Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net\",\"type\":\"plain\"},\"media$keywords\":{},\"media$license\":{\"$t\":\"youtube\",\"type\":\"text/html\",\"href\":\"http://www.youtube.com/t/terms\"},\"media$player\":{\"url\":\"http://www.youtube.com/watch?v=mZqGqE0D0n4&feature=youtube_gdata_player\"},\"media$thumbnail\":[{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/default.jpg\",\"height\":90,\"width\":120,\"time\":\"00:01:28\",\"yt$name\":\"default\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/mqdefault.jpg\",\"height\":180,\"width\":320,\"yt$name\":\"mqdefault\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/hqdefault.jpg\",\"height\":360,\"width\":480,\"yt$name\":\"hqdefault\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/1.jpg\",\"height\":90,\"width\":120,\"time\":\"00:00:44\",\"yt$name\":\"start\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/2.jpg\",\"height\":90,\"width\":120,\"time\":\"00:01:28\",\"yt$name\":\"middle\"},{\"url\":\"http://i1.ytimg.com/vi/mZqGqE0D0n4/3.jpg\",\"height\":90,\"width\":120,\"time\":\"00:02:12\",\"yt$name\":\"end\"}],\"media$title\":{\"$t\":\"Cherry
|
58
|
+
Bloom - King Of The Knife\",\"type\":\"plain\"},\"yt$duration\":{\"seconds\":\"176\"},\"yt$uploaded\":{\"$t\":\"2008-04-12T22:25:35.000Z\"},\"yt$uploaderId\":{\"$t\":\"UCzxQk-rZGowoqMBKxGD5jSA\"},\"yt$videoid\":{\"$t\":\"mZqGqE0D0n4\"}},\"gd$rating\":{\"average\":4.8297873,\"max\":5,\"min\":1,\"numRaters\":47,\"rel\":\"http://schemas.google.com/g/2005#overall\"},\"yt$statistics\":{\"favoriteCount\":\"0\",\"viewCount\":\"6390\"},\"yt$rating\":{\"numDislikes\":\"2\",\"numLikes\":\"45\"}}}"
|
61
59
|
http_version:
|
62
|
-
recorded_at:
|
63
|
-
recorded_with: VCR 2.
|
60
|
+
recorded_at: Thu, 20 Feb 2014 12:43:26 GMT
|
61
|
+
recorded_with: VCR 2.8.0
|
@@ -16,6 +16,23 @@ describe VideoInfo::Providers::Vimeo do
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
+
describe "#available?" do
|
20
|
+
context "with valid video", :vcr do
|
21
|
+
subject { VideoInfo.new('http://www.vimeo.com/898029') }
|
22
|
+
its(:available?) { should be_true }
|
23
|
+
end
|
24
|
+
|
25
|
+
context "with 'this video does not exist' video", :vcr do
|
26
|
+
subject { VideoInfo.new('http://vimeo.com/59312311') }
|
27
|
+
its(:available?) { should be_false }
|
28
|
+
end
|
29
|
+
|
30
|
+
context "with 'password required' video", :vcr do
|
31
|
+
subject { VideoInfo.new('http://vimeo.com/54189727') }
|
32
|
+
its(:available?) { should be_false }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
19
36
|
context "with video 898029", :vcr do
|
20
37
|
subject { VideoInfo.new('http://www.vimeo.com/898029') }
|
21
38
|
|
@@ -17,6 +17,19 @@ describe VideoInfo::Providers::Vkontakte do
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
+
describe "#available?" do
|
21
|
+
context "with valid video", :vcr do
|
22
|
+
subject { VideoInfo.new('http://vk.com/video39576223_108370515') }
|
23
|
+
its(:available?) { should be_true }
|
24
|
+
end
|
25
|
+
|
26
|
+
context "with invalid video", :vcr do
|
27
|
+
subject { VideoInfo.new('http://vk.com/video39576223_invalid') }
|
28
|
+
its(:available?) { should be_false }
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
20
33
|
context "with video video39576223_108370515", :vcr do
|
21
34
|
subject { VideoInfo.new('http://vk.com/video39576223_108370515') }
|
22
35
|
|
@@ -26,7 +39,7 @@ describe VideoInfo::Providers::Vkontakte do
|
|
26
39
|
its(:url) { should eq 'http://vk.com/video39576223_108370515' }
|
27
40
|
its(:embed_url) { should eq 'vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af' }
|
28
41
|
its(:embed_code) { should eq '<iframe src="http://vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
|
29
|
-
its(:title) { should eq 'Я уточка)))))' }
|
42
|
+
its(:title) { should eq 'Я уточка))))) | VK' }
|
30
43
|
its(:description) { should eq 'это ВЗРЫВ МОЗГА!!! Просто отвал башки...' }
|
31
44
|
its(:keywords) { should eq 'это ВЗРЫВ МОЗГА!!! Просто отвал башки...' }
|
32
45
|
its(:duration) { should eq 183 }
|
@@ -41,7 +54,7 @@ describe VideoInfo::Providers::Vkontakte do
|
|
41
54
|
its(:provider) { should eq 'Vkontakte' }
|
42
55
|
its(:video_owner) { should eq '-54799401' }
|
43
56
|
its(:video_id) { should eq '165822734' }
|
44
|
-
its(:title) { should eq 'SpaceGlasses are the future of computing' }
|
57
|
+
its(:title) { should eq 'SpaceGlasses are the future of computing | VK' }
|
45
58
|
end
|
46
59
|
|
47
60
|
end
|
@@ -21,6 +21,23 @@ describe VideoInfo::Providers::Youtube do
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
+
describe "#available?" do
|
25
|
+
context "with valid video", :vcr do
|
26
|
+
subject { VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4') }
|
27
|
+
its(:available?) { should be_true }
|
28
|
+
end
|
29
|
+
|
30
|
+
context "with 'video is unavailable' video", :vcr do
|
31
|
+
subject { VideoInfo.new('http://www.youtube.com/watch?v=SUkXvWn1m7Q') }
|
32
|
+
its(:available?) { should be_false }
|
33
|
+
end
|
34
|
+
|
35
|
+
context "with 'video no longer available due to a copyright claim' video", :vcr do
|
36
|
+
subject { VideoInfo.new('http://www.youtube.com/watch?v=ffClNhwx0KU') }
|
37
|
+
its(:available?) { should be_false }
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
24
41
|
context "with video mZqGqE0D0n4", :vcr do
|
25
42
|
subject { VideoInfo.new('http://www.youtube.com/watch?v=mZqGqE0D0n4') }
|
26
43
|
|
@@ -32,7 +49,7 @@ describe VideoInfo::Providers::Youtube do
|
|
32
49
|
its(:title) { should eq 'Cherry Bloom - King Of The Knife' }
|
33
50
|
its(:description) { should eq 'The first video from the upcoming album Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net' }
|
34
51
|
its(:keywords) { should be_nil }
|
35
|
-
its(:duration) { should eq
|
52
|
+
its(:duration) { should eq 176 }
|
36
53
|
its(:width) { should be_nil }
|
37
54
|
its(:height) { should be_nil }
|
38
55
|
its(:date) { should eq Time.parse('Sat Apr 12 22:25:35 UTC 2008', Time.now.utc) }
|
metadata
CHANGED
@@ -1,125 +1,125 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: video_info
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.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:
|
11
|
+
date: 2014-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: multi_json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: htmlentities
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 1.3.5
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 1.3.5
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: vcr
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: webmock
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
description: Get video info from YouTube, Vimeo and VK url.
|
@@ -128,8 +128,8 @@ executables: []
|
|
128
128
|
extensions: []
|
129
129
|
extra_rdoc_files: []
|
130
130
|
files:
|
131
|
-
- .gitignore
|
132
|
-
- .travis.yml
|
131
|
+
- ".gitignore"
|
132
|
+
- ".travis.yml"
|
133
133
|
- Gemfile
|
134
134
|
- Guardfile
|
135
135
|
- LICENSE.txt
|
@@ -141,6 +141,9 @@ files:
|
|
141
141
|
- lib/video_info/providers/vkontakte.rb
|
142
142
|
- lib/video_info/providers/youtube.rb
|
143
143
|
- lib/video_info/version.rb
|
144
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/available_/.yml
|
145
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/available_/.yml
|
146
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/available_/.yml
|
144
147
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/date/.yml
|
145
148
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/description/.yml
|
146
149
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/duration/.yml
|
@@ -152,6 +155,8 @@ files:
|
|
152
155
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/title/.yml
|
153
156
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/view_count/.yml
|
154
157
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/width/.yml
|
158
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_invalid_video/available_/.yml
|
159
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_valid_video/available_/.yml
|
155
160
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/description/.yml
|
156
161
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/duration/.yml
|
157
162
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/embed_code/.yml
|
@@ -171,6 +176,9 @@ files:
|
|
171
176
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/title/.yml
|
172
177
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/view_count/.yml
|
173
178
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/width/.yml
|
179
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/available_/.yml
|
180
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_is_unavailable_video/available_/.yml
|
181
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_no_longer_available_due_to_a_copyright_claim_video/available_/.yml
|
174
182
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/date/.yml
|
175
183
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/description/.yml
|
176
184
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/duration/.yml
|
@@ -197,21 +205,24 @@ require_paths:
|
|
197
205
|
- lib
|
198
206
|
required_ruby_version: !ruby/object:Gem::Requirement
|
199
207
|
requirements:
|
200
|
-
- -
|
208
|
+
- - ">="
|
201
209
|
- !ruby/object:Gem::Version
|
202
210
|
version: 1.9.2
|
203
211
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
204
212
|
requirements:
|
205
|
-
- -
|
213
|
+
- - ">="
|
206
214
|
- !ruby/object:Gem::Version
|
207
215
|
version: '0'
|
208
216
|
requirements: []
|
209
217
|
rubyforge_project:
|
210
|
-
rubygems_version: 2.1
|
218
|
+
rubygems_version: 2.2.1
|
211
219
|
signing_key:
|
212
220
|
specification_version: 4
|
213
221
|
summary: YouTube, Vimeo & VK parser
|
214
222
|
test_files:
|
223
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_password_required_video/available_/.yml
|
224
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_this_video_does_not_exist_video/available_/.yml
|
225
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/_available_/with_valid_video/available_/.yml
|
215
226
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/date/.yml
|
216
227
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/description/.yml
|
217
228
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/duration/.yml
|
@@ -223,6 +234,8 @@ test_files:
|
|
223
234
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/title/.yml
|
224
235
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/view_count/.yml
|
225
236
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vimeo/with_video_898029/width/.yml
|
237
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_invalid_video/available_/.yml
|
238
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/_available_/with_valid_video/available_/.yml
|
226
239
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/description/.yml
|
227
240
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/duration/.yml
|
228
241
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_39576223_108370515/embed_code/.yml
|
@@ -242,6 +255,9 @@ test_files:
|
|
242
255
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/title/.yml
|
243
256
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/view_count/.yml
|
244
257
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/width/.yml
|
258
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_valid_video/available_/.yml
|
259
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_is_unavailable_video/available_/.yml
|
260
|
+
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/_available_/with_video_no_longer_available_due_to_a_copyright_claim_video/available_/.yml
|
245
261
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/date/.yml
|
246
262
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/description/.yml
|
247
263
|
- spec/fixtures/vcr_cassettes/VideoInfo_Providers_Youtube/with_video_mZqGqE0D0n4/duration/.yml
|