未生成文件时,上报失败

This commit is contained in:
2025-02-08 15:02:36 +08:00
parent b7d6797901
commit 94a5e687df
4 changed files with 17 additions and 3 deletions

View File

@ -168,7 +168,7 @@ def upload_task_file(task_info, ffmpeg_task):
logger.info("开始上传文件: %s%s", task_info.get("id"), url)
try:
with open(ffmpeg_task.get_output_file(), 'rb') as f:
requests.put(url, data=f)
requests.put(url, data=f, headers={"Content-Type": "video/mp4"})
except requests.RequestException as e:
logger.error("上传失败!", e)
return False