Jeffgold commited on
Commit
a097915
·
1 Parent(s): 2ace304

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
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.Download(label="Download", output_path=output_path)
 
 
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