Existance's picture
Update app.py
3355704
raw
history blame contribute delete
No virus
664 Bytes
import gradio as gr
# import yt_dlp as youtube_dl
import tempfile
import os
YT_LENGTH_LIMIT_S = 3600
FILE_LIMIT_MB = 1000
def _return_yt_html_embed(yt_url):
video_id = yt_url.split("?v=")[-1]
HTML_str = (
f'<center> <iframe width="500" height="320" src="https://www.youtube.com/embed/{video_id}"> </iframe>'
" </center>"
)
return HTML_str
demo = gr.Interface(
fn=_return_yt_html_embed,
inputs="text",
# outputs=["html", "text"],
outputs="html",
layout="horizontal",
theme="huggingface",
title="YouTube Video Viwer",
description=("YouTube Video Viwer"),
allow_flagging="never",
)
demo.launch()