video_info 3.0.2 → 3.1.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 +11 -0
- data/lib/video_info/version.rb +1 -1
- data/lib/video_info.rb +10 -0
- data/video_info.gemspec +2 -2
- metadata +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5bcfd93f9cf4782cb70fdaabbbfeb95b6e054e2403c772fce72834d1f302d81
|
4
|
+
data.tar.gz: 99614494315f07c9049b67a30ceb7410882b860030faa3290e0eab9ea1711938
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd789c89161544b5c10cca61e87f9ca1cb4ce42741bda74f22ccc0ffd47d3715c6954ce6b8581c23e3aa13f92f3d42ed3eea9053aca807a8415a74b41f2d0b43
|
7
|
+
data.tar.gz: a52184b867d403f45f703092a82b2ac9f1b059773cc9efbb596ebf3ede90707c10ceed9e1d58385b28ad8d46cf07a7ea47f90972d0d0bfa454e6053a991a09ba
|
data/README.md
CHANGED
@@ -124,6 +124,17 @@ playlist = VideoInfo.new("http://www.youtube.com/playlist?p=PL9hW1uS6HUftLdHI6RI
|
|
124
124
|
# 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')]
|
125
125
|
```
|
126
126
|
|
127
|
+
You can also use the `valid_url?` helper to check if a given url is valid in some of the _enabled_ providers:
|
128
|
+
|
129
|
+
```ruby
|
130
|
+
> VideoInfo.valid_url?('http://www.youtube.com/watch?v=AT_5xOGh6Ko')
|
131
|
+
=> true
|
132
|
+
> VideoInfo.valid_url?('http://vimeo.com/898029')
|
133
|
+
=> true
|
134
|
+
> VideoInfo.valid_url?('http://www.example.com/video/12345')
|
135
|
+
=> false
|
136
|
+
```
|
137
|
+
|
127
138
|
Options
|
128
139
|
-------
|
129
140
|
|
data/lib/video_info/version.rb
CHANGED
data/lib/video_info.rb
CHANGED
@@ -81,6 +81,16 @@ class VideoInfo
|
|
81
81
|
disable_providers.map(&:downcase).include?(provider.downcase)
|
82
82
|
end
|
83
83
|
|
84
|
+
def self.enabled_providers
|
85
|
+
PROVIDERS
|
86
|
+
.reject { |p| disabled_provider?(p) }
|
87
|
+
.map { |p| Providers.const_get(p) }
|
88
|
+
end
|
89
|
+
|
90
|
+
def self.valid_url?(url)
|
91
|
+
enabled_providers.any? { |p| p.usable?(url) }
|
92
|
+
end
|
93
|
+
|
84
94
|
private
|
85
95
|
|
86
96
|
def _select_provider(url, options)
|
data/video_info.gemspec
CHANGED
@@ -23,8 +23,8 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.add_dependency 'oga', '~> 3.0'
|
24
24
|
s.add_dependency 'net_http_timeout_errors', '~> 0.3.0'
|
25
25
|
|
26
|
-
s.add_development_dependency 'bundler', '
|
27
|
-
s.add_development_dependency 'rake', '
|
26
|
+
s.add_development_dependency 'bundler', '~> 2.3'
|
27
|
+
s.add_development_dependency 'rake', '~> 13.0'
|
28
28
|
s.add_development_dependency 'rspec', '~> 3.4'
|
29
29
|
s.add_development_dependency 'rspec-its', '~> 1.2'
|
30
30
|
s.add_development_dependency 'rubocop', '~> 0.37'
|
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: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thibaud Guillaume-Gentil
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: iso8601
|
@@ -56,30 +56,30 @@ dependencies:
|
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: '2.3'
|
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
|
-
version:
|
68
|
+
version: '2.3'
|
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
|
-
version:
|
75
|
+
version: '13.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
|
-
version:
|
82
|
+
version: '13.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -186,7 +186,7 @@ homepage: https://rubygems.org/gems/video_info
|
|
186
186
|
licenses:
|
187
187
|
- MIT
|
188
188
|
metadata: {}
|
189
|
-
post_install_message:
|
189
|
+
post_install_message:
|
190
190
|
rdoc_options: []
|
191
191
|
require_paths:
|
192
192
|
- lib
|
@@ -201,8 +201,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
201
|
- !ruby/object:Gem::Version
|
202
202
|
version: '0'
|
203
203
|
requirements: []
|
204
|
-
rubygems_version: 3.
|
205
|
-
signing_key:
|
204
|
+
rubygems_version: 3.1.6
|
205
|
+
signing_key:
|
206
206
|
specification_version: 4
|
207
207
|
summary: Dailymotion, Vimeo and YouTube info parser.
|
208
208
|
test_files: []
|