We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
错误信息和 #196 一致
问题来自高版本request库修复默认值带来的安全问题引发的连锁反应,详情见 psf/requests#6616
修复方案可参考 SengokuCola/MaiMBot#13
Linux
#196
The text was updated successfully, but these errors were encountered:
实测降级库版本也能修复,暴力替换指定域名用http也行
Sorry, something went wrong.
Hi, 参考了提到的方法,https://vscode.dev/github/Soulter/AstrBot/blob/master/astrbot/core/utils/io.py#L103 给这里加如下代码试试能不能正常工作:
async def download_image_by_url( url: str, post: bool = False, post_data: dict = None, path=None ) -> str: """ 下载图片, 返回 path """ try: async with aiohttp.ClientSession(trust_env=True) as session: if post: async with session.post(url, json=post_data) as resp: if not path: return save_temp_img(await resp.read()) else: with open(path, "wb") as f: f.write(await resp.read()) return path else: async with session.get(url) as resp: if not path: return save_temp_img(await resp.read()) else: with open(path, "wb") as f: f.write(await resp.read()) return path except aiohttp.client.ClientConnectorSSLError: # 关闭SSL验证 ssl_context = ssl.create_default_context() ssl_context.check_hostname = False ssl_context.verify_mode = ssl.CERT_NONE ssl_context.set_ciphers("AES") async with aiohttp.ClientSession() as session: if post: async with session.get(url, ssl=ssl_context) as resp: return save_temp_img(await resp.read()) else: async with session.get(url, ssl=ssl_context) as resp: return save_temp_img(await resp.read()) except Exception as e: raise e
No branches or pull requests
发生了什么
错误信息和 #196 一致
如何复现?
问题来自高版本request库修复默认值带来的安全问题引发的连锁反应,详情见 psf/requests#6616
AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器
修复方案可参考 SengokuCola/MaiMBot#13
操作系统
Linux
报错日志
#196
你愿意提交 PR 吗?
Code of Conduct
The text was updated successfully, but these errors were encountered: