|
|
@ -1,5 +1,6 @@ |
|
|
|
#VERSION: 1.27 |
|
|
|
#VERSION: 1.28 |
|
|
|
#AUTHORS: Christophe Dumez (chris@qbittorrent.org) |
|
|
|
#AUTHORS: Christophe Dumez (chris@qbittorrent.org) |
|
|
|
|
|
|
|
#CONTRIBUTORS: Diego de las Heras (diegodelasheras@gmail.com) |
|
|
|
|
|
|
|
|
|
|
|
# Redistribution and use in source and binary forms, with or without |
|
|
|
# Redistribution and use in source and binary forms, with or without |
|
|
|
# modification, are permitted provided that the following conditions are met: |
|
|
|
# modification, are permitted provided that the following conditions are met: |
|
|
@ -25,48 +26,45 @@ |
|
|
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
|
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
|
|
# POSSIBILITY OF SUCH DAMAGE. |
|
|
|
# POSSIBILITY OF SUCH DAMAGE. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from novaprinter import prettyPrinter |
|
|
|
from novaprinter import prettyPrinter |
|
|
|
from helpers import retrieve_url, download_file |
|
|
|
from helpers import retrieve_url, download_file |
|
|
|
import json |
|
|
|
import json |
|
|
|
|
|
|
|
|
|
|
|
class kickasstorrents(object): |
|
|
|
class kickasstorrents(object): |
|
|
|
url = 'https://kat.cr' |
|
|
|
url = 'https://kat.cr' |
|
|
|
name = 'Kickass Torrents' |
|
|
|
name = 'Kickass Torrents' |
|
|
|
supported_categories = {'all': '', 'movies': 'Movies', 'tv': 'TV', 'music': 'Music', 'games': 'Games', 'software': 'Applications'} |
|
|
|
supported_categories = {'all': '', 'movies': 'Movies', 'tv': 'TV', 'music': 'Music', 'games': 'Games', 'software': 'Applications'} |
|
|
|
|
|
|
|
|
|
|
|
def __init__(self): |
|
|
|
def __init__(self): |
|
|
|
self.results = [] |
|
|
|
pass |
|
|
|
|
|
|
|
|
|
|
|
def download_torrent(self, info): |
|
|
|
def download_torrent(self, info): |
|
|
|
print(download_file(info, info)) |
|
|
|
print(download_file(info, info)) |
|
|
|
|
|
|
|
|
|
|
|
def search(self, what, cat='all'): |
|
|
|
def search(self, what, cat='all'): |
|
|
|
ret = [] |
|
|
|
i = 1 |
|
|
|
i = 1 |
|
|
|
while True and i < 11: |
|
|
|
while True and i<11: |
|
|
|
json_data = retrieve_url(self.url+'/json.php?q=%s&page=%d'%(what, i)) |
|
|
|
results = [] |
|
|
|
try: |
|
|
|
json_data = retrieve_url(self.url+'/json.php?q=%s&page=%d'%(what, i)) |
|
|
|
json_dict = json.loads(json_data) |
|
|
|
try: |
|
|
|
except: |
|
|
|
json_dict = json.loads(json_data) |
|
|
|
i += 1 |
|
|
|
except: |
|
|
|
continue |
|
|
|
i += 1 |
|
|
|
if int(json_dict['total_results']) <= 0: |
|
|
|
continue |
|
|
|
return |
|
|
|
if int(json_dict['total_results']) <= 0: return |
|
|
|
for r in json_dict['list']: |
|
|
|
results = json_dict['list'] |
|
|
|
try: |
|
|
|
for r in results: |
|
|
|
if cat != 'all' and self.supported_categories[cat] != r['category']: |
|
|
|
try: |
|
|
|
continue |
|
|
|
if cat != 'all' and self.supported_categories[cat] != r['category']: continue |
|
|
|
res_dict = dict() |
|
|
|
res_dict = dict() |
|
|
|
res_dict['name'] = r['title'] |
|
|
|
res_dict['name'] = r['title'] |
|
|
|
res_dict['size'] = str(r['size']) |
|
|
|
res_dict['size'] = str(r['size']) |
|
|
|
res_dict['seeds'] = r['seeds'] |
|
|
|
res_dict['seeds'] = r['seeds'] |
|
|
|
res_dict['leech'] = r['leechs'] |
|
|
|
res_dict['leech'] = r['leechs'] |
|
|
|
res_dict['link'] = r['torrentLink'] |
|
|
|
res_dict['link'] = r['torrentLink'] |
|
|
|
res_dict['desc_link'] = r['link'].replace('http://', 'https://') |
|
|
|
res_dict['desc_link'] = r['link'] |
|
|
|
res_dict['engine_url'] = self.url |
|
|
|
res_dict['engine_url'] = self.url |
|
|
|
prettyPrinter(res_dict) |
|
|
|
prettyPrinter(res_dict) |
|
|
|
except: |
|
|
|
except: |
|
|
|
pass |
|
|
|
pass |
|
|
|
i += 1 |
|
|
|
i += 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|