fix: in old lyrics some lines would be missing ms digits like '06:06'. And in this case we would manually add dummy one at last.

This commit is contained in:
Xie, Tianshi
2024-05-16 20:21:17 -04:00
parent 39976d144b
commit d437975744

View File

@@ -84,6 +84,8 @@ def ttml_convent_to_lrc(ttml: str) -> str:
lyric_time: str = lyric.get("begin")
if not lyric_time:
raise NotTimeSyncedLyricsException
if lyric_time.find('.') == -1:
lyric_time += '.000'
match lyric_time.count(":"):
case 0:
split_time = lyric_time.split(".")