2019-05-25 15:40:52 +00:00
|
|
|
|
# -*- coding: utf-8 -*-
|
2019-09-17 02:04:27 +00:00
|
|
|
|
from __future__ import absolute_import
|
2022-11-09 07:38:50 +00:00
|
|
|
|
|
2019-05-25 15:40:52 +00:00
|
|
|
|
import logging
|
2021-03-28 18:32:21 +00:00
|
|
|
|
import re
|
2019-05-25 15:40:52 +00:00
|
|
|
|
import time
|
|
|
|
|
|
|
|
|
|
from requests import Session
|
2022-11-09 07:38:50 +00:00
|
|
|
|
from six.moves import range
|
2019-05-25 15:40:52 +00:00
|
|
|
|
from subliminal import __short_version__
|
2020-04-03 17:18:44 +00:00
|
|
|
|
from subliminal.providers import ParserBeautifulSoup
|
2022-11-09 07:38:50 +00:00
|
|
|
|
from subliminal.video import Episode
|
|
|
|
|
from subliminal.video import Movie
|
2020-02-07 14:01:26 +00:00
|
|
|
|
from subliminal_patch.exceptions import APIThrottled
|
2020-04-03 17:18:44 +00:00
|
|
|
|
from subliminal_patch.providers import Provider
|
2022-04-19 00:17:51 +00:00
|
|
|
|
from subliminal_patch.providers.utils import get_archive_from_bytes
|
|
|
|
|
from subliminal_patch.providers.utils import get_subtitle_from_archive
|
|
|
|
|
from subliminal_patch.providers.utils import update_matches
|
2022-11-09 07:38:50 +00:00
|
|
|
|
from subliminal_patch.subtitle import Subtitle
|
|
|
|
|
from subzero.language import Language
|
2019-05-25 15:40:52 +00:00
|
|
|
|
|
2021-12-30 19:31:59 +00:00
|
|
|
|
_SERVER_URL = "https://www.subdivx.com"
|
2021-03-28 18:32:21 +00:00
|
|
|
|
|
2021-06-06 13:57:29 +00:00
|
|
|
|
_CLEAN_TITLE_RES = [
|
2021-03-28 18:32:21 +00:00
|
|
|
|
(r"subt[ií]tulos de", ""),
|
|
|
|
|
(r"´|`", "'"),
|
|
|
|
|
(r" {2,}", " "),
|
|
|
|
|
]
|
|
|
|
|
|
2022-10-20 00:06:00 +00:00
|
|
|
|
_SPANISH_RE = re.compile(r"españa|ib[eé]rico|castellano|gallego|castilla")
|
2021-12-30 19:41:16 +00:00
|
|
|
|
_YEAR_RE = re.compile(r"(\(\d{4}\))")
|
2022-11-09 07:38:50 +00:00
|
|
|
|
|
|
|
|
|
|
2022-10-20 23:42:25 +00:00
|
|
|
|
_SERIES_RE = re.compile(
|
|
|
|
|
r"\(?\d{4}\)?|(s\d{1,2}(e\d{1,2})?|(season|temporada)\s\d{1,2}).*?$",
|
|
|
|
|
flags=re.IGNORECASE,
|
|
|
|
|
)
|
|
|
|
|
_EPISODE_NUM_RE = re.compile(r"[eE](?P<x>\d{1,2})")
|
|
|
|
|
_SEASON_NUM_RE = re.compile(
|
|
|
|
|
r"(s|(season|temporada)\s)(?P<x>\d{1,2})", flags=re.IGNORECASE
|
|
|
|
|
)
|
2022-11-09 07:38:50 +00:00
|
|
|
|
_EPISODE_YEAR_RE = re.compile(r"\((?P<x>(19\d{2}|20[0-2]\d))\)")
|
2022-10-20 23:42:25 +00:00
|
|
|
|
_UNSUPPORTED_RE = re.compile(
|
|
|
|
|
r"(\)?\d{4}\)?|[sS]\d{1,2})\s.{,3}(extras|forzado(s)?|forced)", flags=re.IGNORECASE
|
|
|
|
|
)
|
2021-12-30 19:41:16 +00:00
|
|
|
|
|
2019-05-25 15:40:52 +00:00
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SubdivxSubtitle(Subtitle):
|
2021-01-25 21:18:32 +00:00
|
|
|
|
provider_name = "subdivx"
|
2019-05-25 15:40:52 +00:00
|
|
|
|
hash_verifiable = False
|
|
|
|
|
|
2022-01-12 04:15:57 +00:00
|
|
|
|
def __init__(
|
|
|
|
|
self, language, video, page_link, title, description, uploader, download_url
|
|
|
|
|
):
|
2021-01-25 21:18:32 +00:00
|
|
|
|
super(SubdivxSubtitle, self).__init__(
|
|
|
|
|
language, hearing_impaired=False, page_link=page_link
|
|
|
|
|
)
|
2020-04-03 17:18:44 +00:00
|
|
|
|
self.video = video
|
2022-06-21 05:44:24 +00:00
|
|
|
|
|
2022-01-12 04:15:57 +00:00
|
|
|
|
self.download_url = download_url
|
2020-03-28 19:34:39 +00:00
|
|
|
|
self.uploader = uploader
|
2022-06-21 05:44:24 +00:00
|
|
|
|
|
2022-10-20 00:06:00 +00:00
|
|
|
|
self._title = str(title).strip()
|
|
|
|
|
self._description = str(description).strip()
|
|
|
|
|
|
|
|
|
|
self.release_info = self._title
|
2022-06-21 05:44:24 +00:00
|
|
|
|
|
2022-10-20 00:06:00 +00:00
|
|
|
|
if self._description:
|
|
|
|
|
self.release_info += " | " + self._description
|
2019-05-25 15:40:52 +00:00
|
|
|
|
|
|
|
|
|
@property
|
|
|
|
|
def id(self):
|
2019-09-21 12:09:11 +00:00
|
|
|
|
return self.page_link
|
2019-05-25 15:40:52 +00:00
|
|
|
|
|
|
|
|
|
def get_matches(self, video):
|
|
|
|
|
matches = set()
|
|
|
|
|
|
|
|
|
|
# episode
|
|
|
|
|
if isinstance(video, Episode):
|
2022-10-20 00:06:00 +00:00
|
|
|
|
# already matched within provider
|
2021-01-25 21:18:32 +00:00
|
|
|
|
matches.update(["title", "series", "season", "episode", "year"])
|
2019-05-25 15:40:52 +00:00
|
|
|
|
|
|
|
|
|
# movie
|
|
|
|
|
elif isinstance(video, Movie):
|
2022-10-20 00:06:00 +00:00
|
|
|
|
# already matched within provider
|
2021-01-25 21:18:32 +00:00
|
|
|
|
matches.update(["title", "year"])
|
|
|
|
|
|
2022-10-20 00:06:00 +00:00
|
|
|
|
update_matches(matches, video, self._description)
|
2019-05-25 15:40:52 +00:00
|
|
|
|
|
2022-01-12 04:15:57 +00:00
|
|
|
|
# Don't lowercase; otherwise it will match a lot of false positives
|
2022-10-20 00:06:00 +00:00
|
|
|
|
if video.release_group and video.release_group in self._description:
|
2022-01-12 04:15:57 +00:00
|
|
|
|
matches.add("release_group")
|
|
|
|
|
|
2019-05-25 15:40:52 +00:00
|
|
|
|
return matches
|
|
|
|
|
|
|
|
|
|
|
2022-01-12 04:15:57 +00:00
|
|
|
|
_IDUSER_COOKIE = "VkZaRk9WQlJQVDA12809"
|
|
|
|
|
|
|
|
|
|
|
2019-05-25 15:40:52 +00:00
|
|
|
|
class SubdivxSubtitlesProvider(Provider):
|
2021-01-25 21:18:32 +00:00
|
|
|
|
provider_name = "subdivx"
|
2019-05-25 15:40:52 +00:00
|
|
|
|
hash_verifiable = False
|
2021-06-06 13:57:29 +00:00
|
|
|
|
languages = {Language("spa", "MX")} | {Language.fromalpha2("es")}
|
2021-11-10 03:55:47 +00:00
|
|
|
|
video_types = (Episode, Movie)
|
2019-05-25 15:40:52 +00:00
|
|
|
|
subtitle_class = SubdivxSubtitle
|
|
|
|
|
|
|
|
|
|
multi_result_throttle = 2
|
|
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
|
self.session = None
|
|
|
|
|
|
|
|
|
|
def initialize(self):
|
|
|
|
|
self.session = Session()
|
2021-01-25 21:18:32 +00:00
|
|
|
|
self.session.headers["User-Agent"] = f"Subliminal/{__short_version__}"
|
2022-01-12 04:15:57 +00:00
|
|
|
|
self.session.cookies.update({"iduser_cookie": _IDUSER_COOKIE})
|
2019-05-25 15:40:52 +00:00
|
|
|
|
|
|
|
|
|
def terminate(self):
|
|
|
|
|
self.session.close()
|
|
|
|
|
|
2020-04-03 17:18:44 +00:00
|
|
|
|
def query(self, video, languages):
|
2022-04-19 00:17:51 +00:00
|
|
|
|
subtitles = []
|
|
|
|
|
|
2020-04-03 17:18:44 +00:00
|
|
|
|
if isinstance(video, Episode):
|
2022-10-20 00:06:00 +00:00
|
|
|
|
# TODO: cache pack queries (TV SHOW S01).
|
2022-10-19 05:17:54 +00:00
|
|
|
|
# Too many redundant server calls.
|
|
|
|
|
|
2022-04-19 00:17:51 +00:00
|
|
|
|
for query in (
|
|
|
|
|
f"{video.series} S{video.season:02}E{video.episode:02}",
|
|
|
|
|
f"{video.series} S{video.season:02}",
|
|
|
|
|
):
|
|
|
|
|
subtitles += self._handle_multi_page_search(query, video)
|
2022-10-19 05:17:54 +00:00
|
|
|
|
|
2022-10-20 00:06:00 +00:00
|
|
|
|
# Try only with series title
|
|
|
|
|
if len(subtitles) <= 5:
|
|
|
|
|
subtitles += self._handle_multi_page_search(video.series, video, 1)
|
|
|
|
|
|
2020-04-03 17:18:44 +00:00
|
|
|
|
else:
|
2022-05-20 19:03:03 +00:00
|
|
|
|
for query in (video.title, f"{video.title} ({video.year})"):
|
|
|
|
|
subtitles += self._handle_multi_page_search(query, video)
|
|
|
|
|
# Second query is a fallback
|
|
|
|
|
if subtitles:
|
|
|
|
|
break
|
2022-04-19 00:17:51 +00:00
|
|
|
|
|
|
|
|
|
return subtitles
|
2019-05-25 15:40:52 +00:00
|
|
|
|
|
2022-10-20 23:42:25 +00:00
|
|
|
|
def _handle_multi_page_search(self, query, video, max_loops=2):
|
2019-05-25 15:40:52 +00:00
|
|
|
|
params = {
|
2021-12-30 19:31:59 +00:00
|
|
|
|
"buscar2": query,
|
|
|
|
|
"accion": "5",
|
|
|
|
|
"masdesc": "",
|
|
|
|
|
"subtitulos": "1",
|
|
|
|
|
"realiza_b": "1",
|
2022-06-21 05:44:24 +00:00
|
|
|
|
"pg": 1,
|
2019-05-25 15:40:52 +00:00
|
|
|
|
}
|
2022-04-19 00:17:51 +00:00
|
|
|
|
logger.debug("Query: %s", query)
|
2019-05-25 15:40:52 +00:00
|
|
|
|
|
2022-04-19 00:17:51 +00:00
|
|
|
|
loops = 1
|
|
|
|
|
max_loops_not_met = True
|
2019-05-25 15:40:52 +00:00
|
|
|
|
|
2022-04-19 00:17:51 +00:00
|
|
|
|
while max_loops_not_met:
|
|
|
|
|
max_loops_not_met = loops < max_loops
|
2019-05-25 15:40:52 +00:00
|
|
|
|
|
2022-10-20 00:06:00 +00:00
|
|
|
|
page_subtitles, last_page = self._get_page_subtitles(params, video)
|
2022-04-19 00:17:51 +00:00
|
|
|
|
|
2022-10-20 00:06:00 +00:00
|
|
|
|
logger.debug("Yielding %d subtitles [loop #%d]", len(page_subtitles), loops)
|
2022-04-19 00:17:51 +00:00
|
|
|
|
yield from page_subtitles
|
2019-05-25 15:40:52 +00:00
|
|
|
|
|
2022-10-20 00:06:00 +00:00
|
|
|
|
if last_page:
|
|
|
|
|
logger.debug("Last page for '%s' query. Breaking loop", query)
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
loops += 1
|
2020-03-28 19:34:39 +00:00
|
|
|
|
|
2021-01-25 21:18:32 +00:00
|
|
|
|
params["pg"] += 1 # search next page
|
2020-03-28 19:34:39 +00:00
|
|
|
|
time.sleep(self.multi_result_throttle)
|
2019-05-25 15:40:52 +00:00
|
|
|
|
|
2022-10-20 00:06:00 +00:00
|
|
|
|
if not max_loops_not_met:
|
2022-10-20 23:42:25 +00:00
|
|
|
|
logger.debug("Max loops limit exceeded (%d)", max_loops)
|
2022-10-20 00:06:00 +00:00
|
|
|
|
|
2022-04-19 00:17:51 +00:00
|
|
|
|
def _get_page_subtitles(self, params, video):
|
|
|
|
|
search_link = f"{_SERVER_URL}/index.php"
|
|
|
|
|
response = self.session.get(
|
|
|
|
|
search_link, params=params, allow_redirects=True, timeout=20
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
try:
|
2022-10-20 00:06:00 +00:00
|
|
|
|
page_subtitles, last_page = self._parse_subtitles_page(video, response)
|
2022-04-19 00:17:51 +00:00
|
|
|
|
except Exception as error:
|
|
|
|
|
logger.error(f"Error parsing subtitles list: {error}")
|
|
|
|
|
return []
|
|
|
|
|
|
2022-10-20 00:06:00 +00:00
|
|
|
|
return page_subtitles, last_page
|
2019-05-25 15:40:52 +00:00
|
|
|
|
|
|
|
|
|
def list_subtitles(self, video, languages):
|
2020-04-03 17:18:44 +00:00
|
|
|
|
return self.query(video, languages)
|
2019-05-25 15:40:52 +00:00
|
|
|
|
|
|
|
|
|
def download_subtitle(self, subtitle):
|
2021-12-30 19:31:59 +00:00
|
|
|
|
# download the subtitle
|
2022-10-20 00:06:00 +00:00
|
|
|
|
logger.debug("Downloading subtitle %r", subtitle)
|
2019-09-21 12:09:11 +00:00
|
|
|
|
|
2021-12-30 19:31:59 +00:00
|
|
|
|
# download zip / rar file with the subtitle
|
|
|
|
|
response = self.session.get(
|
2022-01-12 04:15:57 +00:00
|
|
|
|
subtitle.download_url,
|
2021-12-30 19:31:59 +00:00
|
|
|
|
headers={"Referer": subtitle.page_link},
|
|
|
|
|
timeout=30,
|
|
|
|
|
)
|
|
|
|
|
response.raise_for_status()
|
2019-05-25 15:40:52 +00:00
|
|
|
|
|
2022-04-19 00:17:51 +00:00
|
|
|
|
# TODO: add MustGetBlacklisted support
|
|
|
|
|
|
|
|
|
|
archive = get_archive_from_bytes(response.content)
|
|
|
|
|
if archive is None:
|
|
|
|
|
raise APIThrottled("Unknwon compressed format")
|
|
|
|
|
|
|
|
|
|
episode = None
|
|
|
|
|
if isinstance(subtitle.video, Episode):
|
|
|
|
|
episode = subtitle.video.episode
|
2019-05-25 15:40:52 +00:00
|
|
|
|
|
2022-04-19 00:17:51 +00:00
|
|
|
|
subtitle.content = get_subtitle_from_archive(archive, episode=episode)
|
2019-09-22 15:24:02 +00:00
|
|
|
|
|
2022-04-19 00:17:51 +00:00
|
|
|
|
def _parse_subtitles_page(self, video, response):
|
2019-09-22 15:24:02 +00:00
|
|
|
|
subtitles = []
|
|
|
|
|
|
2021-01-25 21:18:32 +00:00
|
|
|
|
page_soup = ParserBeautifulSoup(
|
|
|
|
|
response.content.decode("utf-8", "ignore"), ["lxml", "html.parser"]
|
|
|
|
|
)
|
|
|
|
|
title_soups = page_soup.find_all("div", {"id": "menu_detalle_buscador"})
|
|
|
|
|
body_soups = page_soup.find_all("div", {"id": "buscador_detalle"})
|
2022-10-20 00:06:00 +00:00
|
|
|
|
|
|
|
|
|
title_checker = _check_episode if isinstance(video, Episode) else _check_movie
|
2019-09-22 15:24:02 +00:00
|
|
|
|
|
|
|
|
|
for subtitle in range(0, len(title_soups)):
|
|
|
|
|
title_soup, body_soup = title_soups[subtitle], body_soups[subtitle]
|
|
|
|
|
# title
|
2021-12-30 19:41:16 +00:00
|
|
|
|
title = _clean_title(title_soup.find("a").text)
|
|
|
|
|
|
2022-10-20 23:42:25 +00:00
|
|
|
|
if _UNSUPPORTED_RE.search(title):
|
|
|
|
|
logger.debug("Skipping unsupported subtitles: %s", title)
|
2021-12-30 19:41:16 +00:00
|
|
|
|
continue
|
|
|
|
|
|
2022-10-20 00:06:00 +00:00
|
|
|
|
if not title_checker(video, title):
|
2021-12-30 19:41:16 +00:00
|
|
|
|
continue
|
2020-10-11 19:40:48 +00:00
|
|
|
|
|
2021-06-06 13:57:29 +00:00
|
|
|
|
# Data
|
|
|
|
|
datos = body_soup.find("div", {"id": "buscador_detalle_sub_datos"}).text
|
|
|
|
|
# Ignore multi-disc and non-srt subtitles
|
|
|
|
|
if not any(item in datos for item in ("Cds:</b> 1", "SubRip")):
|
|
|
|
|
continue
|
|
|
|
|
|
2020-03-28 19:34:39 +00:00
|
|
|
|
# description
|
2021-06-06 13:57:29 +00:00
|
|
|
|
sub_details = body_soup.find("div", {"id": "buscador_detalle_sub"}).text
|
2022-01-12 04:15:57 +00:00
|
|
|
|
description = sub_details.replace(",", " ")
|
2020-03-28 19:34:39 +00:00
|
|
|
|
|
2022-05-03 18:47:16 +00:00
|
|
|
|
# language
|
2022-09-27 21:21:13 +00:00
|
|
|
|
spain = (
|
|
|
|
|
"/pais/7.gif" in datos
|
|
|
|
|
or _SPANISH_RE.search(description.lower()) is not None
|
|
|
|
|
)
|
2022-05-03 18:47:16 +00:00
|
|
|
|
language = Language.fromalpha2("es") if spain else Language("spa", "MX")
|
|
|
|
|
|
2020-03-28 19:34:39 +00:00
|
|
|
|
# uploader
|
2021-01-25 21:18:32 +00:00
|
|
|
|
uploader = body_soup.find("a", {"class": "link1"}).text
|
2022-01-12 04:15:57 +00:00
|
|
|
|
download_url = _get_download_url(body_soup)
|
2021-06-06 13:57:29 +00:00
|
|
|
|
page_link = title_soup.find("a")["href"]
|
2019-05-25 15:40:52 +00:00
|
|
|
|
|
2021-01-25 21:18:32 +00:00
|
|
|
|
subtitle = self.subtitle_class(
|
2022-01-12 04:15:57 +00:00
|
|
|
|
language, video, page_link, title, description, uploader, download_url
|
2021-01-25 21:18:32 +00:00
|
|
|
|
)
|
2019-09-22 15:24:02 +00:00
|
|
|
|
|
2021-01-25 21:18:32 +00:00
|
|
|
|
logger.debug("Found subtitle %r", subtitle)
|
2019-09-22 15:24:02 +00:00
|
|
|
|
subtitles.append(subtitle)
|
|
|
|
|
|
2022-10-20 00:06:00 +00:00
|
|
|
|
return subtitles, len(title_soups) < 100
|
2019-09-22 15:24:02 +00:00
|
|
|
|
|
2020-10-03 23:41:41 +00:00
|
|
|
|
|
2021-12-30 19:31:59 +00:00
|
|
|
|
def _clean_title(title):
|
|
|
|
|
"""
|
|
|
|
|
Normalize apostrophes and spaces to avoid matching problems
|
|
|
|
|
(e.g. Subtitulos de Carlito´s Way -> Carlito's Way)
|
|
|
|
|
"""
|
|
|
|
|
for og, new in _CLEAN_TITLE_RES:
|
|
|
|
|
title = re.sub(og, new, title, flags=re.IGNORECASE)
|
|
|
|
|
|
|
|
|
|
return title
|
|
|
|
|
|
|
|
|
|
|
2022-01-12 04:15:57 +00:00
|
|
|
|
def _get_download_url(data):
|
|
|
|
|
try:
|
|
|
|
|
return [
|
|
|
|
|
a_.get("href")
|
|
|
|
|
for a_ in data.find_all("a")
|
|
|
|
|
if "bajar.php" in a_.get("href", "n/a")
|
|
|
|
|
][0]
|
|
|
|
|
except IndexError:
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
|
2022-10-20 00:06:00 +00:00
|
|
|
|
def _check_episode(video, title):
|
2022-10-20 23:42:25 +00:00
|
|
|
|
ep_num = _EPISODE_NUM_RE.search(title)
|
|
|
|
|
season_num = _SEASON_NUM_RE.search(title)
|
2022-11-09 07:38:50 +00:00
|
|
|
|
year = _EPISODE_YEAR_RE.search(title)
|
|
|
|
|
|
|
|
|
|
# Only check if both video and Subdivx's title have year metadata
|
|
|
|
|
if year is not None and video.year:
|
|
|
|
|
year = int(year.group("x"))
|
|
|
|
|
# Tolerancy of 1 year difference
|
|
|
|
|
if abs(year - (video.year or 0)) > 1:
|
|
|
|
|
logger.debug("Series year doesn't match: %s", title)
|
|
|
|
|
return False
|
2022-10-20 23:42:25 +00:00
|
|
|
|
|
|
|
|
|
if season_num is None:
|
|
|
|
|
logger.debug("Not a season/episode: %s", title)
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
season_num = int(season_num.group("x"))
|
|
|
|
|
|
|
|
|
|
if ep_num is not None:
|
|
|
|
|
ep_num = int(ep_num.group("x"))
|
|
|
|
|
|
|
|
|
|
ep_matches = (
|
|
|
|
|
(video.episode == ep_num) or (ep_num is None)
|
|
|
|
|
) and season_num == video.season
|
|
|
|
|
|
2022-10-20 00:06:00 +00:00
|
|
|
|
series_title = _SERIES_RE.sub("", title).strip()
|
|
|
|
|
|
|
|
|
|
distance = abs(len(series_title) - len(video.series))
|
|
|
|
|
|
2022-10-20 23:42:25 +00:00
|
|
|
|
series_matched = distance < 4 and ep_matches
|
2022-10-20 00:06:00 +00:00
|
|
|
|
|
|
|
|
|
logger.debug(
|
2022-10-20 23:42:25 +00:00
|
|
|
|
"Series matched? %s [%s -> %s] [title distance: %d]",
|
2022-10-20 00:06:00 +00:00
|
|
|
|
series_matched,
|
2022-10-20 23:42:25 +00:00
|
|
|
|
video,
|
|
|
|
|
title,
|
2022-10-20 00:06:00 +00:00
|
|
|
|
distance,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
return series_matched
|
|
|
|
|
|
|
|
|
|
|
2021-12-30 19:41:16 +00:00
|
|
|
|
def _check_movie(video, title):
|
|
|
|
|
if str(video.year) not in title:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
aka_split = re.split("aka", title, flags=re.IGNORECASE)
|
|
|
|
|
|
|
|
|
|
alt_title = None
|
|
|
|
|
if len(aka_split) == 2:
|
|
|
|
|
alt_title = aka_split[-1].strip()
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
actual_movie_title = _YEAR_RE.split(title)[0].strip()
|
|
|
|
|
except IndexError:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
all_titles = [
|
|
|
|
|
v_title.lower() for v_title in [video.title, *video.alternative_titles]
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
actual_movie_title.lower() in all_titles
|
|
|
|
|
or (alt_title or "").lower() in all_titles
|
|
|
|
|
)
|