Open JaceyMarvin99 opened 1 year ago
I encountered the same error. I believe it is caused by an authentication error thrown by the OpenAI API.
I added the line print(f"ERROR: payload = {payload}")
before line 83 on chatgpt\chatgpt.py
and the output to console when i ran it was:
ERROR: payload = <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><meta content='text/html; charset=utf-8' http-equiv='content-type'/><style type='text/css'>body { font-family:Arial; margin-left:40px; }img { border:0 none; }#content { margin-left: auto; margin-right: auto }#message h2 { font-size: 20px; font-weight: normal; color: #000000; margin: 34px 0px 0px 0px }#message p { font-size: 13px; color: #000000; margin: 7px 0px 0px 0px }#errorref { font-size: 11px; color: #737373; margin-top: 41px }</style><title>Microsoft</title></head><body><div id='content'><div id='message'><h2>The request is blocked.</h2></div><div id='errorref'><span>0/m2PYwAAAAAH9LLwx3+3QKxJna0IDJrmTE9OMjFFREdFMTYxMABlNjZiOGIwMy0wNzkzLTQ0MDktOTc3My0yZTYxMmU3MWExZTM=</span></div></div></body></html>
To me it looks like the authentication token generated by interceptor.js is somehow invalid (i dont have any expertise in js). Perhaps one of the developers can take a look into this.
Hi @somenothing, @kenngkz!
@AlexSua has been doing an amazing job improving the library. Changes in the OpenAI's backend broke the library but it is already working again. Now it can log in directly with an email and password.
You can update the library with pip install -U chatgpt
and create a config.json file with the following information:
{
"email": "email@example.org",
"password": "xxx"
}
Now it can log in directly with an email and password.
It works! Thanks!
It seems again to having a problem w/ login. I get "Login error. Try again or insert the token yourself."
Just to add more context, I added all params (access_token, session) including email and password and it's failing again.
It seems again to having a problem w/ login. I get "Login error. Try again or insert the token yourself."
This is mainly caused on the backend side of ChatGPT. It is having high traffic problems, which causes some login problems. Look carefully in the stacktrace and you will see that it sometimes is a refused connection, timeout, captcha prompt etc.
Just to add more context, I added all params (access_token, session) including email and password and it's failing again.
Again this is most likely also caused by the OpenAI backend, howevver, if you use it in a python lib you can login manually and make sure to set the config.json path:
model._config_path = 'config.json'
model.login(username, password)
You can also disable the config.json generation when creating a new session by disabling these lines, so you can check make sure that it will generate new keys and not load old ones: https://github.com/labteral/chatgpt-python/blob/f2d632bbe28fe7b7725169119092df39f262d1e8/chatgpt/chatgpt.py#L357 https://github.com/labteral/chatgpt-python/blob/f2d632bbe28fe7b7725169119092df39f262d1e8/chatgpt/chatgpt.py#L404
using python 3.10
my code was
I got
I stored the result of interceptor.js in
config.json
correcly before I run the code. It was