Commit 428bb92b by baiquan

refactor(upload): 调整视频时长的判断逻辑

- 将视频时长的判断条件从大于 60 秒改为大于等于 59 秒- 这样可以更准确地处理接近 60 秒的视频,避免因时长问题导致的上传失败
parent dd7b0757
...@@ -703,7 +703,7 @@ def prepare_video_file(task): ...@@ -703,7 +703,7 @@ def prepare_video_file(task):
download_video(task['video_url'], file_path, headers=task['headers']) download_video(task['video_url'], file_path, headers=task['headers'])
video_duration = get_video_duration(file_path) video_duration = get_video_duration(file_path)
if video_duration > 60: if video_duration >= 59:
logger.error("视频时长大于60秒,上传失败") logger.error("视频时长大于60秒,上传失败")
raise VideoError(f"{file_path} 视频时长大于60秒,上传失败") raise VideoError(f"{file_path} 视频时长大于60秒,上传失败")
is_valid, actual_ratio, best_match = check_video_aspect_ratio(file_path) is_valid, actual_ratio, best_match = check_video_aspect_ratio(file_path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment