diff --git a/addon.py b/addon.py index 6429f78..cf74c92 100644 --- a/addon.py +++ b/addon.py @@ -72,7 +72,7 @@ def search(plugin, search_query, thumb=None): for p, se in zip(range(0, 100, 100 / len(search_in)), search_in): progress.update(p, line1=se.name) found_items.extend(se().search(search_query)) - open('/tmp/t.t', 'w').write(repr(list(map(lambda x: x.url, found_items)))) + #open('/tmp/t.t', 'w').write(repr(list(map(lambda x: x.url, found_items)))) res_items = [] for i in sorted(found_items, key=lambda x: x.seeders, reverse=True): if '2160p' in i.title: hd = '[2160p/{}] '.format(i.size) diff --git a/resources/lib/searchers/kinozal.py b/resources/lib/searchers/kinozal.py index 655299c..aa3eb17 100644 --- a/resources/lib/searchers/kinozal.py +++ b/resources/lib/searchers/kinozal.py @@ -6,7 +6,7 @@ from codequick.listing import local_image # @UnresolvedImport class SearchEngine(Searcher): base_url = option['kinozal_url'] - search_path = '/browse.php?s={}&g=0&c=0&v=0&d=0&w=0&t=1&f=0' + search_path = '/browse.php?s={}&t=1' name = 'Kinozal.tv' icon = 'searcher_kinozal.png' enabled = option.get_boolean('kinozal_enable') # @UndefinedVariable @@ -27,9 +27,10 @@ class SearchEngine(Searcher): title = link.text seeders = int(r.find('.//td[@class="sl_s"]').text.strip()) leachers = int(r.find('.//td[@class="sl_p"]').text.strip()) - size = list(filter(lambda x: x.text.strip().endswith((u'ГБ', u'МБ')), + size_l = list(filter(lambda x: x.text.strip().endswith((u'ГБ', u'МБ')), r.findall('.//td[@class="s"]')) - )[0].text.strip() + ) + size = size_l[0].text.strip() if len(size_l) else '0' yield ResultItem(url, title, size, seeders, leachers, self.icon, self.cookies, self.base_url) def login(self): user = option['kinozal_login'] diff --git a/resources/lib/searchers/rutracker.py b/resources/lib/searchers/rutracker.py index b0a6a26..6c1dbd0 100644 --- a/resources/lib/searchers/rutracker.py +++ b/resources/lib/searchers/rutracker.py @@ -6,7 +6,7 @@ from codequick.listing import local_image # @UnresolvedImport class SearchEngine(Searcher): base_url = option['rutracker_url'] - search_path = '/forum/tracker.php?nm={}' + search_path = '/forum/tracker.php?nm={}&o=10&s=2' name = 'RuTracker.org' icon = 'searcher_rutracker.png' enabled = option.get_boolean('rutracker_enable') # @UndefinedVariable