captcha-solver-api 1.0.1__tar.gz → 1.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (19) hide show
  1. {captcha_solver_api-1.0.1 → captcha_solver_api-1.0.2}/PKG-INFO +7 -12
  2. {captcha_solver_api-1.0.1 → captcha_solver_api-1.0.2}/README.md +6 -11
  3. captcha_solver_api-1.0.2/captcha_solver_api/_version.py +1 -0
  4. {captcha_solver_api-1.0.1 → captcha_solver_api-1.0.2}/captcha_solver_api/async_client.py +1 -1
  5. {captcha_solver_api-1.0.1 → captcha_solver_api-1.0.2}/captcha_solver_api/client.py +1 -1
  6. {captcha_solver_api-1.0.1 → captcha_solver_api-1.0.2}/captcha_solver_api/tasks.py +13 -11
  7. {captcha_solver_api-1.0.1 → captcha_solver_api-1.0.2}/captcha_solver_api.egg-info/PKG-INFO +7 -12
  8. captcha_solver_api-1.0.1/captcha_solver_api/_version.py +0 -1
  9. {captcha_solver_api-1.0.1 → captcha_solver_api-1.0.2}/LICENSE.md +0 -0
  10. {captcha_solver_api-1.0.1 → captcha_solver_api-1.0.2}/captcha_solver_api/__init__.py +0 -0
  11. {captcha_solver_api-1.0.1 → captcha_solver_api-1.0.2}/captcha_solver_api/exceptions.py +0 -0
  12. {captcha_solver_api-1.0.1 → captcha_solver_api-1.0.2}/captcha_solver_api/py.typed +0 -0
  13. {captcha_solver_api-1.0.1 → captcha_solver_api-1.0.2}/captcha_solver_api.egg-info/SOURCES.txt +0 -0
  14. {captcha_solver_api-1.0.1 → captcha_solver_api-1.0.2}/captcha_solver_api.egg-info/dependency_links.txt +0 -0
  15. {captcha_solver_api-1.0.1 → captcha_solver_api-1.0.2}/captcha_solver_api.egg-info/requires.txt +0 -0
  16. {captcha_solver_api-1.0.1 → captcha_solver_api-1.0.2}/captcha_solver_api.egg-info/top_level.txt +0 -0
  17. {captcha_solver_api-1.0.1 → captcha_solver_api-1.0.2}/pyproject.toml +0 -0
  18. {captcha_solver_api-1.0.1 → captcha_solver_api-1.0.2}/setup.cfg +0 -0
  19. {captcha_solver_api-1.0.1 → captcha_solver_api-1.0.2}/tests/test_polling.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: captcha-solver-api
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Official Python SDK for solving reCAPTCHA v2/v3, Cloudflare Turnstile, GeeTest v3/v4, Yandex SmartCaptcha, Tencent, and image/click captchas via the Captcha Solver API
5
5
  Author: Captcha Solver Team
6
6
  License-Expression: MIT
@@ -157,7 +157,7 @@ Constructor.
157
157
  | `client_key` | `str` | required | Your Captcha Solver API key. Raises `ValidationError` if empty. |
158
158
  | `base_url` | `str` | `https://api.captcha-solver.com` | API base URL. Override only for self-hosted/staging deployments. |
159
159
  | `timeout` | `int` | `120` | Polling window after task creation, in seconds. Overridable per call; each HTTP request has a separate 30-second timeout. |
160
- | `polling_interval` | `int` | `10` | Seconds before the first `getTaskResult` poll and between subsequent polls, matching the official 2Captcha Python SDK. |
160
+ | `polling_interval` | `int` | `10` | Seconds before the first `getTaskResult` poll and between subsequent polls. |
161
161
  | `language_pool` | `Optional[str]` | `None` | Default worker pool (`"en"` or `"ru"`) applied to every call that doesn't pass its own `language_pool`. |
162
162
 
163
163
  Both clients hold a reusable connection pool (`requests.Session` / `httpx.AsyncClient`)
@@ -476,7 +476,7 @@ for the widget on the target page. Use the coordinates method for image challeng
476
476
 
477
477
  `YandexSmartCaptchaTaskProxyless` / `YandexSmartCaptchaTask` -- token-based
478
478
  challenge. For the image challenge instead, use `CoordinatesTask` with
