capmonster-python 3.2.0__tar.gz → 5.0.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.
- capmonster_python-5.0.0/PKG-INFO +232 -0
- capmonster_python-5.0.0/README.md +210 -0
- capmonster_python-5.0.0/pyproject.toml +36 -0
- capmonster_python-5.0.0/setup.cfg +4 -0
- capmonster_python-5.0.0/src/capmonster_python/__init__.py +47 -0
- capmonster_python-5.0.0/src/capmonster_python/client.py +363 -0
- capmonster_python-5.0.0/src/capmonster_python/exceptions.py +60 -0
- capmonster_python-5.0.0/src/capmonster_python/methods.py +37 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/__init__.py +66 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/altcha.py +48 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/amazon.py +54 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/basilisk.py +24 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/binance.py +31 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/castle.py +46 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/complex_image_recaptcha.py +73 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/complex_image_recognition.py +33 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/datadome.py +62 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/funcaptcha.py +40 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/geetest.py +86 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/hunt.py +27 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/image_to_text.py +37 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/imperva.py +50 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/mtcaptcha.py +36 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/prosopo.py +27 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/recaptcha_click.py +31 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/recaptcha_v2.py +44 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/recaptcha_v2_enterprise.py +44 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/recaptcha_v3.py +34 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/recaptcha_v3_enterprise.py +30 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/task.py +146 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/temu.py +32 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/tendi.py +30 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/tspd.py +44 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/turnstile.py +111 -0
- capmonster_python-5.0.0/src/capmonster_python/tasks/yidun.py +49 -0
- capmonster_python-5.0.0/src/capmonster_python.egg-info/PKG-INFO +232 -0
- capmonster_python-5.0.0/src/capmonster_python.egg-info/SOURCES.txt +39 -0
- capmonster_python-5.0.0/src/capmonster_python.egg-info/requires.txt +2 -0
- capmonster_python-3.2.0/PKG-INFO +0 -120
- capmonster_python-3.2.0/README.md +0 -91
- capmonster_python-3.2.0/capmonster_python/__init__.py +0 -13
- capmonster_python-3.2.0/capmonster_python/aws_waf.py +0 -22
- capmonster_python-3.2.0/capmonster_python/capmonster.py +0 -253
- capmonster_python-3.2.0/capmonster_python/compleximage.py +0 -51
- capmonster_python-3.2.0/capmonster_python/datadome.py +0 -19
- capmonster_python-3.2.0/capmonster_python/fun_captcha.py +0 -30
- capmonster_python-3.2.0/capmonster_python/geetest.py +0 -26
- capmonster_python-3.2.0/capmonster_python/hcaptcha.py +0 -36
- capmonster_python-3.2.0/capmonster_python/image_to_text.py +0 -43
- capmonster_python-3.2.0/capmonster_python/recaptcha_v2.py +0 -27
- capmonster_python-3.2.0/capmonster_python/recaptcha_v2_enterprise.py +0 -30
- capmonster_python-3.2.0/capmonster_python/recaptcha_v3.py +0 -24
- capmonster_python-3.2.0/capmonster_python/tendi.py +0 -19
- capmonster_python-3.2.0/capmonster_python/turnstile.py +0 -23
- capmonster_python-3.2.0/capmonster_python/utils.py +0 -35
- capmonster_python-3.2.0/capmonster_python.egg-info/PKG-INFO +0 -120
- capmonster_python-3.2.0/capmonster_python.egg-info/SOURCES.txt +0 -24
- capmonster_python-3.2.0/capmonster_python.egg-info/requires.txt +0 -2
- capmonster_python-3.2.0/setup.cfg +0 -7
- capmonster_python-3.2.0/setup.py +0 -42
- {capmonster_python-3.2.0 → capmonster_python-5.0.0}/LICENSE +0 -0
- {capmonster_python-3.2.0 → capmonster_python-5.0.0/src}/capmonster_python.egg-info/dependency_links.txt +0 -0
- {capmonster_python-3.2.0 → capmonster_python-5.0.0/src}/capmonster_python.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: capmonster_python
|
|
3
|
+
Version: 5.0.0
|
|
4
|
+
Summary: capmonster.cloud library/package for Python
|
|
5
|
+
Author-email: Alperen Sert <business@alperen.io>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Documentation, https://alperensert.github.io/capmonster_python/
|
|
8
|
+
Project-URL: Source, https://github.com/alperensert/capmonster_python/
|
|
9
|
+
Project-URL: Tracker, https://github.com/alperensert/capmonster_python/issues
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Requires-Python: >=3.9
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: httpx>=0.27.0
|
|
20
|
+
Requires-Dist: pydantic>=2.0
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# Capmonster Python
|
|
24
|
+
|
|
25
|
+
[](https://pypi.org/project/capmonster-python/)
|
|
26
|
+
[](https://github.com/alperensert/capmonster_python/releases)
|
|
27
|
+
[](https://github.com/alperensert/capmonster_python/commits/master)
|
|
28
|
+
[&cacheSeconds=3600)](https://github.com/alperensert/capmonster_python)
|
|
29
|
+
|
|
30
|
+
A modern, strongly-typed Python SDK for [CapMonster Cloud](https://capmonster.cloud/) — solve reCAPTCHA, Turnstile, GeeTest, and 20+ other CAPTCHA types with both sync and async support.
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install capmonster_python
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
> [!IMPORTANT]
|
|
39
|
+
> This is **v4** of Capmonster Python, which includes breaking changes from v3.x.
|
|
40
|
+
> For the legacy API: `pip install capmonster_python==3.2`
|
|
41
|
+
|
|
42
|
+
## Quick Start
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
from capmonster_python import CapmonsterClient, RecaptchaV2Task
|
|
46
|
+
|
|
47
|
+
client = CapmonsterClient(api_key="YOUR_API_KEY")
|
|
48
|
+
|
|
49
|
+
task = RecaptchaV2Task(
|
|
50
|
+
websiteURL="https://example.com",
|
|
51
|
+
websiteKey="SITE_KEY_HERE"
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
result = client.solve(task)
|
|
55
|
+
print(result) # {"gRecaptchaResponse": "03AGdBq24..."}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Async
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
import asyncio
|
|
62
|
+
from capmonster_python import CapmonsterClient, RecaptchaV3Task
|
|
63
|
+
|
|
64
|
+
async def main():
|
|
65
|
+
async with CapmonsterClient(api_key="YOUR_API_KEY") as client:
|
|
66
|
+
task = RecaptchaV3Task(
|
|
67
|
+
websiteURL="https://example.com",
|
|
68
|
+
websiteKey="SITE_KEY_HERE",
|
|
69
|
+
minScore=0.5,
|
|
70
|
+
pageAction="verify"
|
|
71
|
+
)
|
|
72
|
+
result = await client.solve_async(task)
|
|
73
|
+
print(result)
|
|
74
|
+
|
|
75
|
+
asyncio.run(main())
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### With Proxy
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
from capmonster_python import CapmonsterClient, RecaptchaV2Task, ProxyPayload
|
|
82
|
+
|
|
83
|
+
client = CapmonsterClient(api_key="YOUR_API_KEY")
|
|
84
|
+
|
|
85
|
+
task = RecaptchaV2Task(
|
|
86
|
+
websiteURL="https://example.com",
|
|
87
|
+
websiteKey="SITE_KEY_HERE",
|
|
88
|
+
proxy=ProxyPayload(
|
|
89
|
+
proxyType="http",
|
|
90
|
+
proxyAddress="1.2.3.4",
|
|
91
|
+
proxyPort=8080,
|
|
92
|
+
proxyLogin="user",
|
|
93
|
+
proxyPassword="pass"
|
|
94
|
+
)
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
result = client.solve(task)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Client API
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
CapmonsterClient(api_key, timeout=30.0, max_retries=120, retry_delay=2.0)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
| Method | Description |
|
|
107
|
+
|--------|-------------|
|
|
108
|
+
| `solve(task)` | Create task and poll until solved |
|
|
109
|
+
| `create_task(task)` | Create a task, returns `task_id` |
|
|
110
|
+
| `join_task_result(task_id)` | Poll until result is ready |
|
|
111
|
+
| `get_task_result(task_id)` | Single poll (no waiting) |
|
|
112
|
+
| `get_balance()` | Get account balance |
|
|
113
|
+
| `get_user_agent()` | Get current valid User-Agent string |
|
|
114
|
+
| `report_incorrect_image(task_id)` | Report bad image captcha solution |
|
|
115
|
+
| `report_incorrect_token(task_id)` | Report bad token captcha solution |
|
|
116
|
+
|
|
117
|
+
All methods have async variants with the `_async` suffix (e.g. `solve_async`, `get_balance_async`).
|
|
118
|
+
|
|
119
|
+
Both sync and async context managers are supported for proper connection cleanup.
|
|
120
|
+
|
|
121
|
+
## Supported CAPTCHA Types
|
|
122
|
+
|
|
123
|
+
### reCAPTCHA
|
|
124
|
+
|
|
125
|
+
| CAPTCHA Type | Class | Proxy |
|
|
126
|
+
|---|---|---|
|
|
127
|
+
| reCAPTCHA v2 | `RecaptchaV2Task` | Optional |
|
|
128
|
+
| reCAPTCHA v2 Enterprise | `RecaptchaV2EnterpriseTask` | Optional |
|
|
129
|
+
| reCAPTCHA v3 | `RecaptchaV3Task` | No |
|
|
130
|
+
| reCAPTCHA v3 Enterprise | `RecaptchaV3EnterpriseTask` | No |
|
|
131
|
+
| reCAPTCHA Click | `RecaptchaClickTask` | Optional |
|
|
132
|
+
|
|
133
|
+
### Cloudflare
|
|
134
|
+
|
|
135
|
+
| CAPTCHA Type | Class | Proxy |
|
|
136
|
+
|---|---|---|
|
|
137
|
+
| Turnstile | `TurnstileTask` | No |
|
|
138
|
+
| Turnstile Challenge (cf_clearance) | `TurnstileCloudFlareTask` | Required |
|
|
139
|
+
| Turnstile Waiting Room | `TurnstileWaitingRoomTask` | Required |
|
|
140
|
+
|
|
141
|
+
### Image-Based
|
|
142
|
+
|
|
143
|
+
| CAPTCHA Type | Class | Proxy |
|
|
144
|
+
|---|---|---|
|
|
145
|
+
| Image-to-Text OCR | `ImageToTextTask` | No |
|
|
146
|
+
| Complex Image (reCAPTCHA grid) | `ComplexImageRecaptchaTask` | No |
|
|
147
|
+
| Complex Image Recognition | `ComplexImageRecognitionTask` | No |
|
|
148
|
+
|
|
149
|
+
### Behavioral / Interactive
|
|
150
|
+
|
|
151
|
+
| CAPTCHA Type | Class | Proxy |
|
|
152
|
+
|---|---|---|
|
|
153
|
+
| GeeTest v3 | `GeeTestV3Task` | Optional |
|
|
154
|
+
| GeeTest v4 | `GeeTestV4Task` | Optional |
|
|
155
|
+
| FunCaptcha (Arkose Labs) | `FunCaptchaTask` | Optional |
|
|
156
|
+
| Hunt | `HuntTask` | Optional |
|
|
157
|
+
|
|
158
|
+
### Enterprise Protection
|
|
159
|
+
|
|
160
|
+
| CAPTCHA Type | Class | Proxy |
|
|
161
|
+
|---|---|---|
|
|
162
|
+
| DataDome | `DataDomeTask` | Required |
|
|
163
|
+
| Imperva (Incapsula) | `ImpervaTask` | Required |
|
|
164
|
+
| Amazon WAF | `AmazonTask` | Optional |
|
|
165
|
+
| TSPD | `TSPDTask` | Optional |
|
|
166
|
+
|
|
167
|
+
### Platform-Specific
|
|
168
|
+
|
|
169
|
+
| CAPTCHA Type | Class | Proxy |
|
|
170
|
+
|---|---|---|
|
|
171
|
+
| Binance | `BinanceTask` | Required |
|
|
172
|
+
| Temu | `TemuTask` | No |
|
|
173
|
+
| TenDI | `TenDITask` | Required |
|
|
174
|
+
|
|
175
|
+
### Other
|
|
176
|
+
|
|
177
|
+
| CAPTCHA Type | Class | Proxy |
|
|
178
|
+
|---|---|---|
|
|
179
|
+
| Altcha | `AltchaTask` | No |
|
|
180
|
+
| Basilisk | `BasiliskTask` | No |
|
|
181
|
+
| Castle | `CastleTask` | No |
|
|
182
|
+
| MTCaptcha | `MTCaptchaTask` | Optional |
|
|
183
|
+
| Prosopo | `ProsopoTask` | Optional |
|
|
184
|
+
| Yidun | `YidunTask` | Optional |
|
|
185
|
+
|
|
186
|
+
> Don't see your captcha type? Use `VanillaTaskPayload` to build custom task payloads without waiting for an SDK update.
|
|
187
|
+
|
|
188
|
+
## Advanced Usage
|
|
189
|
+
|
|
190
|
+
### Callback URLs
|
|
191
|
+
|
|
192
|
+
```python
|
|
193
|
+
result = client.solve(task, callback_url="https://yoursite.com/callback")
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Report Incorrect Solutions
|
|
197
|
+
|
|
198
|
+
```python
|
|
199
|
+
task_id = client.create_task(task)
|
|
200
|
+
result = client.join_task_result(task_id)
|
|
201
|
+
|
|
202
|
+
# If the token was rejected by the target site:
|
|
203
|
+
client.report_incorrect_token(task_id)
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Fresh Token Generation
|
|
207
|
+
|
|
208
|
+
Use `nocache=True` on reCAPTCHA tasks to prevent cached token reuse:
|
|
209
|
+
|
|
210
|
+
```python
|
|
211
|
+
task = RecaptchaV2Task(
|
|
212
|
+
websiteURL="https://example.com",
|
|
213
|
+
websiteKey="SITE_KEY_HERE",
|
|
214
|
+
nocache=True
|
|
215
|
+
)
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Documentation
|
|
219
|
+
|
|
220
|
+
Full API reference available at [alperensert.github.io/capmonster_python](https://alperensert.github.io/capmonster_python/).
|
|
221
|
+
|
|
222
|
+
## Support
|
|
223
|
+
|
|
224
|
+
- Found a bug? [Open an issue](https://github.com/alperensert/capmonster_python/issues)
|
|
225
|
+
- Contact: business@alperen.io
|
|
226
|
+
|
|
227
|
+
> [!NOTE]
|
|
228
|
+
> Support is limited to questions and issues related to this project. Custom integrations and application-specific logic are outside the scope of support.
|
|
229
|
+
|
|
230
|
+
## License
|
|
231
|
+
|
|
232
|
+
[MIT License](/LICENSE)
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# Capmonster Python
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/capmonster-python/)
|
|
4
|
+
[](https://github.com/alperensert/capmonster_python/releases)
|
|
5
|
+
[](https://github.com/alperensert/capmonster_python/commits/master)
|
|
6
|
+
[&cacheSeconds=3600)](https://github.com/alperensert/capmonster_python)
|
|
7
|
+
|
|
8
|
+
A modern, strongly-typed Python SDK for [CapMonster Cloud](https://capmonster.cloud/) — solve reCAPTCHA, Turnstile, GeeTest, and 20+ other CAPTCHA types with both sync and async support.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install capmonster_python
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
> [!IMPORTANT]
|
|
17
|
+
> This is **v4** of Capmonster Python, which includes breaking changes from v3.x.
|
|
18
|
+
> For the legacy API: `pip install capmonster_python==3.2`
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
from capmonster_python import CapmonsterClient, RecaptchaV2Task
|
|
24
|
+
|
|
25
|
+
client = CapmonsterClient(api_key="YOUR_API_KEY")
|
|
26
|
+
|
|
27
|
+
task = RecaptchaV2Task(
|
|
28
|
+
websiteURL="https://example.com",
|
|
29
|
+
websiteKey="SITE_KEY_HERE"
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
result = client.solve(task)
|
|
33
|
+
print(result) # {"gRecaptchaResponse": "03AGdBq24..."}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Async
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
import asyncio
|
|
40
|
+
from capmonster_python import CapmonsterClient, RecaptchaV3Task
|
|
41
|
+
|
|
42
|
+
async def main():
|
|
43
|
+
async with CapmonsterClient(api_key="YOUR_API_KEY") as client:
|
|
44
|
+
task = RecaptchaV3Task(
|
|
45
|
+
websiteURL="https://example.com",
|
|
46
|
+
websiteKey="SITE_KEY_HERE",
|
|
47
|
+
minScore=0.5,
|
|
48
|
+
pageAction="verify"
|
|
49
|
+
)
|
|
50
|
+
result = await client.solve_async(task)
|
|
51
|
+
print(result)
|
|
52
|
+
|
|
53
|
+
asyncio.run(main())
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### With Proxy
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from capmonster_python import CapmonsterClient, RecaptchaV2Task, ProxyPayload
|
|
60
|
+
|
|
61
|
+
client = CapmonsterClient(api_key="YOUR_API_KEY")
|
|
62
|
+
|
|
63
|
+
task = RecaptchaV2Task(
|
|
64
|
+
websiteURL="https://example.com",
|
|
65
|
+
websiteKey="SITE_KEY_HERE",
|
|
66
|
+
proxy=ProxyPayload(
|
|
67
|
+
proxyType="http",
|
|
68
|
+
proxyAddress="1.2.3.4",
|
|
69
|
+
proxyPort=8080,
|
|
70
|
+
proxyLogin="user",
|
|
71
|
+
proxyPassword="pass"
|
|
72
|
+
)
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
result = client.solve(task)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Client API
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
CapmonsterClient(api_key, timeout=30.0, max_retries=120, retry_delay=2.0)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
| Method | Description |
|
|
85
|
+
|--------|-------------|
|
|
86
|
+
| `solve(task)` | Create task and poll until solved |
|
|
87
|
+
| `create_task(task)` | Create a task, returns `task_id` |
|
|
88
|
+
| `join_task_result(task_id)` | Poll until result is ready |
|
|
89
|
+
| `get_task_result(task_id)` | Single poll (no waiting) |
|
|
90
|
+
| `get_balance()` | Get account balance |
|
|
91
|
+
| `get_user_agent()` | Get current valid User-Agent string |
|
|
92
|
+
| `report_incorrect_image(task_id)` | Report bad image captcha solution |
|
|
93
|
+
| `report_incorrect_token(task_id)` | Report bad token captcha solution |
|
|
94
|
+
|
|
95
|
+
All methods have async variants with the `_async` suffix (e.g. `solve_async`, `get_balance_async`).
|
|
96
|
+
|
|
97
|
+
Both sync and async context managers are supported for proper connection cleanup.
|
|
98
|
+
|
|
99
|
+
## Supported CAPTCHA Types
|
|
100
|
+
|
|
101
|
+
### reCAPTCHA
|
|
102
|
+
|
|
103
|
+
| CAPTCHA Type | Class | Proxy |
|
|
104
|
+
|---|---|---|
|
|
105
|
+
| reCAPTCHA v2 | `RecaptchaV2Task` | Optional |
|
|
106
|
+
| reCAPTCHA v2 Enterprise | `RecaptchaV2EnterpriseTask` | Optional |
|
|
107
|
+
| reCAPTCHA v3 | `RecaptchaV3Task` | No |
|
|
108
|
+
| reCAPTCHA v3 Enterprise | `RecaptchaV3EnterpriseTask` | No |
|
|
109
|
+
| reCAPTCHA Click | `RecaptchaClickTask` | Optional |
|
|
110
|
+
|
|
111
|
+
### Cloudflare
|
|
112
|
+
|
|
113
|
+
| CAPTCHA Type | Class | Proxy |
|
|
114
|
+
|---|---|---|
|
|
115
|
+
| Turnstile | `TurnstileTask` | No |
|
|
116
|
+
| Turnstile Challenge (cf_clearance) | `TurnstileCloudFlareTask` | Required |
|
|
117
|
+
| Turnstile Waiting Room | `TurnstileWaitingRoomTask` | Required |
|
|
118
|
+
|
|
119
|
+
### Image-Based
|
|
120
|
+
|
|
121
|
+
| CAPTCHA Type | Class | Proxy |
|
|
122
|
+
|---|---|---|
|
|
123
|
+
| Image-to-Text OCR | `ImageToTextTask` | No |
|
|
124
|
+
| Complex Image (reCAPTCHA grid) | `ComplexImageRecaptchaTask` | No |
|
|
125
|
+
| Complex Image Recognition | `ComplexImageRecognitionTask` | No |
|
|
126
|
+
|
|
127
|
+
### Behavioral / Interactive
|
|
128
|
+
|
|
129
|
+
| CAPTCHA Type | Class | Proxy |
|
|
130
|
+
|---|---|---|
|
|
131
|
+
| GeeTest v3 | `GeeTestV3Task` | Optional |
|
|
132
|
+
| GeeTest v4 | `GeeTestV4Task` | Optional |
|
|
133
|
+
| FunCaptcha (Arkose Labs) | `FunCaptchaTask` | Optional |
|
|
134
|
+
| Hunt | `HuntTask` | Optional |
|
|
135
|
+
|
|
136
|
+
### Enterprise Protection
|
|
137
|
+
|
|
138
|
+
| CAPTCHA Type | Class | Proxy |
|
|
139
|
+
|---|---|---|
|
|
140
|
+
| DataDome | `DataDomeTask` | Required |
|
|
141
|
+
| Imperva (Incapsula) | `ImpervaTask` | Required |
|
|
142
|
+
| Amazon WAF | `AmazonTask` | Optional |
|
|
143
|
+
| TSPD | `TSPDTask` | Optional |
|
|
144
|
+
|
|
145
|
+
### Platform-Specific
|
|
146
|
+
|
|
147
|
+
| CAPTCHA Type | Class | Proxy |
|
|
148
|
+
|---|---|---|
|
|
149
|
+
| Binance | `BinanceTask` | Required |
|
|
150
|
+
| Temu | `TemuTask` | No |
|
|
151
|
+
| TenDI | `TenDITask` | Required |
|
|
152
|
+
|
|
153
|
+
### Other
|
|
154
|
+
|
|
155
|
+
| CAPTCHA Type | Class | Proxy |
|
|
156
|
+
|---|---|---|
|
|
157
|
+
| Altcha | `AltchaTask` | No |
|
|
158
|
+
| Basilisk | `BasiliskTask` | No |
|
|
159
|
+
| Castle | `CastleTask` | No |
|
|
160
|
+
| MTCaptcha | `MTCaptchaTask` | Optional |
|
|
161
|
+
| Prosopo | `ProsopoTask` | Optional |
|
|
162
|
+
| Yidun | `YidunTask` | Optional |
|
|
163
|
+
|
|
164
|
+
> Don't see your captcha type? Use `VanillaTaskPayload` to build custom task payloads without waiting for an SDK update.
|
|
165
|
+
|
|
166
|
+
## Advanced Usage
|
|
167
|
+
|
|
168
|
+
### Callback URLs
|
|
169
|
+
|
|
170
|
+
```python
|
|
171
|
+
result = client.solve(task, callback_url="https://yoursite.com/callback")
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Report Incorrect Solutions
|
|
175
|
+
|
|
176
|
+
```python
|
|
177
|
+
task_id = client.create_task(task)
|
|
178
|
+
result = client.join_task_result(task_id)
|
|
179
|
+
|
|
180
|
+
# If the token was rejected by the target site:
|
|
181
|
+
client.report_incorrect_token(task_id)
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Fresh Token Generation
|
|
185
|
+
|
|
186
|
+
Use `nocache=True` on reCAPTCHA tasks to prevent cached token reuse:
|
|
187
|
+
|
|
188
|
+
```python
|
|
189
|
+
task = RecaptchaV2Task(
|
|
190
|
+
websiteURL="https://example.com",
|
|
191
|
+
websiteKey="SITE_KEY_HERE",
|
|
192
|
+
nocache=True
|
|
193
|
+
)
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Documentation
|
|
197
|
+
|
|
198
|
+
Full API reference available at [alperensert.github.io/capmonster_python](https://alperensert.github.io/capmonster_python/).
|
|
199
|
+
|
|
200
|
+
## Support
|
|
201
|
+
|
|
202
|
+
- Found a bug? [Open an issue](https://github.com/alperensert/capmonster_python/issues)
|
|
203
|
+
- Contact: business@alperen.io
|
|
204
|
+
|
|
205
|
+
> [!NOTE]
|
|
206
|
+
> Support is limited to questions and issues related to this project. Custom integrations and application-specific logic are outside the scope of support.
|
|
207
|
+
|
|
208
|
+
## License
|
|
209
|
+
|
|
210
|
+
[MIT License](/LICENSE)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "capmonster_python"
|
|
3
|
+
version = "5.0.0"
|
|
4
|
+
description = "capmonster.cloud library/package for Python"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.9"
|
|
7
|
+
license = { text = "MIT" }
|
|
8
|
+
authors = [{ name = "Alperen Sert", email = "business@alperen.io" }]
|
|
9
|
+
dependencies = [
|
|
10
|
+
"httpx>=0.27.0",
|
|
11
|
+
"pydantic>=2.0"
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"License :: OSI Approved :: MIT License",
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Programming Language :: Python :: 3.9",
|
|
19
|
+
"Programming Language :: Python :: 3.10",
|
|
20
|
+
"Programming Language :: Python :: 3.11"
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[project.urls]
|
|
24
|
+
Documentation = "https://alperensert.github.io/capmonster_python/"
|
|
25
|
+
Source = "https://github.com/alperensert/capmonster_python/"
|
|
26
|
+
Tracker = "https://github.com/alperensert/capmonster_python/issues"
|
|
27
|
+
|
|
28
|
+
[build-system]
|
|
29
|
+
requires = ["setuptools>=61", "wheel"]
|
|
30
|
+
build-backend = "setuptools.build_meta"
|
|
31
|
+
|
|
32
|
+
[tool.setuptools.packages.find]
|
|
33
|
+
where = ["src"]
|
|
34
|
+
|
|
35
|
+
[tool.setuptools.package-dir]
|
|
36
|
+
"" = "src"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from .client import CapmonsterClient
|
|
2
|
+
from .exceptions import *
|
|
3
|
+
from .tasks import *
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"CapmonsterClient",
|
|
7
|
+
"VanillaTaskPayload",
|
|
8
|
+
"ProxyPayload",
|
|
9
|
+
"UserAgentPayload",
|
|
10
|
+
"AltchaTask",
|
|
11
|
+
"AltchaMetadata",
|
|
12
|
+
"AmazonTask",
|
|
13
|
+
"BasiliskTask",
|
|
14
|
+
"BinanceTask",
|
|
15
|
+
"CastleTask",
|
|
16
|
+
"CastleMetadata",
|
|
17
|
+
"ComplexImageRecaptchaTask",
|
|
18
|
+
"ComplexImageRecaptchaMetadata",
|
|
19
|
+
"ComplexImageRecognitionTask",
|
|
20
|
+
"DataDomeTask",
|
|
21
|
+
"DataDomeMetadata",
|
|
22
|
+
"FunCaptchaTask",
|
|
23
|
+
"GeeTestV3Task",
|
|
24
|
+
"GeeTestV4Task",
|
|
25
|
+
"HuntTask",
|
|
26
|
+
"ImageToTextTask",
|
|
27
|
+
"ImpervaTask",
|
|
28
|
+
"ImpervaTaskMetadata",
|
|
29
|
+
"MTCaptchaTask",
|
|
30
|
+
"ProsopoTask",
|
|
31
|
+
"RecaptchaClickTask",
|
|
32
|
+
"RecaptchaV2Task",
|
|
33
|
+
"RecaptchaV2EnterpriseTask",
|
|
34
|
+
"RecaptchaV3Task",
|
|
35
|
+
"RecaptchaV3EnterpriseTask",
|
|
36
|
+
"TemuTask",
|
|
37
|
+
"TenDITask",
|
|
38
|
+
"TSPDTask",
|
|
39
|
+
"TSPDMetadata",
|
|
40
|
+
"TurnstileTask",
|
|
41
|
+
"TurnstileCloudFlareTask",
|
|
42
|
+
"TurnstileWaitingRoomTask",
|
|
43
|
+
"YidunTask",
|
|
44
|
+
"CapmonsterException",
|
|
45
|
+
"CapmonsterAPIException",
|
|
46
|
+
"CapmonsterValidationException"
|
|
47
|
+
]
|