From 6c9bb44c4baace7aa31f2385f270cbf535b0fa78 Mon Sep 17 00:00:00 2001 From: Bezleputh Date: Sun, 31 Aug 2014 20:24:45 +0200 Subject: [PATCH] [opensubtitles] fix #1295 --- modules/opensubtitles/pages.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/opensubtitles/pages.py b/modules/opensubtitles/pages.py index 174bc402..b7b08487 100644 --- a/modules/opensubtitles/pages.py +++ b/modules/opensubtitles/pages.py @@ -41,7 +41,7 @@ class SearchPage(BasePage): if len(links) > 0: a = links[0] url = a.attrib.get('href', '') - if "ads.opensubtitles" not in url: + if "ads2.opensubtitles" not in url: self.browser.location("http://www.opensubtitles.org%s" % url) assert self.browser.is_on_page(SubtitlesPage) or self.browser.is_on_page(SubtitlePage) # subtitles page does the job @@ -107,9 +107,8 @@ class SubtitlePage(BasePage): """ def get_subtitle(self): desc = NotAvailable - father = self.parser.select(self.document.getroot(), 'a#app_link', 1).getparent() - a = self.parser.select(father, 'a')[1] - id = a.attrib.get('href', '').split('/')[-1] + a = self.parser.select(self.document.getroot(), 'a#bt-dwl', 1) + id = a.attrib.get('rel', '').split('/')[-1] m = re.match('Download \((\w+)\)', self.parser.tocleanstring(a)) if m: ext = m.group(1)