From 23f242ecb50a73bcb06855de81dfd6a08f750ad3 Mon Sep 17 00:00:00 2001 From: liuwei Date: Wed, 21 May 2025 09:20:15 +0800 Subject: [PATCH] =?UTF-8?q?debug=20=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wechat_ipad/client/message.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wechat_ipad/client/message.py b/wechat_ipad/client/message.py index 32e2955..a24cc4c 100644 --- a/wechat_ipad/client/message.py +++ b/wechat_ipad/client/message.py @@ -245,15 +245,17 @@ class MessageMixin(WechatAPIClientBase): image_base64 = base64.b64encode(f.read()).decode() else: raise ValueError("image should be str, bytes, or path") + self.logging.debug(f"vid_base64:{vid_base64}") self.logging.debug(f"images_base64:{image_base64}") # 打印预估时间,300KB/s predict_time = int(file_len / 1024 / 300) self.logging.info("开始发送视频: 对方wxid:{} 视频base64略 图片base64略 预计耗时:{}秒", wxid, predict_time) async with aiohttp.ClientSession() as session: - json_param = {"Wxid": self.wxid, "ToWxid": wxid, "Base64": vid_base64, + json_param = {"Wxid": self.wxid, "ToWxid": wxid, "Base64": "data:video/mp4;base64,"+vid_base64, "ImageBase64": "data:image/jpeg;base64," + image_base64, "PlayLength": duration} + self.logging.debug(f"json_param::{json_param}") async with session.post(f'http://{self.ip}:{self.port}/api/Msg/SendVideo', json=json_param) as resp: json_resp = await resp.json() self.logging.debug(f"json_resp:{json_resp}")