diff options
author | morpheus65535 <[email protected]> | 2024-07-09 10:01:17 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2024-07-09 10:01:17 -0400 |
commit | 032e8b812d1b8c96ddb8902ae31803b6827c66f6 (patch) | |
tree | 0ca5cabd56dfaa4aef8354634c7fc88e3f9d5cf8 /custom_libs | |
parent | a15b8d560252a953999976343b7665c533570365 (diff) | |
download | bazarr-032e8b812d1b8c96ddb8902ae31803b6827c66f6.tar.gz bazarr-032e8b812d1b8c96ddb8902ae31803b6827c66f6.zip |
no log: small improvement to subdl languages conversion
Diffstat (limited to 'custom_libs')
-rw-r--r-- | custom_libs/subliminal_patch/providers/subdl.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/custom_libs/subliminal_patch/providers/subdl.py b/custom_libs/subliminal_patch/providers/subdl.py index 3c2d2ce7d..794625d15 100644 --- a/custom_libs/subliminal_patch/providers/subdl.py +++ b/custom_libs/subliminal_patch/providers/subdl.py @@ -27,8 +27,6 @@ retry_timeout = 5 language_converters.register('subdl = subliminal_patch.converters.subdl:SubdlConverter') -supported_languages = list(language_converters['subdl'].to_subdl.keys()) - class SubdlSubtitle(Subtitle): provider_name = 'subdl' @@ -91,7 +89,7 @@ class SubdlProvider(ProviderRetryMixin, Provider): """Subdl Provider""" server_hostname = 'api.subdl.com' - languages = {Language(*lang) for lang in supported_languages} + languages = {Language(*lang) for lang in list(language_converters['subdl'].to_subdl.keys())} languages.update(set(Language.rebuild(lang, forced=True) for lang in languages)) languages.update(set(Language.rebuild(l, hi=True) for l in languages)) @@ -130,8 +128,8 @@ class SubdlProvider(ProviderRetryMixin, Provider): imdb_id = self.video.imdb_id # be sure to remove duplicates using list(set()) - langs_list = sorted(list(set([language_converters['subdl'].to_subdl[(lang.alpha3, lang.country, lang.script)] - for lang in languages]))) + langs_list = sorted(list(set([language_converters['subdl'].convert(lang.alpha3, lang.country, lang.script) for + lang in languages]))) langs = ','.join(langs_list) logger.debug(f'Searching for those languages: {langs}') |