Repository: acheong08/ChatGPT

Issue #261: [BUG] Can't login | Cloudflare protection
Created: 2022-12-11T22:15:43Z
Describe the bug
I'm not able to login.
To Reproduce
Steps to reproduce the behavior:

Use the library as normal,  with email/password or session token.
If you are using email/password you'll get an API Error at start
If you are using a session token you'll get an Exception: Wrong response code at start

Expected behavior
Be able to access the website as normal.
Output
Using session token:
Traceback (most recent call last):
  File "/home/container/main.py", line 1, in <module>
    from src import bot
  File "/home/container/src/bot.py", line 3, in <module>
    from src import responses
  File "/home/container/src/responses.py", line 36, in <module>
    chatbot = Chatbot(config, conversation_id=None)
  File "/home/container/.local/lib/python3.10/site-packages/revChatGPT/revChatGPT.py", line 95, in __init__
    self.refresh_session()
  File "/home/container/.local/lib/python3.10/site-packages/revChatGPT/revChatGPT.py", line 296, in refresh_session
    raise Exception("Wrong response code")
Exception: Wrong response code

Using email/password:
Traceback (most recent call last):
  File "/home/container/main.py", line 1, in <module>
    from src import bot
  File "/home/container/src/bot.py", line 3, in <module>
    from src import responses
  File "/home/container/src/responses.py", line 36, in <module>
    chatbot = Chatbot(config, conversation_id=None)
  File "/home/container/.local/lib/python3.10/site-packages/revChatGPT/revChatGPT.py", line 95, in __init__
    self.refresh_session()
  File "/home/container/.local/lib/python3.10/site-packages/revChatGPT/revChatGPT.py", line 340, in refresh_session
    raise exc
  File "/home/container/.local/lib/python3.10/site-packages/revChatGPT/revChatGPT.py", line 337, in refresh_session
    self.login(self.config["email"], self.config["password"])
  File "/home/container/.local/lib/python3.10/site-packages/revChatGPT/revChatGPT.py", line 373, in login
    raise exc
  File "/home/container/.local/lib/python3.10/site-packages/revChatGPT/revChatGPT.py", line 366, in login
    auth.begin()
  File "/home/container/.local/lib/python3.10/site-packages/OpenAIAuth/OpenAIAuth.py", line 95, in begin
    raise Exception("API error")
Exception: API error

Environment (please complete the following information):
Please update your packages before reporting! pip3 install --upgrade OpenAIAuth revChatGPT

OS: Linux
Python version: 3.10.8
ChatGPT Version: 0.0.38.6
OpenAI Version: 0.0.6

Additional context
I saw that they applied Cloudflare on the website, and there are more cookies than before:

If I delete the cookie cf_clearance, the next time I reload the website I will get the Cloudflare is verifying your connection page, otherwise, it will not show.

Duplicate issue #283: JSONDecodeError
Created: 2022-12-12T14:58:31Z
When sending a message to the bot, an error appears -
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 3 (char 2)

Can you suggest what to do at this moment?

Closing comment (2022-12-12T15:00:00Z): This is a duplicate of #261