video_thumb 0.1.6 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6888ae1ea891885747b25475f3a4c10db4a76a16936d48c1a8877a2f677da472
4
- data.tar.gz: 4e4a771830e18b4173c50a9a0d55e448cc5882e650ae5212bc440e890a062822
3
+ metadata.gz: f99d53fc27df6cd785476fac9e619afaee8c070c04326d81a6e729210ac82076
4
+ data.tar.gz: 90b759636f8dd3c4a49908bb03c99073f94b714cb002e59a4d888dc05d44cbf3
5
5
  SHA512:
6
- metadata.gz: e78be4a60f4589de74446a6f4024e3e4fb47cee74aa02337d1763459d94afada8c5bdbd4994a7a184bc4c575dd9b8322884940305fcd0d4ad3edbbd383dedea0
7
- data.tar.gz: b67321f0c1621ca470216ea7f23b621de1d9d73cd5d5167fec03ec1a9a13678bd24ea3e8b749e3dd313dcb6f41d53f12c72bf2a1c8c970f201655cf3ce81057d
6
+ metadata.gz: 6c6934fdd10cd4e13d6de036a8ac161be0c0f58c36ca778c67fb94baddcf0d448343bd0a2d92efb38dc2dcbb72deb88a4fb3ee4f6576880be16d7aaaa73a547c
7
+ data.tar.gz: 313150e20480a40fb449e9db1cdfab7a7495c3565b4f12e9121a3ac18f3dff20ae873bd20b73ef390bd4f9d5a80fe680e6fff464bb374a3ad7e0cc757cccd745
@@ -1,3 +1,3 @@
1
1
  module VideoThumb
2
- VERSION = "0.1.6"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/video_thumb.rb CHANGED
@@ -53,16 +53,16 @@ module VideoThumb
53
53
  url = get_redirect_url(url) unless regex.match?(url)
54
54
  url.gsub(regex) do
55
55
  vimeo_video_id = Regexp.last_match(2)
56
- vimeo_video_json_url = format('http://vimeo.com/api/v2/video/%s.json', vimeo_video_id)
56
+ vimeo_video_json_url = format('https://vimeo.com/api/v2/video/%s.json', vimeo_video_id)
57
57
  image = begin
58
- JSON.parse(open(vimeo_video_json_url).read).first[vimeo_size]
59
- rescue StandardError
58
+ JSON.parse(URI.open(vimeo_video_json_url).read).first[vimeo_size]
59
+ rescue OpenURI::HTTPError
60
60
  nil
61
61
  end
62
62
  return image
63
63
  end
64
64
  elsif url.include?('izlesene')
65
- image = Nokogiri::HTML(open(url)).css("meta[property='og:image']").at_css('meta[property="og:image"]')['content']
65
+ image = Nokogiri::HTML(URI.open(url)).css("meta[property='og:image']").at_css('meta[property="og:image"]')['content']
66
66
  return image
67
67
  else
68
68
  return false
@@ -7,15 +7,15 @@ class VideoThumbTest < Minitest::Test
7
7
  end
8
8
 
9
9
  def test_vimeo_video
10
- assert_equal 'http://i.vimeocdn.com/video/483188148_640.jpg', VideoThumb.get('http://vimeo.com/101419884')
10
+ assert_equal 'https://i.vimeocdn.com/video/483188148-c2e6e58357c4d88f05c53949868a19ff76d7237f71f48947dd0b28276ab3d61b-d_640', VideoThumb.get('http://vimeo.com/101419884')
11
11
  end
12
12
 
13
13
  def test_secure_vimeo_video
14
- assert_equal 'http://i.vimeocdn.com/video/483188148_640.jpg', VideoThumb.get('https://vimeo.com/101419884')
14
+ assert_equal 'https://i.vimeocdn.com/video/483188148-c2e6e58357c4d88f05c53949868a19ff76d7237f71f48947dd0b28276ab3d61b-d_640', VideoThumb.get('https://vimeo.com/101419884')
15
15
  end
16
16
 
17
17
  def test_aliased_vimeo_video
18
- assert_equal 'http://i.vimeocdn.com/video/699818221_640.jpg', VideoThumb.get('https://vimeo.com/madeinyuhara/watasinoinaihoshi')
18
+ assert_equal 'https://i.vimeocdn.com/video/699818221-17cfe596d47c3751e58295209cb575361fc964f385b9be553834b19345dcae4a-d_640', VideoThumb.get('https://vimeo.com/madeinyuhara/watasinoinaihoshi')
19
19
  end
20
20
 
21
21
  def test_reversed_url_params
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: video_thumb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tolga Gezginiş
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-17 00:00:00.000000000 Z
11
+ date: 2023-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -115,8 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
- rubyforge_project:
119
- rubygems_version: 2.7.3
118
+ rubygems_version: 3.0.3.1
120
119
  signing_key:
121
120
  specification_version: 4
122
121
  summary: Youtube, Vimeo and İzlesene thumbnails