diff --git a/libs/subliminal_patch/providers/subscene.py b/libs/subliminal_patch/providers/subscene.py index 69d94f9b9..8868a270a 100644 --- a/libs/subliminal_patch/providers/subscene.py +++ b/libs/subliminal_patch/providers/subscene.py @@ -310,7 +310,7 @@ class SubsceneProvider(Provider, ProviderSubtitleArchiveMixin): # re-search for episodes without explicit release name if isinstance(video, Episode): - titles = list(set([video.series] + video.alternative_series))[:2] + titles = list(set([video.series] + video.alternative_series[:1])) # term = u"%s S%02iE%02i" % (video.series, video.season, video.episode) more_than_one = len(titles) > 1 for series in titles: @@ -339,7 +339,7 @@ class SubsceneProvider(Provider, ProviderSubtitleArchiveMixin): if more_than_one: time.sleep(self.search_throttle) else: - titles = list(set([video.title] + video.alternative_titles))[:2] + titles = list(set([video.title] + video.alternative_titles[:1])) more_than_one = len(titles) > 1 for title in titles: logger.debug('Searching for movie results: %r', title) diff --git a/libs/subscene_api/subscene.py b/libs/subscene_api/subscene.py index 086d31d98..e91f6fdef 100644 --- a/libs/subscene_api/subscene.py +++ b/libs/subscene_api/subscene.py @@ -243,20 +243,14 @@ def get_first_film(soup, section, year=None, session=None): url = None - if not year: - url = SITE_DOMAIN + tag.findNext("ul").find("li").div.a.get("href") - else: - for t in tag.findNext("ul").findAll("li"): - if isinstance(t, NavigableString) or not t.div: - continue - - if str(year) in t.div.a.string: - url = SITE_DOMAIN + t.div.a.get("href") - break - if not url: - # fallback to non-year results - logger.info("Falling back to non-year results as year wasn't found (%s)", year) - url = SITE_DOMAIN + tag.findNext("ul").find("li").div.a.get("href") + url = SITE_DOMAIN + tag.findNext("ul").find("li").div.a.get("href") + for t in tag.findNext("ul").findAll("li"): + if isinstance(t, NavigableString) or not t.div: + continue + + if str(year) in t.div.a.string: + url = SITE_DOMAIN + t.div.a.get("href") + break return Film.from_url(url, session=session)