Fix for invalid language in filename.

pull/614/head
Louis Vézina 5 years ago
parent 2a78008ecb
commit a4ed73b6fc

@ -33,7 +33,7 @@ class EmbeddedSubsReader:
with open(file, 'rb') as f: with open(file, 'rb') as f:
mkv = enzyme.MKV(f) mkv = enzyme.MKV(f)
for subtitle_track in mkv.subtitle_tracks: for subtitle_track in mkv.subtitle_tracks:
subtitles_list.append([subtitle_track.language, subtitle_track.forced]) subtitles_list.append([subtitle_track.language, subtitle_track.forced, subtitle_track.codec_id])
return subtitles_list return subtitles_list

@ -615,7 +615,7 @@ def _search_external_subtitles(path, languages=None, only_one=False, scandir_gen
try: try:
language_code = p_root.rsplit(".", 1)[1].replace('_', '-') language_code = p_root.rsplit(".", 1)[1].replace('_', '-')
try: try:
language_code = Language.fromietf(language_code) Language.fromietf(language_code)
except: except:
language_code = None language_code = None
except IndexError: except IndexError:

Loading…
Cancel
Save