From 4222190aa71db9f183b2cc2dbd55cf05467ac3bd Mon Sep 17 00:00:00 2001 From: JackDandy Date: Sat, 29 Oct 2016 19:21:02 +0100 Subject: [PATCH] Fix PiSexy for vip user class. --- CHANGES.md | 1 + sickbeard/providers/pisexy.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 4b92ccc5..66ad5a4c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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) diff --git a/sickbeard/providers/pisexy.py b/sickbeard/providers/pisexy.py index 5fe5cf01..6beaed5a 100644 --- a/sickbeard/providers/pisexy.py +++ b/sickbeard/providers/pisexy.py @@ -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