conductor(cs229): Phase 1 Acquire - transcript.json (5397 segments via yt-dlp VTT fallback) + video.log (yt-dlp success for 336MB mp4, R5 verified)
Fix extract_transcript.py: YouTubeTranscriptApi.get_transcript() (not .fetch()). youtube-transcript-api v1.2.4 uses class method get_transcript(video_id), not instance .fetch(). R5 mitigation: yt-dlp's VTT auto-sub extraction works where youtube-transcript-api fails (XML parse error on empty response). 5397 segments recovered. Add gitignore patterns for video_analysis artifacts: *.mp4, *.vtt (regenerable). video.log intentionally tracked.
This commit is contained in:
@@ -70,10 +70,9 @@ def format_transcript_json(video_id: str, segments: list[dict[str, Any]]) -> dic
|
||||
|
||||
|
||||
def _fetch_raw_transcript(video_id: str) -> list[dict[str, Any]]:
|
||||
api = YouTubeTranscriptApi()
|
||||
fetched = api.fetch(video_id)
|
||||
fetched = YouTubeTranscriptApi.get_transcript(video_id)
|
||||
return [
|
||||
{"start": float(s.start), "duration": float(s.duration), "text": str(s.text)}
|
||||
{"start": float(s["start"]), "duration": float(s["duration"]), "text": str(s["text"])}
|
||||
for s in fetched
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user