From c45f4bdd3ddbf5265987d68c1bce3156b5dcf369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=BE=D1=80=D0=BE=D0=B4=D0=B8=D0=BD=20=D0=A0=D0=BE?= =?UTF-8?q?=D0=BC=D0=B0=D0=BD?= Date: Wed, 22 May 2019 12:22:03 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=B2=D0=B5=D1=80=D0=BD=D0=BE=20?= =?UTF-8?q?=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B0=D0=BB=D1=81?= =?UTF-8?q?=D1=8F=20=D1=80=D0=B0=D0=B7=D0=BC=D0=B5=D1=80=20=D0=B2=20kinoza?= =?UTF-8?q?l=20=D0=B8=20=D0=BD=D0=B5=D0=B2=D0=B5=D1=80=D0=BD=D0=BE=20?= =?UTF-8?q?=D0=B2=D1=8B=D0=B1=D0=B8=D1=80=D0=B0=D0=BB=D1=81=D1=8F=20=D0=B8?= =?UTF-8?q?=D0=BD=D0=B4=D0=B5=D0=BA=D1=81=20=D1=84=D0=B0=D0=B9=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .project | 17 +++++++++++++++++ addon.py | 5 +++-- resources/lib/searchers/kinozal.py | 4 +--- 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 .project diff --git a/.project b/.project new file mode 100644 index 0000000..679201d --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + plugin.video.torrenter3 + + + + + + org.python.pydev.PyDevBuilder + + + + + + org.python.pydev.pythonNature + + diff --git a/addon.py b/addon.py index d7a0e11..6552e87 100644 --- a/addon.py +++ b/addon.py @@ -105,7 +105,8 @@ def open_torrent(plugin, url='--back--', cookies={}, referer='', path=''): if not tf: yield False t_full_path = store_torrent_file(tf) e = get_engine(t_full_path) - files = sorted(list(filter(lambda x: x.name.decode('utf-8').startswith(path) and x.name.decode('utf-8').lower().endswith(video_extensions), e.list_from_info(media_types=['video']))), + files = sorted(list(filter( + lambda x: x.name.decode('utf-8').startswith(path) and x.name.decode('utf-8').lower().endswith(video_extensions), e.list_from_info(media_types=['video']))), key=lambda x: x.name) dirs = list(set(list(map( lambda x: x.name.decode('utf-8')[len(path):].lstrip('/').split('/')[0], filter( lambda x: len(x.name.decode('utf-8')[len(path):].lstrip('/').split('/')) > 1, files ) )))) for d in sorted(dirs): @@ -123,7 +124,7 @@ def open_torrent(plugin, url='--back--', cookies={}, referer='', path=''): if len(p) == 1: item = Listitem.from_dict(play_file, '{} ({:.3f} GB)'.format(p[0], f.size / 1024.0 / 1024.0 /1024.0), - params={'t_full_path': t_full_path, 'f_index': i} + params={'t_full_path': t_full_path, 'f_index': f.index} ) item.art.local_thumb('video.png') yield item diff --git a/resources/lib/searchers/kinozal.py b/resources/lib/searchers/kinozal.py index 61d8299..bc0fdf3 100644 --- a/resources/lib/searchers/kinozal.py +++ b/resources/lib/searchers/kinozal.py @@ -27,11 +27,9 @@ 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( - list(filter(lambda x: x.text.strip().endswith((u'ГБ', u'МБ')), + size = list(filter(lambda x: x.text.strip().endswith((u'ГБ', u'МБ')), r.findall('.//td[@class="s"]')) )[0].text.strip() - )[0].strip() yield ResultItem(url, title, size, seeders, leachers, self.icon, self.cookies, self.base_url) def login(self): user = option['kinozal_login']