Browse Source

Merge pull request #3312 from ngosang/kickassimp

[search engine] Update KickassTorrents
adaptive-webui-19844
sledgehammer999 10 years ago
parent
commit
bcfb8f1f53
  1. 22
      src/searchengine/nova/engines/kickasstorrents.py
  2. 2
      src/searchengine/nova/engines/versions.txt
  3. 22
      src/searchengine/nova3/engines/kickasstorrents.py
  4. 2
      src/searchengine/nova3/engines/versions.txt

22
src/searchengine/nova/engines/kickasstorrents.py

@ -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,7 +26,6 @@
# 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
@ -36,37 +36,35 @@ class kickasstorrents(object):
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:
results = []
json_data = retrieve_url(self.url+'/json.php?q=%s&page=%d'%(what, i)) json_data = retrieve_url(self.url+'/json.php?q=%s&page=%d'%(what, i))
try: try:
json_dict = json.loads(json_data) json_dict = json.loads(json_data)
except: except:
i += 1 i += 1
continue continue
if int(json_dict['total_results']) <= 0: return if int(json_dict['total_results']) <= 0:
results = json_dict['list'] return
for r in results: for r in json_dict['list']:
try: try:
if cat != 'all' and self.supported_categories[cat] != r['category']: 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'] res_dict['desc_link'] = r['link'].replace('http://', 'https://')
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

2
src/searchengine/nova/engines/versions.txt

@ -1,7 +1,7 @@
btdigg: 1.25 btdigg: 1.25
demonoid: 1.1 demonoid: 1.1
extratorrent: 2.0 extratorrent: 2.0
kickasstorrents: 1.27 kickasstorrents: 1.28
legittorrents: 2.00 legittorrents: 2.00
mininova: 2.00 mininova: 2.00
piratebay: 2.11 piratebay: 2.11

22
src/searchengine/nova3/engines/kickasstorrents.py

@ -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,7 +26,6 @@
# 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
@ -36,37 +36,35 @@ class kickasstorrents(object):
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:
results = []
json_data = retrieve_url(self.url+'/json.php?q=%s&page=%d'%(what, i)) json_data = retrieve_url(self.url+'/json.php?q=%s&page=%d'%(what, i))
try: try:
json_dict = json.loads(json_data) json_dict = json.loads(json_data)
except: except:
i += 1 i += 1
continue continue
if int(json_dict['total_results']) <= 0: return if int(json_dict['total_results']) <= 0:
results = json_dict['list'] return
for r in results: for r in json_dict['list']:
try: try:
if cat != 'all' and self.supported_categories[cat] != r['category']: 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'] res_dict['desc_link'] = r['link'].replace('http://', 'https://')
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

2
src/searchengine/nova3/engines/versions.txt

@ -1,7 +1,7 @@
btdigg: 1.25 btdigg: 1.25
demonoid: 1.1 demonoid: 1.1
extratorrent: 2.0 extratorrent: 2.0
kickasstorrents: 1.27 kickasstorrents: 1.28
legittorrents: 2.00 legittorrents: 2.00
mininova: 2.00 mininova: 2.00
piratebay: 2.11 piratebay: 2.11

Loading…
Cancel
Save