Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,13 @@
|
|
| 1 |
import os
|
| 2 |
|
| 3 |
def fetch_transcript(url, name):
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
import gradio as gr
|
| 8 |
|
|
|
|
| 1 |
import os
|
| 2 |
|
| 3 |
def fetch_transcript(url, name):
|
| 4 |
+
transcript_filename = f"{name}.txt"
|
| 5 |
+
os.system(f"youtube-dl --write-auto-sub --skip-download --sub-format txt {url} -o {transcript_filename}")
|
| 6 |
+
|
| 7 |
+
if os.path.exists(transcript_filename):
|
| 8 |
+
return transcript_filename
|
| 9 |
+
else:
|
| 10 |
+
raise FileNotFoundError(f"Transcript file '{transcript_filename}' could not be found.")
|
| 11 |
|
| 12 |
import gradio as gr
|
| 13 |
|