Update app.py
Browse files
app.py
CHANGED
@@ -6,15 +6,19 @@ def app(video_link):
|
|
6 |
print(f"Received video link: {video_link}")
|
7 |
video_path = download_youtube_video(video_link)
|
8 |
print(f"Downloaded video path: {video_path}")
|
9 |
-
return gr.Video(video_path
|
10 |
except Exception as e:
|
11 |
print(f"An error occurred: {str(e)}")
|
12 |
return None
|
13 |
|
|
|
|
|
|
|
|
|
14 |
interface = gr.Interface(
|
15 |
fn=app,
|
16 |
inputs=gr.Textbox(label="Enter YouTube link"),
|
17 |
-
outputs=gr.Video(label="
|
18 |
)
|
19 |
|
20 |
interface.launch(debug=True)
|
|
|
6 |
print(f"Received video link: {video_link}")
|
7 |
video_path = download_youtube_video(video_link)
|
8 |
print(f"Downloaded video path: {video_path}")
|
9 |
+
return gr.Video(video_path)
|
10 |
except Exception as e:
|
11 |
print(f"An error occurred: {str(e)}")
|
12 |
return None
|
13 |
|
14 |
+
# Function to trigger the download of the video file
|
15 |
+
def download_file(video_path):
|
16 |
+
gr.download(video_path, "downloaded_video.mp4")
|
17 |
+
|
18 |
interface = gr.Interface(
|
19 |
fn=app,
|
20 |
inputs=gr.Textbox(label="Enter YouTube link"),
|
21 |
+
outputs=gr.Video(label = "Video")
|
22 |
)
|
23 |
|
24 |
interface.launch(debug=True)
|