video_info 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +40 -14
- data/lib/video_info.rb +6 -1
- data/lib/video_info/providers/dailymotion.rb +85 -0
- data/lib/video_info/providers/youtube.rb +1 -1
- data/lib/video_info/providers/youtubeplaylist.rb +55 -0
- data/lib/video_info/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_This_video_does_not_exist_or_has_been_deleted_/available_/.yml +63 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_valid_video/available_/.yml +60 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_video_is_unavailable_video/available_/.yml +46 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/_available_/with_video_no_longer_available_due_to_a_copyright_claim_video/available_/.yml +46 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/date/.yml +63 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/description/.yml +63 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/duration/.yml +63 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/keywords/.yml +63 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/thumbnail_large/.yml +63 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/thumbnail_medium/.yml +63 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/thumbnail_small/.yml +63 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/title/.yml +63 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Dailymotion/with_video_x7lni3/view_count/.yml +63 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/description/.yml +305 -305
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/duration/.yml +1015 -1015
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_code/.yml +305 -305
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/embed_url/.yml +305 -305
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/height/.yml +1015 -1015
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/keywords/.yml +1015 -1015
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/view_count/.yml +1015 -1015
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_Vkontakte/with_video_video39576223_108370515/width/.yml +1015 -1015
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_invalid_playlist/available_/.yml +46 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/_available_/with_valid_playlist/available_/.yml +56 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/.yml +98 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/date/.yml +98 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/description/.yml +98 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/duration/.yml +98 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/keywords/.yml +98 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/thumbnail_large/.yml +96 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/thumbnail_medium/.yml +96 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/thumbnail_small/.yml +98 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/title/.yml +98 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/videos/.yml +96 -0
- data/spec/fixtures/vcr_cassettes/VideoInfo_Providers_YoutubePlaylist/with_playlist_PL9hW1uS6HUftLdHI6RIsaf/view_count/.yml +98 -0
- data/spec/lib/video_info/providers/dailymotion_spec.rb +78 -0
- data/spec/lib/video_info/providers/youtube_playlist_spec.rb +66 -0
- data/spec/lib/video_info/providers/youtube_spec.rb +5 -0
- data/spec/lib/video_info_spec.rb +20 -0
- data/video_info.gemspec +4 -4
- metadata +64 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58cc86ef25f00b1ffc554c0765a0a44cdfd1431a
|
4
|
+
data.tar.gz: cd5cf65c26ce4431441ba20260104ea207500d31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf64eb48e870c0d60099de9d8a7df0005fa442b6b93e1581a3fdd2aa9c603bdeeecf4b3cb41e37804d6b8064d3b081f32d6c5db32f3de471afd0b6f0f656423e
|
7
|
+
data.tar.gz: ecb8bbdd71b372c12cbd0749a47eb7b4a63a1a65d60a5365c113c8ca25a429015a5ff0ac5996d0e09a39ee08e0d8753791996dfc3ba1f880fafbe0f4372bb415
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/video_info.png)](http://badge.fury.io/rb/video_info) [![Build Status](https://travis-ci.org/thibaudgg/video_info.png?branch=master)](https://travis-ci.org/thibaudgg/video_info) [![Dependency Status](https://gemnasium.com/thibaudgg/video_info.png)](https://gemnasium.com/thibaudgg/video_info) [![Code Climate](https://codeclimate.com/github/thibaudgg/video_info.png)](https://codeclimate.com/github/thibaudgg/video_info) [![Coverage Status](https://coveralls.io/repos/thibaudgg/video_info/badge.png?branch=master)](https://coveralls.io/r/thibaudgg/video_info)
|
4
4
|
|
5
|
-
Simple Ruby Gem to get video info from
|
5
|
+
Simple Ruby Gem to get video info from Dailymotion, Vimeo, VK and YouTube (with playlist support).
|
6
6
|
|
7
|
-
Tested against Ruby 1.9.3, 2.0.0 and the latest versions of JRuby & Rubinius.
|
7
|
+
Tested against Ruby 1.9.3, 2.0.0, 2.1.0 and the latest versions of JRuby & Rubinius.
|
8
8
|
|
9
9
|
Install
|
10
10
|
--------
|
@@ -17,19 +17,19 @@ Usage
|
|
17
17
|
-----
|
18
18
|
|
19
19
|
``` ruby
|
20
|
-
video = VideoInfo.new("http://www.
|
20
|
+
video = VideoInfo.new("http://www.dailymotion.com/video/x7lni3")
|
21
21
|
# video.available? => true
|
22
|
-
# video.video_id => "
|
23
|
-
# video.provider => "
|
24
|
-
# video.title => "
|
25
|
-
# video.description => "
|
26
|
-
# video.duration =>
|
27
|
-
# video.date =>
|
28
|
-
# video.thumbnail_small => "http://
|
29
|
-
# video.thumbnail_medium => "http://
|
30
|
-
# video.thumbnail_large => "http://
|
31
|
-
# video.embed_url => "http://www.
|
32
|
-
# video.embed_code => "'<iframe src="http://www.
|
22
|
+
# video.video_id => "x7lni3"
|
23
|
+
# video.provider => "Dailymotion"
|
24
|
+
# video.title => "Mario Kart (Rémi Gaillard)"
|
25
|
+
# video.description => "Super Rémi Kart est un jeu vidéo de course développé et édité par N'Importe Quoi TV."
|
26
|
+
# video.duration => 136 (in seconds)
|
27
|
+
# video.date => Mon Mar 03 16:29:31 UTC 2008
|
28
|
+
# video.thumbnail_small => "http://s2.dmcdn.net/BgWxI/x60-kbf.jpg"
|
29
|
+
# video.thumbnail_medium => "http://s2.dmcdn.net/BgWxI/x240-b83.jpg"
|
30
|
+
# video.thumbnail_large => "http://s2.dmcdn.net/BgWxI/x720-YcV.jpg"
|
31
|
+
# video.embed_url => "http://www.dailymotion.com/embed/video/x7lni3"
|
32
|
+
# video.embed_code => "'<iframe src="http://www.dailymotion.com/embed/video/x7lni3" frameborder="0" allowfullscreen="allowfullscreen"></iframe>'"
|
33
33
|
|
34
34
|
video = VideoInfo.new("http://vimeo.com/898029")
|
35
35
|
# video.available? => true
|
@@ -47,6 +47,32 @@ video = VideoInfo.new("http://vimeo.com/898029")
|
|
47
47
|
# video.thumbnail_large => "http://b.vimeocdn.com/ts/343/731/34373130_640.jpg"
|
48
48
|
# video.embed_url => "http://player.vimeo.com/video/898029"
|
49
49
|
# video.embed_code => "'<iframe src="http://player.vimeo.com/video/898029?title=0&byline=0&portrait=0&autoplay=0" frameborder="0"></iframe>'"
|
50
|
+
|
51
|
+
video = VideoInfo.new("http://www.youtube.com/watch?v=mZqGqE0D0n4")
|
52
|
+
# video.available? => true
|
53
|
+
# video.video_id => "mZqGqE0D0n4"
|
54
|
+
# video.provider => "YouTube"
|
55
|
+
# video.title => "Cherry Bloom - King Of The Knife"
|
56
|
+
# video.description => "The first video from the upcoming album Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net"
|
57
|
+
# video.duration => 175 (in seconds)
|
58
|
+
# video.date => Sat Apr 12 22:25:35 UTC 2008
|
59
|
+
# video.thumbnail_small => "http://i.ytimg.com/vi/mZqGqE0D0n4/default.jpg"
|
60
|
+
# video.thumbnail_medium => "http://i.ytimg.com/vi/mZqGqE0D0n4/mqdefault.jpg"
|
61
|
+
# video.thumbnail_large => "http://i.ytimg.com/vi/mZqGqE0D0n4/hqdefault.jpg"
|
62
|
+
# video.embed_url => "http://www.youtube.com/embed/mZqGqE0D0n4"
|
63
|
+
# video.embed_code => "'<iframe src="http://www.youtube.com/embed/mZqGqE0D0n4" frameborder="0" allowfullscreen="allowfullscreen"></iframe>'"
|
64
|
+
|
65
|
+
playlist = VideoInfo.new("http://www.youtube.com/playlist?p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr")
|
66
|
+
# playlist.available? => true
|
67
|
+
# playlist.playlist_id => "PL9hW1uS6HUftLdHI6RIsaf"
|
68
|
+
# playlist.provider => "YouTube"
|
69
|
+
# playlist.title => "YouTube Policy and Copyright"
|
70
|
+
# playlist.thumbnail_small => "http://i.ytimg.com/vi/8b0aEoxqqC0/default.jpg"
|
71
|
+
# playlist.thumbnail_medium => "http://i.ytimg.com/vi/8b0aEoxqqC0/mqdefault.jpg"
|
72
|
+
# playlist.thumbnail_large => "http://i.ytimg.com/vi/8b0aEoxqqC0/hqdefault.jpg"
|
73
|
+
# playlist.embed_url => "http://www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr"
|
74
|
+
# playlist.embed_code => "'<iframe src="http://www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr" frameborder="0" allowfullscreen="allowfullscreen"></iframe>'"
|
75
|
+
# playlist.videos => [VideoInfo.new('http://www.youtube.com/watch?v=_Bt3-WsHfB0'), VideoInfo.new('http://www.youtube.com/watch?v=9g2U12SsRns'), VideoInfo.new('http://www.youtube.com/watch?v=8b0aEoxqqC0'), VideoInfo.new('http://www.youtube.com/watch?v=6c3mHikRz0I'), VideoInfo.new('http://www.youtube.com/watch?v=OQVHWsTHcoc')]
|
50
76
|
```
|
51
77
|
|
52
78
|
Options
|
data/lib/video_info.rb
CHANGED
@@ -7,7 +7,7 @@ class VideoInfo
|
|
7
7
|
class UrlError < StandardError; end
|
8
8
|
extend Forwardable
|
9
9
|
|
10
|
-
PROVIDERS = %w[Vimeo Vkontakte Youtube]
|
10
|
+
PROVIDERS = %w[Vimeo Vkontakte Youtube YoutubePlaylist Dailymotion]
|
11
11
|
PROVIDERS.each { |p| require "video_info/providers/#{p.downcase}" }
|
12
12
|
|
13
13
|
def_delegators :@provider, :provider, :video_id, :video_owner, :url, :data
|
@@ -16,6 +16,7 @@ class VideoInfo
|
|
16
16
|
def_delegators :@provider, :thumbnail_small, :thumbnail_medium, :thumbnail_large
|
17
17
|
def_delegators :@provider, :embed_code, :embed_url
|
18
18
|
def_delegators :@provider, :available?
|
19
|
+
def_delegators :@provider, :playlist_id, :videos
|
19
20
|
|
20
21
|
def initialize(url, options = {})
|
21
22
|
@provider = _select_provider(url, options)
|
@@ -32,6 +33,10 @@ class VideoInfo
|
|
32
33
|
false
|
33
34
|
end
|
34
35
|
|
36
|
+
def ==(other)
|
37
|
+
url == other.url && video_id == other.video_id
|
38
|
+
end
|
39
|
+
|
35
40
|
private
|
36
41
|
|
37
42
|
def _select_provider(url, options)
|
@@ -0,0 +1,85 @@
|
|
1
|
+
class VideoInfo
|
2
|
+
module Providers
|
3
|
+
class Dailymotion < Provider
|
4
|
+
|
5
|
+
def self.usable?(url)
|
6
|
+
url =~ /(dai(?:\.ly|lymotion\.com))/
|
7
|
+
end
|
8
|
+
|
9
|
+
def provider
|
10
|
+
'Dailymotion'
|
11
|
+
end
|
12
|
+
|
13
|
+
%w[title description duration].each do |method|
|
14
|
+
define_method(method) { data[method] }
|
15
|
+
end
|
16
|
+
|
17
|
+
%w[width height].each do |method|
|
18
|
+
define_method(method) { nil }
|
19
|
+
end
|
20
|
+
|
21
|
+
def keywords
|
22
|
+
data['tags']
|
23
|
+
end
|
24
|
+
|
25
|
+
def embed_url
|
26
|
+
"www.dailymotion.com/embed/video/#{video_id}"
|
27
|
+
end
|
28
|
+
|
29
|
+
def date
|
30
|
+
Time.at(data['created_time']).utc
|
31
|
+
end
|
32
|
+
|
33
|
+
def thumbnail_small
|
34
|
+
data['thumbnail_60_url']
|
35
|
+
end
|
36
|
+
|
37
|
+
def thumbnail_medium
|
38
|
+
data['thumbnail_240_url']
|
39
|
+
end
|
40
|
+
|
41
|
+
def thumbnail_large
|
42
|
+
data['thumbnail_720_url']
|
43
|
+
end
|
44
|
+
|
45
|
+
def view_count
|
46
|
+
data['views_total'].to_i
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def _response_code
|
52
|
+
response = nil
|
53
|
+
Net::HTTP.start(_api_base, 443, use_ssl: true) {|http|
|
54
|
+
response = http.get(_api_path)
|
55
|
+
}
|
56
|
+
response.code
|
57
|
+
end
|
58
|
+
|
59
|
+
def _url_regex
|
60
|
+
/dai(?:\.ly|lymotion\.com\/(?:embed\/)?video)\/([a-zA-Z0-9]*)/
|
61
|
+
end
|
62
|
+
|
63
|
+
def _api_base
|
64
|
+
"api.dailymotion.com"
|
65
|
+
end
|
66
|
+
|
67
|
+
def _api_path
|
68
|
+
"/video/#{video_id}"
|
69
|
+
end
|
70
|
+
|
71
|
+
def _api_url
|
72
|
+
"https://#{_api_base}#{_api_path}?fields=id,title,description,duration,created_time,url,views_total,tags,thumbnail_url,thumbnail_720_url,thumbnail_240_url,thumbnail_60_url"
|
73
|
+
end
|
74
|
+
|
75
|
+
def _default_iframe_attributes
|
76
|
+
{}
|
77
|
+
end
|
78
|
+
|
79
|
+
def _default_url_attributes
|
80
|
+
{ autoplay: 0 }
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
class VideoInfo
|
2
|
+
module Providers
|
3
|
+
class YoutubePlaylist < Youtube
|
4
|
+
|
5
|
+
alias_method :playlist_id, :video_id
|
6
|
+
|
7
|
+
def self.usable?(url)
|
8
|
+
url =~ /(youtube\.com)\/playlist/
|
9
|
+
end
|
10
|
+
|
11
|
+
def videos
|
12
|
+
_playlist_video_ids.map do |entry_id|
|
13
|
+
VideoInfo.new("http://www.youtube.com/watch?v=#{entry_id}")
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def embed_url
|
18
|
+
"www.youtube.com/embed/videoseries?list=#{playlist_id}"
|
19
|
+
end
|
20
|
+
|
21
|
+
def description
|
22
|
+
_playlist_entry['subtitle']['$t']
|
23
|
+
end
|
24
|
+
|
25
|
+
%w[date keywords duration view_count].each do |method|
|
26
|
+
define_method(method) { nil }
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def _playlist_entry
|
32
|
+
data['feed']
|
33
|
+
end
|
34
|
+
|
35
|
+
def _video_entry
|
36
|
+
_playlist_entry
|
37
|
+
end
|
38
|
+
|
39
|
+
def _url_regex
|
40
|
+
/youtube.com\/playlist\?p=(\S*)/
|
41
|
+
end
|
42
|
+
|
43
|
+
def _api_path
|
44
|
+
"/feeds/api/playlists/#{playlist_id}?v=2&alt=json"
|
45
|
+
end
|
46
|
+
|
47
|
+
def _playlist_video_ids
|
48
|
+
_playlist_entry['entry'].map do |entry|
|
49
|
+
entry['media$group']['yt$videoid']['$t']
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
data/lib/video_info/version.rb
CHANGED
@@ -0,0 +1,63 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.dailymotion.com/video/inValIdiD
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- '*/*'
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 404
|
19
|
+
message: Not Found
|
20
|
+
headers:
|
21
|
+
Server:
|
22
|
+
- DMS/1.0.42
|
23
|
+
X-Dm-Backnode:
|
24
|
+
- web-104.adm.dailymotion.com:80
|
25
|
+
Vary:
|
26
|
+
- Authorization,Accept-Encoding
|
27
|
+
Cache-Control:
|
28
|
+
- private, max-age=900, no-transform, no-cache="set-cookie"
|
29
|
+
Content-Type:
|
30
|
+
- application/json
|
31
|
+
X-Api-Error:
|
32
|
+
- code="404", message="This video does not exist or has been deleted."
|
33
|
+
P3p:
|
34
|
+
- policyref="http://www.dailymotion.com/w3c/p3p.xml", CP="IDC DSP CURa ADMa
|
35
|
+
DEVa TAIa OUR BUS IND UNI COM NAV INT"
|
36
|
+
Date:
|
37
|
+
- Sat, 22 Feb 2014 12:37:47 GMT
|
38
|
+
Keep-Alive:
|
39
|
+
- timeout=60, max=4984
|
40
|
+
X-Dm-Lb:
|
41
|
+
- 195.8.215.129
|
42
|
+
Access-Control-Allow-Origin:
|
43
|
+
- '*'
|
44
|
+
Etag:
|
45
|
+
- W/"CcU5dNT05vkow2VzLcDLDA"
|
46
|
+
Connection:
|
47
|
+
- Keep-Alive
|
48
|
+
Set-Cookie:
|
49
|
+
- ts=332925; expires=Thu, 22-Feb-2024 12:37:47 GMT; Max-Age=315532800; path=/;
|
50
|
+
domain=.dailymotion.com
|
51
|
+
Last-Modified:
|
52
|
+
- Wed, 29 Jan 2014 19:37:41 GMT
|
53
|
+
X-Dm-Page:
|
54
|
+
- fr.rest.rest_api
|
55
|
+
Content-Length:
|
56
|
+
- '110'
|
57
|
+
body:
|
58
|
+
encoding: UTF-8
|
59
|
+
string: '{"error":{"code":404,"message":"This video does not exist or has been
|
60
|
+
deleted.","type":"not_found"}}'
|
61
|
+
http_version:
|
62
|
+
recorded_at: Sat, 22 Feb 2014 12:37:47 GMT
|
63
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,60 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.dailymotion.com/video/x7lni3
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- '*/*'
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Server:
|
22
|
+
- DMS/1.0.42
|
23
|
+
X-Dm-Backnode:
|
24
|
+
- web-029.adm.dailymotion.com:80
|
25
|
+
Vary:
|
26
|
+
- Authorization,Accept-Encoding
|
27
|
+
Cache-Control:
|
28
|
+
- private, max-age=900, no-transform, no-cache="set-cookie"
|
29
|
+
Content-Type:
|
30
|
+
- application/json
|
31
|
+
P3p:
|
32
|
+
- policyref="http://www.dailymotion.com/w3c/p3p.xml", CP="IDC DSP CURa ADMa
|
33
|
+
DEVa TAIa OUR BUS IND UNI COM NAV INT"
|
34
|
+
Date:
|
35
|
+
- Sat, 22 Feb 2014 12:37:46 GMT
|
36
|
+
Keep-Alive:
|
37
|
+
- timeout=60, max=4966
|
38
|
+
X-Dm-Lb:
|
39
|
+
- 195.8.215.129
|
40
|
+
Access-Control-Allow-Origin:
|
41
|
+
- '*'
|
42
|
+
Etag:
|
43
|
+
- W/"O1DJzTYSf9K1Wvn1OkaB4Q"
|
44
|
+
Connection:
|
45
|
+
- Keep-Alive
|
46
|
+
Set-Cookie:
|
47
|
+
- ts=227877; expires=Thu, 22-Feb-2024 12:37:46 GMT; Max-Age=315532800; path=/;
|
48
|
+
domain=.dailymotion.com
|
49
|
+
Last-Modified:
|
50
|
+
- Sat, 06 Jul 2013 19:32:30 GMT
|
51
|
+
X-Dm-Page:
|
52
|
+
- fr.rest.rest_api
|
53
|
+
Content-Length:
|
54
|
+
- '103'
|
55
|
+
body:
|
56
|
+
encoding: UTF-8
|
57
|
+
string: '{"id":"x7lni3","title":"Mario Kart (R\u00e9mi Gaillard)","channel":"fun","owner":"x4r137"}'
|
58
|
+
http_version:
|
59
|
+
recorded_at: Sat, 22 Feb 2014 12:37:47 GMT
|
60
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: head
|
5
|
+
uri: http://gdata.youtube.com/feeds/api/videos/SUkXvWn1m7Q?alt=json&v=2
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- '*/*'
|
12
|
+
User-Agent:
|
13
|
+
- Ruby
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 404
|
17
|
+
message: Not Found
|
18
|
+
headers:
|
19
|
+
X-Gdata-User-Country:
|
20
|
+
- FR
|
21
|
+
Content-Type:
|
22
|
+
- application/vnd.google.gdata.error+xml
|
23
|
+
Content-Length:
|
24
|
+
- '181'
|
25
|
+
Date:
|
26
|
+
- Fri, 21 Feb 2014 15:53:18 GMT
|
27
|
+
Expires:
|
28
|
+
- Fri, 21 Feb 2014 15:53:18 GMT
|
29
|
+
Cache-Control:
|
30
|
+
- private, max-age=0
|
31
|
+
X-Content-Type-Options:
|
32
|
+
- nosniff
|
33
|
+
X-Frame-Options:
|
34
|
+
- SAMEORIGIN
|
35
|
+
X-Xss-Protection:
|
36
|
+
- 1; mode=block
|
37
|
+
Server:
|
38
|
+
- GSE
|
39
|
+
Alternate-Protocol:
|
40
|
+
- 80:quic
|
41
|
+
body:
|
42
|
+
encoding: UTF-8
|
43
|
+
string: ''
|
44
|
+
http_version:
|
45
|
+
recorded_at: Fri, 21 Feb 2014 15:53:17 GMT
|
46
|
+
recorded_with: VCR 2.8.0
|