mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-04 23:39:18 +00:00
skip subtitle segments without duration, take 2
This commit is contained in:
@@ -195,6 +195,11 @@ class SubtitleParser:
|
|||||||
|
|
||||||
if flatten:
|
if flatten:
|
||||||
# fix overlapping retiming issue
|
# fix overlapping retiming issue
|
||||||
|
if "dDurationMs" not in flatten[-1]:
|
||||||
|
# some events won't have a duration
|
||||||
|
print(f"failed to parse event without duration: {event}")
|
||||||
|
continue
|
||||||
|
|
||||||
last_end = flatten[-1]["tStartMs"] + flatten[-1]["dDurationMs"]
|
last_end = flatten[-1]["tStartMs"] + flatten[-1]["dDurationMs"]
|
||||||
if event["tStartMs"] < last_end:
|
if event["tStartMs"] < last_end:
|
||||||
joined = flatten[-1]["segs"][0]["utf8"] + "\n" + text
|
joined = flatten[-1]["segs"][0]["utf8"] + "\n" + text
|
||||||
|
|||||||
Reference in New Issue
Block a user