video_info 3.0.1 → 3.0.2
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/lib/video_info/providers/vimeo_api.rb +9 -3
- data/lib/video_info/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f960d9a256e4190a6ebde694ff7f73aa630c69e82d2b76d1caed6dca392e27e0
|
4
|
+
data.tar.gz: 8b8eae4ca13fd6db5afddc9de44ceb8ae4d7a0ca2508d9da7b5dd80c76b2210a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3806b4f8e3f44c852c2adda8183fed0cd007d18c67647b59ed702be8ae8aa64e002bb019fbf6f1d54d4d61f0410924dddfca9315a74bb982994f0f8d2392d726
|
7
|
+
data.tar.gz: c3b416a326ec07d0c692d35e8dd0be5ef3024368d2f79c41f86e5ac7595259eb16aeb59f78d74a918e8ff5b5d838c160001f1abd1b2d049226b4e6ca727ded50
|
@@ -1,6 +1,8 @@
|
|
1
1
|
class VideoInfo
|
2
2
|
module Providers
|
3
3
|
module VimeoAPI
|
4
|
+
THUMBNAIL_LINK_REGEX = /.*\/(\d+\-[^_]+)/
|
5
|
+
|
4
6
|
def api_key
|
5
7
|
VideoInfo.provider_api_keys[:vimeo]
|
6
8
|
end
|
@@ -23,7 +25,7 @@ class VideoInfo
|
|
23
25
|
|
24
26
|
def author_thumbnail_id
|
25
27
|
author_uri = _video['user']['pictures']['uri']
|
26
|
-
@author_thumbnail_id ||=
|
28
|
+
@author_thumbnail_id ||= parse_picture_id_from_user(author_uri)
|
27
29
|
end
|
28
30
|
|
29
31
|
def author_url
|
@@ -36,7 +38,7 @@ class VideoInfo
|
|
36
38
|
end
|
37
39
|
|
38
40
|
def thumbnail_id
|
39
|
-
@thumbnail_id ||=
|
41
|
+
@thumbnail_id ||= parse_picture_id(_video.dig("pictures", "sizes").first["link"])
|
40
42
|
end
|
41
43
|
|
42
44
|
def thumbnail_small
|
@@ -111,9 +113,13 @@ class VideoInfo
|
|
111
113
|
"https://#{_api_base}#{_api_path}"
|
112
114
|
end
|
113
115
|
|
114
|
-
def
|
116
|
+
def parse_picture_id_from_user (uri)
|
115
117
|
%r{\/pictures\/(\d+)}.match(uri)[1]
|
116
118
|
end
|
119
|
+
|
120
|
+
def parse_picture_id(uri)
|
121
|
+
uri.match(THUMBNAIL_LINK_REGEX)[1]
|
122
|
+
end
|
117
123
|
end
|
118
124
|
end
|
119
125
|
end
|
data/lib/video_info/version.rb
CHANGED
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.0.2
|
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: 2021-
|
11
|
+
date: 2021-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: iso8601
|
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
201
|
- !ruby/object:Gem::Version
|
202
202
|
version: '0'
|
203
203
|
requirements: []
|
204
|
-
rubygems_version: 3.
|
204
|
+
rubygems_version: 3.2.22
|
205
205
|
signing_key:
|
206
206
|
specification_version: 4
|
207
207
|
summary: Dailymotion, Vimeo and YouTube info parser.
|