Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,7 +36,9 @@ def get_youtube_transcript(link):
|
|
| 36 |
return "Video ID could not be extracted"
|
| 37 |
|
| 38 |
try:
|
| 39 |
-
|
|
|
|
|
|
|
| 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
|