From a1658bbf3271f66295ca8106eabfa2ab842cdb17 Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Sun, 20 Oct 2024 23:26:01 -0400 Subject: [PATCH] Added support for Spanish (Latino) in opensubtitles.com. #2720 --- custom_libs/subliminal_patch/providers/opensubtitlescom.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/custom_libs/subliminal_patch/providers/opensubtitlescom.py b/custom_libs/subliminal_patch/providers/opensubtitlescom.py index 14289919a..0f0c2eaff 100644 --- a/custom_libs/subliminal_patch/providers/opensubtitlescom.py +++ b/custom_libs/subliminal_patch/providers/opensubtitlescom.py @@ -54,6 +54,7 @@ def fix_movie_naming(title): custom_languages = { 'pt': 'pt-PT', 'zh': 'zh-CN', + 'es-MX': 'ea', } @@ -156,9 +157,10 @@ class OpenSubtitlesComProvider(ProviderRetryMixin, Provider): """OpenSubtitlesCom Provider""" server_hostname = 'api.opensubtitles.com' - languages = {Language.fromopensubtitles(lang) for lang in language_converters['szopensubtitles'].codes} + languages = ({Language.fromietf("es-MX")} | + {Language.fromopensubtitles(lang) for lang in language_converters['szopensubtitles'].codes}) languages.update(set(Language.rebuild(lang, forced=True) for lang in languages)) - languages.update(set(Language.rebuild(l, hi=True) for l in languages)) + languages.update(set(Language.rebuild(lang, hi=True) for lang in languages)) video_types = (Episode, Movie)