Salman11223
commited on
Commit
•
c4d440c
1
Parent(s):
c3c5aca
Update app.py
Browse files
app.py
CHANGED
@@ -6,40 +6,18 @@ 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", placeholder="Paste YouTube video URL here"),
|
17 |
-
outputs=[gr.Video(label="Downloaded Video"), gr.Button("Download Video")],
|
18 |
-
)
|
19 |
-
|
20 |
-
interface.launch(debug=True)
|
21 |
-
|
22 |
-
|
23 |
-
# from youtube_video import download_youtube_video
|
24 |
-
# import gradio as gr
|
25 |
-
|
26 |
-
# def app(video_link):
|
27 |
-
# try:
|
28 |
-
# print(f"Received video link: {video_link}")
|
29 |
-
# video_path = download_youtube_video(video_link)
|
30 |
-
# print(f"Downloaded video path: {video_path}")
|
31 |
-
# return gr.Video(video_path)
|
32 |
-
# except Exception as e:
|
33 |
-
# print(f"An error occurred: {str(e)}")
|
34 |
-
# return None
|
35 |
|
36 |
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
|
43 |
-
|
44 |
|
45 |
-
|
|
|
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 |
|
15 |
|
16 |
+
interface = gr.Interface(
|
17 |
+
fn=app,
|
18 |
+
inputs=gr.Textbox(label="Enter YouTube link"),
|
19 |
+
outputs=[gr.Video(label = "video_path")],
|
20 |
|
21 |
+
)
|
22 |
|
23 |
+
interface.launch(debug=True)
|