Cosmos01 / aichat-chatGPT

HoshinoBot aichat插件魔改GPT-3.5 API版本
Apache License 2.0
51 stars 7 forks source link

Wrong response code #6

Closed cpms closed 1 year ago

cpms commented 1 year ago
[2022-12-12 12:37:41,529 nonebot] ERROR: Failed to import "hoshino.modules.aichat-chatGPT.aichat", error: Wrong response code
[2022-12-12 12:37:41,530 nonebot] ERROR: Wrong response code
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/nonebot/plugin.py", line 253, in load_plugin
    module = importlib.import_module(module_path)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/root/xcwbot/HoshinoBot/hoshino/modules/aichat-chatGPT/aichat.py", line 34, in <module>
    chatbot = Chatbot(auth_config)
              ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/revChatGPT/revChatGPT.py", line 96, in __init__
    self.refresh_session()
  File "/usr/local/lib/python3.11/site-packages/revChatGPT/revChatGPT.py", line 308, in refresh_session
    raise Exception("Wrong response code")
Exception: Wrong response code

测试过的revChatGPT版本:0.0.38.7(网站加了cf保护)、0.0.38.8(目前最新) 按照此方法获取了参数。

不知道这个错误是不是验证失败导致的呢?

Cosmos01 commented 1 year ago

我目前使用的版本是0.0.38.7 这个问题我只在三个参数输入错误的时候遇到过,请检查一下参数,如果使用了代理请确认你浏览器登录网页时是否使用了相同代理。

cpms commented 1 year ago

是不是说,取得参数的机器IP,跟运行机器人必须是同一个IP呢。我是在我电脑上拿cookie的,然后放到服务器去运行。

Cosmos01 commented 1 year ago

服务器如果不能直接开浏览器的话,可以开个代理服务,你本地用代理获取cookie。或是服务器和本地使用相同代理。反正起码得保证ip一致

cpms commented 1 year ago

看起来访问的IP是不能有变化的。我使用服务器进行代理,然后用本地浏览器获取cookie后解决。感谢。