From 685fffbc2536a0fbde9c2dca26ae62c1852970ab Mon Sep 17 00:00:00 2001 From: BillNasty Date: Sat, 21 Feb 2015 06:10:35 -0500 Subject: [PATCH] Possible Fix for Alpha Ratio Possible Fix for alpha ratio per issue #654 --- sickbeard/providers/alpharatio.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/sickbeard/providers/alpharatio.py b/sickbeard/providers/alpharatio.py index a4f5c993..be7fd457 100755 --- a/sickbeard/providers/alpharatio.py +++ b/sickbeard/providers/alpharatio.py @@ -183,17 +183,15 @@ class AlphaRatioProvider(generic.TorrentProvider): for result in torrent_rows[1:]: cells = result.find_all('td') - - link = cells[1].find('a', attrs={'title': 'Download'}) - full_id = link['href'].replace('torrents.php?action=download&id=', '') - torrent_id = full_id.split("&")[0] + link = result.find('a', attrs = {'dir': 'ltr'}) + url = result.find('a', attrs = {'title': 'Download'}) try: - title = cells[1].find('a', attrs={'title': 'View Auto Torrent'}).contents[0] - download_url = self.urls['download'] % (link['href']) - id = torrent_id - seeders = cells[6].contents[0] - leechers = cells[7].contents[0] + title = link.contents[0] + download_url = self.urls['download'] % (url['href']) + id = link['href'].replace('torrents.php?id=', '').split('&')[0] + seeders = cells[len(cells)-2].string + leechers = cells[len(cells)-1].string except (AttributeError, TypeError): continue