Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -81,8 +81,15 @@ def convert_video(video_file: File, quality, aspect_ratio, video_url):
|
|
81 |
# The file has now been converted, so we can display it in the output viewer
|
82 |
gr.outputs.Video(output_path)
|
83 |
|
|
|
|
|
|
|
|
|
|
|
84 |
# Add a button to download the file
|
85 |
-
gr.outputs.
|
|
|
|
|
86 |
|
87 |
from gradio import outputs
|
88 |
|
|
|
81 |
# The file has now been converted, so we can display it in the output viewer
|
82 |
gr.outputs.Video(output_path)
|
83 |
|
84 |
+
# Create a temporary file to store the download link
|
85 |
+
with tempfile.NamedTemporaryFile(delete=False) as f:
|
86 |
+
f.write(output_path.encode())
|
87 |
+
download_link = f.name
|
88 |
+
|
89 |
# Add a button to download the file
|
90 |
+
gr.outputs.HTML("""
|
91 |
+
<a href="{}" download="downloaded_file.mp4">Download</a>
|
92 |
+
""".format(download_link))
|
93 |
|
94 |
from gradio import outputs
|
95 |
|