acheong08 / EdgeGPT

Reverse engineered API of Microsoft's Bing Chat AI
The Unlicense
8.09k stars 920 forks source link

Exception: Authentication failed with Status code: 404 #178

Closed cool-xuan closed 1 year ago

cool-xuan commented 1 year ago

Thanks a lot for your awesome work first.

Prior to this day, EdgeGPT was working well, but unexpectedly, an exception has arisen. Despite my attempts to upgrade EdgeGPT to the most newest version (0.1.3) and to refresh my cookie file, this exception persists.

Besides, a Status Code 404 is reported.

Precisely, when I try to run python -m EdgeGPT --cookie-file ./cookies.json, the shell outputs:

    EdgeGPT - A demo of reverse engineering the Bing GPT chatbot
    Repo: github.com/acheong08/EdgeGPT
    By: Antonio Cheong

    !help for help

    Type !exit to exit

    Initializing...
    Enter `alt+enter` or `escape+enter` to send a message
    Status code: 404
    A looooooooooooooooooooong code (like html codes)
    Traceback (most recent call last):
      File "/home/zhouyixuan/miniconda3/envs/edgegpt/lib/python3.8/runpy.py", line 194, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "/home/zhouyixuan/miniconda3/envs/edgegpt/lib/python3.8/runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "/home/zhouyixuan/chatgpt/EdgeGPT/src/EdgeGPT.py", line 467, in <module>
        asyncio.run(main())
      File "/home/zhouyixuan/miniconda3/envs/edgegpt/lib/python3.8/asyncio/runners.py", line 44, in run
        return loop.run_until_complete(main)
      File "/home/zhouyixuan/miniconda3/envs/edgegpt/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
        return future.result()
      File "/home/zhouyixuan/chatgpt/EdgeGPT/src/EdgeGPT.py", line 378, in main
        bot = Chatbot()
      File "/home/zhouyixuan/chatgpt/EdgeGPT/src/EdgeGPT.py", line 308, in __init__
        self.chat_hub: ChatHub = ChatHub(Conversation(self.cookiePath, self.cookies))
      File "/home/zhouyixuan/chatgpt/EdgeGPT/src/EdgeGPT.py", line 220, in __init__
        raise Exception("Authentication failed")
    Exception: Authentication failed
jerrymaolong commented 1 year ago

i have the same problem! what happen?

cool-xuan commented 1 year ago

@DreamMaoMao I suspect that Edge is only available in specific regions and unfortunately, China is currently blocked. 😭

yduanBioinfo commented 1 year ago

I have the same problem too.

Harry-Jing commented 1 year ago

Now you can't access https://edgeservices.bing.com/edgesvc/turing/conversation/create when you use China's IP

jerrymaolong commented 1 year ago

Chinese IP addresses can access this link, but it seems that the link has been moved and is no longer valid, resulting in a 404 error @Harry-Jing

yduanBioinfo commented 1 year ago

As you said, I can't access the link right now. The following is the response when I try to reach that link:

Our services aren't available right now

We're working to restore all services as soon as possible. Please check back soon.

0scYbZAAAAAA5aSklsq20Q7e9xNqoeKDbQkoxRURHRTEwXXXXXXXXX== Can I suppose that the rules for Chinese IP for this link will be consistent with what is for the link www.bing.com/NEW? And I can't use this package until Microsoft changes its IP rules for both edgeservices.bing.com and NEWBING? ________________________________ 发件人: GreamMaoMao ***@***.***> 发送时间: 2023年3月23日 11:51 收件人: acheong08/EdgeGPT ***@***.***> 抄送: yduanBioinfo ***@***.***>; Comment ***@***.***> 主题: Re: [acheong08/EdgeGPT] Exception: Authentication failed with Status code: 404 (Issue #178) Chinese IP addresses can access this link, but it seems that the link has been moved and is no longer valid, resulting in a 404 error @Harry-Jing ― Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: ***@***.***>
KamiPasi commented 1 year ago

需要加代理

acheong08 commented 1 year ago

export all_proxy=socks5://127.0.0.1:1080/

tom68-ll commented 1 year ago

I have the same question

chswy123 commented 1 year ago

Yes, I have the same problem

WhitneyYan commented 1 year ago

如果用的是v2rayN做代理,而且报错

httpx.ConnectError: EOF occurred in violation of protocol (_ssl.c:997)

