Existance commited on
Commit
b5b2ed1
·
1 Parent(s): 181922a

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
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()