Comments (7)
I dont know why the first error will happen. A Xvfb session should be started automatically in the library. Maybe that part is not working.
The second error is because you cant minimize window on Xvfb.
Try to delete all minimize windows function and see how it goes.
Also, the google login is not very reliable. A screenshot should be available in your working directory. Check that.
from pychatgpt.
I dont know why the first error will happen. A Xvfb session should be started automatically in the library. Maybe that part is not working. The second error is because you cant minimize window on Xvfb. Try to delete all minimize windows function and see how it goes. Also, the google login is not very reliable. A screenshot should be available in your working directory. Check that.
Thanks! I check the screenshot, and find that google login failed verification.
So I updated pkg to the latest and switched to session-token login, and failed again. I got the error ValueError: Invalid session token
.
[0] Platform: Linux
[0] Display: True
[0] Headless: False
[init] Starting browser
[init] Restoring session token
[init] Ensuring Cloudflare cookies
[cf] Opening new tab
[cf] Getting authorization
[cf] Validating authorization
[cf] resp is not json
[cf] Authorization is empty
Traceback (most recent call last):
File "/root/chat_test.py", line 5, in <module>
api = ChatGPT(session_token=session_token, verbose=True)
File "/root/miniconda3/lib/python3.9/site-packages/pyChatGPT/pyChatGPT.py", line 68, in __init__
self.__init_browser()
File "/root/miniconda3/lib/python3.9/site-packages/pyChatGPT/pyChatGPT.py", line 133, in __init_browser
self.__ensure_cf()
File "/root/miniconda3/lib/python3.9/site-packages/pyChatGPT/pyChatGPT.py", line 322, in __ensure_cf
raise ValueError('Invalid session token')
ValueError: Invalid session token
My session_token is copied from https://chat.openai.com/api/auth/session,
from pychatgpt.
Thanks! I check the screenshot, and find that google login failed verification.
Regarding this, you can recover your account by https://accounts.google.com/signin/recovery?ec=ar_t.
And you will be able to login by google (at least on my end).
My session_token is copied from https://chat.openai.com/api/auth/session
accessToken in this page means Authorization
in headers, not session_token
.
Try to copy from F12 > Application > Cookies tab.
from pychatgpt.
Rogar that! Thanks to your help, I've logged in successfully and sent messages!π
However, api.reset_conversation()
threw a new exception ElementClickInterceptedException
.π
[send_msg] Response is not an error
nice to meet you!
Resetting conversation
Traceback (most recent call last):
File "/root/chat_test.py", line 10, in <module>
api.reset_conversation() # reset the conversation
File "/root/miniconda3/lib/python3.9/site-packages/pyChatGPT/pyChatGPT.py", line 396, in reset_conversation
self.driver.find_element(By.LINK_TEXT, 'New Thread').click()
File "/root/miniconda3/lib/python3.9/site-packages/selenium/webdriver/remote/webelement.py", line 93, in click
self._execute(Command.CLICK_ELEMENT)
File "/root/miniconda3/lib/python3.9/site-packages/selenium/webdriver/remote/webelement.py", line 410, in _execute
return self._parent.execute(command, params)
File "/root/miniconda3/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 444, in execute
self.error_handler.check_response(response)
File "/root/miniconda3/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 249, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element <a class="flex py-3 px-3 items-center gap-3 rounded-md hover:bg-gray-500/10 transition-colors duration-200 text-white cursor-pointer text-sm flex-shrink-0 border border-white/20">...</a> is not clickable at point (120, 31). Other element would receive the click: <div class="flex gap-2">...</div>
(Session info: chrome=108.0.5359.94)
Stacktrace:
#0 0x55d77c44f2a3 <unknown>
Maybe this error is due to the change of UI? I log into chat https://chat.openai.com and find that the chatroom UI is different from what I saw servel days ago.
from pychatgpt.
However,
api.reset_conversation()
threw a new exceptionElementClickInterceptedException
.π
Yeah. This prompt is blocking the view. I am looking into this issue.
from pychatgpt.
Check v0.3.9.2
from pychatgpt.
It works now. Thanks very much~
from pychatgpt.
Related Issues (20)
- chatgpt plus: can we use pychatgpt? HOT 1
- pyChatGPT doesn't work for edge.
- pychatgpt doesn't work for two response
- pychatgpt doesn't work for two response in last version
- today pyChatgpt not working anymore ... HOT 5
- anyone help this problem
- how to use pychatgpt by email and password without cash
- TimeoutException HOT 18
- python example wrapper with 'python3 -m pyChatGPT' ?
- Login button update?
- Crash on session_token = chatgptapi ----- api = ChatGPT(session_token)
- GRPC error HOT 1
- response['message'] could not get the returned data HOT 10
- 'NoneType' object has no attribute 'group' HOT 2
- Made a library that has a similar structure to this library, but is maintained and improved
- helpοΌlist index out of range HOT 2
- Add a support for system prompts
- list index out of range
- do not work HOT 3
- version chrome_driver problem HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pychatgpt.