pull/409/head
sekkr1 6 years ago
parent a5599d553e
commit a38b210963

@ -5,7 +5,7 @@ import subprocess
from utils import get_binary from utils import get_binary
class MKVAndNoFFprobe(Exception): class NotMKVAndNoFFprobe(Exception):
pass pass
class FFprobeError(Exception): class FFprobeError(Exception):
@ -22,7 +22,7 @@ class EmbeddedSubsReader:
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
raise FFprobeError(e.output) raise FFprobeError(e.output)
if os.path.splitext(file)[1] != '.mkv': if os.path.splitext(file)[1] != '.mkv':
raise MKVAndNoFFprobe() raise NotMKVAndNoFFprobe()
with open(file, 'rb') as f: with open(file, 'rb') as f:
mkv = enzyme.MKV(f) mkv = enzyme.MKV(f)
return [subtitle_track.language for subtitle_track in mkv.subtitle_tracks] return [subtitle_track.language for subtitle_track in mkv.subtitle_tracks]

Loading…
Cancel
Save