mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
feat: add delays and input actions for captcha and auth flows
- Added `await asyncio.sleep(1)` inside captcha verification loop in `EasyChat.py` to introduce delay between checks - Modified `Grok.py` to send "Hello" input to a selected textarea element during auth flow - Added delay after sending keys to textarea in `Grok.py` using `await asyncio.sleep(1)` - Added logic to select and click a submit button if present in `Grok.py` during header check loop - All changes are within the `EasyChat` and `Grok` class definitions respectively
This commit is contained in:
parent
4164cb5978
commit
5b65101a2a
2 changed files with 7 additions and 0 deletions
|
|
@ -65,6 +65,7 @@ class EasyChat(OpenaiTemplate, AuthFileMixin):
|
|||
if not modal:
|
||||
break
|
||||
debug.log("EasyChaat: Waiting for captcha verification...")
|
||||
await asyncio.sleep(1)
|
||||
if cls.captchaToken:
|
||||
debug.log("EasyChat: Captcha token found, proceeding.")
|
||||
break
|
||||
|
|
|
|||
|
|
@ -62,6 +62,12 @@ class Grok(AsyncAuthedProvider, ProviderModelMixin):
|
|||
while True:
|
||||
if has_headers:
|
||||
break
|
||||
textarea = await page.select("textarea", 180)
|
||||
await textarea.send_keys("Hello")
|
||||
await asyncio.sleep(1)
|
||||
button = await page.select("button[type='submit']")
|
||||
if button:
|
||||
await button.click()
|
||||
await asyncio.sleep(1)
|
||||
auth_result.cookies = {}
|
||||
for c in await page.send(nodriver.cdp.network.get_cookies([cls.url])):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue