【错误回报】图文动态截图失败,网站SSL证书无效,报错源为aunly-captcha-solver包
MiKayule opened this issue · comments
MiKayule commented
运行环境
Red Hat Enterprise Linux release 9.2 (Plow)
HarukaBot 版本
v1.6.0post5
go-cqhttp 版本
v1.1.0
错误描述
图文动态截图失败,报错源为aunly-captcha-solver包,问题似乎出在网站captcha-cd.ngworks.cn上,该网站的SSL证书属于*.cdn.myqcloud.com
报错日志(如果有)
09-19 09:08:26 [ERROR] haruka_bot | 动态 8428754*********31 截图失败
Traceback (most recent call last):
File "/home/mikayule/.local/bin/hb", line 8, in <module>
sys.exit(main())
File "/home/mikayule/.local/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/home/mikayule/.local/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/home/mikayule/.local/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/mikayule/.local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/mikayule/.local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/home/mikayule/.local/lib/python3.11/site-packages/haruka_bot/cli/__init__.py", line 16, in run
run()
File "/home/mikayule/.local/lib/python3.11/site-packages/haruka_bot/cli/bot.py", line 35, in run
nonebot.run(app="haruka_bot.cli.bot:app")
File "/home/mikayule/.local/lib/python3.11/site-packages/nonebot/__init__.py", line 331, in run
get_driver().run(*args, **kwargs)
File "/home/mikayule/.local/lib/python3.11/site-packages/nonebot/drivers/fastapi.py", line 201, in run
uvicorn.run(
File "/home/mikayule/.local/lib/python3.11/site-packages/uvicorn/main.py", line 587, in run
server.run()
File "/home/mikayule/.local/lib/python3.11/site-packages/uvicorn/server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
File "/usr/lib64/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
File "/usr/lib64/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
File "/home/mikayule/.local/lib/python3.11/site-packages/apscheduler/executors/base_py3.py", line 30, in run_coroutine_job
retval = await job.func(*job.args, **job.kwargs)
File "/home/mikayule/.local/lib/python3.11/site-packages/haruka_bot/plugins/pusher/dynamic_pusher.py", line 78, in dy_sched
image, err = await get_dynamic_screenshot(dynamic_id)
> File "/home/mikayule/.local/lib/python3.11/site-packages/haruka_bot/utils/browser.py", line 79, in get_dynamic_screenshot
page, clip = await get_dynamic_screenshot_mobile(dynamic_id, page)
File "/home/mikayule/.local/lib/python3.11/site-packages/haruka_bot/utils/browser.py", line 123, in get_dynamic_screenshot_mobile
page = await captcha.solve_captcha(page, url)
File "/home/mikayule/.local/lib/python3.11/site-packages/aunly_captcha_solver/__init__.py", line 80, in solve_captcha
data = await self._captcha_api_request(self.captcha_image_body)
File "/home/mikayule/.local/lib/python3.11/site-packages/aunly_captcha_solver/__init__.py", line 47, in _captcha_api_request
captcha_req = await client.post(
File "/home/mikayule/.local/lib/python3.11/site-packages/httpx/_client.py", line 1848, in post
return await self.request(
File "/home/mikayule/.local/lib/python3.11/site-packages/httpx/_client.py", line 1530, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
File "/home/mikayule/.local/lib/python3.11/site-packages/httpx/_client.py", line 1617, in send
response = await self._send_handling_auth(
File "/home/mikayule/.local/lib/python3.11/site-packages/httpx/_client.py", line 1645, in _send_handling_auth
response = await self._send_handling_redirects(
File "/home/mikayule/.local/lib/python3.11/site-packages/httpx/_client.py", line 1682, in _send_handling_redirects
response = await self._send_single_request(request)
File "/home/mikayule/.local/lib/python3.11/site-packages/httpx/_client.py", line 1719, in _send_single_request
response = await transport.handle_async_request(request)
File "/home/mikayule/.local/lib/python3.11/site-packages/httpx/_transports/default.py", line 366, in handle_async_request
resp = await self._pool.handle_async_request(req)
File "/home/mikayule/.local/lib/python3.11/site-packages/httpcore/_async/connection_pool.py", line 262, in handle_async_request
raise exc
File "/home/mikayule/.local/lib/python3.11/site-packages/httpcore/_async/connection_pool.py", line 245, in handle_async_request
response = await connection.handle_async_request(request)
File "/home/mikayule/.local/lib/python3.11/site-packages/httpcore/_async/connection.py", line 99, in handle_async_request
raise exc
File "/home/mikayule/.local/lib/python3.11/site-packages/httpcore/_async/connection.py", line 76, in handle_async_request
stream = await self._connect(request)
File "/home/mikayule/.local/lib/python3.11/site-packages/httpcore/_async/connection.py", line 156, in _connect
stream = await stream.start_tls(**kwargs)
File "/home/mikayule/.local/lib/python3.11/site-packages/httpcore/_backends/anyio.py", line 78, in start_tls
raise exc
File "/home/mikayule/.local/lib/python3.11/site-packages/httpcore/_backends/anyio.py", line 69, in start_tls
ssl_stream = await anyio.streams.tls.TLSStream.wrap(
File "/home/mikayule/.local/lib/python3.11/site-packages/anyio/streams/tls.py", line 123, in wrap
await wrapper._call_sslobject_method(ssl_object.do_handshake)
File "/home/mikayule/.local/lib/python3.11/site-packages/anyio/streams/tls.py", line 131, in _call_sslobject_method
result = func(*args)
File "/usr/lib64/python3.11/ssl.py", line 979, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'captcha-cd.ngworks.cn'. (_ssl.c:992)
苍策 commented
+1
HarukaBot 版本 1.6.0.post5