video_info 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +7 -7
- data/lib/video_info/provider.rb +1 -2
- data/lib/video_info/providers/dailymotion.rb +1 -1
- data/lib/video_info/providers/vimeo.rb +1 -1
- data/lib/video_info/providers/vimeoplaylist.rb +1 -1
- data/lib/video_info/providers/vkontakte.rb +1 -1
- data/lib/video_info/providers/youtube.rb +1 -1
- data/lib/video_info/providers/youtubeplaylist.rb +1 -1
- data/lib/video_info/version.rb +1 -1
- data/spec/lib/video_info/provider_spec.rb +3 -7
- data/spec/lib/video_info/providers/dailymotion_spec.rb +2 -2
- data/spec/lib/video_info/providers/vimeo_playlist_spec.rb +2 -2
- data/spec/lib/video_info/providers/vimeo_spec.rb +2 -2
- data/spec/lib/video_info/providers/vkontakte_spec.rb +2 -2
- data/spec/lib/video_info/providers/youtube_playlist_spec.rb +2 -2
- data/spec/lib/video_info/providers/youtube_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b23b675eabd2f73c4be3749f313889419cee3f2b
|
4
|
+
data.tar.gz: 3401047502c7d50ae27238de005b3e9bb6200e64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03cff744f33c2f4bd479342aa1b49d95776b1a8644052c8fc77050255531e915e0dbcb810ea4d269d3744405a9c0fa053ecda7634c8ef49cb447b0ed0db8f33b
|
7
|
+
data.tar.gz: 7ec2496b8484342aa9a766d97487ed93eb9125acf32fade34878157311b9c2c07e91129b088df4014acb7ef213fe4cf19531bcf7e0f1000814c5050aab2343eb
|
data/README.md
CHANGED
@@ -29,7 +29,7 @@ video = VideoInfo.new("http://www.dailymotion.com/video/x7lni3")
|
|
29
29
|
# video.thumbnail_medium => "http://s2.dmcdn.net/BgWxI/x240-b83.jpg"
|
30
30
|
# video.thumbnail_large => "http://s2.dmcdn.net/BgWxI/x720-YcV.jpg"
|
31
31
|
# video.embed_url => "http://www.dailymotion.com/embed/video/x7lni3"
|
32
|
-
# video.embed_code => "'<iframe src="
|
32
|
+
# video.embed_code => "'<iframe src="//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
|
@@ -46,7 +46,7 @@ video = VideoInfo.new("http://vimeo.com/898029")
|
|
46
46
|
# video.thumbnail_medium => "http://b.vimeocdn.com/ts/343/731/34373130_200.jpg"
|
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
|
-
# video.embed_code => "'<iframe src="
|
49
|
+
# video.embed_code => "'<iframe src="//player.vimeo.com/video/898029?title=0&byline=0&portrait=0&autoplay=0" frameborder="0"></iframe>'"
|
50
50
|
|
51
51
|
video = VideoInfo.new("http://www.youtube.com/watch?v=mZqGqE0D0n4")
|
52
52
|
# video.available? => true
|
@@ -60,7 +60,7 @@ video = VideoInfo.new("http://www.youtube.com/watch?v=mZqGqE0D0n4")
|
|
60
60
|
# video.thumbnail_medium => "http://i.ytimg.com/vi/mZqGqE0D0n4/mqdefault.jpg"
|
61
61
|
# video.thumbnail_large => "http://i.ytimg.com/vi/mZqGqE0D0n4/hqdefault.jpg"
|
62
62
|
# video.embed_url => "http://www.youtube.com/embed/mZqGqE0D0n4"
|
63
|
-
# video.embed_code => "'<iframe src="
|
63
|
+
# video.embed_code => "'<iframe src="//www.youtube.com/embed/mZqGqE0D0n4" frameborder="0" allowfullscreen="allowfullscreen"></iframe>'"
|
64
64
|
|
65
65
|
playlist = VideoInfo.new("http://www.youtube.com/playlist?p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr")
|
66
66
|
# playlist.available? => true
|
@@ -71,7 +71,7 @@ playlist = VideoInfo.new("http://www.youtube.com/playlist?p=PL9hW1uS6HUftLdHI6RI
|
|
71
71
|
# playlist.thumbnail_medium => "http://i.ytimg.com/vi/8b0aEoxqqC0/mqdefault.jpg"
|
72
72
|
# playlist.thumbnail_large => "http://i.ytimg.com/vi/8b0aEoxqqC0/hqdefault.jpg"
|
73
73
|
# playlist.embed_url => "http://www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr"
|
74
|
-
# playlist.embed_code => "<iframe src="
|
74
|
+
# playlist.embed_code => "<iframe src="//www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr" frameborder="0" allowfullscreen="allowfullscreen"></iframe>"
|
75
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')]
|
76
76
|
|
77
77
|
playlist = VideoInfo.new("http://vimeo.com/album/2755718")
|
@@ -83,7 +83,7 @@ playlist = VideoInfo.new("http://vimeo.com/album/2755718")
|
|
83
83
|
# playlist.thumbnail_medium => "http://b.vimeocdn.com/ts/443/595/443595474_200.jpg"
|
84
84
|
# playlist.thumbnail_large => "http://b.vimeocdn.com/ts/443/595/443595474_640.jpg"
|
85
85
|
# playlist.embed_url => "player.vimeo.com/hubnut/album/2755718"
|
86
|
-
# playlist.embed_code => "<iframe src="
|
86
|
+
# playlist.embed_code => "<iframe src="//player.vimeo.com/hubnut/album/2755718?autoplay=0&byline=0&portrait=0&title=0" frameborder="0"></iframe>"
|
87
87
|
# playlist.videos => [VideoInfo.new('http://vimeo.com/67977038'), VideoInfo.new('http://vimeo.com/68843810'), VideoInfo.new('http://vimeo.com/69949597'), VideoInfo.new('http://vimeo.com/70388245')]
|
88
88
|
```
|
89
89
|
|
@@ -111,10 +111,10 @@ You can also include an `iframe_attributes` or `url_attributes` hash to the `emb
|
|
111
111
|
|
112
112
|
``` ruby
|
113
113
|
VideoInfo.new("http://www.youtube.com/watch?v=mZqGqE0D0n4").embed_code(iframe_attributes: { width: 800, height: 600, "data-key" => "value" })
|
114
|
-
=> '<iframe src="
|
114
|
+
=> '<iframe src="//www.youtube.com/embed/mZqGqE0D0n4" frameborder="0" allowfullscreen="allowfullscreen" width="800" height="600" data-key="value"></iframe>
|
115
115
|
|
116
116
|
'VideoInfo.new("http://www.youtube.com/watch?v=mZqGqE0D0n4").embed_code(url_attributes: { autoplay: 1 })
|
117
|
-
=> '<iframe src="
|
117
|
+
=> '<iframe src="//www.youtube.com/embed/mZqGqE0D0n4?autoplay=1" frameborder="0" allowfullscreen="allowfullscreen"></iframe>'
|
118
118
|
```
|
119
119
|
|
120
120
|
Author
|
data/lib/video_info/provider.rb
CHANGED
@@ -87,11 +87,10 @@ class VideoInfo
|
|
87
87
|
end
|
88
88
|
|
89
89
|
def _embed_url(options)
|
90
|
-
url_scheme = options.fetch(:url_scheme, 'http')
|
91
90
|
url_attrs = options.fetch(:url_attributes, {})
|
92
91
|
url_attrs = _default_url_attributes.merge(url_attrs)
|
93
92
|
|
94
|
-
url =
|
93
|
+
url = embed_url
|
95
94
|
url += "?#{_hash_to_params(url_attrs)}" unless url_attrs.empty?
|
96
95
|
url
|
97
96
|
end
|
data/lib/video_info/version.rb
CHANGED
@@ -7,7 +7,7 @@ describe VideoInfo::Provider do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def embed_url
|
10
|
-
"foo.com"
|
10
|
+
"//foo.com"
|
11
11
|
end
|
12
12
|
|
13
13
|
def _default_url_attributes; {} end
|
@@ -44,16 +44,12 @@ describe VideoInfo::Provider do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
describe "embed_code" do
|
47
|
-
it "supports url_scheme option" do
|
48
|
-
expect(provider.embed_code(url_scheme: 'https')).to eq '<iframe src="https://foo.com" frameborder="0"></iframe>'
|
49
|
-
end
|
50
|
-
|
51
47
|
it "supports url_attributes option" do
|
52
|
-
expect(provider.embed_code(url_attributes: { foo: 'bar' })).to eq '<iframe src="
|
48
|
+
expect(provider.embed_code(url_attributes: { foo: 'bar' })).to eq '<iframe src="//foo.com?foo=bar" frameborder="0"></iframe>'
|
53
49
|
end
|
54
50
|
|
55
51
|
it "supports url_attributes option" do
|
56
|
-
expect(provider.embed_code(iframe_attributes: { foo: 'bar' })).to eq '<iframe src="
|
52
|
+
expect(provider.embed_code(iframe_attributes: { foo: 'bar' })).to eq '<iframe src="//foo.com" frameborder="0" foo="bar"></iframe>'
|
57
53
|
end
|
58
54
|
end
|
59
55
|
|
@@ -40,8 +40,8 @@ describe VideoInfo::Providers::Dailymotion do
|
|
40
40
|
its(:provider) { should eq 'Dailymotion' }
|
41
41
|
its(:video_id) { should eq 'x7lni3' }
|
42
42
|
its(:url) { should eq 'http://www.dailymotion.com/video/x7lni3' }
|
43
|
-
its(:embed_url) { should eq 'www.dailymotion.com/embed/video/x7lni3' }
|
44
|
-
its(:embed_code) { should eq '<iframe src="
|
43
|
+
its(:embed_url) { should eq '//www.dailymotion.com/embed/video/x7lni3' }
|
44
|
+
its(:embed_code) { should eq '<iframe src="//www.dailymotion.com/embed/video/x7lni3?autoplay=0" frameborder="0"></iframe>' }
|
45
45
|
its(:title) { should eq 'Mario Kart (Rémi Gaillard)' }
|
46
46
|
its(:description) { should eq 'Super Rémi Kart est un jeu vidéo de course développé et édité par N\'Importe Quoi TV. Sa principale originalité vient de sa réalité...<br />L\'aventure continue sur www.nimportequi.com' }
|
47
47
|
its(:keywords) { should eq ["rémi","remi","gaillard","imposteur","imposture","mario","bros","kart","nintendo","jeux"] }
|
@@ -53,8 +53,8 @@ describe VideoInfo::Providers::VimeoPlaylist do
|
|
53
53
|
its(:provider) { should eq 'Vimeo' }
|
54
54
|
its(:playlist_id) { should eq '2755718' }
|
55
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="
|
56
|
+
its(:embed_url) { should eq '//player.vimeo.com/hubnut/album/2755718' }
|
57
|
+
its(:embed_code) { should eq '<iframe src="//player.vimeo.com/hubnut/album/2755718?autoplay=0&byline=0&portrait=0&title=0" frameborder="0"></iframe>' }
|
58
58
|
its(:title) { should eq 'The Century Of Self' }
|
59
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
60
|
its(:keywords) { should be_nil }
|
@@ -49,8 +49,8 @@ describe VideoInfo::Providers::Vimeo do
|
|
49
49
|
its(:provider) { should eq 'Vimeo' }
|
50
50
|
its(:video_id) { should eq '898029' }
|
51
51
|
its(:url) { should eq 'http://www.vimeo.com/898029' }
|
52
|
-
its(:embed_url) { should eq 'player.vimeo.com/video/898029' }
|
53
|
-
its(:embed_code) { should eq '<iframe src="
|
52
|
+
its(:embed_url) { should eq '//player.vimeo.com/video/898029' }
|
53
|
+
its(:embed_code) { should eq '<iframe src="//player.vimeo.com/video/898029?autoplay=0&byline=0&portrait=0&title=0" frameborder="0"></iframe>' }
|
54
54
|
its(:title) { should eq 'Cherry Bloom - King Of The Knife' }
|
55
55
|
its(:description) { should eq 'The first video from the upcoming album Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net' }
|
56
56
|
its(:keywords) { should eq 'cherry bloom, secret sounds, king of the knife, rock, alternative' }
|
@@ -37,8 +37,8 @@ describe VideoInfo::Providers::Vkontakte do
|
|
37
37
|
its(:video_owner) { should eq '39576223' }
|
38
38
|
its(:video_id) { should eq '108370515' }
|
39
39
|
its(:url) { should eq 'http://vk.com/video39576223_108370515' }
|
40
|
-
its(:embed_url) { should eq 'vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af' }
|
41
|
-
its(:embed_code) { should eq '<iframe src="
|
40
|
+
its(:embed_url) { should eq '//vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af' }
|
41
|
+
its(:embed_code) { should eq '<iframe src="//vk.com/video_ext.php?oid=39576223&id=108370515&hash=15184dbd085c47af" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
|
42
42
|
its(:title) { should eq 'Я уточка))))) | VK' }
|
43
43
|
its(:description) { should eq 'это ВЗРЫВ МОЗГА!!! Просто отвал башки...' }
|
44
44
|
its(:keywords) { should eq 'это ВЗРЫВ МОЗГА!!! Просто отвал башки...' }
|
@@ -48,8 +48,8 @@ describe VideoInfo::Providers::YoutubePlaylist do
|
|
48
48
|
its(:provider) { should eq 'YouTube' }
|
49
49
|
its(:playlist_id) { should eq 'PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
|
50
50
|
its(:url) { should eq 'http://www.youtube.com/playlist?p=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
|
51
|
-
its(:embed_url) { should eq 'www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
|
52
|
-
its(:embed_code) { should eq '<iframe src="
|
51
|
+
its(:embed_url) { should eq '//www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr' }
|
52
|
+
its(:embed_code) { should eq '<iframe src="//www.youtube.com/embed/videoseries?list=PL9hW1uS6HUftLdHI6RIsaf-iXTm09qnEr" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
|
53
53
|
its(:title) { should eq 'YouTube Policy and Copyright' }
|
54
54
|
its(:description) { should eq 'Learn more about copyright basics, flagging, and the YouTube community.' }
|
55
55
|
its(:keywords) { should be_nil }
|
@@ -49,8 +49,8 @@ describe VideoInfo::Providers::Youtube do
|
|
49
49
|
its(:provider) { should eq 'YouTube' }
|
50
50
|
its(:video_id) { should eq 'mZqGqE0D0n4' }
|
51
51
|
its(:url) { should eq 'http://www.youtube.com/watch?v=mZqGqE0D0n4' }
|
52
|
-
its(:embed_url) { should eq 'www.youtube.com/embed/mZqGqE0D0n4' }
|
53
|
-
its(:embed_code) { should eq '<iframe src="
|
52
|
+
its(:embed_url) { should eq '//www.youtube.com/embed/mZqGqE0D0n4' }
|
53
|
+
its(:embed_code) { should eq '<iframe src="//www.youtube.com/embed/mZqGqE0D0n4" frameborder="0" allowfullscreen="allowfullscreen"></iframe>' }
|
54
54
|
its(:title) { should eq 'Cherry Bloom - King Of The Knife' }
|
55
55
|
its(:description) { should eq 'The first video from the upcoming album Secret Sounds, to download in-stores April 14. Checkout http://www.cherrybloom.net' }
|
56
56
|
its(:keywords) { should be_nil }
|
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.3.
|
4
|
+
version: 2.3.1
|
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-03
|
11
|
+
date: 2014-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|