Неверно отображался размер в kinozal и неверно выбирался индекс файла
parent
1e0556a525
commit
c45f4bdd3d
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>plugin.video.torrenter3</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.python.pydev.PyDevBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.python.pydev.pythonNature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
5
addon.py
5
addon.py
|
@ -105,7 +105,8 @@ def open_torrent(plugin, url='--back--', cookies={}, referer='', path=''):
|
||||||
if not tf: yield False
|
if not tf: yield False
|
||||||
t_full_path = store_torrent_file(tf)
|
t_full_path = store_torrent_file(tf)
|
||||||
e = get_engine(t_full_path)
|
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)
|
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 ) ))))
|
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):
|
for d in sorted(dirs):
|
||||||
|
@ -123,7 +124,7 @@ def open_torrent(plugin, url='--back--', cookies={}, referer='', path=''):
|
||||||
if len(p) == 1:
|
if len(p) == 1:
|
||||||
item = Listitem.from_dict(play_file,
|
item = Listitem.from_dict(play_file,
|
||||||
'{} ({:.3f} GB)'.format(p[0], f.size / 1024.0 / 1024.0 /1024.0),
|
'{} ({:.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')
|
item.art.local_thumb('video.png')
|
||||||
yield item
|
yield item
|
||||||
|
|
|
@ -27,11 +27,9 @@ class SearchEngine(Searcher):
|
||||||
title = link.text
|
title = link.text
|
||||||
seeders = int(r.find('.//td[@class="sl_s"]').text.strip())
|
seeders = int(r.find('.//td[@class="sl_s"]').text.strip())
|
||||||
leachers = int(r.find('.//td[@class="sl_p"]').text.strip())
|
leachers = int(r.find('.//td[@class="sl_p"]').text.strip())
|
||||||
size = list(
|
size = list(filter(lambda x: x.text.strip().endswith((u'ГБ', u'МБ')),
|
||||||
list(filter(lambda x: x.text.strip().endswith((u'ГБ', u'МБ')),
|
|
||||||
r.findall('.//td[@class="s"]'))
|
r.findall('.//td[@class="s"]'))
|
||||||
)[0].text.strip()
|
)[0].text.strip()
|
||||||
)[0].strip()
|
|
||||||
yield ResultItem(url, title, size, seeders, leachers, self.icon, self.cookies, self.base_url)
|
yield ResultItem(url, title, size, seeders, leachers, self.icon, self.cookies, self.base_url)
|
||||||
def login(self):
|
def login(self):
|
||||||
user = option['kinozal_login']
|
user = option['kinozal_login']
|
||||||
|
|
Loading…
Reference in New Issue