lss233 / chatgpt-mirai-qq-bot

🚀 一键部署!真正的 AI 聊天机器人!支持ChatGPT、文心一言、讯飞星火、Bing、Bard、ChatGLM、POE,多账号,人设调教,虚拟女仆、图片渲染、语音发送 | 支持 QQ、Telegram、Discord、微信 等平台
GNU Affero General Public License v3.0
13.33k stars 1.56k forks source link

[BUG] 切换bing失败 Authentication failed. #274

Closed Southpl closed 1 year ago

Southpl commented 1 year ago

提交 issue 前,请先确认:

表现
管理员发送“切换AI bing"后报错:出现故障!如果这个问题持续出现,请和我说“重置会话” 来开启一段新的会话,或者发送 “回滚会话” 来回溯到上一条对话,你上一条说的我就当作没看见。 Authentication failed. You have not been accepted into the beta.

运行环境:

截图
ERROR | main:request:182 - Authentication failed. You have not been accepted into the beta. Traceback (most recent call last):

File "E:\GPT\Windows-quickstart-refs.tags.v2.1.0\chatgpt\python3.9\lib\site-packages\EdgeGPT.py", line 153, in init raise NotAllowedToAccess(self.struct["result"]["message"]) │ │ └ {'result': {'value': 'UnauthorizedRequest', 'message': 'Sorry, you need to login first to access this service.'}} │ └ <EdgeGPT.Conversation object at 0x00000261DD0AA700> └ <class 'EdgeGPT.NotAllowedToAccess'>

EdgeGPT.NotAllowedToAccess: Sorry, you need to login first to access this service.

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

Traceback (most recent call last):

File "E:\GPT\Windows-quickstart-refs.tags.v2.1.0\chatgpt\bot.py", line 292, in app.launch_blocking() │ └ <classmethod object at 0x00000261DAA89970> └ <graia.ariadne.app.Ariadne object at 0x00000261B12ED2E0>

File "E:\GPT\Windows-quickstart-refs.tags.v2.1.0\chatgpt\python3.9\lib\site-packages\graia\ariadne\app.py", line 312, in launch_blocking cls.launch_manager.launch_blocking(loop=cls.service.loop, stop_signal=stop_signals) │ │ │ │ │ │ └ (<Signals.SIGINT: 2>,) │ │ │ │ │ └ <property object at 0x00000261DAA8E950> │ │ │ │ └ <graia.ariadne.service.ElizabethService object at 0x00000261DA3EAC70> │ │ │ └ <class 'graia.ariadne.app.Ariadne'> │ │ └ <function Launart.launch_blocking at 0x00000261DA4690D0> │ └ <launart.manager.Launart object at 0x00000261DBC449D0> └ <class 'graia.ariadne.app.Ariadne'>

File "E:\GPT\Windows-quickstart-refs.tags.v2.1.0\chatgpt\python3.9\lib\site-packages\launart\manager.py", line 494, in launch_blocking loop.run_until_complete(launch_task) │ │ └ <Task pending name='amnesia-launch' coro=<Launart.launch() running at E:\GPT\Windows-quickstart-refs.tags.v2.1.0\chatgpt\pyth... │ └ <function BaseEventLoop.run_until_complete at 0x00000261B37F8AF0> └

File "asyncio\base_events.py", line 634, in run_until_complete ', '.join(str(exc) for exc in exceptions))) └ <module 'asyncio.exceptions' from 'E:\GPT\Windows-quickstart-refs.tags.v2.1.0\chatgpt\python3.9\python39.zip\asyncio\e...

File "asyncio\windows_events.py", line 321, in run_forever

File "asyncio\base_events.py", line 601, in run_forever exc.errno, 'error while '

File "asyncio\base_events.py", line 1905, in _run_once

File "asyncio\events.py", line 80, in _run self._loop = loop │ └ <member '_loop' of 'Handle' objects> └ <Handle <TaskStepMethWrapper object at 0x00000261DBA5EFD0>()>