可以看看这个,然后把代理开了也不报错。 我没升级v2rayN,就用的这种方法。 image

acheong08 commented 1 year ago

我用的是 https://github.com/p4gefau1t/trojan-go

Meteor-Sage commented 1 year ago

If you are using a Chinese IP, please use a proxy. If this still happens, please check the proxy rules. Some proxy rules set Microsoft services to be directly connected. Modify them to use a proxy instead.

cool-xuan commented 1 year ago

If you are using a Chinese IP, please use a proxy. If this still happens, please check the proxy rules. Some proxy rules set Microsoft services to be directly connected. Modify them to use a proxy instead.

Thanks for your reply. EdgeGPT works again when I set Proxy.

Silhouette6 commented 1 year ago

It was used for none proxy,but now......

Nu11Const commented 1 year ago

How can not use proxy to work?

jerrymaolong commented 1 year ago

它曾经用于无代理,但现在...... The reason I use this interface is because I don't want to use proxy ...

Nu11Const commented 1 year ago

I try to use python to reverse proxy it.

Nu11Const commented 1 year ago

我解决这个问题了! 把 https://edgeservices.bing.com/edgesvc/turing/conversation/create 改成我搭建的镜像站https://bing.vmtask.repl.co/edgesvc/turing/conversation/create 就行了。不过最好不要用我的,要自己搭建。

freedgw commented 1 year ago

我解决这个问题了! 把 https://edgeservices.bing.com/edgesvc/turing/conversation/create 改成我搭建的镜像站https://bing.vmtask.repl.co/edgesvc/turing/conversation/create 就行了。不过最好不要用我的,要自己搭建。

如何搭建呢,反代吗

acheong08 commented 1 year ago

如何搭建呢,反代吗

Example: https://github.com/acheong08/EdgeGPT-Proxy

acheong08 commented 1 year ago
acheong08 commented 1 year ago
export BING_PROXY_URL="https://edge.churchless.tech/edgesvc/turing/conversation/create"
acheong08 commented 1 year ago

https://github.com/acheong08/EdgeGPT/releases/tag/0.1.9

acheong08 commented 1 year ago

It automatically retries on error with a public proxy server.

wong2 commented 1 year ago

So does the fallback proxy have access to the user cookie? I think that should be clarified.

acheong08 commented 1 year ago

It does in order to authenticate. How should I ensure transparency?

acheong08 commented 1 year ago

It runs https://github.com/acheong08/EdgeGPT-Proxy and doesn't log anything

wong2 commented 1 year ago

Maybe not provide it as a fallback, but let user use it manually via export BING_PROXY_URL="https://edge.churchless.tech/edgesvc/turing/conversation/create"

wong2 commented 1 year ago

@acheong08 Can you add CORS headers to the proxy response? I'd like to use it in https://github.com/chathub-dev/chathub thanks!

acheong08 commented 1 year ago

@acheong08 Can you add CORS headers to the proxy response? I'd like to use it in chathub-dev/chathub thanks!

Added

acheong08 commented 1 year ago

Maybe not provide it as a fallback, but let user use it manually via export BING_PROXY_URL="https://edge.churchless.tech/edgesvc/turing/conversation/create"

I want the experience to be smooth. Most people don't read the readme properly. You can of course still set BING_PROXY_URL to override it.

Darkluna999 commented 1 year ago

我解决这个问题了! 把 https://edgeservices.bing.com/edgesvc/turing/conversation/create 改成我搭建的镜像站https://bing.vmtask.repl.co/edgesvc/turing/conversation/create 就行了。不过最好不要用我的,要自己搭建。

请问你是如何解决的?我自己部署之后会不断出现被新加坡微软云访问然后302。。。 image

image

头几个是直接浏览器访问和wget,没有任何问题 但使用python模块拉取就会触发302 部署的方式是

go install github.com/acheong08/EdgeGPT-Proxy@latest
go/bin/EdgeGPT-Proxy

尝试了反向代理和https都没效,我是不是比你少了某些设置?

AthanaD commented 1 year ago

出现故障!如果这个问题持续出现,请和我说“重置会话” 来开启一段新的会话,或者发送 “回滚会话” 来回溯到上一条对话,你上一条说的我就当作没看见。 CaptchaChallenge: User needs to solve CAPTCHA to continue.