Fix for invalid language code.

pull/614/head
Louis Vézina 5 years ago
parent ba2920423c
commit 7c75ae7615

@ -614,6 +614,10 @@ def _search_external_subtitles(path, languages=None, only_one=False, scandir_gen
# extract the potential language code # extract the potential language code
try: try:
language_code = p_root.rsplit(".", 1)[1].replace('_', '-') language_code = p_root.rsplit(".", 1)[1].replace('_', '-')
try:
language_code = Language.fromietf(language_code)
except ValueError:
language_code = None
except IndexError: except IndexError:
language_code = None language_code = None

Loading…
Cancel
Save