Giter Club home page Giter Club logo

Comments (7)

terry3041 avatar terry3041 commented on July 30, 2024

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.

Ulysses0817 avatar Ulysses0817 commented on July 30, 2024

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.
image

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,
image

from pychatgpt.

terry3041 avatar terry3041 commented on July 30, 2024

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.

Ulysses0817 avatar Ulysses0817 commented on July 30, 2024

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.
image

from pychatgpt.

terry3041 avatar terry3041 commented on July 30, 2024

However, api.reset_conversation() threw a new exception ElementClickInterceptedException.😭

image

Yeah. This prompt is blocking the view. I am looking into this issue.

from pychatgpt.

terry3041 avatar terry3041 commented on July 30, 2024

Check v0.3.9.2

from pychatgpt.

Ulysses0817 avatar Ulysses0817 commented on July 30, 2024

It works now. Thanks very much~

from pychatgpt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.