Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def return_yt_html_embed(yt_url):
|
4 |
+
video_id = yt_url.split("?v=")[-1]
|
5 |
+
HTML_str = (
|
6 |
+
f'<center> <iframe width="500" height="320" src="https://www.youtube.com/embed/{video_id}"> </iframe>'
|
7 |
+
" </center>"
|
8 |
+
)
|
9 |
+
return HTML_str
|
10 |
+
|
11 |
+
iface = gr.Interface(fn=return_yt_html_embed, inputs="text", outputs="html")
|
12 |
+
iface.launch()
|