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)