File "E:\GPT\Windows-quickstart-refs.tags.v2.1.0\chatgpt\bot.py", line 115, in request conversation_handler.current_conversation = await conversation_handler.create(bot_type_search.group(1).strip()) │ │ │ │ │ └ <method 'group' of 're.Match' objects> │ │ │ │ └ <re.Match object; span=(0, 9), match='切换AI bing'> │ │ │ └ <function ConversationHandler.create at 0x00000261DBC941F0> │ │ └ <conversation.ConversationHandler object at 0x00000261B3BE2850> │ └ <conversation.ConversationContext object at 0x00000261DB1EB760> └ <conversation.ConversationHandler object at 0x00000261B3BE2850>

File "E:\GPT\Windows-quickstart-refs.tags.v2.1.0\chatgpt\conversation.py", line 99, in create conversation = ConversationContext(_type, self.session_id) │ │ │ └ 'friend-1121601996' │ │ └ <conversation.ConversationHandler object at 0x00000261B3BE2850> │ └ 'bing' └ <class 'conversation.ConversationContext'>

File "E:\GPT\Windows-quickstart-refs.tags.v2.1.0\chatgpt\conversation.py", line 33, in init self.adapter = BingAdapter(self.session_id) │ │ │ └ 'friend-1121601996' │ │ └ <conversation.ConversationContext object at 0x00000261DB6981F0> │ └ <class 'adapter.ms.bing.BingAdapter'> └ <conversation.ConversationContext object at 0x00000261DB6981F0>

File "E:\GPT\Windows-quickstart-refs.tags.v2.1.0\chatgpt\adapter\ms\bing.py", line 33, in init self.bot = EdgeChatbot(self.cookieFile.name) │ │ │ │ └ 'C:\Users\Shao_\AppData\Local\Temp\tmpj1hk_l_o.json' │ │ │ └ <tempfile._TemporaryFileWrapper object at 0x00000261DD0AA610> │ │ └ <adapter.ms.bing.BingAdapter object at 0x00000261DD0AA6A0> │ └ <class 'EdgeGPT.Chatbot'> └ <adapter.ms.bing.BingAdapter object at 0x00000261DD0AA6A0>

File "E:\GPT\Windows-quickstart-refs.tags.v2.1.0\chatgpt\python3.9\lib\site-packages\EdgeGPT.py", line 235, in init self.chathub: ChatHub = ChatHub(Conversation(self.cookiePath)) │ │ │ │ └ 'C:\Users\Shao\AppData\Local\Temp\tmpj1hk_l_o.json' │ │ │ └ <EdgeGPT.Chatbot object at 0x00000261DD0AA850> │ │ └ <class 'EdgeGPT.Conversation'> │ └ <class 'EdgeGPT.ChatHub'> └ <EdgeGPT.Chatbot object at 0x00000261DD0AA850>

File "E:\GPT\Windows-quickstart-refs.tags.v2.1.0\chatgpt\python3.9\lib\site-packages\EdgeGPT.py", line 155, in init raise Exception(

Exception: Authentication failed. You have not been accepted into the beta.

其他内容
我的new bing使用申请已经通过

lss233 commented 1 year ago

这是你的 Cookie 不正确导致的
请检查你的 Cookie 是否完整

Southpl commented 1 year ago

README中说需要cookie_content = 'MUID=xxxxx; SRCHD=AF=xxxx; SRCHUID=V=2&GUID=xxxxxxxx; MicrosoftApplicationsTelemetryDeviceId=xxxxxx-xxxx-xxxx-xxx-xxxxx; ...一串很长的文本...' 我已将cookie全部复制,我获取到的cookie非常长,其中还包括了一些上面没有的参数,如PPLState=1; imgv=flts=xxx; _UR=QS=0&TQS=0; _tarLang=default=zh-Hans; _TTSS_IN=hist=xxx; _TTSS_OUT=hist=xxx,这是否有影响?还是说只需要上面的 'MUID=xxxxx; SRCHD=AF=xxxx; SRCHUID=V=2&GUID=xxxxxxxx; MicrosoftApplicationsTelemetryDeviceId=xxxxxx-xxxx-xxxx-xxx-xxxxx; ‘这些参数即可?登录的时候控制台显示bing账号登陆成功。

lss233 commented 1 year ago

需要包含所有的参数
你在网页上和 bing 聊过吗,确定能用?

Southpl commented 1 year ago

确定可以用,已经聊过了,代理对cookie有没有影响?

Southpl commented 1 year ago

v2.2.0已经可以成功切换bingAI