Update transcript processing to use new API object attributes

This commit is contained in:
sandeeppainuly 2025-09-28 12:09:17 +02:00
parent c08508c0c4
commit 7bb8e77ee1

View file

@ -141,9 +141,9 @@ async def add_youtube_video_document(
# Include complete caption information with timestamps
transcript_segments = []
for line in captions:
start_time = line.get("start", 0)
duration = line.get("duration", 0)
text = line.get("text", "")
start_time = line.start
duration = line.duration
text = line.text
timestamp = f"[{start_time:.2f}s-{start_time + duration:.2f}s]"
transcript_segments.append(f"{timestamp} {text}")
transcript_text = "\n".join(transcript_segments)