From 1308d6fea630ade4c0e37ac4cdb0d158341c99cb Mon Sep 17 00:00:00 2001 From: Asankilp Date: Sun, 2 Feb 2025 21:49:22 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E7=B2=97=E6=9A=B4=E5=9C=B0?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Dhttpx=20ssl=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_marshoai/marsho.py | 1 + nonebot_plugin_marshoai/util.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nonebot_plugin_marshoai/marsho.py b/nonebot_plugin_marshoai/marsho.py index cb323c6..3438169 100644 --- a/nonebot_plugin_marshoai/marsho.py +++ b/nonebot_plugin_marshoai/marsho.py @@ -268,6 +268,7 @@ async def marsho( ) # type: ignore ).as_dict() # type: ignore ) # type: ignore + logger.info(f"输入图片 {i.data['url']}") elif config.marshoai_enable_support_image_tip: await UniMessage( "*此模型不支持图片处理或管理员未启用此模型的图片支持。图片将被忽略。" diff --git a/nonebot_plugin_marshoai/util.py b/nonebot_plugin_marshoai/util.py index 1c45c75..5380f1a 100755 --- a/nonebot_plugin_marshoai/util.py +++ b/nonebot_plugin_marshoai/util.py @@ -96,7 +96,9 @@ async def get_image_b64(url: str, timeout: int = 10) -> Optional[str]: return: 图片base64编码 """ - if data_type := await get_image_raw_and_type(url, timeout): + if data_type := await get_image_raw_and_type( + url.replace("https://", "http://"), timeout + ): # image_format = content_type.split("/")[1] if content_type else "jpeg" base64_image = base64.b64encode(data_type[0]).decode("utf-8") data_url = "data:{};base64,{}".format(data_type[1], base64_image)