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 @@ @@ -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,7 +26,6 @@ @@ -25,7 +26,6 @@
# 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
@ -36,37 +36,35 @@ class kickasstorrents(object): @@ -36,37 +36,35 @@ class kickasstorrents(object):
supported_categories = {'all': '', 'movies': 'Movies', 'tv': 'TV', 'music': 'Music', 'games': 'Games', 'software': 'Applications'}
def __init__(self):
self.results = []
pass
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 = []
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
results = json_dict['list']
for r in results:
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
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['desc_link'] = r['link'].replace('http://', 'https://')
res_dict['engine_url'] = self.url
prettyPrinter(res_dict)
except:
pass
i += 1

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

@ -1,7 +1,7 @@ @@ -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

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

@ -1,5 +1,6 @@ @@ -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,7 +26,6 @@ @@ -25,7 +26,6 @@
# 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
@ -36,37 +36,35 @@ class kickasstorrents(object): @@ -36,37 +36,35 @@ class kickasstorrents(object):
supported_categories = {'all': '', 'movies': 'Movies', 'tv': 'TV', 'music': 'Music', 'games': 'Games', 'software': 'Applications'}
def __init__(self):
self.results = []
pass
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 = []
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
results = json_dict['list']
for r in results:
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
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['desc_link'] = r['link'].replace('http://', 'https://')
res_dict['engine_url'] = self.url
prettyPrinter(res_dict)
except:
pass
i += 1

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

@ -1,7 +1,7 @@ @@ -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

Loading…
Cancel
Save