Update app.py
Browse files
app.py
CHANGED
@@ -62,7 +62,7 @@ def convert_to_mp4(input_file):
|
|
62 |
def gradio_interface(url, auth_token=""):
|
63 |
mkv_file = download_twitch_clip(url, auth_token)
|
64 |
mp4_file = convert_to_mp4(mkv_file)
|
65 |
-
return mp4_file
|
66 |
|
67 |
with gr.Blocks() as app:
|
68 |
gr.Markdown(title_and_description)
|
@@ -70,7 +70,8 @@ with gr.Blocks() as app:
|
|
70 |
with gr.Row():
|
71 |
with gr.Column():
|
72 |
result_video = gr.Video(label="Vídeo Output")
|
73 |
-
|
|
|
74 |
with gr.Row():
|
75 |
with gr.Column():
|
76 |
url_input = gr.Textbox(label="Twitch Clip URL")
|
@@ -80,7 +81,8 @@ with gr.Blocks() as app:
|
|
80 |
run_btn.click(
|
81 |
gradio_interface,
|
82 |
inputs=[url_input, auth_token_input],
|
83 |
-
outputs=[result_video]
|
84 |
)
|
|
|
85 |
app.queue()
|
86 |
app.launch()
|
|
|
62 |
def gradio_interface(url, auth_token=""):
|
63 |
mkv_file = download_twitch_clip(url, auth_token)
|
64 |
mp4_file = convert_to_mp4(mkv_file)
|
65 |
+
return mp4_file, mp4_file # Return the file path twice, for both the video and file components
|
66 |
|
67 |
with gr.Blocks() as app:
|
68 |
gr.Markdown(title_and_description)
|
|
|
70 |
with gr.Row():
|
71 |
with gr.Column():
|
72 |
result_video = gr.Video(label="Vídeo Output")
|
73 |
+
download_link = gr.File(label="Download MP4") # File component for downloading
|
74 |
+
|
75 |
with gr.Row():
|
76 |
with gr.Column():
|
77 |
url_input = gr.Textbox(label="Twitch Clip URL")
|
|
|
81 |
run_btn.click(
|
82 |
gradio_interface,
|
83 |
inputs=[url_input, auth_token_input],
|
84 |
+
outputs=[result_video, download_link] # Include the file component in the outputs
|
85 |
)
|
86 |
+
|
87 |
app.queue()
|
88 |
app.launch()
|