Lookimi commited on
Commit
484083d
·
1 Parent(s): 532b398

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -1,8 +1,13 @@
1
  import os
2
 
3
  def fetch_transcript(url, name):
4
- os.system(f"youtube-dl --write-auto-sub --skip-download --sub-format txt {url} -o {name}.txt")
5
- return f"{name}.txt"
 
 
 
 
 
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