someshb07 commited on
Commit
9b0dd81
·
verified ·
1 Parent(s): daffa70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -36,7 +36,9 @@ def get_youtube_transcript(link):
36
  return "Video ID could not be extracted"
37
 
38
  try:
39
- transcript= YouTubeTranscriptApi.get_transcript(video_id) # fetches the trancript
 
 
40
 
41
  formatter= TextFormatter()
42
  text_transcript = formatter.format_transcript(transcript) # This will format the transcript
 
36
  return "Video ID could not be extracted"
37
 
38
  try:
39
+ transcript_list = YouTubeTranscriptApi.list_transcripts(video_id)
40
+ transcript = transcript_list.find_transcript(['en'])
41
+ transcript = transcript.fetch()
42
 
43
  formatter= TextFormatter()
44
  text_transcript = formatter.format_transcript(transcript) # This will format the transcript