|
|
|
@ -99,14 +99,15 @@ class SuchaProvider(Provider):
|
|
|
|
|
result.raise_for_status()
|
|
|
|
|
|
|
|
|
|
results = result.json()
|
|
|
|
|
if isinstance(result, dict):
|
|
|
|
|
logger.debug("No subtitles found")
|
|
|
|
|
return []
|
|
|
|
|
|
|
|
|
|
subtitles = []
|
|
|
|
|
for item in results:
|
|
|
|
|
matches = set()
|
|
|
|
|
title = item.get("title", "").lower()
|
|
|
|
|
alt_title = item.get("alt_title", title).lower()
|
|
|
|
|
if not title:
|
|
|
|
|
logger.debug("No subtitles found")
|
|
|
|
|
return []
|
|
|
|
|
|
|
|
|
|
if any(video.title.lower() in item for item in (title, alt_title)):
|
|
|
|
|
matches.add("title")
|
|
|
|
@ -117,7 +118,7 @@ class SuchaProvider(Provider):
|
|
|
|
|
if is_episode and any(
|
|
|
|
|
q["query"].lower() in item for item in (title, alt_title)
|
|
|
|
|
):
|
|
|
|
|
matches.update("title", "series", "season", "episode", "year")
|
|
|
|
|
matches.update(("title", "series", "season", "episode", "year"))
|
|
|
|
|
|
|
|
|
|
subtitles.append(
|
|
|
|
|
SuchaSubtitle(
|
|
|
|
|