You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 79d1aa7
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+12-5Lines changed: 12 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -330,23 +330,29 @@ that the target page expects in `cf-turnstile-response`.
330
330
|`action`| no | Value of the widget's `data-action` attribute, if set. |
331
331
|`data`| no | Custom payload from the widget's `data-cdata` attribute, if set. |
332
332
|`pagedata`| no | Value of the `chlPageData` parameter, needed for some Cloudflare challenge pages beyond the basic widget. |
333
-
|`userAgent`| no | User-Agent to solve with -- the returned token is tied to it, submit with the same one. |
333
+
|`userAgent`| no |Current browser User-Agent. Pass it for Cloudflare Challenge pages; it is not needed for a standalone widget. |
334
334
335
335
**Response:**`token` -- submit as `cf-turnstile-response`. For Cloudflare
336
-
Challenge pages, the solution also includes `userAgent`; use that User-Agent
337
-
when submitting the token. Pass `action`, `data`, and `pagedata` when the page
338
-
provides them. The API field is spelled `pagedata`, all lowercase.
336
+
Challenge pages, pass `action`, `data`, `pagedata`, and the current browser
337
+
`userAgent` in the task. The solution also contains `userAgent`; switch the
338
+
browser or HTTP client to this returned value before invoking the callback with
339
+
the token. The API field is spelled `pagedata`, all lowercase.
339
340
340
341
```python
341
342
from captcha_solver_api import CaptchaClient
342
343
from captcha_solver_api.tasks import TurnstileTaskProxyless
343
344
client = CaptchaClient("your_api_key")
344
345
task = TurnstileTaskProxyless(
345
346
websiteURL="https://example.com/login",
346
-
websiteKey="YOUR_WEBSITE_KEY"
347
+
websiteKey="YOUR_WEBSITE_KEY",
348
+
action="managed",
349
+
data="INTERCEPTED_CDATA",
350
+
pagedata="INTERCEPTED_CHL_PAGE_DATA",
351
+
userAgent="CURRENT_BROWSER_USER_AGENT",
347
352
)
348
353
result = client.solve(task)
349
354
print(result["token"])
355
+
print(result.get("userAgent"))
350
356
```
351
357
352
358
With proxy, use `TurnstileTask` (same proxy fields as reCAPTCHA v2).
@@ -712,6 +718,7 @@ Full API reference: https://captcha-solver.com/en/docs/captcha-types
712
718
713
719
## Useful Links
714
720
721
+
-[Cloudflare Turnstile Puppeteer Demo](https://github.com/captcha-solver-api/cloudflare-turnstile-puppeteer-demo) — a working browser automation example for Cloudflare Turnstile.
715
722
-[How to Automate Tencent CAPTCHA](https://captcha-solver.com/en/blog/how-to-automate-tencent-captcha) — a step-by-step guide with Python and JavaScript SDK examples.
0 commit comments