mirror of
https://github.com/anasty17/mirror-leech-telegram-bot.git
synced 2025-01-08 12:07:33 +08:00
Fix ffmpeg cmd list edit
Signed-off-by: anasty17 <e.anastayyar@gmail.com>
This commit is contained in:
parent
f1a8a5ecfc
commit
4f343c7544
@ -1121,14 +1121,14 @@ class TaskConfig:
|
|||||||
async def proceed_ffmpeg(self, dl_path, gid):
|
async def proceed_ffmpeg(self, dl_path, gid):
|
||||||
checked = False
|
checked = False
|
||||||
for ffmpeg_cmd in self.ffmpeg_cmds:
|
for ffmpeg_cmd in self.ffmpeg_cmds:
|
||||||
if "-del" in ffmpeg_cmd:
|
cmd = ["ffmpeg"] + ffmpeg_cmd
|
||||||
ffmpeg_cmd.remove("-del")
|
if "-del" in cmd:
|
||||||
|
cmd.remove("-del")
|
||||||
delete_files = True
|
delete_files = True
|
||||||
else:
|
else:
|
||||||
delete_files = False
|
delete_files = False
|
||||||
ffmpeg_cmd.insert(0, "ffmpeg")
|
index = cmd.index("-i")
|
||||||
index = ffmpeg_cmd.index("-i")
|
input_file = cmd[index + 1]
|
||||||
input_file = ffmpeg_cmd[index + 1]
|
|
||||||
if input_file.endswith(".video"):
|
if input_file.endswith(".video"):
|
||||||
ext = "video"
|
ext = "video"
|
||||||
elif input_file.endswith(".audio"):
|
elif input_file.endswith(".audio"):
|
||||||
@ -1159,8 +1159,8 @@ class TaskConfig:
|
|||||||
task_dict[self.mid] = FFmpegStatus(self, gid)
|
task_dict[self.mid] = FFmpegStatus(self, gid)
|
||||||
await cpu_eater_lock.acquire()
|
await cpu_eater_lock.acquire()
|
||||||
LOGGER.info(f"Running ffmpeg cmd for: {file_path}")
|
LOGGER.info(f"Running ffmpeg cmd for: {file_path}")
|
||||||
ffmpeg_cmd[index + 1] = file_path
|
cmd[index + 1] = file_path
|
||||||
res = await run_ffmpeg_cmd(self, ffmpeg_cmd, file_path)
|
res = await run_ffmpeg_cmd(self, cmd, file_path)
|
||||||
if res and delete_files:
|
if res and delete_files:
|
||||||
await remove(file_path)
|
await remove(file_path)
|
||||||
else:
|
else:
|
||||||
@ -1181,14 +1181,14 @@ class TaskConfig:
|
|||||||
continue
|
continue
|
||||||
elif ext != "all" and not f_path.endswith(ext):
|
elif ext != "all" and not f_path.endswith(ext):
|
||||||
continue
|
continue
|
||||||
ffmpeg_cmd[index + 1] = f_path
|
cmd[index + 1] = f_path
|
||||||
if not checked:
|
if not checked:
|
||||||
checked = True
|
checked = True
|
||||||
async with task_dict_lock:
|
async with task_dict_lock:
|
||||||
task_dict[self.mid] = FFmpegStatus(self, gid)
|
task_dict[self.mid] = FFmpegStatus(self, gid)
|
||||||
await cpu_eater_lock.acquire()
|
await cpu_eater_lock.acquire()
|
||||||
LOGGER.info(f"Running ffmpeg cmd for: {f_path}")
|
LOGGER.info(f"Running ffmpeg cmd for: {f_path}")
|
||||||
res = await run_ffmpeg_cmd(self, ffmpeg_cmd, f_path)
|
res = await run_ffmpeg_cmd(self, cmd, f_path)
|
||||||
if res and delete_files:
|
if res and delete_files:
|
||||||
await remove(f_path)
|
await remove(f_path)
|
||||||
if checked:
|
if checked:
|
||||||
|
Loading…
Reference in New Issue
Block a user