From f925488373d92f5dcc381e39757a3ae7ac1e6a33 Mon Sep 17 00:00:00 2001 From: echel0n Date: Wed, 9 Jul 2014 01:26:45 -0700 Subject: [PATCH] KickAss torrents now uses multiple urls to try from incase one goes down. --- sickbeard/providers/kat.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/sickbeard/providers/kat.py b/sickbeard/providers/kat.py index 12000c4c..21d5e088 100644 --- a/sickbeard/providers/kat.py +++ b/sickbeard/providers/kat.py @@ -64,9 +64,7 @@ class KATProvider(generic.TorrentProvider): self.cache = KATCache(self) - self.url = 'http://kickass.to/' - - self.searchurl = self.url + 'usearch/%s/?field=seeders&sorder=desc' #order by seed + self.urls = ['http://kickass.to/', 'http://katproxy.com'] def isEnabled(self): return self.enabled @@ -232,14 +230,18 @@ class KATProvider(generic.TorrentProvider): for mode in search_params.keys(): for search_string in search_params[mode]: - if mode != 'RSS': - searchURL = self.searchurl % (urllib.quote(unidecode(search_string))) - logger.log(u"Search string: " + searchURL, logger.DEBUG) - else: - searchURL = self.url + 'tv/?field=time_add&sorder=desc' - logger.log(u"KAT cache update URL: " + searchURL, logger.DEBUG) + for url in self.urls: + if mode != 'RSS': + searchURL = url + 'usearch/%s/?field=seeders&sorder=desc' % (urllib.quote(unidecode(search_string))) + logger.log(u"Search string: " + searchURL, logger.DEBUG) + else: + searchURL = url + 'tv/?field=time_add&sorder=desc' + logger.log(u"KAT cache update URL: " + searchURL, logger.DEBUG) + + html = self.getURL(searchURL) + if html: + break - html = self.getURL(searchURL) if not html: continue