noneplugin / nonebot-plugin-ddcheck

NoneBot2 成分姬插件
MIT License
54 stars 13 forks source link

查成分报错 #21

Closed dgcccccc closed 1 year ago

dgcccccc commented 1 year ago

nonebot 2.0.0-rc1+onebotv12 使用nonebot-plugin-gocqhttp 指令为 ’查成分 uid‘ 回复’出错了,请稍后再试‘ log: 11-17 15:52:18 [WARNING] nonebot_plugin_ddcheck | Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/httpcore/_exceptions.py", line 8, in map_exceptions yield File "/usr/local/lib/python3.8/dist-packages/httpcore/backends/asyncio.py", line 109, in connect_tcp stream: anyio.abc.ByteStream = await anyio.connect_tcp( File "/usr/local/lib/python3.8/dist-packages/anyio/_core/_sockets.py", line 189, in connect_tcp gai_res = await getaddrinfo( File "/usr/local/lib/python3.8/dist-packages/anyio/_core/_sockets.py", line 496, in getaddrinfo gai_res = await get_asynclib().getaddrinfo( File "/usr/local/lib/python3.8/dist-packages/anyio/_backends/_asyncio.py", line 1754, in getaddrinfo result = await get_running_loop().getaddrinfo( File "uvloop/loop.pyx", line 1528, in getaddrinfo socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions yield File "/usr/local/lib/python3.8/dist-packages/httpx/_transports/default.py", line 353, in handle_async_request resp = await self._pool.handle_async_request(req) File "/usr/local/lib/python3.8/dist-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request raise exc File "/usr/local/lib/python3.8/dist-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request response = await connection.handle_async_request(request) File "/usr/local/lib/python3.8/dist-packages/httpcore/_async/connection.py", line 86, in handle_async_request raise exc File "/usr/local/lib/python3.8/dist-packages/httpcore/_async/connection.py", line 63, in handle_async_request stream = await self._connect(request) File "/usr/local/lib/python3.8/dist-packages/httpcore/_async/connection.py", line 111, in _connect stream = await self._network_backend.connect_tcp(**kwargs) File "/usr/local/lib/python3.8/dist-packages/httpcore/backends/auto.py", line 29, in connect_tcp return await self._backend.connect_tcp( File "/usr/local/lib/python3.8/dist-packages/httpcore/backends/asyncio.py", line 109, in connect_tcp stream: anyio.abc.ByteStream = await anyio.connect_tcp( File "/usr/lib/python3.8/contextlib.py", line 131, in exit self.gen.throw(type, value, traceback) File "/usr/local/lib/python3.8/dist-packages/httpcore/_exceptions.py", line 12, in map_exceptions raise to_exc(exc) httpcore.ConnectError: [Errno -2] Name or service not known

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/nonebot_pluginddcheck/init.py", line 39, in res = await get_reply(text) File "/usr/local/lib/python3.8/dist-packages/nonebot_plugin_ddcheck/data_source.py", line 171, in get_reply vtb_list = await get_vtb_list() File "/usr/local/lib/python3.8/dist-packages/nonebot_plugin_ddcheck/data_source.py", line 88, in get_vtb_list await update_vtb_list() File "/usr/local/lib/python3.8/dist-packages/nonebot_plugin_ddcheck/data_source.py", line 38, in update_vtb_list resp = await client.get(url, timeout=20) File "/usr/local/lib/python3.8/dist-packages/httpx/_client.py", line 1751, in get return await self.request( File "/usr/local/lib/python3.8/dist-packages/httpx/_client.py", line 1527, in request return await self.send(request, auth=auth, follow_redirects=follow_redirects) File "/usr/local/lib/python3.8/dist-packages/httpx/_client.py", line 1614, in send response = await self._send_handling_auth( File "/usr/local/lib/python3.8/dist-packages/httpx/_client.py", line 1642, in _send_handling_auth response = await self._send_handling_redirects( File "/usr/local/lib/python3.8/dist-packages/httpx/_client.py", line 1679, in _send_handling_redirects response = await self._send_single_request(request) File "/usr/local/lib/python3.8/dist-packages/httpx/_client.py", line 1716, in _send_single_request response = await transport.handle_async_request(request) File "/usr/local/lib/python3.8/dist-packages/httpx/_transports/default.py", line 353, in handle_async_request resp = await self._pool.handle_async_request(req) File "/usr/lib/python3.8/contextlib.py", line 131, in exit self.gen.throw(type, value, traceback) File "/usr/local/lib/python3.8/dist-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.ConnectError: [Errno -2] Name or service not known 复现方法:执行查成分命令 复现频率:每次

Shinon9 commented 1 year ago

+1

Shinon9 commented 1 year ago

把data_source.py下面这个函数的urls中的第一个url删掉就可以用了

删这个"http://bh.ayud.top/bili/bilicfsql.php",

async def update_vtb_list(): vtb_list = [] urls = [ "http://bh.ayud.top/bili/bilicfsql.php", "https://api.vtbs.moe/v1/short", "https://api.tokyo.vtbs.moe/v1/short", "https://vtbs.musedash.moe/v1/short", ]