from download_youtube_video import download_youtube_video import gradio as gr import pytube def app(video_link): downloaded_file_path = download_youtube_video(video_link) if downloaded_file_path: # Do something with the downloaded video file, such as returning it to the user with open(downloaded_file_path, 'rb') as f: video_data = f.read() # Return the video data here (e.g., send it as a response in a web application) interface = gr.Interface(fn = app, inputs = [gr.components.Textbox(label="Enter youtube link")], outputs=[gr.components.Video(label="Your result")] ) interface.launch(debug=True)