acheong08 / EdgeGPT

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

[Bug]: httpx.TooManyRedirects: Exceeded maximum allowed redirects #600

Open xuantianfengwu opened 1 year ago

xuantianfengwu commented 1 year ago

Is there an existing issue for this?

What happened?

I am at Mainland China. But I am sure my VPN can successfully visit the Bing Chat website and use its function.

I installed the package using Anaconda Prompt successfully, I installed the Browser Extension and export the cookie information successfully. I pasted the json cookie into a newly-created file and named it "bing_cookies_20230709.json". I enter "python -m EdgeGPT.EdgeGPT --cookie-file bing_cookies_20230709.json" in the Anaconda Prompt.

Then comes to the error message: httpx.TooManyRedirects: Exceeded maximum allowed redirects

Steps to reproduce the problem

As described in the "What happened" part

What should have happened?

It should run successfully as instructed.

Version where the problem happens

Name: revChatGPT Version: 6.4.1 Summary: ChatGPT is a reverse engineering of OpenAI's ChatGPT API Home-page: https://github.com/acheong08/ChatGPT Author: Antonio Cheong Author-email: acheong@student.dalat.org License: GNU General Public License v2.0 Location: c:\users\86188\anaconda3\lib\site-packages Requires: async-tio, curl-cffi, httpx, openai, OpenAIAuth, prompt-toolkit, requests, rich, tiktoken Required-by:

What Python version are you running this with?

Python 3.10.9

What is your operating system ?

Windows

Command Line Arguments

python -m EdgeGPT.EdgeGPT --cookie-file bing_cookies_20230709.json

Console logs

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
Traceback (most recent call last):
  File "C:\Users\86188\anaconda3\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\86188\anaconda3\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\86188\anaconda3\lib\site-packages\EdgeGPT\EdgeGPT.py", line 235, in <module>
    main()
  File "C:\Users\86188\anaconda3\lib\site-packages\EdgeGPT\main.py", line 244, in main
    asyncio.run(async_main(args))
  File "C:\Users\86188\anaconda3\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Users\86188\anaconda3\lib\asyncio\base_events.py", line 649, in run_until_complete
    return future.result()
  File "C:\Users\86188\anaconda3\lib\site-packages\EdgeGPT\main.py", line 79, in async_main
    bot = await Chatbot.create(proxy=args.proxy, cookies=cookies)
  File "C:\Users\86188\anaconda3\lib\site-packages\EdgeGPT\EdgeGPT.py", line 42, in create
    await Conversation.create(self.proxy, cookies=cookies),
  File "C:\Users\86188\anaconda3\lib\site-packages\EdgeGPT\conversation.py", line 103, in create
    response = await client.get(
  File "C:\Users\86188\anaconda3\lib\site-packages\httpx\_client.py", line 1757, in get
    return await self.request(
  File "C:\Users\86188\anaconda3\lib\site-packages\httpx\_client.py", line 1530, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "C:\Users\86188\anaconda3\lib\site-packages\httpx\_client.py", line 1617, in send
    response = await self._send_handling_auth(
  File "C:\Users\86188\anaconda3\lib\site-packages\httpx\_client.py", line 1645, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "C:\Users\86188\anaconda3\lib\site-packages\httpx\_client.py", line 1675, in _send_handling_redirects
    raise TooManyRedirects(
httpx.TooManyRedirects: Exceeded maximum allowed redirects.

Additional information

No response

xuantianfengwu commented 1 year ago

Error EdgeGPT

DrowskoytayhulGuider commented 1 year ago

Same problem.

icychick-liu commented 1 year ago

Same same

shaonx commented 1 year ago

same

1138958926 commented 1 year ago

same

DrowskoytayhulGuider commented 1 year ago

Who has solution?

1138958926 commented 1 year ago

Refer to using the command. If starting from the command line, you need to add - proxy to configure your proxy. For example: -- proxy http://127.0.0.1:9999

icychick-liu commented 1 year ago

Refer to using the command. If starting from the command line, you need to add - proxy to configure your proxy. For example: -- proxy http://127.0.0.1:9999

I did. But still not working.

1138958926 commented 1 year ago

emmm

Refer to using the command. If starting from the command line, you need to add - proxy to configure your proxy. For example: -- proxy http://127.0.0.1:9999

I did. But still not working.

What is your VPN and will it have an impact? I am using Clash for Windows

DrowskoytayhulGuider commented 1 year ago

emmm

Refer to using the command. If starting from the command line, you need to add - proxy to configure your proxy. For example: -- proxy http://127.0.0.1:9999

I did. But still not working.

What is your VPN and will it have impact? I am using Clash for Windows

Yes, I am using Clash for Windows, too. It may have some impact, such as when I am using it and opening system proxy, my python crawler will throw error: requests.exceptions.SSLError: HTTPSConnectionPool(host='www.baidu.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1122)'))), even Chinese websites. And I tried your method(after closing Clash), I got another error: httpx.ConnectError: All connection attempts failed.

icychick-liu commented 1 year ago

emmm

Refer to using the command. If starting from the command line, you need to add - proxy to configure your proxy. For example: -- proxy http://127.0.0.1:9999

I did. But still not working.

What is your VPN and will it have an impact? I am using Clash for Windows

It work!!!😂😂😂 I use the TUN mode of Clash,finally it work! Thx image

image

DrowskoytayhulGuider commented 1 year ago

emmm

Refer to using the command. If starting from the command line, you need to add - proxy to configure your proxy. For example: -- proxy http://127.0.0.1:9999

I did. But still not working.

What is your VPN and will it have an impact? I am using Clash for Windows

It work!!!😂😂😂 I use the TUN mode of Clash,finally it work! Thx image

image

你的Clash或是安装EdgeGPT时还有别的配置吗?我的也开了TUN模式,但仍然不起作用。

icychick-liu commented 1 year ago

不知道是不是这里起了作用?我之前修改了Profiles,里面添加了一条bing.com都走代理的规则。 image

DrowskoytayhulGuider commented 1 year ago

bing

这个要怎么编辑啊,我的配置是从某网站上直接配置的,这个怎么手动配置啊?

viopsa233 commented 1 year ago

bing

这个要怎么编辑啊,我的配置是从某网站上直接配置的,这个怎么手动配置啊?

右键点击看到编辑点进去就行 Snipaste_2023-07-11_12-48-23

icychick-liu commented 1 year ago

bing

这个要怎么编辑啊,我的配置是从某网站上直接配置的,这个怎么手动配置啊?

参考下这个,我也不确定是否可以哦,可以试试看。 image

1138958926 commented 1 year ago

好家伙,终于不说英文了你们

DrowskoytayhulGuider commented 1 year ago

当前的问题全部全部解决,谢谢大伙们

1138958926 commented 1 year ago

大伙注意,不要用普通的对话模式传输创建图像的文字,我这边账号的ai功能直接被ban了。目前和newbing 直接对话,一直弹机器人验证,要么就是ai完全不回答

icychick-liu commented 1 year ago

大伙注意,不要用普通的对话模式传输创建图像的文字,我这边账号的ai功能直接被ban了。目前和newbing 直接对话,一直弹机器人验证,要么就是ai完全不回答

收到,谢谢提醒哦

TJustLive commented 1 year ago

bing

这个要怎么编辑啊,我的配置是从某网站上直接配置的,这个怎么手动配置啊?

参考下这个,我也不确定是否可以哦,可以试试看。 image

老哥们,确实是这样,我用的是ghelper的windows客户端,也是莫名其妙的报那个重定向次数多的问题,我现在看到你们配置了这个策略,我也加上了,就没有那个重定向次数过多的问题了。