Skip to content

Commit

Permalink
🐛 youtube: fetch auto-genereated transcripts as well
Browse files Browse the repository at this point in the history
- for some reason their defaults `("en", )` doesn't work, but providing `["en"]` works fine
  • Loading branch information
lainisourgod committed Jul 1, 2024
1 parent 3d0d617 commit 5e67cc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/eightify/api/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def get_video_transcript(video_id: str) -> Optional[VideoTranscript]:
logger.debug(f"Getting video transcript for {video_id}")

try:
transcript = YouTubeTranscriptApi.get_transcript(video_id)
transcript = YouTubeTranscriptApi.get_transcript(video_id, ["en"])
points = [entry["text"] for entry in transcript]
transcript_text = " ".join(points)
return VideoTranscript(text=transcript_text, points=points)
Expand Down

0 comments on commit 5e67cc7

Please sign in to comment.