charliebaby2023
commited on
Commit
•
1e56eb5
1
Parent(s):
b443650
Update app.py
Browse files
app.py
CHANGED
@@ -1,45 +1,19 @@
|
|
1 |
from youtube_video import download_youtube_video
|
2 |
import requests
|
3 |
import gradio as gr
|
4 |
-
#data='go';
|
5 |
-
#data = requests.get('data', '')
|
6 |
-
#def echo( request: gr.Request):
|
7 |
-
|
8 |
data = 'https://www.youtube.com/watch?v=bJ5FDtgOwjo'
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
def app(video_link):
|
16 |
-
video_path = download_youtube_video(
|
17 |
-
# route('/') # Extracting data from URL query parameter
|
18 |
-
|
19 |
-
# print(data)
|
20 |
return video_path
|
21 |
|
22 |
interface = gr.Interface(
|
23 |
-
|
24 |
fn=app,
|
25 |
inputs=gr.Textbox(data, label="Enter YouTube link"),
|
26 |
-
outputs=gr.Video(
|
27 |
)
|
28 |
|
29 |
interface.launch(debug=True)
|
30 |
|
31 |
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
#@app.route('/')
|
38 |
-
#def index():
|
39 |
-
|
40 |
-
# return render_template('index.html', data=data)
|
41 |
-
|
42 |
-
#if __name__ == '__main__':
|
43 |
-
# app.run(debug=True)
|
44 |
-
|
45 |
|
|
|
1 |
from youtube_video import download_youtube_video
|
2 |
import requests
|
3 |
import gradio as gr
|
|
|
|
|
|
|
|
|
4 |
data = 'https://www.youtube.com/watch?v=bJ5FDtgOwjo'
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
def app(video_link):
|
6 |
+
video_path = download_youtube_video(video_link)
|
|
|
|
|
|
|
7 |
return video_path
|
8 |
|
9 |
interface = gr.Interface(
|
|
|
10 |
fn=app,
|
11 |
inputs=gr.Textbox(data, label="Enter YouTube link"),
|
12 |
+
outputs=gr.Video(label = "video_path")
|
13 |
)
|
14 |
|
15 |
interface.launch(debug=True)
|
16 |
|
17 |
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|