Browse Source

Исправлены проблемы определения размера и добавлена сортировка по сидам

master
Бородин Роман 1 year ago
parent
commit
e5bd0ca668
3 changed files with 6 additions and 5 deletions
  1. +1
    -1
      addon.py
  2. +4
    -3
      resources/lib/searchers/kinozal.py
  3. +1
    -1
      resources/lib/searchers/rutracker.py

+ 1
- 1
addon.py View File

@ -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)

+ 4
- 3
resources/lib/searchers/kinozal.py View File

@ -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']

+ 1
- 1
resources/lib/searchers/rutracker.py View File

@ -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

Loading…
Cancel
Save