From 83e88d682b1587d0eb87016e5dd77e8d45d702f3 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sat, 7 Mar 2020 19:32:31 +0000 Subject: [PATCH] animetosho2mks: Work with older format An older format has no language flag for subtitles. --- animetosho2mks.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/animetosho2mks.py b/animetosho2mks.py index fc5aaa9..dc375df 100755 --- a/animetosho2mks.py +++ b/animetosho2mks.py @@ -13,7 +13,11 @@ class SubtitleTrack: def _parse_filename(self): basename = self.filename.split(".")[0] - language = basename.split("_")[1] + try: + language = basename.split("_")[1] + except IndexError: + # older format + language = "eng" return language