兼容linux

This commit is contained in:
liuwei
2025-05-20 18:19:53 +08:00
parent 0fdd980b46
commit 5c2ff540be

View File

@@ -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}")