Spaces:
Runtime error
Runtime error
Next
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -19,11 +19,11 @@ with gr.Blocks(theme="Nex432/green") as demo:
|
|
19 |
audio_output = gr.Audio(visible=False)
|
20 |
video_output = gr.Video(visible=False)
|
21 |
def download_media(url, name_file, format):
|
22 |
-
filename = download_url(url, name_file, format)
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
|
28 |
download.click(download_media, inputs=[url, name_file, format], outputs=[audio_output, video_output])
|
29 |
with gr.Tab("credits"):
|
|
|
19 |
audio_output = gr.Audio(visible=False)
|
20 |
video_output = gr.Video(visible=False)
|
21 |
def download_media(url, name_file, format):
|
22 |
+
filename = download_url(url, name_file, format):
|
23 |
+
if format == "mp3":
|
24 |
+
return filename, None # Return filename for audio, None for video
|
25 |
+
else:
|
26 |
+
return None, filename # Return None for audio, filename for video
|
27 |
|
28 |
download.click(download_media, inputs=[url, name_file, format], outputs=[audio_output, video_output])
|
29 |
with gr.Tab("credits"):
|