directlink 0.0.8.0 → 0.0.8.1
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 +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a692b5ff0cc96ba9acd3383150c2db6df97cf061
|
4
|
+
data.tar.gz: ce9ee5b9edc2aafcf717ab4b3574695914a6ce9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 965bf3f132fce53ea31ddefea4dab9c901c66d6ffc33a0f2dfe6635847750323481ad34517ee2a03118d128c3aef77f66062021bf538be32e7586cb3050dbc25
|
7
|
+
data.tar.gz: 37d541655fdb921623fe5acb88eefe35db2d7a3c637dc56231b0fb8159ff9ccc75362c8abbbbcc4a0e26c6949b5ce84b027915765f0b8b20c1b5ca2f9a529f99
|
data/directlink.gemspec
CHANGED
data/lib/directlink.rb
CHANGED
@@ -242,7 +242,7 @@ module DirectLink
|
|
242
242
|
end
|
243
243
|
|
244
244
|
def self.vk link
|
245
|
-
raise ErrorBadLink.new link unless %r{\Ahttps
|
245
|
+
raise ErrorBadLink.new link unless %r{\Ahttps://vk\.com/id(?<user_id>\d+)\?z=photo(?<id>\k<user_id>_\d+)(%2Falbum\k<user_id>_0)?\z} =~ link
|
246
246
|
raise ErrorMissingEnvVar.new "define VK_ACCESS_TOKEN and VK_CLIENT_SECRET env vars" unless ENV["VK_ACCESS_TOKEN"] && ENV["VK_CLIENT_SECRET"]
|
247
247
|
json = JSON.load NetHTTPUtils.request_data "https://api.vk.com/method/photos.getById", :POST, form: { photos: id, access_token: ENV["VK_ACCESS_TOKEN"], client_secret: ENV["VK_CLIENT_SECRET"], v: "5.101" }
|
248
248
|
json.fetch("response").tap do |r|
|
data/test.rb
CHANGED
@@ -396,6 +396,7 @@ describe DirectLink do
|
|
396
396
|
] ],
|
397
397
|
[ :vk, [
|
398
398
|
["https://vk.com/id57030827?z=photo57030827_456241143", [1920, 1440, "https://sun9-66.userapi.com/c845322/v845322944/167836/bP9z41BybhI.jpg"]],
|
399
|
+
["https://vk.com/id57030827?z=photo57030827_456241143%2Falbum57030827_0", [1920, 1440, "https://sun9-66.userapi.com/c845322/v845322944/167836/bP9z41BybhI.jpg"]],
|
399
400
|
] ],
|
400
401
|
].each do |method, tests|
|
401
402
|
describe method do
|