Skip to content

Commit f035f22

Browse files
minor: better storing of metadata for yt
Signed-off-by: thiswillbeyourgithub <[email protected]>
1 parent b5d1d6a commit f035f22

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

wdoc/utils/loaders.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2285,10 +2285,11 @@ def seconds_to_timecode(inp: str) -> str:
22852285
return f"{hour:02d}:{minute:02d}:{second:02d}"
22862286

22872287
for ich, ch in enumerate(chap):
2288-
chap[ich]["start_time"] = seconds_to_timecode(chap[ich]["start_time"])
2289-
chap[ich]["end_time"] = seconds_to_timecode(chap[ich]["end_time"])
2288+
chap[ich]["start"] = seconds_to_timecode(chap[ich]["start_time"])
2289+
chap[ich]["end"] = seconds_to_timecode(chap[ich]["end_time"])
2290+
del chap[ich]["start_time"], chap[ich]["end_time"]
22902291

2291-
meta["yt_chapters"] = chap
2292+
meta["yt_chapters"] = json.dumps(chap, ensure_ascii=False)
22922293

22932294
def timecode_to_second(inp: str) -> float:
22942295
"turns a vtt timecode into seconds"

0 commit comments

Comments
 (0)