File size: 650 Bytes
cfdee17
 
 
36ecbae
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from download_youtube_video imort download_youtube_video
import gradio as gr


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)