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 +4 -4
- data/directlink.gemspec +1 -1
- data/lib/directlink.rb +1 -1
- data/test.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a1ae138f21693bf2fd25cdeaf7bc4752bb13ea3
|
4
|
+
data.tar.gz: 324e4a5f70a2d41a44b49c8990b3f86d75097b94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46fb0e0f41a0b08f0f9b649492b39e279ce18b98cad89a07eb85bed2a1e1785e84180e65de7b0186e699ed942920af55e895dcc8892c6f04aca0da8e1b19ae6c
|
7
|
+
data.tar.gz: 9b27ff12af472d897c029dbe45416c7bedfdefd86afd0af88ec6cca65864c10a98603282cafc526796cda43dedae7657c107441ad3c4878dcf62645536719a75
|
data/directlink.gemspec
CHANGED
data/lib/directlink.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2019-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastimage
|