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