mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-17 18:35:19 +02:00
Update transcript processing to use new API object attributes
This commit is contained in:
parent
c08508c0c4
commit
7bb8e77ee1
1 changed files with 3 additions and 3 deletions
|
|
@ -141,9 +141,9 @@ async def add_youtube_video_document(
|
||||||
# Include complete caption information with timestamps
|
# Include complete caption information with timestamps
|
||||||
transcript_segments = []
|
transcript_segments = []
|
||||||
for line in captions:
|
for line in captions:
|
||||||
start_time = line.get("start", 0)
|
start_time = line.start
|
||||||
duration = line.get("duration", 0)
|
duration = line.duration
|
||||||
text = line.get("text", "")
|
text = line.text
|
||||||
timestamp = f"[{start_time:.2f}s-{start_time + duration:.2f}s]"
|
timestamp = f"[{start_time:.2f}s-{start_time + duration:.2f}s]"
|
||||||
transcript_segments.append(f"{timestamp} {text}")
|
transcript_segments.append(f"{timestamp} {text}")
|
||||||
transcript_text = "\n".join(transcript_segments)
|
transcript_text = "\n".join(transcript_segments)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue