Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,7 +33,11 @@ def get_youtube_transcript(video_url):
|
|
| 33 |
try:
|
| 34 |
# Fetch the transcript
|
| 35 |
transcript = YouTubeTranscriptApi.get_transcript(video_id)
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
# Format the transcript into plain text
|
| 38 |
formatter = TextFormatter()
|
| 39 |
text_transcript = formatter.format_transcript(transcript)
|
|
|
|
| 33 |
try:
|
| 34 |
# Fetch the transcript
|
| 35 |
transcript = YouTubeTranscriptApi.get_transcript(video_id)
|
| 36 |
+
for id in transcript:
|
| 37 |
+
try:
|
| 38 |
+
srt = YouTubeTranscriptApi.get_transcripts(id)
|
| 39 |
+
except:
|
| 40 |
+
print(f"{id} doesn't have a transcript")
|
| 41 |
# Format the transcript into plain text
|
| 42 |
formatter = TextFormatter()
|
| 43 |
text_transcript = formatter.format_transcript(transcript)
|