pull/1173/head
Louis Vézina 4 years ago
parent 1d0d6821eb
commit c323cd8518

@ -310,7 +310,7 @@ class SubsceneProvider(Provider, ProviderSubtitleArchiveMixin):
# re-search for episodes without explicit release name # re-search for episodes without explicit release name
if isinstance(video, Episode): 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) # term = u"%s S%02iE%02i" % (video.series, video.season, video.episode)
more_than_one = len(titles) > 1 more_than_one = len(titles) > 1
for series in titles: for series in titles:
@ -339,7 +339,7 @@ class SubsceneProvider(Provider, ProviderSubtitleArchiveMixin):
if more_than_one: if more_than_one:
time.sleep(self.search_throttle) time.sleep(self.search_throttle)
else: 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 more_than_one = len(titles) > 1
for title in titles: for title in titles:
logger.debug('Searching for movie results: %r', title) logger.debug('Searching for movie results: %r', title)

@ -243,9 +243,7 @@ def get_first_film(soup, section, year=None, session=None):
url = None url = None
if not 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")
else:
for t in tag.findNext("ul").findAll("li"): for t in tag.findNext("ul").findAll("li"):
if isinstance(t, NavigableString) or not t.div: if isinstance(t, NavigableString) or not t.div:
continue continue
@ -253,10 +251,6 @@ def get_first_film(soup, section, year=None, session=None):
if str(year) in t.div.a.string: if str(year) in t.div.a.string:
url = SITE_DOMAIN + t.div.a.get("href") url = SITE_DOMAIN + t.div.a.get("href")
break 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")
return Film.from_url(url, session=session) return Film.from_url(url, session=session)

Loading…
Cancel
Save