aboutsummaryrefslogtreecommitdiffhomepage
path: root/custom_libs/subliminal_patch/providers/animetosho.py
diff options
context:
space:
mode:
authorAnderson Shindy Oki <[email protected]>2024-04-25 09:27:04 +0900
committerGitHub <[email protected]>2024-04-24 20:27:04 -0400
commit5e0433834e16dfbc1c7184fd2116b2d7a79db631 (patch)
treef2bcf047fb598160e46ed9412279e3378eb7e5c9 /custom_libs/subliminal_patch/providers/animetosho.py
parentfd190aad143a01a83e13dcf03b82bb34ddb8d2fc (diff)
downloadbazarr-5e0433834e16dfbc1c7184fd2116b2d7a79db631.tar.gz
bazarr-5e0433834e16dfbc1c7184fd2116b2d7a79db631.zip
Fixed animetosho provider empty subtitle name. #2468
Diffstat (limited to 'custom_libs/subliminal_patch/providers/animetosho.py')
-rw-r--r--custom_libs/subliminal_patch/providers/animetosho.py5
1 files changed, 3 insertions, 2 deletions
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(