返回提交历史
Modified
g4f/Provider/EasyChat.py
+1
-0
Modified
g4f/Provider/needs_auth/Grok.py
+6
-0
XFEstudio/gpt4free
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
5b65101a
代码差异
2 个文件
+7
-0
@@ -65,6 +65,7 @@ class EasyChat(OpenaiTemplate, AuthFileMixin):
65
65
if not modal:
66
66
break
67
67
debug.log("EasyChaat: Waiting for captcha verification...")
68
await asyncio.sleep(1)
68
69
if cls.captchaToken:
69
70
debug.log("EasyChat: Captcha token found, proceeding.")
70
71
break
@@ -62,6 +62,12 @@ class Grok(AsyncAuthedProvider, ProviderModelMixin):
62
62
while True:
63
63
if has_headers:
64
64
break
65
textarea = await page.select("textarea", 180)
66
await textarea.send_keys("Hello")
67
await asyncio.sleep(1)
68
button = await page.select("button[type='submit']")
69
if button:
70
await button.click()
65
71
await asyncio.sleep(1)
66
72
auth_result.cookies = {}
67
73
for c in await page.send(nodriver.cdp.network.get_cookies([cls.url])):