479
- `imgType="smart_captcha"` (see [Coordinates](#coordinates-click-captcha) below).
479
+ [Coordinates](#coordinates-click-captcha) is available for generic click captchas.
480
480
 
481
481
  | Parameter | Required | Description |
482
482
  |---|---|---|
@@ -519,10 +519,9 @@ SmartCaptcha's image challenge. No proxy variant -- the image is submitted direc
519
519
  |---|---|---|
520
520
  | `body` | yes | The captcha image, base64-encoded. |
521
521
  | `comment` | no (recommended) | Hint for the worker, e.g. `"click on the green apple"`. |
522
- | `imgInstructions` | required for `imgType="smart_captcha"` | Instruction image, base64-encoded, showing what to click and in what order. |
522
+ | `imgInstructions` | no | Optional instruction image, base64-encoded. |
523
523
  | `minClicks` | no | Minimum number of clicks expected (default `1`). |
524
524
  | `maxClicks` | no | Maximum number of clicks allowed. |
525
- | `imgType` | no | `"smart_captcha"` to solve a Yandex SmartCaptcha image challenge instead of a generic click captcha. |
526
525
 
527
526
  **Response:** `coordinates` -- a list of `{"x": int, "y": int}` pixel positions to click, in order.
528
527
 
@@ -540,9 +539,6 @@ task = CoordinatesTask(
540
539
  result = client.solve(task)
541
540
  print(result["coordinates"]) # [{"x": 140, "y": 110}]
542
541
  ```
543
- For the Yandex SmartCaptcha image challenge, see
544
- [examples/sync/yandex_smartcaptcha_image.py](https://github.com/captcha-solver-api/python-sdk/blob/main/examples/sync/yandex_smartcaptcha_image.py)
545
- (or [examples/async](https://github.com/captcha-solver-api/python-sdk/blob/main/examples/async/yandex_smartcaptcha_image.py)).
546
542
 
547
543
  ### Tencent
548
544
 
@@ -604,8 +600,8 @@ result = client.solve(task, timeout=300)
604
600
  ```
605
601
 
606
602
  The [API requires at least 5 seconds between polls](https://captcha-solver.com/en/docs/how-it-works).
607
- The SDK defaults to 10 seconds, like the official 2Captcha Python SDK. `solve()`
608
- waits for `polling_interval` before its first poll and between polls.
603
+ The SDK defaults to 10 seconds. `solve()` waits for `polling_interval` before
604
+ its first poll and between polls.
609
605
  Its default 120-second polling window is independent of the API's five-minute
610
606
  task lifetime. A local timeout does not cancel a task or mean that the API
611
607
  failed to solve it. Use `create_task()` and keep its `task_id` if you need to
@@ -695,8 +691,7 @@ Avoid importing it by name: it shadows Python's built-in `TimeoutError`.
695
691
  See the dedicated [examples documentation](https://github.com/captcha-solver-api/python-sdk/blob/main/examples/README.md) for the full
696
692
  sync/async example list, setup steps, expected results, and placeholder guidance.
697
693
 
698
- - **Image/click captchas** (`image_to_text.py`, `coordinates.py`,
699
- `yandex_smartcaptcha_image.py`) run after installing the dependencies and setting a valid
694
+ - **Image/click captchas** (`image_to_text.py`, `coordinates.py`) run after installing the dependencies and setting a valid
700
695
  `CAPTCHA_API_KEY` -- they read sample images bundled in
701
696
  [examples/assets](https://github.com/captcha-solver-api/python-sdk/tree/main/examples/assets), no target page needed.
702
697
  `python-dotenv` is optional: install it only if you want the scripts to load a `.env` file.
@@ -121,7 +121,7 @@ Constructor.
121
121
  | `client_key` | `str` | required | Your Captcha Solver API key. Raises `ValidationError` if empty. |
122
122
  | `base_url` | `str` | `https://api.captcha-solver.com` | API base URL. Override only for self-hosted/staging deployments. |
123
123
  | `timeout` | `int` | `120` | Polling window after task creation, in seconds. Overridable per call; each HTTP request has a separate 30-second timeout. |
124
- | `polling_interval` | `int` | `10` | Seconds before the first `getTaskResult` poll and between subsequent polls, matching the official 2Captcha Python SDK. |
124
+ | `polling_interval` | `int` | `10` | Seconds before the first `getTaskResult` poll and between subsequent polls. |
125
125
  | `language_pool` | `Optional[str]` | `None` | Default worker pool (`"en"` or `"ru"`) applied to every call that doesn't pass its own `language_pool`. |
126
126
 
127
127
  Both clients hold a reusable connection pool (`requests.Session` / `httpx.AsyncClient`)
@@ -440,7 +440,7 @@ for the widget on the target page. Use the coordinates method for image challeng
440
440
 
441
441
  `YandexSmartCaptchaTaskProxyless` / `YandexSmartCaptchaTask` -- token-based
442
442
  challenge. For the image challenge instead, use `CoordinatesTask` with
443
- `imgType="smart_captcha"` (see [Coordinates](#coordinates-click-captcha) below).
443
+ [Coordinates](#coordinates-click-captcha) is available for generic click captchas.
444
444
 
445
445
  | Parameter | Required | Description |
446
446
  |---|---|---|
@@ -483,10 +483,9 @@ SmartCaptcha's image challenge. No proxy variant -- the image is submitted direc
483
483
  |---|---|---|
484
484
  | `body` | yes | The captcha image, base64-encoded. |
485
485
  | `comment` | no (recommended) | Hint for the worker, e.g. `"click on the green apple"`. |
486
- | `imgInstructions` | required for `imgType="smart_captcha"` | Instruction image, base64-encoded, showing what to click and in what order. |
486
+ | `imgInstructions` | no | Optional instruction image, base64-encoded. |
487
487
  | `minClicks` | no | Minimum number of clicks expected (default `1`). |
488
488
  | `maxClicks` | no | Maximum number of clicks allowed. |
489
- | `imgType` | no | `"smart_captcha"` to solve a Yandex SmartCaptcha image challenge instead of a generic click captcha. |
490
489
 
491
490
  **Response:** `coordinates` -- a list of `{"x": int, "y": int}` pixel positions to click, in order.
492
491
 
@@ -504,9 +503,6 @@ task = CoordinatesTask(
504
503
  result = client.solve(task)
505
504
  print(result["coordinates"]) # [{"x": 140, "y": 110}]
506
505
  ```
507
- For the Yandex SmartCaptcha image challenge, see
508
- [examples/sync/yandex_smartcaptcha_image.py](https://github.com/captcha-solver-api/python-sdk/blob/main/examples/sync/yandex_smartcaptcha_image.py)
509
- (or [examples/async](https://github.com/captcha-solver-api/python-sdk/blob/main/examples/async/yandex_smartcaptcha_image.py)).
510
506
 
511
507
  ### Tencent
512
508
 
@@ -568,8 +564,8 @@ result = client.solve(task, timeout=300)
568
564
  ```
569
565
 
570
566
  The [API requires at least 5 seconds between polls](https://captcha-solver.com/en/docs/how-it-works).
571
- The SDK defaults to 10 seconds, like the official 2Captcha Python SDK. `solve()`
572
- waits for `polling_interval` before its first poll and between polls.
567
+ The SDK defaults to 10 seconds. `solve()` waits for `polling_interval` before
568
+ its first poll and between polls.
573
569
  Its default 120-second polling window is independent of the API's five-minute
574
570
  task lifetime. A local timeout does not cancel a task or mean that the API
575
571
  failed to solve it. Use `create_task()` and keep its `task_id` if you need to
@@ -659,8 +655,7 @@ Avoid importing it by name: it shadows Python's built-in `TimeoutError`.
659
655
  See the dedicated [examples documentation](https://github.com/captcha-solver-api/python-sdk/blob/main/examples/README.md) for the full
660
656
  sync/async example list, setup steps, expected results, and placeholder guidance.
661
657
 
662
- - **Image/click captchas** (`image_to_text.py`, `coordinates.py`,
663
- `yandex_smartcaptcha_image.py`) run after installing the dependencies and setting a valid
658
+ - **Image/click captchas** (`image_to_text.py`, `coordinates.py`) run after installing the dependencies and setting a valid
664
659
  `CAPTCHA_API_KEY` -- they read sample images bundled in
665
660
  [examples/assets](https://github.com/captcha-solver-api/python-sdk/tree/main/examples/assets), no target page needed.
666
661
  `python-dotenv` is optional: install it only if you want the scripts to load a `.env` file.
@@ -0,0 +1 @@
1
+ __version__ = "1.0.2"
@@ -54,7 +54,7 @@ class AsyncCaptchaClient:
54
54
  raising `CaptchaTimeoutError`. Can be overridden per call.
55
55
  polling_interval: Seconds to wait before the first `getTaskResult`
56
56
  poll and between subsequent polls inside `solve()`. Defaults
57
- to 10 seconds, matching the official 2Captcha Python SDK.
57
+ to 10 seconds.
58
58
  language_pool: Default worker pool selector (e.g. `"en"` or `"ru"`)
59
59
  applied to every `create_task()`/`solve()` call that doesn't pass
60
60
  its own `language_pool`. Leave unset to use the account's default
@@ -43,7 +43,7 @@ class CaptchaClient:
43
43
  raising `CaptchaTimeoutError`. Can be overridden per call.
44
44
  polling_interval: Seconds to wait before the first `getTaskResult`
45
45
  poll and between subsequent polls inside `solve()`. Defaults
46
- to 10 seconds, matching the official 2Captcha Python SDK.
46
+ to 10 seconds.
47
47
  language_pool: Default worker pool selector (e.g. `"en"` or `"ru"`)
48
48
  applied to every `create_task()`/`solve()` call that doesn't pass
49
49
  its own `language_pool`. Leave unset to use the account's default
@@ -55,6 +55,15 @@ class ProxyMixin:
55
55
  proxy_login: Optional[str] = None,
56
56
  proxy_password: Optional[str] = None,
57
57
  ) -> None:
58
+ """Sets the proxy fields on this task.
59
+
60
+ Args:
61
+ proxy_type: `"http"`, `"socks4"`, or `"socks5"`.
62
+ proxy_address: Proxy IP address or hostname.
63
+ proxy_port: Proxy port.
64
+ proxy_login: Proxy auth username, if required.
65
+ proxy_password: Proxy auth password, if required.
66
+ """
58
67
  self.proxyType = proxy_type
59
68
  self.proxyAddress = proxy_address
60
69
  self.proxyPort = proxy_port
@@ -525,8 +534,7 @@ class GeeTestTask(BaseTask, ProxyMixin):
525
534
 
526
535
 
527
536
  class YandexSmartCaptchaTaskProxyless(BaseTask):
528
- """Yandex SmartCaptcha (token challenge) without proxy. For the image
529
- challenge instead, use `CoordinatesTask` with `imgType="smart_captcha"`.
537
+ """Yandex SmartCaptcha (token challenge) without proxy.
530
538
 
531
539
  Args:
532
540
  websiteURL: Full URL of the page where the widget is located.
@@ -597,20 +605,16 @@ class YandexSmartCaptchaTask(BaseTask, ProxyMixin):
597
605
 
598
606
 
599
607
  class CoordinatesTask(BaseTask):
600
- """Coordinate-based (click) image captcha. Used both for generic
601
- "click on X" captchas and for Yandex SmartCaptcha's image challenge (set
602
- `imgType` accordingly). No proxy variant -- the image is submitted directly.
608
+ """Coordinate-based (click) image captcha. No proxy variant -- the image
609
+ is submitted directly.
603
610
 
604
611
  Args:
605
612
  body: The captcha image, base64-encoded (no `data:image/...;base64,` prefix).
606
613
  comment: Hint for the worker, e.g. `"click on the green apple"`. Recommended
607
614
  for generic click captchas.
608
- imgInstructions: Optional instruction image, base64-encoded, showing what
609
- to click and in what order. Required when `imgType="smart_captcha"`.
615
+ imgInstructions: Optional instruction image, base64-encoded.
610
616
  minClicks: Minimum number of clicks expected (default `1`).
611
617
  maxClicks: Maximum number of clicks allowed.
612
- imgType: Set to `"smart_captcha"` to solve a Yandex SmartCaptcha image
613
- challenge instead of a generic click captcha.
614
618
 
615
619
  Returns (`solution` from `solve()`):
616
620
  `coordinates` -- a list of `{"x": int, "y": int}` pixel positions to click,
@@ -626,14 +630,12 @@ class CoordinatesTask(BaseTask):
626
630
  imgInstructions: Optional[str] = None,
627
631
  minClicks: Optional[int] = None,
628
632
  maxClicks: Optional[int] = None,
629
- imgType: Optional[str] = None,
630
633
  ) -> None:
631
634
  self.body = body
632
635
  self.comment = comment
633
636
  self.imgInstructions = imgInstructions
634
637
  self.minClicks = minClicks
635
638
  self.maxClicks = maxClicks
636
- self.imgType = imgType
637
639
 
638
640
 
639
641
  class TencentTaskProxyless(BaseTask):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: captcha-solver-api
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Official Python SDK for solving reCAPTCHA v2/v3, Cloudflare Turnstile, GeeTest v3/v4, Yandex SmartCaptcha, Tencent, and image/click captchas via the Captcha Solver API
5
5
  Author: Captcha Solver Team
6
6
  License-Expression: MIT
@@ -157,7 +157,7 @@ Constructor.
157
157
  | `client_key` | `str` | required | Your Captcha Solver API key. Raises `ValidationError` if empty. |
158
158
  | `base_url` | `str` | `https://api.captcha-solver.com` | API base URL. Override only for self-hosted/staging deployments. |
159
159
  | `timeout` | `int` | `120` | Polling window after task creation, in seconds. Overridable per call; each HTTP request has a separate 30-second timeout. |
160
- | `polling_interval` | `int` | `10` | Seconds before the first `getTaskResult` poll and between subsequent polls, matching the official 2Captcha Python SDK. |
160
+ | `polling_interval` | `int` | `10` | Seconds before the first `getTaskResult` poll and between subsequent polls. |
161
161
  | `language_pool` | `Optional[str]` | `None` | Default worker pool (`"en"` or `"ru"`) applied to every call that doesn't pass its own `language_pool`. |
162
162
 
163
163
  Both clients hold a reusable connection pool (`requests.Session` / `httpx.AsyncClient`)
@@ -476,7 +476,7 @@ for the widget on the target page. Use the coordinates method for image challeng
476
476
 
477
477
  `YandexSmartCaptchaTaskProxyless` / `YandexSmartCaptchaTask` -- token-based
478
478
  challenge. For the image challenge instead, use `CoordinatesTask` with
479
- `imgType="smart_captcha"` (see [Coordinates](#coordinates-click-captcha) below).
479
+ [Coordinates](#coordinates-click-captcha) is available for generic click captchas.
480
480
 
481
481
  | Parameter | Required | Description |
482
482
  |---|---|---|
@@ -519,10 +519,9 @@ SmartCaptcha's image challenge. No proxy variant -- the image is submitted direc
519
519
  |---|---|---|
520
520
  | `body` | yes | The captcha image, base64-encoded. |
521
521
  | `comment` | no (recommended) | Hint for the worker, e.g. `"click on the green apple"`. |
522
- | `imgInstructions` | required for `imgType="smart_captcha"` | Instruction image, base64-encoded, showing what to click and in what order. |
522
+ | `imgInstructions` | no | Optional instruction image, base64-encoded. |
523
523
  | `minClicks` | no | Minimum number of clicks expected (default `1`). |
524
524
  | `maxClicks` | no | Maximum number of clicks allowed. |
525
- | `imgType` | no | `"smart_captcha"` to solve a Yandex SmartCaptcha image challenge instead of a generic click captcha. |
526
525
 
527
526
  **Response:** `coordinates` -- a list of `{"x": int, "y": int}` pixel positions to click, in order.
528
527
 
@@ -540,9 +539,6 @@ task = CoordinatesTask(
540
539
  result = client.solve(task)
541
540
  print(result["coordinates"]) # [{"x": 140, "y": 110}]
542
541
  ```
543
- For the Yandex SmartCaptcha image challenge, see
544
- [examples/sync/yandex_smartcaptcha_image.py](https://github.com/captcha-solver-api/python-sdk/blob/main/examples/sync/yandex_smartcaptcha_image.py)
545
- (or [examples/async](https://github.com/captcha-solver-api/python-sdk/blob/main/examples/async/yandex_smartcaptcha_image.py)).
546
542
 
547
543
  ### Tencent
548
544
 
@@ -604,8 +600,8 @@ result = client.solve(task, timeout=300)
604
600
  ```
605
601
 
606
602
  The [API requires at least 5 seconds between polls](https://captcha-solver.com/en/docs/how-it-works).
607
- The SDK defaults to 10 seconds, like the official 2Captcha Python SDK. `solve()`
608
- waits for `polling_interval` before its first poll and between polls.
603
+ The SDK defaults to 10 seconds. `solve()` waits for `polling_interval` before
604
+ its first poll and between polls.
609
605
  Its default 120-second polling window is independent of the API's five-minute
610
606
  task lifetime. A local timeout does not cancel a task or mean that the API
611
607
  failed to solve it. Use `create_task()` and keep its `task_id` if you need to
@@ -695,8 +691,7 @@ Avoid importing it by name: it shadows Python's built-in `TimeoutError`.
695
691
  See the dedicated [examples documentation](https://github.com/captcha-solver-api/python-sdk/blob/main/examples/README.md) for the full
696
692
  sync/async example list, setup steps, expected results, and placeholder guidance.
697
693
 
698
- - **Image/click captchas** (`image_to_text.py`, `coordinates.py`,
699
- `yandex_smartcaptcha_image.py`) run after installing the dependencies and setting a valid
694
+ - **Image/click captchas** (`image_to_text.py`, `coordinates.py`) run after installing the dependencies and setting a valid
700
695
  `CAPTCHA_API_KEY` -- they read sample images bundled in
701
696
  [examples/assets](https://github.com/captcha-solver-api/python-sdk/tree/main/examples/assets), no target page needed.
702
697
  `python-dotenv` is optional: install it only if you want the scripts to load a `.env` file.
@@ -1 +0,0 @@
1
- __version__ = "1.0.1"