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 a8ed1d3
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+48-14Lines changed: 48 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,10 @@ enabled in your editor, hover over `CaptchaClient`, `AsyncCaptchaClient`, their
75
75
methods, or a task class such as `RecaptchaV2TaskProxyless` to read the documentation.
76
76
Signature help shows argument names, types, and defaults while you type a call.
77
77
78
+
The `captcha_solver_api/py.typed` file is intentionally empty. It is the standard
79
+
[PEP 561](https://peps.python.org/pep-0561/) marker that tells type checkers to use
80
+
the inline type annotations shipped with this package.
81
+
78
82
Docstrings describe parameters, solution fields, exceptions, and usage examples.
79
83
Task examples assume an existing synchronous `client`; with `AsyncCaptchaClient`,
80
84
use `solution = await client.solve(task)` instead. Async snippets run inside an
@@ -151,15 +155,19 @@ on the target page.
151
155
|---|---|---|
152
156
| reCAPTCHA v2 | ✅ | ✅ |
153
157
| reCAPTCHA v2 Enterprise | ✅ | ✅ |
154
-
| reCAPTCHA v3 | ✅ |❌|
158
+
| reCAPTCHA v3 | ✅ |-|
155
159
| Cloudflare Turnstile | ✅ | ✅ |
156
160
| GeeTest v3 | ✅ | ✅ |
157
161
| GeeTest v4 | ✅ | ✅ |
158
-
| Image to Text | ✅ |❌|
162
+
| Image to Text | ✅ |-|
159
163
| Yandex SmartCaptcha | ✅ | ✅ |
160
-
| Coordinates (click captcha) | ✅ | ❌ |
164
+
| Yandex SmartCaptcha Image | ✅ | - |
165
+
| Coordinates (click captcha) | ✅ | - |
161
166
| Tencent | ✅ | ✅ |
162
167
168
+
A dash (`-`) means that this CAPTCHA type has no separate task class that accepts
169
+
your own proxy; it does not indicate that solving the CAPTCHA is unsupported.
170
+
163
171
## Client Reference
164
172
165
173
Every method below is available on both `CaptchaClient` (sync, `requests`-based) and
@@ -207,14 +215,17 @@ solution -- wraps `create_task()` + `get_task_result()` so you don't poll by han
207
215
208
216
Returns the `solution` dict once `status` is `"ready"` -- its shape depends on
209
217
the task type (see [Captcha Types](#captcha-types)).
210
-
Raises `ApiError`, `CaptchaTimeoutError`, or `NetworkError`.
218
+
Raises `ValidationError` before any request if `task` is not a task object or a
219
+
required task parameter is missing or empty. Otherwise raises `ApiError`,
220
+
`CaptchaTimeoutError`, or `NetworkError`.
211
221
212
222
### `create_task(task, language_pool=None)`
213
223
214
224
Submits `task` and returns its numeric task ID without waiting for a solution.
215
225
Accepts `task` and `language_pool`; it does not accept `timeout`. Use this instead of `solve()` if you need to
216
226
manage polling yourself (e.g. checking on many tasks from a different process).
217
-
Raises `ApiError`, `CaptchaTimeoutError`, or `NetworkError`.
227
+
Raises `ValidationError` before any request if `task` is invalid (same rules as
228
+
`solve()`). Otherwise raises `ApiError`, `CaptchaTimeoutError`, or `NetworkError`.
218
229
219
230
### `get_task_result(task_id)`
220
231
@@ -479,7 +490,7 @@ print(result["validate"])
479
490
print(result["seccode"])
480
491
```
481
492
`challenge` is session-specific and expires quickly, so it can't be hardcoded
482
-
into a static example -- see [examples/sync/geetest_v3.py](https://github.com/captcha-solver-api/python-sdk/blob/main/examples/sync/geetest_v3.py)
493
+
into a static example -- see [examples/sync/geetest_v3_proxyless.py](https://github.com/captcha-solver-api/python-sdk/blob/main/examples/sync/geetest_v3_proxyless.py)
483
494
for where the fetch belongs in the flow.
484
495
485
496
```python
@@ -662,6 +673,16 @@ task lifetime. A local timeout does not cancel a task or mean that the API
662
673
failed to solve it. Use `create_task()` and keep its `task_id` if you need to
663
674
check the same task later; calling `solve()` again creates a new task.
664
675
676
+
While polling, `solve()` retries short network failures and HTTP timeouts of
677
+
`getTaskResult` on the next poll, so a brief outage does not lose an already
678
+
created task. After `poll_retries` (default 3) consecutive failures the error is
679
+
raised. API errors are not retried, and `createTask` is never retried because
680
+
that could create and pay for a second task. To change the limit:
681
+
682
+
```python
683
+
client.poll_retries =5
684
+
```
685
+
665
686
### Worker language pool
666
687
667
688
Set a default `language_pool` once at construction instead of passing it to every call:
-[Cloudflare Turnstile Puppeteer Demo](https://github.com/captcha-solver-api/cloudflare-turnstile-puppeteer-demo)— a working browser automation example for Cloudflare Turnstile.
801
-
-[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.
834
+
-[Cloudflare Turnstile Puppeteer Demo](https://github.com/captcha-solver-api/cloudflare-turnstile-puppeteer-demo)- a working browser automation example for Cloudflare Turnstile.
835
+
-[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