From 5e0433834e16dfbc1c7184fd2116b2d7a79db631 Mon Sep 17 00:00:00 2001 From: Anderson Shindy Oki Date: Thu, 25 Apr 2024 09:27:04 +0900 Subject: Fixed animetosho provider empty subtitle name. #2468 --- custom_libs/subliminal_patch/providers/animetosho.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'custom_libs/subliminal_patch/providers/animetosho.py') diff --git a/custom_libs/subliminal_patch/providers/animetosho.py b/custom_libs/subliminal_patch/providers/animetosho.py index 25b1ea95b..f242c420f 100644 --- a/custom_libs/subliminal_patch/providers/animetosho.py +++ b/custom_libs/subliminal_patch/providers/animetosho.py @@ -141,8 +141,9 @@ class AnimeToshoProvider(Provider, ProviderSubtitleArchiveMixin): lang = Language.fromalpha3b(subtitle_file['info']['lang']) # For Portuguese and Portuguese Brazilian they both share the same code, the name is the only - # identifier AnimeTosho provides. - if lang.alpha3 == 'por' and subtitle_file['info']['name'].lower().find('brazil'): + # identifier AnimeTosho provides. Also, some subtitles does not have name, in this case it could + # be a false negative but there is nothing we can use to guarantee it is PT-BR, we rather skip it. + if lang.alpha3 == 'por' and subtitle_file['info'].get('name', '').lower().find('brazil'): lang = Language('por', 'BR') subtitle = self.subtitle_class( -- cgit v1.2.3