1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-10 19:35:08 -05:00

KickAss torrents now uses multiple urls to try from incase one goes down.

This commit is contained in:
echel0n 2014-07-09 01:26:45 -07:00
parent d6225dd8d3
commit f925488373

View File

@ -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]:
for url in self.urls:
if mode != 'RSS':
searchURL = self.searchurl % (urllib.quote(unidecode(search_string)))
searchURL = url + 'usearch/%s/?field=seeders&sorder=desc' % (urllib.quote(unidecode(search_string)))
logger.log(u"Search string: " + searchURL, logger.DEBUG)
else:
searchURL = self.url + 'tv/?field=time_add&sorder=desc'
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
if not html:
continue