Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import unicode_literals
|
| 2 |
+
#import youtube_dl as yt
|
| 3 |
+
import gradio as gr
|
| 4 |
+
import youtube_dl
|
| 5 |
+
|
| 6 |
+
def dl(inp):
|
| 7 |
+
out = None
|
| 8 |
+
|
| 9 |
+
ydl_opts = {}
|
| 10 |
+
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
|
| 11 |
+
out = ydl.download([f'{inp}'])
|
| 12 |
+
return out
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
with gr.Blocks() as app:
|
| 16 |
+
inp_url = gr.Textbox()
|
| 17 |
+
go_btn = gr.Button()
|
| 18 |
+
outp_vid=gr.Video()
|
| 19 |
+
go_btn.click(dl,inp_url,outp_vid)
|
| 20 |
+
|
| 21 |
+
app.launch()
|