ZMediumToMarkdown 2.5.0 → 2.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/Request.rb +1 -15
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c16ac0a5062f690cf0d57960b5921599e254c609b249c7e55929f7c925fb89c
|
4
|
+
data.tar.gz: d571bfe350ecffc3a9ab79028d81fe76383f97c21dc2a46b81a6ccd194623e5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0bff21c619bed3182c7142bbf4b8f56cf975314f5d852d0032182715e6ea51a805245e4e490b8d55b21a593c9b983df1b0ec9c975a7e9570e221ccc340df4ef
|
7
|
+
data.tar.gz: 94574f5cc07a86bd0897efb99538352a664e01483586f102a5440862bf4a90d9907a3868e122f78883e3eafed56e8a0117664037fd33675c66d3fa9929d1ec20
|
data/lib/Request.rb
CHANGED
@@ -27,21 +27,7 @@ class Request
|
|
27
27
|
end
|
28
28
|
|
29
29
|
response = https.request(request);
|
30
|
-
|
31
|
-
cookies = response.get_fields('set-cookie').map { |cookie| cookie.split('; ').first }.each_with_object({}) do |cookie, hash|
|
32
|
-
key, value = cookie.split('=', 2) # Split by '=' into key and value
|
33
|
-
hash[key] = value
|
34
|
-
end;
|
35
|
-
|
36
|
-
if !cookies['uid'].nil?
|
37
|
-
$cookie_uid = cookies['uid'];
|
38
|
-
end
|
39
|
-
|
40
|
-
if !cookies['sid'].nil?
|
41
|
-
$cookie_sid = cookies['sid'];
|
42
|
-
end
|
43
|
-
|
44
|
-
puts response
|
30
|
+
|
45
31
|
# 3XX Redirect
|
46
32
|
if response.code.to_i == 429
|
47
33
|
raise "Error: Too Manay Reqeust, blocked by Medium.\n####################\n### Please try again later.\n### Ref: https://zhgchg.li/posts/en-medium-to-jekyll/#paywall-posts-require-a-medium-account-with-access-permissions-and-cookies-author-or-medium-member \n####################\n### ERROR URL: #{url}"
|