video_info 4.0.0 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/Gemfile +3 -0
- data/README.md +12 -3
- data/lib/video_info/providers/vimeo.rb +1 -1
- data/lib/video_info/providers/vimeo_scraper.rb +2 -2
- data/lib/video_info/providers/youtube.rb +1 -1
- data/lib/video_info/providers/youtube_scraper.rb +5 -1
- 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: c8147a3698a183d13edcbf0a4bb084741c99b6c64f69d562ce441f7e116a8d8d
|
4
|
+
data.tar.gz: 2b52569e7059929c4c64816f5f204bdd74fd669b775558dc76a8ef8dca693bb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bda11c5fc3854079bfe460e3a161dbba6cdd47219004b9a03f05a60448633f81e8712480e933d3812294e52dee5eedb89c44376b2872663853eea8764e9bfda4
|
7
|
+
data.tar.gz: 274803d8d83b50659cdae0b6b7f59abf7c20595d07ddedc3627298a8f7b01b0a45bd72f5bfbc7d3b58d25831c9fea408d1eccc5ce7ba0d726badf30ddbcfc1d8
|
data/.github/workflows/ci.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -6,9 +6,12 @@
|
|
6
6
|
[![Test Coverage](https://api.codeclimate.com/v1/badges/1f03474bdb81e735002c/test_coverage)](https://codeclimate.com/github/thibaudgg/video_info/test_coverage)
|
7
7
|
[![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard)
|
8
8
|
|
9
|
-
Simple Ruby Gem to get video
|
9
|
+
Simple Ruby Gem to get video information from different providers. Supported providers:
|
10
10
|
|
11
|
-
|
11
|
+
- YouTube (with playlists)
|
12
|
+
- Vimeo
|
13
|
+
- Dailymotion
|
14
|
+
- Wistia
|
12
15
|
|
13
16
|
## Features
|
14
17
|
|
@@ -24,6 +27,12 @@ Tested against Ruby 2.7, 3.0, 3.1 and 3.2.
|
|
24
27
|
gem install video_info
|
25
28
|
```
|
26
29
|
|
30
|
+
Or add to the Gemfile:
|
31
|
+
|
32
|
+
```bash
|
33
|
+
gem 'video_info'
|
34
|
+
```
|
35
|
+
|
27
36
|
## Usage
|
28
37
|
|
29
38
|
### Note for YouTube and Vimeo usage!
|
@@ -198,4 +207,4 @@ Please read [the contributing guidelines](CONTRIBUTING.md).
|
|
198
207
|
|
199
208
|
### Contributors
|
200
209
|
|
201
|
-
[
|
210
|
+
Thanks to [all contributors](https://github.com/thibaudgg/video_info/graphs/contributors)!
|
@@ -131,9 +131,9 @@ class VideoInfo
|
|
131
131
|
private
|
132
132
|
|
133
133
|
def user_interaction_count(interaction_type:)
|
134
|
-
interaction_statistic
|
134
|
+
interaction_statistic&.find do |stat|
|
135
135
|
stat["interactionType"] == "http://schema.org/#{interaction_type}"
|
136
|
-
end["userInteractionCount"
|
136
|
+
end&.public_send(:[], "userInteractionCount")
|
137
137
|
end
|
138
138
|
|
139
139
|
def interaction_statistic
|
@@ -29,7 +29,11 @@ class VideoInfo
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def channel_id
|
32
|
-
itemprop_node_value("channelId")
|
32
|
+
# NOTE the previous implementation, based on itemprop_node_value("channelId"),
|
33
|
+
# does not work well, probably due to some YouTube change
|
34
|
+
page_content = data.to_s
|
35
|
+
matches = page_content.match(/"channelId":"([a-zA-Z0-9_-]+)"/)
|
36
|
+
matches[1] if matches
|
33
37
|
end
|
34
38
|
|
35
39
|
def author_url
|
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: 4.
|
4
|
+
version: 4.2.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: 2024-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: iso8601
|
@@ -212,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
212
212
|
- !ruby/object:Gem::Version
|
213
213
|
version: '0'
|
214
214
|
requirements: []
|
215
|
-
rubygems_version: 3.4.
|
215
|
+
rubygems_version: 3.4.10
|
216
216
|
signing_key:
|
217
217
|
specification_version: 4
|
218
218
|
summary: Dailymotion, Vimeo and YouTube info parser.
|