This commit is contained in:
2024-12-24 14:59:52 +08:00
parent 5ed7198a8a
commit 7bcb561a65
9 changed files with 28 additions and 12 deletions

View File

@ -9,6 +9,11 @@ session = requests.Session()
logger = logging.getLogger(__name__)
def normalize_task(task_info):
...
return task_info
def sync_center():
"""
通过接口获取任务

View File

@ -8,6 +8,9 @@ from entity.ffmpeg import FfmpegTask
def start_render(ffmpeg_task: FfmpegTask):
print(ffmpeg_task)
print(ffmpeg_task.get_ffmpeg_args())
if not ffmpeg_task.need_run():
ffmpeg_task.set_output_file(ffmpeg_task.input_file[0])
return True
code = os.system("ffmpeg.exe "+" ".join(ffmpeg_task.get_ffmpeg_args()))
return code == 0

View File

@ -26,8 +26,9 @@ def download_from_oss(url, file_path):
:return bool: 是否成功
"""
file_dir, file_name = os.path.split(file_path)
if not os.path.exists(file_dir):
os.makedirs(file_dir)
if file_dir:
if not os.path.exists(file_dir):
os.makedirs(file_dir)
try:
response = requests.get(url)
with open(file_path, 'wb') as f: