python-rucaptcha 6.6.0__tar.gz → 6.7.0__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 (89) hide show
  1. {python_rucaptcha-6.6.0/src/python_rucaptcha.egg-info → python_rucaptcha-6.7.0}/PKG-INFO +58 -2
  2. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/README.md +57 -1
  3. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/pyproject.toml +3 -0
  4. python_rucaptcha-6.7.0/src/python_rucaptcha/__version__.py +1 -0
  5. python_rucaptcha-6.7.0/src/python_rucaptcha/captchaai.py +160 -0
  6. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/core/base.py +21 -0
  7. python_rucaptcha-6.7.0/src/python_rucaptcha/core/captchaai.py +685 -0
  8. python_rucaptcha-6.7.0/src/python_rucaptcha/core/data/__init__.py +1 -0
  9. python_rucaptcha-6.7.0/src/python_rucaptcha/core/data/captchaai_legacy_profiles.json +19 -0
  10. python_rucaptcha-6.7.0/src/python_rucaptcha/core/data/captchaai_profiles.json +26 -0
  11. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/core/enums.py +2 -0
  12. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/core/serializer.py +7 -3
  13. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0/src/python_rucaptcha.egg-info}/PKG-INFO +58 -2
  14. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha.egg-info/SOURCES.txt +6 -0
  15. python_rucaptcha-6.7.0/tests/test_captchaai.py +379 -0
  16. python_rucaptcha-6.6.0/src/python_rucaptcha/__version__.py +0 -1
  17. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/LICENSE +0 -0
  18. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/MANIFEST.in +0 -0
  19. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/setup.cfg +0 -0
  20. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/__init__.py +0 -0
  21. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/altcha_captcha.py +0 -0
  22. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/amazon_waf.py +0 -0
  23. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/atb_captcha.py +0 -0
  24. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/audio_captcha.py +0 -0
  25. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/binance_captcha.py +0 -0
  26. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/bounding_box_captcha.py +0 -0
  27. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/captcha_fox.py +0 -0
  28. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/capy_puzzle.py +0 -0
  29. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/control.py +0 -0
  30. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/coordinates_captcha.py +0 -0
  31. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/core/__init__.py +0 -0
  32. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/core/config.py +0 -0
  33. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/core/result_handler.py +0 -0
  34. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/cutcaptcha.py +0 -0
  35. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/cyber_siara_captcha.py +0 -0
  36. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/datadome_captcha.py +0 -0
  37. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/draw_around_captcha.py +0 -0
  38. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/friendly_captcha.py +0 -0
  39. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/fun_captcha.py +0 -0
  40. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/gee_test.py +0 -0
  41. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/grid_captcha.py +0 -0
  42. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/hcaptcha.py +0 -0
  43. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/image_captcha.py +0 -0
  44. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/key_captcha.py +0 -0
  45. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/lemin_captcha.py +0 -0
  46. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/mt_captcha.py +0 -0
  47. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/prosopo.py +0 -0
  48. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/re_captcha.py +0 -0
  49. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/rotate_captcha.py +0 -0
  50. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/temu_captcha.py +0 -0
  51. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/tencent.py +0 -0
  52. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/text_captcha.py +0 -0
  53. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/turnstile.py +0 -0
  54. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/vk_captcha.py +0 -0
  55. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/yandex_smart_captcha.py +0 -0
  56. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha/yidun_captcha.py +0 -0
  57. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha.egg-info/dependency_links.txt +0 -0
  58. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha.egg-info/requires.txt +0 -0
  59. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/src/python_rucaptcha.egg-info/top_level.txt +0 -0
  60. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_altcha.py +0 -0
  61. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_amazon.py +0 -0
  62. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_audio.py +0 -0
  63. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_binance.py +0 -0
  64. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_bounding_box.py +0 -0
  65. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_capypuzzle.py +0 -0
  66. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_control.py +0 -0
  67. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_coordinates.py +0 -0
  68. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_core.py +0 -0
  69. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_cutcaptcha.py +0 -0
  70. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_cybersiara.py +0 -0
  71. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_datadome.py +0 -0
  72. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_draw_around.py +0 -0
  73. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_friendly_captcha.py +0 -0
  74. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_funcaptcha.py +0 -0
  75. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_geetest.py +0 -0
  76. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_grid.py +0 -0
  77. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_hcaptcha.py +0 -0
  78. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_image.py +0 -0
  79. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_key_captcha.py +0 -0
  80. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_lemin.py +0 -0
  81. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_mtcaptcha.py +0 -0
  82. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_recaptcha.py +0 -0
  83. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_rotate.py +0 -0
  84. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_tencent.py +0 -0
  85. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_text.py +0 -0
  86. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_turnstile.py +0 -0
  87. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_vk_captcha.py +0 -0
  88. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_yandex_smart_captcha.py +0 -0
  89. {python_rucaptcha-6.6.0 → python_rucaptcha-6.7.0}/tests/test_yidun_captcha.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-rucaptcha
3
- Version: 6.6.0
3
+ Version: 6.7.0
4
4
  Summary: Python 3.9+ RuCaptcha library with AIO module.
5
5
  Author-email: AndreiDrang <python-captcha@pm.me>
6
6
  License-Expression: MIT
@@ -39,7 +39,63 @@ Dynamic: license-file
39
39
  [![Downloads](https://static.pepy.tech/badge/python-rucaptcha/month)](https://pepy.tech/project/python-rucaptcha)
40
40
  [![Documentation](https://img.shields.io/badge/docs-Sphinx-green)](https://andreidrang.github.io/python-rucaptcha/)
41
41
 
42
- **Python 3.9+ library to solve CAPTCHAs automatically using RuCaptcha, 2Captcha, or DeathByCaptcha services.**
42
+ **Python 3.9+ library to solve CAPTCHAs automatically using RuCaptcha, 2Captcha, DeathByCaptcha, or CaptchaAI services.**
43
+
44
+ > **Using CaptchaAI:** compatible high-level classes can pass `service_type=ServiceEnm.CAPTCHAAI`.
45
+ > CaptchaAI uses the classic multipart `in.php`/`res.php` endpoints.
46
+ > ```python
47
+ > from python_rucaptcha.turnstile import Turnstile
48
+ > from python_rucaptcha.core.enums import ServiceEnm
49
+ > result = Turnstile(
50
+ > rucaptcha_key="CAPTCHAAI_KEY",
51
+ > service_type=ServiceEnm.CAPTCHAAI,
52
+ > websiteURL="https://example.com",
53
+ > websiteKey="0x4AAAAAAA...",
54
+ > userAgent="Mozilla/5.0 ...",
55
+ > ).captcha_handler()
56
+ > ```
57
+ >
58
+ > Proxy task types require `proxyType`, `proxyAddress`, and `proxyPort`; credentials are optional:
59
+ > ```python
60
+ > from python_rucaptcha.re_captcha import ReCaptcha
61
+ > from python_rucaptcha.core.enums import ReCaptchaEnm, ServiceEnm
62
+ >
63
+ > result = ReCaptcha(
64
+ > rucaptcha_key="CAPTCHAAI_KEY",
65
+ > service_type=ServiceEnm.CAPTCHAAI,
66
+ > websiteURL="https://example.com/login",
67
+ > websiteKey="SITE_KEY",
68
+ > method=ReCaptchaEnm.RecaptchaV2Task,
69
+ > proxyType="HTTPS",
70
+ > proxyAddress="203.0.113.7",
71
+ > proxyPort=3128,
72
+ > proxyLogin="user",
73
+ > proxyPassword="pass",
74
+ > ).captcha_handler()
75
+ > ```
76
+ >
77
+ > For every documented CaptchaAI method—or a provider method released after this package—use the native,
78
+ > type-free client. `profile` validates a packaged documented contract; omit it to pass provider-native fields
79
+ > through unchanged.
80
+ > ```python
81
+ > from python_rucaptcha.captchaai import CaptchaAI, CaptchaAIFile
82
+ >
83
+ > result = CaptchaAI(
84
+ > rucaptcha_key="CAPTCHAAI_KEY",
85
+ > profile="cloudflare-challenge",
86
+ > params={
87
+ > "pageurl": "https://example.com/protected",
88
+ > "proxy": "user:pass@203.0.113.7:3128",
89
+ > "proxytype": "HTTPS",
90
+ > },
91
+ > ).captcha_handler()
92
+ >
93
+ > image = CaptchaAI(
94
+ > rucaptcha_key="CAPTCHAAI_KEY",
95
+ > profile="normal-solve-file",
96
+ > files={"file": CaptchaAIFile(b"... PNG bytes ...", "captcha.png", "image/png")},
97
+ > ).captcha_handler()
98
+ > ```
43
99
 
44
100
  ## What is this?
45
101
 
@@ -5,7 +5,63 @@
5
5
  [![Downloads](https://static.pepy.tech/badge/python-rucaptcha/month)](https://pepy.tech/project/python-rucaptcha)
6
6
  [![Documentation](https://img.shields.io/badge/docs-Sphinx-green)](https://andreidrang.github.io/python-rucaptcha/)
7
7
 
8
- **Python 3.9+ library to solve CAPTCHAs automatically using RuCaptcha, 2Captcha, or DeathByCaptcha services.**
8
+ **Python 3.9+ library to solve CAPTCHAs automatically using RuCaptcha, 2Captcha, DeathByCaptcha, or CaptchaAI services.**
9
+
10
+ > **Using CaptchaAI:** compatible high-level classes can pass `service_type=ServiceEnm.CAPTCHAAI`.
11
+ > CaptchaAI uses the classic multipart `in.php`/`res.php` endpoints.
12
+ > ```python
13
+ > from python_rucaptcha.turnstile import Turnstile
14
+ > from python_rucaptcha.core.enums import ServiceEnm
15
+ > result = Turnstile(
16
+ > rucaptcha_key="CAPTCHAAI_KEY",
17
+ > service_type=ServiceEnm.CAPTCHAAI,
18
+ > websiteURL="https://example.com",
19
+ > websiteKey="0x4AAAAAAA...",
20
+ > userAgent="Mozilla/5.0 ...",
21
+ > ).captcha_handler()
22
+ > ```
23
+ >
24
+ > Proxy task types require `proxyType`, `proxyAddress`, and `proxyPort`; credentials are optional:
25
+ > ```python
26
+ > from python_rucaptcha.re_captcha import ReCaptcha
27
+ > from python_rucaptcha.core.enums import ReCaptchaEnm, ServiceEnm
28
+ >
29
+ > result = ReCaptcha(
30
+ > rucaptcha_key="CAPTCHAAI_KEY",
31
+ > service_type=ServiceEnm.CAPTCHAAI,
32
+ > websiteURL="https://example.com/login",
33
+ > websiteKey="SITE_KEY",
34
+ > method=ReCaptchaEnm.RecaptchaV2Task,
35
+ > proxyType="HTTPS",
36
+ > proxyAddress="203.0.113.7",
37
+ > proxyPort=3128,
38
+ > proxyLogin="user",
39
+ > proxyPassword="pass",
40
+ > ).captcha_handler()
41
+ > ```
42
+ >
43
+ > For every documented CaptchaAI method—or a provider method released after this package—use the native,
44
+ > type-free client. `profile` validates a packaged documented contract; omit it to pass provider-native fields
45
+ > through unchanged.
46
+ > ```python
47
+ > from python_rucaptcha.captchaai import CaptchaAI, CaptchaAIFile
48
+ >
49
+ > result = CaptchaAI(
50
+ > rucaptcha_key="CAPTCHAAI_KEY",
51
+ > profile="cloudflare-challenge",
52
+ > params={
53
+ > "pageurl": "https://example.com/protected",
54
+ > "proxy": "user:pass@203.0.113.7:3128",
55
+ > "proxytype": "HTTPS",
56
+ > },
57
+ > ).captcha_handler()
58
+ >
59
+ > image = CaptchaAI(
60
+ > rucaptcha_key="CAPTCHAAI_KEY",
61
+ > profile="normal-solve-file",
62
+ > files={"file": CaptchaAIFile(b"... PNG bytes ...", "captcha.png", "image/png")},
63
+ > ).captcha_handler()
64
+ > ```
9
65
 
10
66
  ## What is this?
11
67
 
@@ -99,6 +99,9 @@ dependencies = [
99
99
  where = ["src"]
100
100
  include = ["python_rucaptcha*"]
101
101
 
102
+ [tool.setuptools.package-data]
103
+ python_rucaptcha = ["core/data/*.json"]
104
+
102
105
  [tool.setuptools.dynamic]
103
106
  version = {attr = "python_rucaptcha.__version__"}
104
107
 
@@ -0,0 +1 @@
1
+ __version__ = "6.7.0"
@@ -0,0 +1,160 @@
1
+ """Native, future-compatible CaptchaAI classic API client."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Any, Mapping
6
+
7
+ import requests
8
+ from requests.adapters import HTTPAdapter
9
+
10
+ from .core import captchaai as transport
11
+ from .core.enums import ServiceEnm
12
+ from .core.config import RETRIES
13
+ from .core.serializer import CaptchaOptionsSer
14
+
15
+ CaptchaAIFile = transport.CaptchaAIFile
16
+
17
+
18
+ class CaptchaAI:
19
+ """Client for CaptchaAI's classic multipart API.
20
+
21
+ A packaged profile can validate a documented method contract. Omitting the
22
+ profile allows provider-native parameters for methods not yet represented
23
+ in the package metadata.
24
+
25
+ Attributes:
26
+ key: CaptchaAI API key used for requests.
27
+ method: Provider method submitted by the client.
28
+ params: Provider-native scalar parameters.
29
+ files: Multipart file parts keyed by provider field name.
30
+ profile: Optional packaged profile name.
31
+ poll: Whether to poll for a result after submission.
32
+ """
33
+
34
+ def __init__(
35
+ self,
36
+ rucaptcha_key: str,
37
+ method: str | None = None,
38
+ params: Mapping[str, Any] | None = None,
39
+ *,
40
+ files: Mapping[str, CaptchaAIFile] | None = None,
41
+ profile: str | None = None,
42
+ poll: bool | None = None,
43
+ sleep_time: int = 10,
44
+ ):
45
+ """Create a client for one CaptchaAI method.
46
+
47
+ Args:
48
+ rucaptcha_key: API key used for CaptchaAI requests.
49
+ method: Provider-native method name. Required unless ``profile``
50
+ supplies the method.
51
+ params: Provider-native scalar parameters.
52
+ files: Multipart file parts keyed by provider field name.
53
+ profile: Optional packaged profile used for validation and defaults.
54
+ poll: Whether to poll after submission. If omitted, the profile
55
+ determines the default and native methods poll by default.
56
+ sleep_time: Seconds between result polls.
57
+
58
+ Raises:
59
+ ValueError: If neither ``method`` nor ``profile`` is supplied.
60
+ """
61
+ if method is None:
62
+ if profile is None:
63
+ raise ValueError("CaptchaAI requires a method or a documented profile")
64
+ method = transport.profile_method(profile)
65
+
66
+ self.key = rucaptcha_key
67
+ self.method = method
68
+ self.params = dict(params or {})
69
+ self.files = dict(files or {})
70
+ self.profile = profile
71
+ self.poll = poll
72
+ self.options = CaptchaOptionsSer(sleep_time=sleep_time, service_type=ServiceEnm.CAPTCHAAI)
73
+ self.options.urls_set()
74
+ self.session = requests.Session()
75
+ self.session.mount("http://", HTTPAdapter(max_retries=RETRIES))
76
+ self.session.mount("https://", HTTPAdapter(max_retries=RETRIES))
77
+
78
+ @classmethod
79
+ def profiles(cls) -> tuple[str, ...]:
80
+ """List the packaged CaptchaAI profile names.
81
+
82
+ Returns:
83
+ Profile names available for declarative validation.
84
+ """
85
+ return transport.profiles()
86
+
87
+ def captcha_handler(self) -> dict[str, Any]:
88
+ """Submit the configured method and optionally poll for its result.
89
+
90
+ Returns:
91
+ A normalized result mapping containing either the solution or an
92
+ error description.
93
+ """
94
+ return transport.solve_native(
95
+ key=self.key,
96
+ method=self.method,
97
+ params=self.params,
98
+ files=self.files,
99
+ profile=self.profile,
100
+ poll=self.poll,
101
+ url_request=self.options.url_request,
102
+ url_response=self.options.url_response,
103
+ sleep_time=self.options.sleep_time,
104
+ session=self.session,
105
+ )
106
+
107
+ async def aio_captcha_handler(self) -> dict[str, Any]:
108
+ """Asynchronously submit the method and optionally poll for its result.
109
+
110
+ Returns:
111
+ A normalized result mapping containing either the solution or an
112
+ error description.
113
+ """
114
+ return await transport.aio_solve_native(
115
+ key=self.key,
116
+ method=self.method,
117
+ params=self.params,
118
+ files=self.files,
119
+ profile=self.profile,
120
+ poll=self.poll,
121
+ url_request=self.options.url_request,
122
+ url_response=self.options.url_response,
123
+ sleep_time=self.options.sleep_time,
124
+ )
125
+
126
+ def get_balance(self) -> dict[str, Any]:
127
+ """Fetch the account balance through the CaptchaAI control API.
128
+
129
+ Returns:
130
+ The provider response with the balance value when successful, or
131
+ the normalized error mapping returned by the transport.
132
+ """
133
+ return transport.control(self.key, "balance", self.options.url_response, session=self.session)
134
+
135
+ async def aio_get_balance(self) -> dict[str, Any]:
136
+ """Asynchronously fetch the account balance.
137
+
138
+ Returns:
139
+ The provider response with the balance value when successful, or
140
+ the normalized error mapping returned by the transport.
141
+ """
142
+ return await transport.aio_control(self.key, "balance", self.options.url_response)
143
+
144
+ def get_threads_info(self) -> dict[str, Any]:
145
+ """Fetch total and active thread information.
146
+
147
+ Returns:
148
+ The provider response with thread information, or the normalized
149
+ error mapping returned by the transport.
150
+ """
151
+ return transport.control(self.key, "threads_info", self.options.url_response, session=self.session)
152
+
153
+ async def aio_get_threads_info(self) -> dict[str, Any]:
154
+ """Asynchronously fetch total and active thread information.
155
+
156
+ Returns:
157
+ The provider response with thread information, or the normalized
158
+ error mapping returned by the transport.
159
+ """
160
+ return await transport.aio_control(self.key, "threads_info", self.options.url_response)
@@ -82,6 +82,17 @@ class BaseCaptcha:
82
82
  Method processing captcha solving task creation result
83
83
  :param kwargs: additional params for Requests library
84
84
  """
85
+ # CaptchaAI speaks the classic in.php/res.php API, not the JSON createTask API.
86
+ if self.params.service_type == ServiceEnm.CAPTCHAAI.value:
87
+ from . import captchaai
88
+
89
+ return captchaai.solve(
90
+ create_task_payload=self.create_task_payload,
91
+ url_request=self.params.url_request,
92
+ url_response=self.params.url_response,
93
+ sleep_time=self.params.sleep_time,
94
+ session=self.session,
95
+ )
85
96
  try:
86
97
  response = GetTaskResultResponseSer(
87
98
  **self.session.post(self.params.url_request, json=self.create_task_payload, **kwargs).json()
@@ -126,6 +137,16 @@ class BaseCaptcha:
126
137
  """
127
138
  Method processing async captcha solving task creation result
128
139
  """
140
+ # CaptchaAI speaks the classic in.php/res.php API, not the JSON createTask API.
141
+ if self.params.service_type == ServiceEnm.CAPTCHAAI.value:
142
+ from . import captchaai
143
+
144
+ return await captchaai.aio_solve(
145
+ create_task_payload=self.create_task_payload,
146
+ url_request=self.params.url_request,
147
+ url_response=self.params.url_response,
148
+ sleep_time=self.params.sleep_time,
149
+ )
129
150
  try:
130
151
  # make async or sync request
131
152
  response = await self.__aio_create_task()