From 9a9893decc2627e5760eaab557603a2c2b183f8c Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli <nicolas.martinelli@gmail.com> Date: Tue, 12 May 2015 20:46:35 +0200 Subject: [PATCH] EZTV Provider: browse possible links found in the homepage magnet, extratorrent (download_1) or rarbg (download_3) --- sickbeard/providers/eztv.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/sickbeard/providers/eztv.py b/sickbeard/providers/eztv.py index c2151217..e648b590 100644 --- a/sickbeard/providers/eztv.py +++ b/sickbeard/providers/eztv.py @@ -109,18 +109,20 @@ class EZTVProvider(generic.TorrentProvider): for entries in resultsTable: title = entries.find('a', attrs={'class': 'epinfo'}).contents[0] - link = entries.find('a', attrs={'class': 'magnet'}) or entries.find('a', attrs={'class': 'download_1'}) - if link: - link = link.get('href') - else: - continue + for link_type in ('magnet', 'download_1', 'download_3'): + link = entries.find('a', attrs={'class': link_type}) + if link: + link = link.get('href') + else: + continue - item = { - 'title': title, - 'link': link, - } + item = { + 'title': title, + 'link': link, + } - items[mode].append(item) + items[mode].append(item) + continue except Exception, e: logger.log(u"Failed parsing " + self.name + " Traceback: " + traceback.format_exc(), -- GitLab