This commit is contained in:
sekkr1 2019-04-23 23:28:35 +03:00
parent a5599d553e
commit a38b210963
1 changed files with 2 additions and 2 deletions

View File

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