Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -82,16 +82,17 @@ def convert_video(video_file, quality, aspect_ratio, video_url, api_key, web3_up
|
|
82 |
|
83 |
# Copy the output to a new temporary file that won't be deleted when the
|
84 |
# TemporaryDirectory context manager exits.
|
85 |
-
output_copy_path = shutil.copy2(output_path, tempfile.
|
86 |
|
87 |
-
|
88 |
|
89 |
-
|
90 |
-
#
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
|
|
95 |
|
96 |
def main():
|
97 |
video_file = gr.inputs.File(label="Video File", type="file")
|
|
|
82 |
|
83 |
# Copy the output to a new temporary file that won't be deleted when the
|
84 |
# TemporaryDirectory context manager exits.
|
85 |
+
output_copy_path = shutil.copy2(output_path, tempfile.gettempdir())
|
86 |
|
87 |
+
# Let's complete the code here.
|
88 |
|
89 |
+
```python
|
90 |
+
# If the user wants to upload to web3, do that and return the URL.
|
91 |
+
# Otherwise, just return the local path.
|
92 |
+
if web3_upload:
|
93 |
+
return upload_to_web3_storage(api_key, output_copy_path)
|
94 |
+
else:
|
95 |
+
return output_copy_path
|
96 |
|
97 |
def main():
|
98 |
video_file = gr.inputs.File(label="Video File", type="file")
|