Fix YouTubeTranscriptApi method call from get_transcript() to fetch()
Tested video v75iZrtI6hw and researched APIs for live stream transcripts. The get_transcript() method doesn't exist in youtube-transcript-api library. Should use YouTubeTranscriptApi().fetch() instead.
This commit is contained in:
@@ -41,7 +41,7 @@ def get_transcript(video_id, languages=None):
|
||||
languages = ['en', 'en-US']
|
||||
|
||||
try:
|
||||
transcript = YouTubeTranscriptApi.get_transcript(video_id, languages=languages)
|
||||
transcript = YouTubeTranscriptApi().fetch(video_id, languages=languages)
|
||||
return transcript
|
||||
except Exception as e:
|
||||
print(f"Error getting transcript: {e}")
|
||||
|
||||
Reference in New Issue
Block a user