jiuface commited on
Commit
8bbd43c
·
verified ·
1 Parent(s): 985fbf6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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
- s3.upload_fileobj(video_file, bucket_name, video_remote_path)
 
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