Fix PiSexy for vip user class.

This commit is contained in:
JackDandy 2016-10-29 19:21:02 +01:00
parent 26c6a7be9c
commit 4222190aa7
2 changed files with 6 additions and 2 deletions

View file

@ -219,6 +219,7 @@
* Change logging for newznab response code 910 and add check for empty response data
* Change improve reverse proxy web_root support
* Fix "error trying to retrieve image" from tvdb due to there is no image to fetch
* Fix PiSexy for vip user class
### 0.11.16 (2016-10-16 17:30:00 UTC)

View file

@ -73,12 +73,15 @@ class PiSexyProvider(generic.TorrentProvider):
if 2 > len(torrent_rows):
raise generic.HaltParseException
header = torrent_rows[0].find_all('td')
peers_td = ([x.get_text().strip().lower() for x in header].index('see/lee') - len(header))
size_td = ([x.get_text().strip().lower() for x in header].index('size'))
for tr in torrent_rows[1:]:
cells = tr.find_all('td')
if 5 > len(cells):
continue
try:
seeders, leechers = 2 * [cells[-4].get_text().strip()]
seeders, leechers = 2 * [cells[peers_td].get_text().strip()]
seeders, leechers = [tryInt(n) for n in [
rc['seeders'].findall(seeders)[0], rc['leechers'].findall(leechers)[0]]]
if self._peers_fail(mode, seeders, leechers) or not tr.find('a', href=rc['valid_cat']) \
@ -87,7 +90,7 @@ class PiSexyProvider(generic.TorrentProvider):
info = tr.find('a', href=rc['info'])
title = (rc['title'].sub('', info.attrs.get('title', '')) or info.get_text()).strip()
size = cells[3].get_text().strip()
size = cells[size_td].get_text().strip()
download_url = self._link(tr.find('a', href=rc['get'])['href'])
except (AttributeError, TypeError, ValueError, KeyError, IndexError):
continue