mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-07-31 08:59:51 +00:00
🐛 粗暴地修复httpx ssl问题
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user