lib/download_tv/grabbers/torrentapi.rb in download_tv-2.6.0 vs lib/download_tv/grabbers/torrentapi.rb in download_tv-2.6.1
- old
+ new
@@ -19,16 +19,18 @@
# Specific implementation for TorrentAPI (requires token)
def online?
@agent.read_timeout = 2
renew_token
true
- rescue Mechanize::ResponseCodeError, Net::HTTP::Persistent::Error => e
+ rescue Mechanize::ResponseCodeError => e
if e.response_code == '429'
sleep(@wait)
retry
else
false
end
+ rescue Net::HTTP::Persistent::Error => e
+ false
end
##
# Makes a get request tp the given url.
# Returns the JSON response parsed into a hash