Fixed improper subtitles being downloaded when HI is required by languages profile. #2293

pull/2304/head v1.3.2-beta.11
morpheus65535 1 year ago
parent cb3a274894
commit 0f19d79fa2

@ -40,7 +40,7 @@ def generate_subtitles(path, languages, audio_language, sceneName, title, media_
providers = pool.providers
language_set = _get_language_obj(languages=languages)
hi_required = any([x.hi for x in language_set])
hi_required = "force HI" if any([x.hi for x in language_set]) else False
also_forced = any([x.forced for x in language_set])
forced_required = all([x.forced for x in language_set])
_set_forced_providers(pool=pool, also_forced=also_forced, forced_required=forced_required)

@ -32,6 +32,7 @@ tags.Language = Language
class EmbeddedSubtitle(Subtitle):
provider_name = "embeddedsubtitles"
hash_verifiable = False
hearing_impaired_verifiable = True
def __init__(self, stream, container, matches, media_type):
super().__init__(stream.language, stream.disposition.hearing_impaired)

@ -20,6 +20,7 @@ _BASE_URL = "https://api.gestdown.info"
class GestdownSubtitle(Subtitle):
provider_name = "gestdown"
hash_verifiable = False
hearing_impaired_verifiable = True
def __init__(self, language, data: dict):
super().__init__(language, hearing_impaired=data["hearingImpaired"])

@ -23,6 +23,7 @@ logger = logging.getLogger(__name__)
class HDBitsSubtitle(Subtitle):
provider_name = "hdbits"
hash_verifiable = False
hearing_impaired_verifiable = True
def __init__(self, language, id, name, filename, matches=None, episode=None):
super().__init__(language, hearing_impaired=language.hi)

@ -74,7 +74,8 @@ def from_opensubtitlescom(lang):
class OpenSubtitlesComSubtitle(Subtitle):
provider_name = 'opensubtitlescom'
hash_verifiable = False
hash_verifiable = True
hearing_impaired_verifiable = True
def __init__(self, language, forced, hearing_impaired, page_link, file_id, releases, uploader, title, year,
hash_matched, file_hash=None, season=None, episode=None, imdb_match=False):

@ -29,6 +29,7 @@ logger = logging.getLogger(__name__)
class YifySubtitle(Subtitle):
"""YIFY Subtitles"""
provider_name = 'yifysubtitles'
hearing_impaired_verifiable = True
def __init__(self, language, page_link, release, uploader, rating, hi):
super(YifySubtitle, self).__init__(language)

Loading…
Cancel
Save