chatgpt.exceptions.ForbiddenException: Access forbidden.
Shuangcheng-Ni opened this issue · 7 comments
chatgpt-api version: 0.2.1
My code:
with ChatGPT(session_token='...', response_timeout=30) as chatter:
ask = input('ask:')
print('ans:', chatter.send_message(ask).content)
The exception it causes:
Traceback (most recent call last):
File "...", line ..., in <module>
with ChatGPT(session_token='...', response_timeout=30) as chatter:
File "/home/user/.local/lib/python3.8/site-packages/chatgpt/api.py", line 68, in __enter__
self.authenticate()
File "/home/user/.local/lib/python3.8/site-packages/chatgpt/api.py", line 81, in authenticate
raise ForbiddenException(
chatgpt.exceptions.ForbiddenException: Access forbidden. It may indicate that something had changed on ChatGPT side. See https://github.com/mbroton/chatgpt-api/issues
It seems that the chatgpt server has upgraded its security policy, which might cause authentication failure.
Yup, they put a Cloudflare anti-DDOS frontend. I think we have to resort to Selenium-like trickeries to be able to bypass it…
Good luck. Needles to say a command line chatGPT is a game changer. Salute
The same problem. Maybe can use the methods applied in this repo https://github.com/acheong08/ChatGPT, which is great enough for terminal use with xvfb. But that one does not contain a good tui so I hope this project can continue improving.
I'm aware of this problem. I'll try to make it work in a day or so.
I made it works, but I need to test it and adapt to the CLI.
Unfortunately, ChatGPT is currently overloaded, so I have to pause my work.
My changes from yesterday don't work anymore.
It's really time consuming to keep it up to date with OpenAI's changes and I can't afford it.
I'm thinking about archiving the repository.
If someone wants to contribute or start working on this project, feel free to do so.
My changes from yesterday don't work anymore. It's really time consuming to keep it up to date with OpenAI's changes and I can't afford it. I'm thinking about archiving the repository. If someone wants to contribute or start working on this project, feel free to do so.
I've found a repository that still works. It resorts to playwright trickeries to bypass the Cloudflare frontend. Maybe you can refer to it.