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 +4 -4
- data/lib/download_tv/grabbers/torrentapi.rb +10 -2
- data/lib/download_tv/version.rb +1 -1
- 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: 6e4cddc01c5bc6770c7a837f9d9eb1174e0f93af7db253ff37d3556f95e4a74c
|
4
|
+
data.tar.gz: 97e4a77fcafb4169098284e2fcb552c1ebc9de980efe2809c557b3f54ef2fbe8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 =
|
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
|
-
|
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
|
data/lib/download_tv/version.rb
CHANGED