download_tv 2.4.3 → 2.4.4

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: 0af99a48106973261cbe72aa5ba52b15282533b9c411ebfe23e1efbb8d847d9f
4
- data.tar.gz: fb02bd92c7308fd9800e1b8c0029334e06ef9b296a5ceb47bd6369013e553ec6
3
+ metadata.gz: 6e4cddc01c5bc6770c7a837f9d9eb1174e0f93af7db253ff37d3556f95e4a74c
4
+ data.tar.gz: 97e4a77fcafb4169098284e2fcb552c1ebc9de980efe2809c557b3f54ef2fbe8
5
5
  SHA512:
6
- metadata.gz: 97ecf94a1fcd2fc3efd1e748b998e54302d894b69822b4864e8659c467f020d4435b86662f9db0fa584f3b58a5e6fb03f7d95fefb77e293d78e69f6379b444de
7
- data.tar.gz: 344c702622eebef1dbd4bdaddcbd06af281c465c4ee2d0723da5f0a4c551a9c8610eea852ffb49e0d610dbd03a7e85f1e8a5c6708e8891cca345f625e20891ad
6
+ metadata.gz: 86ea0bb76eec8f246e127ba00e3bec996b0e76b5858e354ebdf5c11d6c815e5a01616313101552290916bf66f77a26702276f35b2470345cab4d0556bbf7d458
7
+ data.tar.gz: 5428be080cfa6d23a78efb2cbbd1e31dfe1e1d320c85683e4906b3e71657ba05c609c126efe917de4a8d398b0a8ba9bcc6645c61005f8b303585f789a591d7c7
@@ -8,14 +8,14 @@ module DownloadTV
8
8
 
9
9
  def initialize
10
10
  super('https://torrentapi.org/pubapi_v2.php?mode=search&search_string=%s&token=%s&app_id=DownloadTV')
11
- @wait = 2.1
11
+ @wait = 0.1
12
12
  end
13
13
 
14
14
  ##
15
15
  # Specific implementation for TorrentAPI (requires token)
16
16
  def online?
17
17
  @agent.read_timeout = 2
18
- @agent.head(format(@url, 'test', 'test'))
18
+ renew_token
19
19
  true
20
20
  rescue Mechanize::ResponseCodeError, Net::HTTP::Persistent::Error
21
21
  false
@@ -60,6 +60,14 @@ module DownloadTV
60
60
  links = obj['torrent_results'].collect { |i| i['download'] }
61
61
 
62
62
  names.zip(links)
63
+ rescue Mechanize::ResponseCodeError => e
64
+ if e.response_code == '429'
65
+ sleep(@wait)
66
+ retry
67
+ else
68
+ warn 'An unexpected error has occurred. Try updating the gem.'
69
+ exit 1
70
+ end
63
71
  end
64
72
  end
65
73
  end
@@ -1,3 +1,3 @@
1
1
  module DownloadTV
2
- VERSION = '2.4.3'.freeze
2
+ VERSION = '2.4.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: download_tv
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.3
4
+ version: 2.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - guille