From 650e7018a7a45a864eca5073413faf98faeb91e6 Mon Sep 17 00:00:00 2001 From: ngosang Date: Sat, 27 Jun 2015 16:15:27 +0200 Subject: [PATCH] [search engine] Update KickassTorrents --- .../nova/engines/kickasstorrents.py | 74 +++++++++---------- src/searchengine/nova/engines/versions.txt | 2 +- .../nova3/engines/kickasstorrents.py | 74 +++++++++---------- src/searchengine/nova3/engines/versions.txt | 2 +- 4 files changed, 74 insertions(+), 78 deletions(-) diff --git a/src/searchengine/nova/engines/kickasstorrents.py b/src/searchengine/nova/engines/kickasstorrents.py index d23899456..59bea57be 100644 --- a/src/searchengine/nova/engines/kickasstorrents.py +++ b/src/searchengine/nova/engines/kickasstorrents.py @@ -1,5 +1,6 @@ -#VERSION: 1.27 +#VERSION: 1.28 #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 # 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 # POSSIBILITY OF SUCH DAMAGE. - from novaprinter import prettyPrinter from helpers import retrieve_url, download_file import json class kickasstorrents(object): - url = 'https://kat.cr' - name = 'Kickass Torrents' - supported_categories = {'all': '', 'movies': 'Movies', 'tv': 'TV', 'music': 'Music', 'games': 'Games', 'software': 'Applications'} + url = 'https://kat.cr' + name = 'Kickass Torrents' + supported_categories = {'all': '', 'movies': 'Movies', 'tv': 'TV', 'music': 'Music', 'games': 'Games', 'software': 'Applications'} - def __init__(self): - self.results = [] + def __init__(self): + pass - def download_torrent(self, info): - print download_file(info, info) + def download_torrent(self, info): + print download_file(info, info) - def search(self, what, cat='all'): - ret = [] - i = 1 - while True and i<11: - results = [] - json_data = retrieve_url(self.url+'/json.php?q=%s&page=%d'%(what, i)) - try: - json_dict = json.loads(json_data) - except: - i += 1 - continue - if int(json_dict['total_results']) <= 0: return - results = json_dict['list'] - for r in results: - try: - if cat != 'all' and self.supported_categories[cat] != r['category']: continue - res_dict = dict() - res_dict['name'] = r['title'] - res_dict['size'] = str(r['size']) - res_dict['seeds'] = r['seeds'] - res_dict['leech'] = r['leechs'] - res_dict['link'] = r['torrentLink'] - res_dict['desc_link'] = r['link'] - res_dict['engine_url'] = self.url - prettyPrinter(res_dict) - except: - pass - i += 1 - + def search(self, what, cat='all'): + i = 1 + while True and i < 11: + json_data = retrieve_url(self.url+'/json.php?q=%s&page=%d'%(what, i)) + try: + json_dict = json.loads(json_data) + except: + i += 1 + continue + if int(json_dict['total_results']) <= 0: + return + for r in json_dict['list']: + try: + if cat != 'all' and self.supported_categories[cat] != r['category']: + continue + res_dict = dict() + res_dict['name'] = r['title'] + res_dict['size'] = str(r['size']) + res_dict['seeds'] = r['seeds'] + res_dict['leech'] = r['leechs'] + res_dict['link'] = r['torrentLink'] + res_dict['desc_link'] = r['link'].replace('http://', 'https://') + res_dict['engine_url'] = self.url + prettyPrinter(res_dict) + except: + pass + i += 1 diff --git a/src/searchengine/nova/engines/versions.txt b/src/searchengine/nova/engines/versions.txt index 25b2da2a0..7d5c2378c 100644 --- a/src/searchengine/nova/engines/versions.txt +++ b/src/searchengine/nova/engines/versions.txt @@ -1,7 +1,7 @@ btdigg: 1.25 demonoid: 1.1 extratorrent: 2.0 -kickasstorrents: 1.27 +kickasstorrents: 1.28 legittorrents: 2.00 mininova: 2.00 piratebay: 2.11 diff --git a/src/searchengine/nova3/engines/kickasstorrents.py b/src/searchengine/nova3/engines/kickasstorrents.py index 9cae8a1c4..ea592470a 100644 --- a/src/searchengine/nova3/engines/kickasstorrents.py +++ b/src/searchengine/nova3/engines/kickasstorrents.py @@ -1,5 +1,6 @@ -#VERSION: 1.27 +#VERSION: 1.28 #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 # 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 # POSSIBILITY OF SUCH DAMAGE. - from novaprinter import prettyPrinter from helpers import retrieve_url, download_file import json class kickasstorrents(object): - url = 'https://kat.cr' - name = 'Kickass Torrents' - supported_categories = {'all': '', 'movies': 'Movies', 'tv': 'TV', 'music': 'Music', 'games': 'Games', 'software': 'Applications'} + url = 'https://kat.cr' + name = 'Kickass Torrents' + supported_categories = {'all': '', 'movies': 'Movies', 'tv': 'TV', 'music': 'Music', 'games': 'Games', 'software': 'Applications'} - def __init__(self): - self.results = [] + def __init__(self): + pass - def download_torrent(self, info): - print(download_file(info, info)) + def download_torrent(self, info): + print(download_file(info, info)) - def search(self, what, cat='all'): - ret = [] - i = 1 - while True and i<11: - results = [] - json_data = retrieve_url(self.url+'/json.php?q=%s&page=%d'%(what, i)) - try: - json_dict = json.loads(json_data) - except: - i += 1 - continue - if int(json_dict['total_results']) <= 0: return - results = json_dict['list'] - for r in results: - try: - if cat != 'all' and self.supported_categories[cat] != r['category']: continue - res_dict = dict() - res_dict['name'] = r['title'] - res_dict['size'] = str(r['size']) - res_dict['seeds'] = r['seeds'] - res_dict['leech'] = r['leechs'] - res_dict['link'] = r['torrentLink'] - res_dict['desc_link'] = r['link'] - res_dict['engine_url'] = self.url - prettyPrinter(res_dict) - except: - pass - i += 1 - + def search(self, what, cat='all'): + i = 1 + while True and i < 11: + json_data = retrieve_url(self.url+'/json.php?q=%s&page=%d'%(what, i)) + try: + json_dict = json.loads(json_data) + except: + i += 1 + continue + if int(json_dict['total_results']) <= 0: + return + for r in json_dict['list']: + try: + if cat != 'all' and self.supported_categories[cat] != r['category']: + continue + res_dict = dict() + res_dict['name'] = r['title'] + res_dict['size'] = str(r['size']) + res_dict['seeds'] = r['seeds'] + res_dict['leech'] = r['leechs'] + res_dict['link'] = r['torrentLink'] + res_dict['desc_link'] = r['link'].replace('http://', 'https://') + res_dict['engine_url'] = self.url + prettyPrinter(res_dict) + except: + pass + i += 1 diff --git a/src/searchengine/nova3/engines/versions.txt b/src/searchengine/nova3/engines/versions.txt index 25b2da2a0..7d5c2378c 100644 --- a/src/searchengine/nova3/engines/versions.txt +++ b/src/searchengine/nova3/engines/versions.txt @@ -1,7 +1,7 @@ btdigg: 1.25 demonoid: 1.1 extratorrent: 2.0 -kickasstorrents: 1.27 +kickasstorrents: 1.28 legittorrents: 2.00 mininova: 2.00 piratebay: 2.11