summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAnderson Shindy Oki <[email protected]>2024-07-09 23:54:02 +0900
committerGitHub <[email protected]>2024-07-09 23:54:02 +0900
commit12e7bbfb01e846f95074705a111823eab72f5a7d (patch)
treedef90a479b72fca2c3a3b5328f70320206eecfde
parent96af60918ea4e94190af290fe41fcc5034b3d23f (diff)
downloadbazarr-12e7bbfb01e846f95074705a111823eab72f5a7d.tar.gz
bazarr-12e7bbfb01e846f95074705a111823eab72f5a7d.zip
Fixed animetosho empty language fallback (#2571)
-rw-r--r--custom_libs/subliminal_patch/providers/animetosho.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/custom_libs/subliminal_patch/providers/animetosho.py b/custom_libs/subliminal_patch/providers/animetosho.py
index 1fb791e86..9cd3d80b9 100644
--- a/custom_libs/subliminal_patch/providers/animetosho.py
+++ b/custom_libs/subliminal_patch/providers/animetosho.py
@@ -141,7 +141,8 @@ class AnimeToshoProvider(Provider, ProviderSubtitleArchiveMixin):
for subtitle_file in subtitle_files:
hex_id = format(subtitle_file['id'], '08x')
- lang = Language.fromalpha3b(subtitle_file['info']['lang'])
+ # Animetosho assumes missing languages as english as fallback when not specified.
+ lang = Language.fromalpha3b(subtitle_file['info'].get('lang', 'eng'))
# For Portuguese and Portuguese Brazilian they both share the same code, the name is the only
# identifier AnimeTosho provides. Also, some subtitles does not have name, in this case it could