diff --git a/autokara/autosyl/assUtils.py b/autokara/autosyl/assUtils.py index 5f5959a20b6a2fb1a7011a14f9fb5146fabf00ef..4b819a1188d348cda707eb4976b59fb629b123d8 100644 --- a/autokara/autosyl/assUtils.py +++ b/autokara/autosyl/assUtils.py @@ -9,7 +9,7 @@ def timeToDate(time): remainder_sec = (seconds % 60) + centiseconds hours = int(mins // 60) remainder_mins = int(mins % 60) - return f'{hours:02d}:{remainder_mins:02d}:{remainder_sec:.2f}' + return f'{hours:02d}:{remainder_mins:02d}:{remainder_sec:05.2f}' def dateToTime(date): @@ -29,7 +29,7 @@ def getSyls(ass_file): with open(ass_file, 'r') as f: CONTENT = f.read() strip_regex = re.compile('[^a-zA-Z]') - LINES_KARA = re.compile(r"Comment:.*(\d+:\d{2}:\d{2}.\d{2}),(\d+:\d{2}:\d{2}.\d{2}),([^,]*),([^,]*),(\d+),(\d+),(\d+),karaoke,(.*)\n"); + LINES_KARA = re.compile(r"(?:Comment|Dialogue):.*(\d+:\d{2}:\d{2}.\d{2}),(\d+:\d{2}:\d{2}.\d{2}),([^,]*),([^,]*),(\d+),(\d+),(\d+),(?:(?!fx|template|code)\w)*,(.*)\n") RGX_TAGS = re.compile(r"\{\\k(\d+)\}([^\{\n\r]*)") for line in LINES_KARA.findall(CONTENT): syl_line = []