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

master
Бородин Роман 2020-05-06 22:23:27 +03:00
parent c4e6d7763e
commit 2bb8f0e60f
2 changed files with 4 additions and 3 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.torrenter3" name="Torrenter3" provider-name="inpos" version="3.2.0"> <addon id="plugin.video.torrenter3" name="Torrenter3" provider-name="inpos" version="3.2.1">
<requires> <requires>
<import addon="xbmc.python" version="2.25.0"/> <import addon="xbmc.python" version="2.25.0"/>
<import addon="script.module.pyrrent2http"/> <import addon="script.module.pyrrent2http" version="1.0.0"/>
<import addon="script.module.codequick" version="0.9.6"/> <import addon="script.module.codequick" version="0.9.6"/>
<import addon="script.module.pysocks" version="1.0.0"/> <import addon="script.module.pysocks" version="1.0.0"/>
<import addon="script.module.win_inet_pton" version="1.0.0"/> <import addon="script.module.win_inet_pton" version="1.0.0"/>
@ -22,6 +22,7 @@
<email>roman@ukamnya.ru</email> <email>roman@ukamnya.ru</email>
<platform>all</platform> <platform>all</platform>
<language>en_GB ru_RU</language> <language>en_GB ru_RU</language>
<news>- 3.2.1: Fix wrong torrent size for rutracker</news>
<news>- 3.2.0: Add searcher rutracker.org. Add socks-proxy for trackers</news> <news>- 3.2.0: Add searcher rutracker.org. Add socks-proxy for trackers</news>
<news>- 3.1.0: Add searcher kinozal.tv</news> <news>- 3.1.0: Add searcher kinozal.tv</news>
<news>- 3.0.1: First rewrited version</news> <news>- 3.0.1: First rewrited version</news>

View File

@ -27,7 +27,7 @@ class SearchEngine(Searcher):
seeders_el = r.find('.//*[@class="seedmed"]') seeders_el = r.find('.//*[@class="seedmed"]')
seeders = int(seeders_el.text.strip() if seeders_el is not None else 0) seeders = int(seeders_el.text.strip() if seeders_el is not None else 0)
leachers = int(list(filter(lambda x: 'leechmed' in x.attrib['class'], r.findall('.//td')))[0].text.strip()) leachers = int(list(filter(lambda x: 'leechmed' in x.attrib['class'], r.findall('.//td')))[0].text.strip())
size = ' '.join(list(filter(lambda x: 't-title' in x.attrib['class'], r.findall('.//td')))[0].find('.//a').text.strip().split(' ')[:2]) size = ' '.join(list(filter(lambda x: 'tor-size' in x.attrib['class'], r.findall('.//td')))[0].find('.//a').text.strip().split(' ')[:2])
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['rutracker_login'] user = option['rutracker_login']