Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headless driver prevents code from running #45

Open
2 of 4 tasks
bhav09 opened this issue Oct 3, 2023 · 0 comments
Open
2 of 4 tasks

Headless driver prevents code from running #45

bhav09 opened this issue Oct 3, 2023 · 0 comments
Assignees
Labels
unconfirmed bug Potential bugs awaiting confirmation

Comments

@bhav09
Copy link

bhav09 commented Oct 3, 2023

Description

When I run the code with headless=True, it doesn't execute.

Steps to Reproduce

I am running the below code:

api = ChatGPT(
    session_token,
    proxy=None,
    disable_moderation=False,
    verbose=False,
    headless=True
)
message = api.send_message(
    "Hey ChatGPT!",
    input_mode="INSTANT", # Can be INSTANT or SLOW
    input_delay=0.1, # Only used when input_mode is set to SLOW
)
print(message.response, message.conversation_id)

Error Message or Traceback

If applicable, include the complete error message or traceback you received. This will help us in identifying the problem more quickly.

Traceback (most recent call last):
  File "venv/lib/python3.10/site-packages/UnlimitedGPT/UnlimitedGPT.py", line 263, in _ensure_cf
    WebDriverWait(self.driver, 10).until_not(
  File "venv/lib/python3.10/site-packages/UnlimitedGPT/UnlimitedGPT.py", line 118, in until_not
    raise TimeoutException(message)
selenium.common.exceptions.TimeoutException: Message: 


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "venv/lib/python3.10/site-packages/UnlimitedGPT/UnlimitedGPT.py", line 263, in _ensure_cf
    WebDriverWait(self.driver, 10).until_not(
  File "venv/lib/python3.10/site-packages/UnlimitedGPT/UnlimitedGPT.py", line 118, in until_not
    raise TimeoutException(message)
selenium.common.exceptions.TimeoutException: Message: 


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "venv/lib/python3.10/site-packages/UnlimitedGPT/UnlimitedGPT.py", line 263, in _ensure_cf
    WebDriverWait(self.driver, 10).until_not(
  File "venv/lib/python3.10/site-packages/UnlimitedGPT/UnlimitedGPT.py", line 118, in until_not
    raise TimeoutException(message)
selenium.common.exceptions.TimeoutException: Message: 


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "venv/lib/python3.10/site-packages/UnlimitedGPT/UnlimitedGPT.py", line 263, in _ensure_cf
    WebDriverWait(self.driver, 10).until_not(
  File "venv/lib/python3.10/site-packages/UnlimitedGPT/UnlimitedGPT.py", line 118, in until_not
    raise TimeoutException(message)
selenium.common.exceptions.TimeoutException: Message: 


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/main.py", line 16, in <module>
    api = ChatGPT(
  File "venv/lib/python3.10/site-packages/UnlimitedGPT/UnlimitedGPT.py", line 77, in __init__
    self._init_browser()
  File "venv/lib/python3.10/site-packages/UnlimitedGPT/UnlimitedGPT.py", line 189, in _init_browser
    self._ensure_cf()
  File "venv/lib/python3.10/site-packages/UnlimitedGPT/UnlimitedGPT.py", line 272, in _ensure_cf
    return self._ensure_cf(retry - 1)
  File "venv/lib/python3.10/site-packages/UnlimitedGPT/UnlimitedGPT.py", line 272, in _ensure_cf
    return self._ensure_cf(retry - 1)
  File "venv/lib/python3.10/site-packages/UnlimitedGPT/UnlimitedGPT.py", line 272, in _ensure_cf
    return self._ensure_cf(retry - 1)
  File "venv/lib/python3.10/site-packages/UnlimitedGPT/UnlimitedGPT.py", line 273, in _ensure_cf
    raise ValueError("Cloudflare challenge failed")
ValueError: Cloudflare challenge failed

Environment Information

Please provide details about your environment:

  • Python version: 3.10.9
  • Operating System: Ventura 13.4
  • UnlimitedGPT version: 0.1.9.3

Expected Behavior

Describe what you expected to happen when encountering the issue.

Possible Solutions

If you have any ideas or suggestions for resolving the issue, please mention them here.

Checklist

Before submitting the issue, please ensure that you have done the following:

  • I have reviewed the documentation before submitting this bug report.
  • I have confirmed that I am running the latest version of UnlimitedGPT.
  • I have verified that the issue is not caused by any modifications you made to the library or code.
  • I have confirmed that the issue is caused by the library itself and not other dependencies used. [E.G headless mode not working because of undetected-chromedriver]

Thank you for taking the time to report this issue. Your contribution helps improve UnlimitedGPT for everyone!

@bhav09 bhav09 added the unconfirmed bug Potential bugs awaiting confirmation label Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unconfirmed bug Potential bugs awaiting confirmation
Projects
None yet
Development

No branches or pull requests

2 participants