from youtube_video import download_youtube_video | |
import requests | |
import gradio as gr | |
def app(video_link): | |
video_path = download_youtube_video(video_link) | |
route('/') | |
data = requests.get('data', '') # Extracting data from URL query parameter | |
return video_path | |
interface = gr.Interface( | |
fn=app, | |
inputs=gr.Textbox(data, label="Enter YouTube link"), | |
outputs=gr.Video(label = "video_path") | |
) | |
interface.launch(debug=True) | |
#@app.route('/') | |
#def index(): | |
# return render_template('index.html', data=data) | |
#if __name__ == '__main__': | |
# app.run(debug=True) | |