Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

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

Open
1 task done
xuantianfengwu opened this issue Jul 9, 2023 · 21 comments
Open
1 task done

Comments

@xuantianfengwu
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

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
Copy link
Author

Error EdgeGPT

@DrowskoytayhulGuider
Copy link

Same problem.

@icychick-liu
Copy link

Same same

@shaonx
Copy link

shaonx commented Jul 10, 2023

same

1 similar comment
@1138958926
Copy link

same

@DrowskoytayhulGuider
Copy link

Who has solution?

@1138958926
Copy link

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
Copy link

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
Copy link

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
Copy link

DrowskoytayhulGuider commented Jul 11, 2023

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
Copy link

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
Copy link

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
Copy link

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

@DrowskoytayhulGuider
Copy link

bing

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

@viopsa233
Copy link

bing

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

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

@icychick-liu
Copy link

bing

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

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

@1138958926
Copy link

1138958926 commented Jul 11, 2023

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

@DrowskoytayhulGuider
Copy link

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

@1138958926
Copy link

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

@icychick-liu
Copy link

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

收到,谢谢提醒哦

@TJustLive
Copy link

bing

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

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

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants