1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-08-13 16:53:54 -04:00

Updated KAT urls

This commit is contained in:
echel0n 2014-12-11 14:58:25 -08:00
parent d337d73e27
commit 7339ab9224
2 changed files with 22 additions and 4 deletions

View File

@ -1457,4 +1457,22 @@ def generateApiKey(*args, **kwargs):
# Return a hex digest of the md5, eg 49f68a5c8493ec2c0bf489821c21fc3b
logger.log(u"New API generated")
return m.hexdigest()
return m.hexdigest()
def pretty_filesize(file_bytes):
file_bytes = float(file_bytes)
if file_bytes >= 1099511627776:
terabytes = file_bytes / 1099511627776
size = '%.2f TB' % terabytes
elif file_bytes >= 1073741824:
gigabytes = file_bytes / 1073741824
size = '%.2f GB' % gigabytes
elif file_bytes >= 1048576:
megabytes = file_bytes / 1048576
size = '%.2f MB' % megabytes
elif file_bytes >= 1024:
kilobytes = file_bytes / 1024
size = '%.2f KB' % kilobytes
else:
size = '%.2f b' % file_bytes
return size

View File

@ -61,7 +61,7 @@ class KATProvider(generic.TorrentProvider):
self.cache = KATCache(self)
self.urls = ['http://kickass.so/', 'http://katproxy.com/', 'http://www.kickmirror.com/']
self.urls = ['http://kickass.so/', 'http://katproxy.com/', 'http://www.kickass.to/']
def isEnabled(self):
return self.enabled
@ -241,11 +241,11 @@ class KATProvider(generic.TorrentProvider):
link = item['link']
id = item['guid']
title = item['title']
url = item['torrent_magnetURI']
url = item['torrent_magneturi']
verified = bool(item['torrent_verified'] or 0)
seeders = int(item['torrent_seeds'])
leechers = int(item['torrent_peers'])
size = int(item['torrent_contentLength'])
size = int(item['torrent_contentlength'])
except (AttributeError, TypeError):
continue