Commit 1b20a87
Changed files (1)
src
others
src/others/ffmpeg.py
@@ -62,7 +62,7 @@ copy操作使用关键帧作为分割点, 因此切片的开始或结束位置
kwargs["progress"] = kwargs.get("progress", await message.reply_text("⏬正在下载媒体文件...", quote=True))
fpath: str = await client.download_media(media_message, file_name=fpath) # type: ignore
if not Path(fpath).is_file():
- await modify_progress(texts="❌媒体文件下载失败", force_update=True, **kwargs)
+ await modify_progress(text="❌媒体文件下载失败", force_update=True, **kwargs)
return
ext = Path(fpath).suffix
start_time = sanitize_time(times[0])
@@ -75,7 +75,7 @@ copy操作使用关键帧作为分割点, 因此切片的开始或结束位置
cmd = f"✅文件下载完成 ({readable_size(path=fpath)})\n✂️执行切片命令:\n`ffmpeg -ss {start_time} -to {end_time} -i input{ext} -c copy output{ext}`"
ffmpeg = FFmpeg().option("y").input(fpath, ss=start_time, to=end_time).output(out_path, acodec="copy", vcodec="copy")
- await modify_progress(texts=cmd, force_update=True, **kwargs)
+ await modify_progress(text=cmd, force_update=True, **kwargs)
@ffmpeg.on("progress")
def on_progress(p: Progress):
@@ -83,7 +83,7 @@ copy操作使用关键帧作为分割点, 因此切片的开始或结束位置
await ffmpeg.execute()
if not Path(out_path).is_file():
- await modify_progress(texts="❌切片失败", force_update=True, **kwargs)
+ await modify_progress(text="❌切片失败", force_update=True, **kwargs)
return
"""
{
@@ -169,12 +169,12 @@ async def ffmpeg_h264(client: Client, message: Message, **kwargs):
kwargs["progress"] = kwargs.get("progress", await message.reply_text("⏬正在下载视频文件...", quote=True))
fpath: str = await client.download_media(media_message, file_name=fpath) # type: ignore
if not Path(fpath).is_file():
- await modify_progress(texts="❌视频文件下载失败", force_update=True, **kwargs)
+ await modify_progress(text="❌视频文件下载失败", force_update=True, **kwargs)
return
media_info = await parse_media_info(fpath)
if media_info["video_codec"] == "h264" and not equal_prefix(message.content, prefix=f"{PREFIX.FFMPEG_CUT} force"):
- await modify_progress(texts=f"⚠️该视频已经是H264编码, 无需转换\n使用 `{PREFIX.FFMPEG_H264} force` 强制进行转换", force_update=True, **kwargs)
+ await modify_progress(text=f"⚠️该视频已经是H264编码, 无需转换\n使用 `{PREFIX.FFMPEG_H264} force` 强制进行转换", force_update=True, **kwargs)
return
h264_path = await convert_to_h264(fpath, force_re_encoding=True)