download_tv 2.6.8 → 2.6.10

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
  SHA256:
3
- metadata.gz: 8220befd4c805752e34c0d67d992fb6a2ba16c901131304c0c630a1c02908340
4
- data.tar.gz: 99f28d45aecd2738f941e49befc895b3e4228e9b5403f53886811d617abf2e85
3
+ metadata.gz: '003218a860babed3e80f3e3c49d0ec1b34b5cb4ccd5f3d76e6cb22c7d1bba398'
4
+ data.tar.gz: 6f0f5d1b4fc0837cfdfa04b0a6d9cc1a3af93488d13b3f571de7813beb65e0c7
5
5
  SHA512:
6
- metadata.gz: 70e69b388a88a2764d129fafaab67a55b0ac222c6c03b64562ed84cd5b3b3a278dd29876161ee2a7f7949185fbf8ec0ae2f47fc04a11ce375f2c656764b31a1e
7
- data.tar.gz: cb9897a14a4dc1a3341a94751525240b93d6cfbbeef8d14231fe3d7f5688e15f2942091d90d6fd105e9eea0b18c18f36f8ad3491b4642e3f7eefaa7039e2c00e
6
+ metadata.gz: 20aa26d49b8227b6243f408d8946a0646d26f2ee4621605fa09c6ec4945a74775b6980622722652c40deb3414708610a938f34d623c790249738245c201b884e
7
+ data.tar.gz: e0a7a099cd21b7e5e8a9ee477bdd20a2bd5da61f5ed3a33d0d2adc0e6878b31c6bfedade3e7880c3006afd284800a85e88119b8608ae2ba10671d1d687d80850
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # download_tv CHANGELOG
2
2
 
3
+ ## 2.6.10 (2023-03-16)
4
+
5
+ * Fixes
6
+ * Bug fixes on the TorrentAPI grabber.
7
+
8
+ ## 2.6.9 (2023-03-08)
9
+
10
+ * Fixes
11
+ * Bug fixes on the TorrentAPI grabber.
12
+
3
13
  ## 2.6.8 (2022-12-02)
4
14
 
5
15
  * Improvements
@@ -12,8 +12,9 @@ module DownloadTV
12
12
  super('https://torrentapi.org/pubapi_v2.php?'\
13
13
  'mode=search&search_string=%s&token=%s&'\
14
14
  'app_id=DownloadTV&sort=seeders')
15
- @wait = 0.5
15
+ @wait = 1.5
16
16
  @token = nil
17
+ @retries_left = 5
17
18
  end
18
19
 
19
20
  ##
@@ -63,7 +64,7 @@ module DownloadTV
63
64
  obj = request_and_parse(search)
64
65
  end
65
66
 
66
- while obj['error_code'] == TOO_MANY_REQUESTS_ERROR || obj.has_key?('rate_limit')
67
+ until obj['error_code'] != TOO_MANY_REQUESTS_ERROR && (obj['rate_limit'].nil? || obj['rate_limit'] == false)
67
68
  sleep(@wait)
68
69
  obj = request_and_parse(search)
69
70
  end
@@ -75,10 +76,12 @@ module DownloadTV
75
76
 
76
77
  names.zip(links)
77
78
  rescue Mechanize::ResponseCodeError => e
78
- if e.response_code == '429'
79
+ if (e.response_code == '429' || e.response_code == '520') && @retries_left > 0
79
80
  sleep(@wait)
81
+ @retries_left -= 1
80
82
  retry
81
83
  end
84
+ raise NoTorrentsError
82
85
  end
83
86
  end
84
87
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DownloadTV
4
- VERSION = '2.6.8'
4
+ VERSION = '2.6.10'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: download_tv
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.8
4
+ version: 2.6.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - guille
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-02 00:00:00.000000000 Z
11
+ date: 2023-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler