From 5c2ff540bee15c464496b6150d5a388dbea4eae4 Mon Sep 17 00:00:00 2001 From: liuwei Date: Tue, 20 May 2025 18:19:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/video_man/main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/video_man/main.py b/plugins/video_man/main.py index 96db42a..9f18469 100644 --- a/plugins/video_man/main.py +++ b/plugins/video_man/main.py @@ -104,7 +104,7 @@ class VideoManPlugin(MessagePluginInterface): try: # 下载视频 - file_abspath,first_frame = self._download_video("https://api.guiguiya.com/api/video/fuji?type=json") + file_abspath, first_frame = self._download_video("https://api.guiguiya.com/api/video/fuji?type=json") # FIXME 需要换成web容器地址。否则无法获取。 if not file_abspath: await self.bot.send_text_message((roomid if roomid else sender), f"\n❌视频下载失败,请稍后再试", @@ -112,7 +112,8 @@ class VideoManPlugin(MessagePluginInterface): return False, "视频下载失败" # 发送视频 - result = await self.bot.send_video_message((roomid if roomid else sender), Path(file_abspath),Path(first_frame)) + result = await self.bot.send_video_message((roomid if roomid else sender), Path(file_abspath), + Path(first_frame)) self.LOG.info(f"发送视频结果: {result}") return True, "发送成功" @@ -163,7 +164,7 @@ class VideoManPlugin(MessagePluginInterface): first_frame_path = os.path.join(self.download_dir, f"frame_{int(time.time())}.jpg") first_frame = self._get_first_frame(save_path, first_frame_path) - return abs_path,first_frame + return abs_path, first_frame except requests.RequestException as e: self.LOG.error(f"请求失败: {e}")