mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-01-01 12:32:25 +08:00
Fix for #1062
This commit is contained in:
parent
1d0d6821eb
commit
c323cd8518
2 changed files with 9 additions and 15 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
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
|
||||
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")
|
||||
if str(year) in t.div.a.string:
|
||||
url = SITE_DOMAIN + t.div.a.get("href")
|
||||
break
|
||||
|
||||
return Film.from_url(url, session=session)
|
||||
|
||||
|
|
Loading…
Reference in a new issue