Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -111,7 +111,8 @@ def upload_video_to_r2(video_file, account_id, access_key, secret_key, bucket_na
|
|
| 111 |
)
|
| 112 |
current_time = datetime.now().strftime("%Y/%m/%d/%H%M%S")
|
| 113 |
video_remote_path = f"generated_images/{current_time}_{random.randint(0, MAX_SEED)}.mp4"
|
| 114 |
-
|
|
|
|
| 115 |
print("upload finish", video_remote_path)
|
| 116 |
|
| 117 |
return video_remote_path
|
|
|
|
| 111 |
)
|
| 112 |
current_time = datetime.now().strftime("%Y/%m/%d/%H%M%S")
|
| 113 |
video_remote_path = f"generated_images/{current_time}_{random.randint(0, MAX_SEED)}.mp4"
|
| 114 |
+
with open(video_path, "rb") as f: # 修正关键点
|
| 115 |
+
s3.upload_fileobj(f, bucket_name, video_remote_path)
|
| 116 |
print("upload finish", video_remote_path)
|
| 117 |
|
| 118 |
return video_remote_path
|