Existance's picture
Update app.py
74150f4
raw
history blame contribute delete
No virus
674 Bytes
import gradio as gr
def return_yt_html_embed(yt_url):
video_id = yt_url.split("?v=")[-1]
HTML_str = (
f'<center> <iframe allowfullscreen width="500" height="320" src="https://www.youtube.com/embed/{video_id}"> </iframe>'
" </center>"
)
return HTML_str
'''<iframe width="560" height="315" src="https://www.youtube.com/embed/byk8H1xuOso?si=j7LxhAtLAjq-vd4_" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>'''
iface = gr.Interface(fn=return_yt_html_embed, inputs="text", outputs="html")
iface.launch(share=True)