mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-25 05:00:16 +00:00
skip subtitle segments without duration, take 2
This commit is contained in:
parent
d086f63861
commit
3147df20da
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user