Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -60,7 +60,11 @@ def download_file(url, destination):
|
|
| 60 |
|
| 61 |
def get_input_path(video_file, video_url):
|
| 62 |
if video_file is not None:
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
elif video_url:
|
| 65 |
url_path = urlparse(video_url).path
|
| 66 |
file_name = Path(url_path).name
|
|
|
|
| 60 |
|
| 61 |
def get_input_path(video_file, video_url):
|
| 62 |
if video_file is not None:
|
| 63 |
+
# Save the uploaded file to the output directory
|
| 64 |
+
input_path = output_dir / video_file.name
|
| 65 |
+
with open(input_path, "wb") as f:
|
| 66 |
+
f.write(video_file.getbuffer())
|
| 67 |
+
return input_path
|
| 68 |
elif video_url:
|
| 69 |
url_path = urlparse(video_url).path
|
| 70 |
file_name = Path(url_path).name
|