Skip to content
New issue

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

[BUG]: 错误信息:Verify you are human,应该怎么解决 #114

Open
3 of 4 tasks
chung1912 opened this issue Feb 14, 2023 · 7 comments
Open
3 of 4 tasks

[BUG]: 错误信息:Verify you are human,应该怎么解决 #114

chung1912 opened this issue Feb 14, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@chung1912
Copy link

报告清单

  • 我已仔细阅读并了解上述注意事项。
  • 我已使用最新版本测试过,确认问题依旧存在。
  • 我确定在 GitHub Issues 中没有相同或相似的问题。
  • 我有足够的时间和能力,愿意为此提交 PR 来修复问题。

影响版本

v0.7.4

问题描述

02-14 12:25:46 [ERROR] nonebot | Running Matcher(type='message', module=nonebot_plugin_chatgpt.utils) failed.
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.10/multiprocessing/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/usr/local/lib/python3.10/multiprocessing/spawn.py", line 129, in _main
return self._bootstrap(parent_sentinel)
File "/usr/local/lib/python3.10/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/usr/local/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/site-packages/uvicorn/subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "/usr/local/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run
return asyncio.run(self.serve(sockets=sockets))
File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.10/site-packages/nonebot/message.py", line 141, in _check_matcher
await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)

File "/usr/local/lib/python3.10/site-packages/nonebot/message.py", line 187, in _run_matcher
await matcher.run(bot, event, state, stack, dependency_cache)
File "/usr/local/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 732, in run
await self.simple_run(bot, event, state, stack, dependency_cache)
File "/usr/local/lib/python3.10/site-packages/nonebot/internal/matcher/matcher.py", line 707, in simple_run
await handler(
File "/usr/local/lib/python3.10/site-packages/nonebot/dependencies/init.py", line 108, in call
return await cast(Callable[..., Awaitable[R]], self.call)(**values)
File "/usr/local/lib/python3.10/site-packages/nonebot_plugin_chatgpt/init.py", line 66, in ai_chat
msg = await chat_bot(**session[event]).get_chat_response(text)
File "/usr/local/lib/python3.10/site-packages/nonebot_plugin_chatgpt/chatgpt.py", line 126, in get_chat_response
await self.get_cf_cookies(page)
File "/usr/local/lib/python3.10/site-packages/nonebot_plugin_chatgpt/chatgpt.py", line 232, in get_cf_cookies
button = page.get_by_role("button", name="Verify you are human")
AttributeError: 'Page' object has no attribute 'get_by_role'

复现步骤

使用CHATGPT_SESSION_TOKEN配置,使用时出现如上错误

预期行为

No response

实际行为

No response

日志信息

No response

额外补充

No response

@chung1912 chung1912 added the bug Something isn't working label Feb 14, 2023
@chung1912
Copy link
Author

只出现几次吗

每次都这样,没有成功过

@525716612
Copy link

image 你把chatgpt.py第55行的这个headless=True改成headless=False,然后重启用一下他会显示出它模拟打开浏览器做的步骤,看看他干了什么,卡在哪了

image
我也遇到这个问题 具体报错是在这里

@525716612
Copy link

我的已经解决了 是因为playwright没装 而且默认浏览器启动的chrome 但是chatGPT回复永远都是超时

@KnightKilito
Copy link

一样,我装了playwright,我也试着替换了@CCYellowStar pr的更改后的chatgpt.py文件,但是还是报错。
服务器Ubuntu,在洛杉矶应该也用不着梯子。感觉就是CF的人机校验拦住了。

03-11 19:31:08 [INFO] nonebot | Event will be handled by Matcher(type='message', module=plugins.mute)
03-11 19:31:08 [INFO] nonebot | Event will be handled by Matcher(type='message', module=plugins.black_word)
03-11 19:31:08 [INFO] nonebot | Event will be handled by Matcher(type='message', module=basic_plugins.chat_history.chat_message)
03-11 19:31:08 [INFO] nonebot | Matcher(type='message', module=plugins.mute) running complete
03-11 19:31:08 [INFO] nonebot | Event will be handled by Matcher(type='message', module=plugins.parse_bilibili_json)
03-11 19:31:08 [INFO] nonebot | Matcher(type='message', module=plugins.black_word) running complete
03-11 19:31:08 [INFO] nonebot | Matcher(type='message', module=plugins.parse_bilibili_json) running complete
03-11 19:31:08 [INFO] nonebot | Matcher(type='message', module=basic_plugins.chat_history.chat_message) running complete
03-11 19:31:08 [INFO] nonebot | Event will be handled by Matcher(type='message', module=plugins.fudu)
03-11 19:31:08 [INFO] nonebot | Event will be handled by Matcher(type='message', module=extensive_plugin.nonebot_plugin_chatgpt.utils)
03-11 19:31:08 [INFO] nonebot | Matcher(type='message', module=plugins.fudu) running complete
03-11 19:31:14 [INFO] nonebot | Matcher(type='message', module=extensive_plugin.nonebot_plugin_chatgpt.utils) running complete
03-11 19:31:14 [ERROR] nonebot | Running Matcher(type='message', module=extensive_plugin.nonebot_plugin_chatgpt.utils) failed.
Traceback (most recent call last):
  File "/home/zhenxun_bot/bot.py", line 23, in <module>
    nonebot.run()
  File "/usr/local/lib/python3.9/dist-packages/nonebot/__init__.py", line 273, in run
    get_driver().run(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/nonebot/drivers/fastapi.py", line 187, in run
    uvicorn.run(
  File "/usr/local/lib/python3.9/dist-packages/uvicorn/main.py", line 463, in run
    server.run()
  File "/usr/local/lib/python3.9/dist-packages/uvicorn/server.py", line 60, in run
    return asyncio.run(self.serve(sockets=sockets))
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/dist-packages/nonebot/message.py", line 141, in _check_matcher
    await _run_matcher(Matcher, bot, event, state, stack, dependency_cache)
> File "/usr/local/lib/python3.9/dist-packages/nonebot/message.py", line 187, in _run_matcher
    await matcher.run(bot, event, state, stack, dependency_cache)
  File "/usr/local/lib/python3.9/dist-packages/nonebot/internal/matcher/matcher.py", line 732, in run
    await self.simple_run(bot, event, state, stack, dependency_cache)
  File "/usr/local/lib/python3.9/dist-packages/nonebot/internal/matcher/matcher.py", line 707, in simple_run
    await handler(
  File "/usr/local/lib/python3.9/dist-packages/nonebot/dependencies/__init__.py", line 108, in __call__
    return await cast(Callable[..., Awaitable[R]], self.call)(**values)
  File "/home/zhenxun_bot/extensive_plugin/nonebot_plugin_chatgpt/__init__.py", line 66, in ai_chat
    msg = await chat_bot(**session[event]).get_chat_response(text)
  File "/home/zhenxun_bot/extensive_plugin/nonebot_plugin_chatgpt/chatgpt.py", line 126, in get_chat_response
    await self.get_cf_cookies(page)
  File "/home/zhenxun_bot/extensive_plugin/nonebot_plugin_chatgpt/chatgpt.py", line 231, in get_cf_cookies
    button = page.get_by_role("button", name="Verify you are human")
AttributeError: 'Page' object has no attribute 'get_by_role'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
@chung1912 @KnightKilito @525716612 and others