lgc-NB2Dev / YetAnotherPicSearch

Yet another picture search plugin for nonebot2
GNU General Public License v3.0
107 stars 9 forks source link

E: JSONDecodeError('Expecting value: line 1 column 1 (char 0)') #25

Closed SakuraXiaoWen closed 2 years ago

SakuraXiaoWen commented 2 years ago

YetAnotherPicSearch 、 go-cqhttp 、 nonebot 、 Python 版本及操作系统

插件版本最新的 go-cqhttp:v1.0.0-rc3 nonebot:beta5 python:3.9.13 系统:centos 7.9

列出安装的 Python 包

No response

如何复现

搜图后返回这个错误

期望行为

No response

实际行为

08-12 00:53:57 [ERROR] plugins | ❌️ 该图 [https://gchat.qpic.cn/gchatpic_new/0/0-0-167AE7DBAB719A311D1E371DCC52434D/0] 搜图失败 Traceback (most recent call last): File "", line 1, in File "/usr/local/python3.9/lib/python3.9/multiprocessing/spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "/usr/local/python3.9/lib/python3.9/multiprocessing/spawn.py", line 129, in _main return self._bootstrap(parent_sentinel) File "/usr/local/python3.9/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/usr/local/python3.9/lib/python3.9/multiprocessing/process.py", line 108, in run self._target(*self._args, self._kwargs) File "/usr/local/python3.9/lib/python3.9/site-packages/uvicorn/_subprocess.py", line 76, in subprocess_started target(sockets=sockets) File "/usr/local/python3.9/lib/python3.9/site-packages/uvicorn/server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "/usr/local/python3.9/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/local/python3.9/lib/python3.9/site-packages/nonebot/message.py", line 146, in _check_matcher await _run_matcher(Matcher, bot, event, state, stack, dependency_cache) File "/usr/local/python3.9/lib/python3.9/site-packages/nonebot/message.py", line 196, in _run_matcher await matcher.run(bot, event, state, stack, dependency_cache) File "/usr/local/python3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 672, in run await self.simple_run(bot, event, state, stack, dependency_cache) File "/usr/local/python3.9/lib/python3.9/site-packages/nonebot/internal/matcher.py", line 639, in simple_run await handler( File "/usr/local/python3.9/lib/python3.9/site-packages/nonebot/dependencies/init.py", line 92, in call return await self.call(values) File "/bot/nonebot/plugins/YetAnotherPicSearch/init.py", line 220, in handle_image_search await image_search(value, mode, purge, _cache, client),

File "/bot/nonebot/plugins/YetAnotherPicSearch/init.py", line 87, in image_search async for attempt in AsyncRetrying( File "/usr/local/python3.9/lib/python3.9/site-packages/tenacity/_asyncio.py", line 69, in anext do = self.iter(retry_state=self._retry_state) File "/usr/local/python3.9/lib/python3.9/site-packages/tenacity/init.py", line 360, in iter raise retry_exc.reraise() File "/usr/local/python3.9/lib/python3.9/site-packages/tenacity/init.py", line 193, in reraise raise self.last_attempt.result() File "/usr/local/python3.9/lib/python3.9/concurrent/futures/_base.py", line 439, in result return self.get_result() File "/usr/local/python3.9/lib/python3.9/concurrent/futures/_base.py", line 391, in get_result raise self._exception File "/bot/nonebot/plugins/YetAnotherPicSearch/init.py", line 98, in image_search result = await saucenao_search(url, mode, client, hide_img) File "/bot/nonebot/plugins/YetAnotherPicSearch/saucenao.py", line 38, in saucenao_search res = await saucenao.search(url) File "/usr/local/python3.9/lib/python3.9/site-packages/PicImageSearch/saucenao.py", line 114, in search resp_json = json_loads(resp_text) File "/usr/local/python3.9/lib/python3.9/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/local/python3.9/lib/python3.9/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/python3.9/lib/python3.9/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) QQ截图20220812003310

NekoAria commented 2 years ago

是否配置了 SAUCENAO_API_KEY

SakuraXiaoWen commented 2 years ago

配置了 QQ截图20220812012717

NekoAria commented 2 years ago

有尝试过其他图片吗? 还是只有该图片会触发? 能访问 saucenao.com 吗?

SakuraXiaoWen commented 2 years ago

其他图片也是这个报错 能够正常访问 Screenshot_2022-08-12-01-37-05-206_com tencent mo Screenshot_2022-08-12-01-37-01-179_com tencent mo QQ截图20220812013831

NekoAria commented 2 years ago

看样子是触发 cf 盾了。。

SakuraXiaoWen commented 2 years ago

那有什么解决办法吗,大佬

NekoAria commented 2 years ago

你有代理的话,先配置一下代理吧,我明天再看看能不能修

SakuraXiaoWen commented 2 years ago

好的

NekoAria commented 2 years ago

如果你的服务器是在国内的,还是上代理解决吧,就算能直连 saucenao.com ,其他相关图站几乎都被墙了。