directlink 0.0.8.5 → 0.0.8.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e62e48e14056c1b1ab1c34049bc1e4137ca77239
4
- data.tar.gz: 405b2ee26671bf02bcc118dd4ae985ba99d545db
3
+ metadata.gz: 7a1ae138f21693bf2fd25cdeaf7bc4752bb13ea3
4
+ data.tar.gz: 324e4a5f70a2d41a44b49c8990b3f86d75097b94
5
5
  SHA512:
6
- metadata.gz: 1b171d73b0edd1ad7b7e7cab84bf78c82916044858c9fdbd0c8dabfd6cba6a00d6b03db9ef6ac84a001e82f769cbd8df4142f30295aab1670dcfe22700cca812
7
- data.tar.gz: ffddae00c3c62fa43ea4ce3050def2347d1010e908f1da28a886d72e39ce3c62f4202f5343180f4869523023f832e5be7f40231344baf30fc6510da03c427a50
6
+ metadata.gz: 46fb0e0f41a0b08f0f9b649492b39e279ce18b98cad89a07eb85bed2a1e1785e84180e65de7b0186e699ed942920af55e895dcc8892c6f04aca0da8e1b19ae6c
7
+ data.tar.gz: 9b27ff12af472d897c029dbe45416c7bedfdefd86afd0af88ec6cca65864c10a98603282cafc526796cda43dedae7657c107441ad3c4878dcf62645536719a75
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "directlink"
3
- spec.version = "0.0.8.5"
3
+ spec.version = "0.0.8.6"
4
4
  spec.summary = "converts any kind of image hyperlink to direct link, type of image and its resolution"
5
5
 
6
6
  spec.author = "Victor Maslov aka Nakilon"
@@ -402,7 +402,7 @@ def DirectLink link, timeout = nil, giveup: false, ignore_meta: false
402
402
  end
403
403
  html = Nokogiri::HTML NetHTTPUtils.request_data link, header: {"User-Agent" => "Mozilla"}
404
404
  if t = html.at_css("meta[@property='og:image']")
405
- return DirectLink t[:content], nil, giveup: true
405
+ return DirectLink URI.join(link, t[:content]), nil, giveup: true
406
406
  end unless ignore_meta
407
407
  h = {} # TODO: maybe move it outside because of possible img[:src] recursion?...
408
408
  l = lambda do |node, s = []|
data/test.rb CHANGED
@@ -680,6 +680,7 @@ describe DirectLink do
680
680
  ["http://imgur.com/HQHBBBD", "https://i.imgur.com/HQHBBBD.jpg?fb"], # .at_css("meta[@property='og:image']")
681
681
  ["https://www.deviantart.com/nadyasonika/art/Asuka-Langley-Beach-Time-590134861", FastImage::UnknownImageType, true],
682
682
  ["https://www.deviantart.com/nadyasonika/art/Asuka-Langley-Beach-Time-590134861", "https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/943f66cb-78ad-40f2-a086-44420b98b431/d9rcmz1-5cbc5670-0193-485b-ac14-755ddb9562f4.jpg/v1/fill/w_1024,h_732,q_75,strp/asuka_langley_beach_time_by_nadyasonika_d9rcmz1-fullview.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7ImhlaWdodCI6Ijw9NzMyIiwicGF0aCI6IlwvZlwvOTQzZjY2Y2ItNzhhZC00MGYyLWEwODYtNDQ0MjBiOThiNDMxXC9kOXJjbXoxLTVjYmM1NjcwLTAxOTMtNDg1Yi1hYzE0LTc1NWRkYjk1NjJmNC5qcGciLCJ3aWR0aCI6Ijw9MTAyNCJ9XV0sImF1ZCI6WyJ1cm46c2VydmljZTppbWFnZS5vcGVyYXRpb25zIl19.M-a_heYtVPwnR4eC9KIPk2mIYeNzEaTg4b4jqr_GwyI"],
683
+ ["https://calgary.skyrisecities.com/news/2019/11/blue-morning-light", "https://cdn.skyrisecities.com/sites/default/files/images/articles/2019/11/39834/39834-132071.jpg"], # og:image without scheme
683
684
  ].each_with_index do |(input, expectation, giveup), i|
684
685
  it "##{i + 1} (#{URI(input).host}) (giveup=#{!!giveup})" do # to match with minitest `-n` run flag
685
686
  ti = ENV.delete "IMGUR_CLIENT_ID"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: directlink
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8.5
4
+ version: 0.0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Maslov aka Nakilon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-18 00:00:00.000000000 Z
11
+ date: 2019-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastimage