Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|
9 |
+
gr.Interface(
|
10 |
+
fetch_transcript,
|
11 |
+
[gr.Textbox(label="YouTube Video URL", placeholder="URL goes here..."),
|
12 |
+
gr.Textbox(label="Transcript file name", placeholder="transcript")],
|
13 |
+
gr.outputs.File(label="Download Transcript"),
|
14 |
+
description="Fetch and download the transcript of a YouTube video as a human readable text file.",
|
15 |
+
enable_queue=True
|
16 |
+
).launch()
|