capmonstercloudclient 4.0.0__tar.gz → 4.1.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.
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/PKG-INFO +60 -36
- capmonstercloudclient-4.1.0/README.md +75 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/CapMonsterCloudClient.py +10 -10
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/GetResultTimeouts.py +31 -3
- capmonstercloudclient-4.1.0/capmonstercloud_client/requests/AlibabaCustomTaskRequest.py +42 -0
- capmonstercloudclient-4.1.0/capmonstercloud_client/requests/FriendlyCaptchaRequest.py +35 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/RecognitionComplexImageTaskRequest.py +2 -2
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/__init__.py +5 -4
- capmonstercloudclient-4.1.0/capmonstercloud_client/version.txt +1 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloudclient.egg-info/PKG-INFO +60 -36
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloudclient.egg-info/SOURCES.txt +2 -2
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/setup.py +2 -3
- capmonstercloudclient-4.0.0/README.md +0 -50
- capmonstercloudclient-4.0.0/capmonstercloud_client/requests/HcaptchaComplexImageTask.py +0 -96
- capmonstercloudclient-4.0.0/capmonstercloud_client/requests/HcaptchaRequest.py +0 -39
- capmonstercloudclient-4.0.0/capmonstercloud_client/version.txt +0 -1
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/LICENSE +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/MANIFEST.in +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/__init__.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/captchaResult.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/clientOptions.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/exceptions.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requestController.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/AltchaCustomTaskRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/AmazonWafRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/BasiliskCustomTaskRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/BinanceTaskRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/CastleCustomTaskRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/ComplexImageTaskBase.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/CustomTaskRequestBase.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/DataDomeCustomTaskRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/FuncaptchaComplexImageTask.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/FuncaptchaRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/GeetestRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/HuntCustomTaskRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/ImageToTextRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/ImpervaCustomTaskRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/MTCaptchaRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/ProsopoTaskRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/RecaptchaComplexImageTask.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/RecaptchaV2EnterpiseRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/RecaptchaV2Request.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/RecaptchaV3EnterpriseRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/RecaptchaV3ProxylessRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/TemuCustomTaskRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/TenDiCustomTaskRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/TspdCustomTaskRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/TurnstileRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/YidunRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/baseRequest.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/baseRequestWithProxy.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/enums.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/proxy_info.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/utils.py +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloudclient.egg-info/dependency_links.txt +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloudclient.egg-info/requires.txt +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloudclient.egg-info/top_level.txt +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/pyproject.toml +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/requirements.txt +0 -0
- {capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: capmonstercloudclient
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.1.0
|
|
4
4
|
Summary: Official CapMonsterCloud Client: https://capmonster.cloud/
|
|
5
5
|
Home-page: https://github.com/ZennoLab/capmonstercloud-client-python
|
|
6
6
|
Author: Andrey Ilyin
|
|
@@ -9,7 +9,6 @@ License: AGPL-3.0
|
|
|
9
9
|
Keywords: captcha
|
|
10
10
|
recaptcha
|
|
11
11
|
geetest
|
|
12
|
-
hcaptcha
|
|
13
12
|
funcaptcha
|
|
14
13
|
python3
|
|
15
14
|
python-library
|
|
@@ -64,53 +63,78 @@ Dynamic: requires-dist
|
|
|
64
63
|
Dynamic: requires-python
|
|
65
64
|
Dynamic: summary
|
|
66
65
|
|
|
67
|
-
#
|
|
66
|
+
# CapMonster Cloud Python SDK
|
|
68
67
|
|
|
69
|
-
|
|
68
|
+
[](https://pypi.org/project/capmonstercloudclient/)
|
|
69
|
+
|
|
70
|
+
Official Python SDK for the CapMonster Cloud API.
|
|
71
|
+
Use this package when you want to create tasks and retrieve solutions from Python applications or scripts.
|
|
72
|
+
|
|
73
|
+
## Links
|
|
74
|
+
|
|
75
|
+
- Package: [capmonstercloudclient on PyPI](https://pypi.org/project/capmonstercloudclient/)
|
|
76
|
+
- Documentation: [docs.capmonster.cloud](https://docs.capmonster.cloud/)
|
|
77
|
+
- Dashboard / API key: [dash.capmonster.cloud](https://dash.capmonster.cloud/)
|
|
70
78
|
|
|
71
79
|
## Installation
|
|
72
80
|
|
|
73
|
-
|
|
81
|
+
```bash
|
|
82
|
+
python3 -m pip install capmonstercloudclient
|
|
83
|
+
```
|
|
74
84
|
|
|
75
|
-
|
|
85
|
+
Need to test before depositing? Contact support and we’ll add trial credits to your account.
|
|
76
86
|
|
|
77
|
-
|
|
78
|
-
import asyncio
|
|
87
|
+
## Minimal async example
|
|
79
88
|
|
|
80
|
-
|
|
81
|
-
|
|
89
|
+
```python
|
|
90
|
+
import asyncio
|
|
82
91
|
|
|
83
|
-
|
|
84
|
-
|
|
92
|
+
from capmonstercloudclient import CapMonsterClient, ClientOptions
|
|
93
|
+
from capmonstercloudclient.requests import RecaptchaV2Request
|
|
85
94
|
|
|
86
|
-
|
|
87
|
-
|
|
95
|
+
client_options = ClientOptions(api_key="<YOUR_API_KEY>")
|
|
96
|
+
cap_monster_client = CapMonsterClient(options=client_options)
|
|
88
97
|
|
|
89
|
-
|
|
90
|
-
|
|
98
|
+
recaptcha2request = RecaptchaV2Request(
|
|
99
|
+
websiteUrl="https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high",
|
|
100
|
+
websiteKey="6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd",
|
|
101
|
+
)
|
|
91
102
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
***
|
|
103
|
+
async def solve_captcha():
|
|
104
|
+
return await cap_monster_client.solve_captcha(recaptcha2request)
|
|
95
105
|
|
|
96
|
-
|
|
106
|
+
response = asyncio.run(solve_captcha())
|
|
107
|
+
print(response)
|
|
108
|
+
```
|
|
97
109
|
|
|
98
|
-
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
- [
|
|
103
|
-
- [
|
|
104
|
-
- [RecaptchaV2EnterpriseProxylessRequest](https://zenno.link/doc-recaptcha2e-en)
|
|
105
|
-
- [RecaptchaV2EnterpriseRequest](https://zenno.link/doc-recaptcha2e-proxy-en)
|
|
106
|
-
- [TurnstileProxylessRequest](https://zenno.link/doc-turnstile-en)
|
|
107
|
-
- [TurnstileRequest](https://zenno.link/doc-turnstile-proxy-en)
|
|
108
|
-
- [RecaptchaComplexImageTaskRequest](https://zenno.link/doc-complextask-rc-en)
|
|
109
|
-
- [DataDomeCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/datadome)
|
|
110
|
-
- [TenDiCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/tendi)
|
|
111
|
-
- [BasiliskCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/Basilisk-task)
|
|
110
|
+
Supported task families include reCAPTCHA, GeeTest, Turnstile, image-to-text, and additional task types documented in the public docs.
|
|
111
|
+
|
|
112
|
+
Supported request classes:
|
|
113
|
+
|
|
114
|
+
- [AltchaCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/altcha-task)
|
|
115
|
+
- [AlibabaCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/alibaba-task)
|
|
112
116
|
- [AmazonWafRequest](https://docs.capmonster.cloud/docs/captchas/amazon-task)
|
|
117
|
+
- [BasiliskCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/Basilisk-task)
|
|
113
118
|
- [BinanceTaskRequest](https://docs.capmonster.cloud/docs/captchas/binance)
|
|
114
|
-
- [
|
|
119
|
+
- [CastleCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/castle-task)
|
|
120
|
+
- [DataDomeCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/datadome)
|
|
121
|
+
- [FriendlyCaptchaRequest](https://docs.capmonster.cloud/docs/captchas/friendly-task)
|
|
122
|
+
- [FuncaptchaRequest](https://docs.capmonster.cloud/docs/captchas/funcaptcha-task)
|
|
123
|
+
- [FunCaptchaComplexImageTaskRequest](https://docs.capmonster.cloud/docs/captchas/ComplexImageTask-Recognition)
|
|
124
|
+
- [GeetestRequest](https://docs.capmonster.cloud/docs/captchas/geetest-task)
|
|
125
|
+
- [HuntCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/hunt-task)
|
|
126
|
+
- [ImageToTextRequest](https://docs.capmonster.cloud/docs/captchas/image-to-text)
|
|
115
127
|
- [ImpervaCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/incapsula)
|
|
116
|
-
- [
|
|
128
|
+
- [MTCaptchaRequest](https://docs.capmonster.cloud/docs/captchas/mtcaptcha-task)
|
|
129
|
+
- [ProsopoTaskRequest](https://docs.capmonster.cloud/docs/captchas/prosopo-task)
|
|
130
|
+
- [RecognitionComplexImageTaskRequest](https://docs.capmonster.cloud/docs/captchas/ComplexImageTask-Recognition)
|
|
131
|
+
- [RecaptchaComplexImageTaskRequest](https://docs.capmonster.cloud/docs/captchas/recaptcha-click)
|
|
132
|
+
- [RecaptchaV2EnterpriseRequest](https://docs.capmonster.cloud/docs/captchas/recaptcha-v2-enterprise-task)
|
|
133
|
+
- [RecaptchaV2Request](https://docs.capmonster.cloud/docs/captchas/no-captcha-task)
|
|
134
|
+
- [RecaptchaV3EnterpriseRequest](https://docs.capmonster.cloud/docs/captchas/recaptcha-v3-enterprise-task)
|
|
135
|
+
- [RecaptchaV3ProxylessRequest](https://docs.capmonster.cloud/docs/captchas/recaptcha-v3-task)
|
|
136
|
+
- [TemuCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/temu-task)
|
|
137
|
+
- [TenDiCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/tendi)
|
|
138
|
+
- [TspdCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/tspd-task)
|
|
139
|
+
- [TurnstileRequest](https://docs.capmonster.cloud/docs/captchas/turnstile-task)
|
|
140
|
+
- [YidunRequest](https://docs.capmonster.cloud/docs/captchas/yidun-task)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# CapMonster Cloud Python SDK
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/capmonstercloudclient/)
|
|
4
|
+
|
|
5
|
+
Official Python SDK for the CapMonster Cloud API.
|
|
6
|
+
Use this package when you want to create tasks and retrieve solutions from Python applications or scripts.
|
|
7
|
+
|
|
8
|
+
## Links
|
|
9
|
+
|
|
10
|
+
- Package: [capmonstercloudclient on PyPI](https://pypi.org/project/capmonstercloudclient/)
|
|
11
|
+
- Documentation: [docs.capmonster.cloud](https://docs.capmonster.cloud/)
|
|
12
|
+
- Dashboard / API key: [dash.capmonster.cloud](https://dash.capmonster.cloud/)
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
python3 -m pip install capmonstercloudclient
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Need to test before depositing? Contact support and we’ll add trial credits to your account.
|
|
21
|
+
|
|
22
|
+
## Minimal async example
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
import asyncio
|
|
26
|
+
|
|
27
|
+
from capmonstercloudclient import CapMonsterClient, ClientOptions
|
|
28
|
+
from capmonstercloudclient.requests import RecaptchaV2Request
|
|
29
|
+
|
|
30
|
+
client_options = ClientOptions(api_key="<YOUR_API_KEY>")
|
|
31
|
+
cap_monster_client = CapMonsterClient(options=client_options)
|
|
32
|
+
|
|
33
|
+
recaptcha2request = RecaptchaV2Request(
|
|
34
|
+
websiteUrl="https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high",
|
|
35
|
+
websiteKey="6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd",
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
async def solve_captcha():
|
|
39
|
+
return await cap_monster_client.solve_captcha(recaptcha2request)
|
|
40
|
+
|
|
41
|
+
response = asyncio.run(solve_captcha())
|
|
42
|
+
print(response)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Supported task families include reCAPTCHA, GeeTest, Turnstile, image-to-text, and additional task types documented in the public docs.
|
|
46
|
+
|
|
47
|
+
Supported request classes:
|
|
48
|
+
|
|
49
|
+
- [AltchaCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/altcha-task)
|
|
50
|
+
- [AlibabaCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/alibaba-task)
|
|
51
|
+
- [AmazonWafRequest](https://docs.capmonster.cloud/docs/captchas/amazon-task)
|
|
52
|
+
- [BasiliskCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/Basilisk-task)
|
|
53
|
+
- [BinanceTaskRequest](https://docs.capmonster.cloud/docs/captchas/binance)
|
|
54
|
+
- [CastleCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/castle-task)
|
|
55
|
+
- [DataDomeCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/datadome)
|
|
56
|
+
- [FriendlyCaptchaRequest](https://docs.capmonster.cloud/docs/captchas/friendly-task)
|
|
57
|
+
- [FuncaptchaRequest](https://docs.capmonster.cloud/docs/captchas/funcaptcha-task)
|
|
58
|
+
- [FunCaptchaComplexImageTaskRequest](https://docs.capmonster.cloud/docs/captchas/ComplexImageTask-Recognition)
|
|
59
|
+
- [GeetestRequest](https://docs.capmonster.cloud/docs/captchas/geetest-task)
|
|
60
|
+
- [HuntCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/hunt-task)
|
|
61
|
+
- [ImageToTextRequest](https://docs.capmonster.cloud/docs/captchas/image-to-text)
|
|
62
|
+
- [ImpervaCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/incapsula)
|
|
63
|
+
- [MTCaptchaRequest](https://docs.capmonster.cloud/docs/captchas/mtcaptcha-task)
|
|
64
|
+
- [ProsopoTaskRequest](https://docs.capmonster.cloud/docs/captchas/prosopo-task)
|
|
65
|
+
- [RecognitionComplexImageTaskRequest](https://docs.capmonster.cloud/docs/captchas/ComplexImageTask-Recognition)
|
|
66
|
+
- [RecaptchaComplexImageTaskRequest](https://docs.capmonster.cloud/docs/captchas/recaptcha-click)
|
|
67
|
+
- [RecaptchaV2EnterpriseRequest](https://docs.capmonster.cloud/docs/captchas/recaptcha-v2-enterprise-task)
|
|
68
|
+
- [RecaptchaV2Request](https://docs.capmonster.cloud/docs/captchas/no-captcha-task)
|
|
69
|
+
- [RecaptchaV3EnterpriseRequest](https://docs.capmonster.cloud/docs/captchas/recaptcha-v3-enterprise-task)
|
|
70
|
+
- [RecaptchaV3ProxylessRequest](https://docs.capmonster.cloud/docs/captchas/recaptcha-v3-task)
|
|
71
|
+
- [TemuCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/temu-task)
|
|
72
|
+
- [TenDiCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/tendi)
|
|
73
|
+
- [TspdCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/tspd-task)
|
|
74
|
+
- [TurnstileRequest](https://docs.capmonster.cloud/docs/captchas/turnstile-task)
|
|
75
|
+
- [YidunRequest](https://docs.capmonster.cloud/docs/captchas/yidun-task)
|
|
@@ -20,11 +20,9 @@ _instance_config = (
|
|
|
20
20
|
((RecaptchaV3EnterpriseRequest,), getRecaptchaV3Timeouts),
|
|
21
21
|
((ImageToTextRequest,), getImage2TextTimeouts),
|
|
22
22
|
((FuncaptchaRequest,), getFuncaptchaTimeouts),
|
|
23
|
-
((HcaptchaRequest,), getHcaptchaTimeouts),
|
|
24
23
|
((GeetestRequest,), getGeetestTimeouts),
|
|
25
24
|
((TurnstileRequest,), getTurnstileTimeouts),
|
|
26
|
-
((RecaptchaComplexImageTaskRequest,
|
|
27
|
-
FunCaptchaComplexImageTaskRequest), getImage2TextTimeouts),
|
|
25
|
+
((RecaptchaComplexImageTaskRequest, FunCaptchaComplexImageTaskRequest), getImage2TextTimeouts),
|
|
28
26
|
((DataDomeCustomTaskRequest,), getDatadomeTimeouts),
|
|
29
27
|
((TenDiCustomTaskRequest,), getTenDiTimeouts),
|
|
30
28
|
((BasiliskCustomTaskRequest,), getBasiliskTimeouts),
|
|
@@ -40,6 +38,8 @@ _instance_config = (
|
|
|
40
38
|
((CastleCustomTaskRequest,), getCastleTimeouts),
|
|
41
39
|
((TspdCustomTaskRequest,), getTspdTimeouts),
|
|
42
40
|
((HuntCustomTaskRequest,), getHuntTimeouts),
|
|
41
|
+
((FriendlyCaptchaRequest,), getFriendlyCaptchaTimeouts),
|
|
42
|
+
((AlibabaCustomTaskRequest,), getAlibabaTimeouts),
|
|
43
43
|
)
|
|
44
44
|
|
|
45
45
|
|
|
@@ -88,8 +88,6 @@ class CapMonsterClient:
|
|
|
88
88
|
ImageToTextRequest,
|
|
89
89
|
FuncaptchaRequest,
|
|
90
90
|
FunCaptchaComplexImageTaskRequest,
|
|
91
|
-
HcaptchaRequest,
|
|
92
|
-
HcaptchaComplexImageTaskRequest,
|
|
93
91
|
GeetestRequest,
|
|
94
92
|
DataDomeCustomTaskRequest,
|
|
95
93
|
TenDiCustomTaskRequest,
|
|
@@ -106,7 +104,9 @@ class CapMonsterClient:
|
|
|
106
104
|
AltchaCustomTaskRequest,
|
|
107
105
|
CastleCustomTaskRequest,
|
|
108
106
|
TspdCustomTaskRequest,
|
|
109
|
-
HuntCustomTaskRequest
|
|
107
|
+
HuntCustomTaskRequest,
|
|
108
|
+
FriendlyCaptchaRequest,
|
|
109
|
+
AlibabaCustomTaskRequest],
|
|
110
110
|
) -> Dict[str, str]:
|
|
111
111
|
'''
|
|
112
112
|
Non-blocking method for captcha solving.
|
|
@@ -130,8 +130,6 @@ class CapMonsterClient:
|
|
|
130
130
|
ImageToTextRequest,
|
|
131
131
|
FuncaptchaRequest,
|
|
132
132
|
FunCaptchaComplexImageTaskRequest,
|
|
133
|
-
HcaptchaRequest,
|
|
134
|
-
HcaptchaComplexImageTaskRequest,
|
|
135
133
|
GeetestRequest,
|
|
136
134
|
DataDomeCustomTaskRequest,
|
|
137
135
|
TenDiCustomTaskRequest,
|
|
@@ -145,7 +143,9 @@ class CapMonsterClient:
|
|
|
145
143
|
YidunRequest,
|
|
146
144
|
TemuCustomTaskRequest,
|
|
147
145
|
ProsopoTaskRequest,
|
|
148
|
-
AltchaCustomTaskRequest
|
|
146
|
+
AltchaCustomTaskRequest,
|
|
147
|
+
FriendlyCaptchaRequest,
|
|
148
|
+
AlibabaCustomTaskRequest],
|
|
149
149
|
timeouts: GetResultTimeouts,
|
|
150
150
|
) -> Dict[str, str]:
|
|
151
151
|
|
|
@@ -215,4 +215,4 @@ class CapMonsterClient:
|
|
|
215
215
|
raise HTTPException(f'Cannot create task. Status code: {resp.status}.')
|
|
216
216
|
else:
|
|
217
217
|
return await resp.json(content_type=None)
|
|
218
|
-
|
|
218
|
+
|
|
@@ -1,78 +1,106 @@
|
|
|
1
1
|
from typing import Union
|
|
2
2
|
from dataclasses import dataclass
|
|
3
3
|
|
|
4
|
+
|
|
4
5
|
@dataclass
|
|
5
6
|
class GetResultTimeouts:
|
|
6
7
|
firstRequestDelay: Union[int, float]
|
|
7
8
|
firstRequestNoCacheDelay: Union[int, float]
|
|
8
|
-
requestsInterval: Union[int, float]
|
|
9
|
+
requestsInterval: Union[int, float]
|
|
9
10
|
timeout: Union[int, float]
|
|
10
11
|
|
|
12
|
+
|
|
11
13
|
def getRecaptchaV2Timeouts() -> GetResultTimeouts:
|
|
12
14
|
return GetResultTimeouts(1, 10, 3, 180)
|
|
13
15
|
|
|
16
|
+
|
|
14
17
|
def getRecaptchaV2EnterpriseTimeouts() -> GetResultTimeouts:
|
|
15
18
|
return GetResultTimeouts(1, 10, 3, 180)
|
|
16
19
|
|
|
20
|
+
|
|
17
21
|
def getRecaptchaV3Timeouts() -> GetResultTimeouts:
|
|
18
22
|
return GetResultTimeouts(1, 10, 3, 180)
|
|
19
23
|
|
|
24
|
+
|
|
20
25
|
def getRecaptchaV3EnterpriseTimeouts() -> GetResultTimeouts:
|
|
21
26
|
return GetResultTimeouts(1, 10, 3, 150)
|
|
22
27
|
|
|
28
|
+
|
|
23
29
|
def getImage2TextTimeouts() -> GetResultTimeouts:
|
|
24
30
|
return GetResultTimeouts(0.35, 0, 0.2, 10)
|
|
25
31
|
|
|
32
|
+
|
|
26
33
|
def getFuncaptchaTimeouts() -> GetResultTimeouts:
|
|
27
34
|
return GetResultTimeouts(1, 10, 1, 80)
|
|
28
35
|
|
|
29
|
-
def getHcaptchaTimeouts() -> GetResultTimeouts:
|
|
30
|
-
return GetResultTimeouts(1, 10, 3, 180)
|
|
31
36
|
|
|
32
37
|
def getGeetestTimeouts() -> GetResultTimeouts:
|
|
33
38
|
return GetResultTimeouts(1, 0, 1, 80)
|
|
34
39
|
|
|
40
|
+
|
|
35
41
|
def getTurnstileTimeouts() -> GetResultTimeouts:
|
|
36
42
|
return GetResultTimeouts(1, 0, 1, 80)
|
|
37
43
|
|
|
44
|
+
|
|
38
45
|
def getDatadomeTimeouts() -> GetResultTimeouts:
|
|
39
46
|
return GetResultTimeouts(1, 0, 1, 80)
|
|
40
47
|
|
|
48
|
+
|
|
41
49
|
def getTenDiTimeouts() -> GetResultTimeouts:
|
|
42
50
|
return GetResultTimeouts(1, 10, 3, 180)
|
|
43
51
|
|
|
52
|
+
|
|
44
53
|
def getBasiliskTimeouts() -> GetResultTimeouts:
|
|
45
54
|
return GetResultTimeouts(1, 10, 3, 100)
|
|
46
55
|
|
|
56
|
+
|
|
47
57
|
def getAmazonWafTimeouts() -> GetResultTimeouts:
|
|
48
58
|
return GetResultTimeouts(1, 10, 3, 180)
|
|
49
59
|
|
|
60
|
+
|
|
50
61
|
def getBinanceTimeouts() -> GetResultTimeouts:
|
|
51
62
|
return GetResultTimeouts(1, 0, 1, 20)
|
|
52
63
|
|
|
64
|
+
|
|
53
65
|
def getImpervaTimeouts() -> GetResultTimeouts:
|
|
54
66
|
return GetResultTimeouts(1, 0, 1, 20)
|
|
55
67
|
|
|
68
|
+
|
|
56
69
|
def getAltchaTimeouts() -> GetResultTimeouts:
|
|
57
70
|
return GetResultTimeouts(1, 0, 1, 50)
|
|
58
71
|
|
|
72
|
+
|
|
59
73
|
def getCastleTimeouts() -> GetResultTimeouts:
|
|
60
74
|
return GetResultTimeouts(1, 0, 1, 60)
|
|
61
75
|
|
|
76
|
+
|
|
62
77
|
def getTspdTimeouts() -> GetResultTimeouts:
|
|
63
78
|
return GetResultTimeouts(1, 0, 1, 60)
|
|
64
79
|
|
|
80
|
+
|
|
65
81
|
def getHuntTimeouts() -> GetResultTimeouts:
|
|
66
82
|
return GetResultTimeouts(1, 0, 1, 60)
|
|
67
83
|
|
|
84
|
+
|
|
68
85
|
def getCITTimeouts() -> GetResultTimeouts:
|
|
69
86
|
return GetResultTimeouts(0.35, 0, 0.2, 10)
|
|
70
87
|
|
|
88
|
+
|
|
71
89
|
def getYidunTimeouts() -> GetResultTimeouts:
|
|
72
90
|
return GetResultTimeouts(1, 10, 3, 180)
|
|
73
91
|
|
|
92
|
+
|
|
74
93
|
def getProsopoTimeouts() -> GetResultTimeouts:
|
|
75
94
|
return GetResultTimeouts(1, 10, 3, 180)
|
|
76
95
|
|
|
96
|
+
|
|
77
97
|
def getTemuTimeouts() -> GetResultTimeouts:
|
|
78
98
|
return GetResultTimeouts(1, 10, 3, 180)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def getFriendlyCaptchaTimeouts() -> GetResultTimeouts:
|
|
102
|
+
return GetResultTimeouts(1, 0, 1, 180)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def getAlibabaTimeouts() -> GetResultTimeouts:
|
|
106
|
+
return GetResultTimeouts(1, 0, 1, 180)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
from typing import Dict, Union
|
|
2
|
+
from pydantic import Field, validator
|
|
3
|
+
|
|
4
|
+
from .CustomTaskRequestBase import CustomTaskRequestBase
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class AlibabaCustomTaskRequest(CustomTaskRequestBase):
|
|
8
|
+
captchaClass: str = Field(default='alibaba')
|
|
9
|
+
metadata: Dict[str, str]
|
|
10
|
+
|
|
11
|
+
@validator('metadata')
|
|
12
|
+
def validate_metadata(cls, value):
|
|
13
|
+
allowed_keys = {'sceneId', 'prefix', 'userId', 'userUserId', 'verifyType',
|
|
14
|
+
'region', 'UserCertifyId', 'apiGetLib'}
|
|
15
|
+
unknown = set(value.keys()) - allowed_keys
|
|
16
|
+
if unknown:
|
|
17
|
+
raise TypeError(f'Unexpected metadata keys: {unknown}. Allowed: {allowed_keys}')
|
|
18
|
+
for key in ['sceneId', 'prefix']:
|
|
19
|
+
if value.get(key) is None:
|
|
20
|
+
raise TypeError(f'Expect that {key} will be defined.')
|
|
21
|
+
if not isinstance(value[key], str):
|
|
22
|
+
raise TypeError(f'Expect that {key} will be str.')
|
|
23
|
+
for key in ['userId', 'userUserId', 'verifyType', 'region', 'UserCertifyId', 'apiGetLib']:
|
|
24
|
+
if key in value and not isinstance(value[key], str):
|
|
25
|
+
raise TypeError(f'Expect that {key} will be str.')
|
|
26
|
+
return value
|
|
27
|
+
|
|
28
|
+
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
|
29
|
+
task = {}
|
|
30
|
+
task['type'] = self.type
|
|
31
|
+
task['class'] = self.captchaClass
|
|
32
|
+
task['websiteURL'] = self.websiteUrl
|
|
33
|
+
task['metadata'] = self.metadata
|
|
34
|
+
if self.proxy:
|
|
35
|
+
task['proxyType'] = self.proxy.proxyType
|
|
36
|
+
task['proxyAddress'] = self.proxy.proxyAddress
|
|
37
|
+
task['proxyPort'] = self.proxy.proxyPort
|
|
38
|
+
task['proxyLogin'] = self.proxy.proxyLogin
|
|
39
|
+
task['proxyPassword'] = self.proxy.proxyPassword
|
|
40
|
+
if self.userAgent is not None:
|
|
41
|
+
task['userAgent'] = self.userAgent
|
|
42
|
+
return task
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from typing import Dict, Union
|
|
2
|
+
from pydantic import Field, validator
|
|
3
|
+
|
|
4
|
+
from .CustomTaskRequestBase import CustomTaskRequestBase
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class FriendlyCaptchaRequest(CustomTaskRequestBase):
|
|
8
|
+
captchaClass: str = Field(default='friendly')
|
|
9
|
+
websiteKey: str = Field()
|
|
10
|
+
metadata: Dict[str, str]
|
|
11
|
+
|
|
12
|
+
@validator('metadata')
|
|
13
|
+
def validate_metadata(cls, value):
|
|
14
|
+
if value.get('apiGetLib') is None:
|
|
15
|
+
raise TypeError('Expect that apiGetLib will be defined.')
|
|
16
|
+
if not isinstance(value['apiGetLib'], str):
|
|
17
|
+
raise TypeError('Expect that apiGetLib will be str.')
|
|
18
|
+
return value
|
|
19
|
+
|
|
20
|
+
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
|
21
|
+
task = {}
|
|
22
|
+
task['type'] = self.type
|
|
23
|
+
task['class'] = self.captchaClass
|
|
24
|
+
task['websiteURL'] = self.websiteUrl
|
|
25
|
+
task['websiteKey'] = self.websiteKey
|
|
26
|
+
task['metadata'] = self.metadata
|
|
27
|
+
if self.proxy:
|
|
28
|
+
task['proxyType'] = self.proxy.proxyType
|
|
29
|
+
task['proxyAddress'] = self.proxy.proxyAddress
|
|
30
|
+
task['proxyPort'] = self.proxy.proxyPort
|
|
31
|
+
task['proxyLogin'] = self.proxy.proxyLogin
|
|
32
|
+
task['proxyPassword'] = self.proxy.proxyPassword
|
|
33
|
+
if self.userAgent is not None:
|
|
34
|
+
task['userAgent'] = self.userAgent
|
|
35
|
+
return task
|
|
@@ -15,8 +15,8 @@ class RecognitionComplexImageTaskRequest(ComplexImageTaskRequestBase):
|
|
|
15
15
|
else:
|
|
16
16
|
if not isinstance(value.get('Task'), str):
|
|
17
17
|
raise TypeError(f'Expect that Task will be str.')
|
|
18
|
-
if not set(value.keys()).issubset(set(["Task", "TaskArgument"])):
|
|
19
|
-
raise TypeError(f'Allowed keys for metadata are "Task" and "
|
|
18
|
+
if not set(value.keys()).issubset(set(["Task", "TaskArgument", "PayloadType"])):
|
|
19
|
+
raise TypeError(f'Allowed keys for metadata are "Task", "TaskArgument" and "PayloadType')
|
|
20
20
|
return value
|
|
21
21
|
|
|
22
22
|
@validator('imagesBase64')
|
|
@@ -4,12 +4,10 @@ from .RecaptchaV2EnterpiseRequest import RecaptchaV2EnterpriseRequest
|
|
|
4
4
|
from .RecaptchaV3ProxylessRequest import RecaptchaV3ProxylessRequest
|
|
5
5
|
from .RecaptchaV3EnterpriseRequest import RecaptchaV3EnterpriseRequest
|
|
6
6
|
from .RecaptchaComplexImageTask import RecaptchaComplexImageTaskRequest
|
|
7
|
-
from .HcaptchaRequest import HcaptchaRequest
|
|
8
7
|
from .FuncaptchaRequest import FuncaptchaRequest
|
|
9
8
|
from .FuncaptchaComplexImageTask import FunCaptchaComplexImageTaskRequest
|
|
10
9
|
from .GeetestRequest import GeetestRequest
|
|
11
10
|
from .TurnstileRequest import TurnstileRequest
|
|
12
|
-
from .HcaptchaComplexImageTask import HcaptchaComplexImageTaskRequest
|
|
13
11
|
from .RecaptchaComplexImageTask import RecaptchaComplexImageTaskRequest
|
|
14
12
|
from .baseRequest import BaseRequest
|
|
15
13
|
from .DataDomeCustomTaskRequest import DataDomeCustomTaskRequest
|
|
@@ -27,13 +25,14 @@ from .AltchaCustomTaskRequest import AltchaCustomTaskRequest
|
|
|
27
25
|
from .CastleCustomTaskRequest import CastleCustomTaskRequest
|
|
28
26
|
from .TspdCustomTaskRequest import TspdCustomTaskRequest
|
|
29
27
|
from .HuntCustomTaskRequest import HuntCustomTaskRequest
|
|
28
|
+
from .FriendlyCaptchaRequest import FriendlyCaptchaRequest
|
|
29
|
+
from .AlibabaCustomTaskRequest import AlibabaCustomTaskRequest
|
|
30
30
|
from .proxy_info import ProxyInfo, ClientProxyInfo
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
REQUESTS = ['RecaptchaV2EnterpiseRequest', 'RecaptchaV2Request', 'RecaptchaV3ProxylessRequest', 'RecaptchaComplexImageTaskRequest', 'RecaptchaV3EnterpriseRequest',
|
|
34
34
|
'ImageToTextRequest',
|
|
35
35
|
'FuncaptchaRequest', 'FunCaptchaComplexImageTaskRequest',
|
|
36
|
-
'HcaptchaRequest', 'HcaptchaComplexImageTaskRequest',
|
|
37
36
|
'GeetestRequest',
|
|
38
37
|
'DataDomeCustomTaskRequest',
|
|
39
38
|
'TenDiCustomTaskRequest',
|
|
@@ -50,5 +49,7 @@ REQUESTS = ['RecaptchaV2EnterpiseRequest', 'RecaptchaV2Request', 'RecaptchaV3Pro
|
|
|
50
49
|
'AltchaCustomTaskRequest',
|
|
51
50
|
'CastleCustomTaskRequest',
|
|
52
51
|
'TspdCustomTaskRequest',
|
|
53
|
-
'HuntCustomTaskRequest'
|
|
52
|
+
'HuntCustomTaskRequest',
|
|
53
|
+
'FriendlyCaptchaRequest',
|
|
54
|
+
'AlibabaCustomTaskRequest'
|
|
54
55
|
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4.1.0
|
{capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloudclient.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: capmonstercloudclient
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.1.0
|
|
4
4
|
Summary: Official CapMonsterCloud Client: https://capmonster.cloud/
|
|
5
5
|
Home-page: https://github.com/ZennoLab/capmonstercloud-client-python
|
|
6
6
|
Author: Andrey Ilyin
|
|
@@ -9,7 +9,6 @@ License: AGPL-3.0
|
|
|
9
9
|
Keywords: captcha
|
|
10
10
|
recaptcha
|
|
11
11
|
geetest
|
|
12
|
-
hcaptcha
|
|
13
12
|
funcaptcha
|
|
14
13
|
python3
|
|
15
14
|
python-library
|
|
@@ -64,53 +63,78 @@ Dynamic: requires-dist
|
|
|
64
63
|
Dynamic: requires-python
|
|
65
64
|
Dynamic: summary
|
|
66
65
|
|
|
67
|
-
#
|
|
66
|
+
# CapMonster Cloud Python SDK
|
|
68
67
|
|
|
69
|
-
|
|
68
|
+
[](https://pypi.org/project/capmonstercloudclient/)
|
|
69
|
+
|
|
70
|
+
Official Python SDK for the CapMonster Cloud API.
|
|
71
|
+
Use this package when you want to create tasks and retrieve solutions from Python applications or scripts.
|
|
72
|
+
|
|
73
|
+
## Links
|
|
74
|
+
|
|
75
|
+
- Package: [capmonstercloudclient on PyPI](https://pypi.org/project/capmonstercloudclient/)
|
|
76
|
+
- Documentation: [docs.capmonster.cloud](https://docs.capmonster.cloud/)
|
|
77
|
+
- Dashboard / API key: [dash.capmonster.cloud](https://dash.capmonster.cloud/)
|
|
70
78
|
|
|
71
79
|
## Installation
|
|
72
80
|
|
|
73
|
-
|
|
81
|
+
```bash
|
|
82
|
+
python3 -m pip install capmonstercloudclient
|
|
83
|
+
```
|
|
74
84
|
|
|
75
|
-
|
|
85
|
+
Need to test before depositing? Contact support and we’ll add trial credits to your account.
|
|
76
86
|
|
|
77
|
-
|
|
78
|
-
import asyncio
|
|
87
|
+
## Minimal async example
|
|
79
88
|
|
|
80
|
-
|
|
81
|
-
|
|
89
|
+
```python
|
|
90
|
+
import asyncio
|
|
82
91
|
|
|
83
|
-
|
|
84
|
-
|
|
92
|
+
from capmonstercloudclient import CapMonsterClient, ClientOptions
|
|
93
|
+
from capmonstercloudclient.requests import RecaptchaV2Request
|
|
85
94
|
|
|
86
|
-
|
|
87
|
-
|
|
95
|
+
client_options = ClientOptions(api_key="<YOUR_API_KEY>")
|
|
96
|
+
cap_monster_client = CapMonsterClient(options=client_options)
|
|
88
97
|
|
|
89
|
-
|
|
90
|
-
|
|
98
|
+
recaptcha2request = RecaptchaV2Request(
|
|
99
|
+
websiteUrl="https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high",
|
|
100
|
+
websiteKey="6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd",
|
|
101
|
+
)
|
|
91
102
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
***
|
|
103
|
+
async def solve_captcha():
|
|
104
|
+
return await cap_monster_client.solve_captcha(recaptcha2request)
|
|
95
105
|
|
|
96
|
-
|
|
106
|
+
response = asyncio.run(solve_captcha())
|
|
107
|
+
print(response)
|
|
108
|
+
```
|
|
97
109
|
|
|
98
|
-
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
- [
|
|
103
|
-
- [
|
|
104
|
-
- [RecaptchaV2EnterpriseProxylessRequest](https://zenno.link/doc-recaptcha2e-en)
|
|
105
|
-
- [RecaptchaV2EnterpriseRequest](https://zenno.link/doc-recaptcha2e-proxy-en)
|
|
106
|
-
- [TurnstileProxylessRequest](https://zenno.link/doc-turnstile-en)
|
|
107
|
-
- [TurnstileRequest](https://zenno.link/doc-turnstile-proxy-en)
|
|
108
|
-
- [RecaptchaComplexImageTaskRequest](https://zenno.link/doc-complextask-rc-en)
|
|
109
|
-
- [DataDomeCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/datadome)
|
|
110
|
-
- [TenDiCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/tendi)
|
|
111
|
-
- [BasiliskCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/Basilisk-task)
|
|
110
|
+
Supported task families include reCAPTCHA, GeeTest, Turnstile, image-to-text, and additional task types documented in the public docs.
|
|
111
|
+
|
|
112
|
+
Supported request classes:
|
|
113
|
+
|
|
114
|
+
- [AltchaCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/altcha-task)
|
|
115
|
+
- [AlibabaCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/alibaba-task)
|
|
112
116
|
- [AmazonWafRequest](https://docs.capmonster.cloud/docs/captchas/amazon-task)
|
|
117
|
+
- [BasiliskCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/Basilisk-task)
|
|
113
118
|
- [BinanceTaskRequest](https://docs.capmonster.cloud/docs/captchas/binance)
|
|
114
|
-
- [
|
|
119
|
+
- [CastleCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/castle-task)
|
|
120
|
+
- [DataDomeCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/datadome)
|
|
121
|
+
- [FriendlyCaptchaRequest](https://docs.capmonster.cloud/docs/captchas/friendly-task)
|
|
122
|
+
- [FuncaptchaRequest](https://docs.capmonster.cloud/docs/captchas/funcaptcha-task)
|
|
123
|
+
- [FunCaptchaComplexImageTaskRequest](https://docs.capmonster.cloud/docs/captchas/ComplexImageTask-Recognition)
|
|
124
|
+
- [GeetestRequest](https://docs.capmonster.cloud/docs/captchas/geetest-task)
|
|
125
|
+
- [HuntCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/hunt-task)
|
|
126
|
+
- [ImageToTextRequest](https://docs.capmonster.cloud/docs/captchas/image-to-text)
|
|
115
127
|
- [ImpervaCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/incapsula)
|
|
116
|
-
- [
|
|
128
|
+
- [MTCaptchaRequest](https://docs.capmonster.cloud/docs/captchas/mtcaptcha-task)
|
|
129
|
+
- [ProsopoTaskRequest](https://docs.capmonster.cloud/docs/captchas/prosopo-task)
|
|
130
|
+
- [RecognitionComplexImageTaskRequest](https://docs.capmonster.cloud/docs/captchas/ComplexImageTask-Recognition)
|
|
131
|
+
- [RecaptchaComplexImageTaskRequest](https://docs.capmonster.cloud/docs/captchas/recaptcha-click)
|
|
132
|
+
- [RecaptchaV2EnterpriseRequest](https://docs.capmonster.cloud/docs/captchas/recaptcha-v2-enterprise-task)
|
|
133
|
+
- [RecaptchaV2Request](https://docs.capmonster.cloud/docs/captchas/no-captcha-task)
|
|
134
|
+
- [RecaptchaV3EnterpriseRequest](https://docs.capmonster.cloud/docs/captchas/recaptcha-v3-enterprise-task)
|
|
135
|
+
- [RecaptchaV3ProxylessRequest](https://docs.capmonster.cloud/docs/captchas/recaptcha-v3-task)
|
|
136
|
+
- [TemuCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/temu-task)
|
|
137
|
+
- [TenDiCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/tendi)
|
|
138
|
+
- [TspdCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/tspd-task)
|
|
139
|
+
- [TurnstileRequest](https://docs.capmonster.cloud/docs/captchas/turnstile-task)
|
|
140
|
+
- [YidunRequest](https://docs.capmonster.cloud/docs/captchas/yidun-task)
|
|
@@ -13,6 +13,7 @@ capmonstercloud_client/exceptions.py
|
|
|
13
13
|
capmonstercloud_client/requestController.py
|
|
14
14
|
capmonstercloud_client/utils.py
|
|
15
15
|
capmonstercloud_client/version.txt
|
|
16
|
+
capmonstercloud_client/requests/AlibabaCustomTaskRequest.py
|
|
16
17
|
capmonstercloud_client/requests/AltchaCustomTaskRequest.py
|
|
17
18
|
capmonstercloud_client/requests/AmazonWafRequest.py
|
|
18
19
|
capmonstercloud_client/requests/BasiliskCustomTaskRequest.py
|
|
@@ -21,11 +22,10 @@ capmonstercloud_client/requests/CastleCustomTaskRequest.py
|
|
|
21
22
|
capmonstercloud_client/requests/ComplexImageTaskBase.py
|
|
22
23
|
capmonstercloud_client/requests/CustomTaskRequestBase.py
|
|
23
24
|
capmonstercloud_client/requests/DataDomeCustomTaskRequest.py
|
|
25
|
+
capmonstercloud_client/requests/FriendlyCaptchaRequest.py
|
|
24
26
|
capmonstercloud_client/requests/FuncaptchaComplexImageTask.py
|
|
25
27
|
capmonstercloud_client/requests/FuncaptchaRequest.py
|
|
26
28
|
capmonstercloud_client/requests/GeetestRequest.py
|
|
27
|
-
capmonstercloud_client/requests/HcaptchaComplexImageTask.py
|
|
28
|
-
capmonstercloud_client/requests/HcaptchaRequest.py
|
|
29
29
|
capmonstercloud_client/requests/HuntCustomTaskRequest.py
|
|
30
30
|
capmonstercloud_client/requests/ImageToTextRequest.py
|
|
31
31
|
capmonstercloud_client/requests/ImpervaCustomTaskRequest.py
|
|
@@ -40,10 +40,9 @@ setup(
|
|
|
40
40
|
python_requires='>=3.6',
|
|
41
41
|
install_requires=REQUIRED,
|
|
42
42
|
keywords="""
|
|
43
|
-
|
|
43
|
+
captcha
|
|
44
44
|
recaptcha
|
|
45
45
|
geetest
|
|
46
|
-
hcaptcha
|
|
47
46
|
funcaptcha
|
|
48
47
|
python3
|
|
49
48
|
python-library
|
|
@@ -68,4 +67,4 @@ setup(
|
|
|
68
67
|
"Operating System :: Microsoft :: Windows",
|
|
69
68
|
"Operating System :: MacOS",
|
|
70
69
|
]
|
|
71
|
-
)
|
|
70
|
+
)
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# Zennolab.CapMonsterCloud.Client
|
|
2
|
-
|
|
3
|
-
Official python client library for [capmonster.cloud](https://capmonster.cloud/) captcha recognition service
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
python3 -m pip install capmonstercloudclient
|
|
8
|
-
|
|
9
|
-
## Usage
|
|
10
|
-
|
|
11
|
-
***
|
|
12
|
-
import asyncio
|
|
13
|
-
|
|
14
|
-
from capmonstercloudclient import CapMonsterClient, ClientOptions
|
|
15
|
-
from capmonstercloudclient.requests import RecaptchaV2ProxylessRequest
|
|
16
|
-
|
|
17
|
-
client_options = ClientOptions(api_key=<YOUR_API_KEY>)
|
|
18
|
-
cap_monster_client = CapMonsterClient(options=client_options)
|
|
19
|
-
|
|
20
|
-
async def solve_captcha():
|
|
21
|
-
return await cap_monster_client.solve_captcha(recaptcha2request)
|
|
22
|
-
|
|
23
|
-
recaptcha2request = RecaptchaV2ProxylessRequest(websiteUrl="https://lessons.zennolab.com/captchas/recaptcha/v2_simple.php?level=high",
|
|
24
|
-
websiteKey="6Lcg7CMUAAAAANphynKgn9YAgA4tQ2KI_iqRyTwd")
|
|
25
|
-
|
|
26
|
-
responses = asyncio.run(solve_captcha())
|
|
27
|
-
print(responses)
|
|
28
|
-
***
|
|
29
|
-
|
|
30
|
-
Supported captcha recognition requests:
|
|
31
|
-
|
|
32
|
-
- [GeeTestProxylessRequest](https://zenno.link/doc-geetest-en)
|
|
33
|
-
- [GeeTestRequest](https://zenno.link/doc-geetest-proxy-en)
|
|
34
|
-
- [ImageToTextRequest](https://zenno.link/doc-ImageToTextTask-en)
|
|
35
|
-
- [RecaptchaV2ProxylessRequest](https://zenno.link/doc-recaptcha2-en)
|
|
36
|
-
- [RecaptchaV2Request](https://zenno.link/doc-recaptcha2-proxy-en)
|
|
37
|
-
- [RecaptchaV3ProxylessRequest](https://zenno.link/doc-recaptcha3-en)
|
|
38
|
-
- [RecaptchaV2EnterpriseProxylessRequest](https://zenno.link/doc-recaptcha2e-en)
|
|
39
|
-
- [RecaptchaV2EnterpriseRequest](https://zenno.link/doc-recaptcha2e-proxy-en)
|
|
40
|
-
- [TurnstileProxylessRequest](https://zenno.link/doc-turnstile-en)
|
|
41
|
-
- [TurnstileRequest](https://zenno.link/doc-turnstile-proxy-en)
|
|
42
|
-
- [RecaptchaComplexImageTaskRequest](https://zenno.link/doc-complextask-rc-en)
|
|
43
|
-
- [DataDomeCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/datadome)
|
|
44
|
-
- [TenDiCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/tendi)
|
|
45
|
-
- [BasiliskCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/Basilisk-task)
|
|
46
|
-
- [AmazonWafRequest](https://docs.capmonster.cloud/docs/captchas/amazon-task)
|
|
47
|
-
- [BinanceTaskRequest](https://docs.capmonster.cloud/docs/captchas/binance)
|
|
48
|
-
- [BinanceTaskProxylessRequest](https://docs.capmonster.cloud/docs/captchas/binance)
|
|
49
|
-
- [ImpervaCustomTaskRequest](https://docs.capmonster.cloud/docs/captchas/incapsula)
|
|
50
|
-
- [ImpervaCustomTaskProxylessRequest](https://docs.capmonster.cloud/docs/captchas/incapsula)
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
from typing import Dict, Union, List, Optional
|
|
2
|
-
from pydantic import Field, validator
|
|
3
|
-
|
|
4
|
-
from .ComplexImageTaskBase import ComplexImageTaskRequestBase
|
|
5
|
-
from ..exceptions import NumbersImagesErrors, ZeroImagesErrors, TaskNotDefinedError, ExtraParamsError
|
|
6
|
-
|
|
7
|
-
class HcaptchaComplexImageTaskRequest(ComplexImageTaskRequestBase):
|
|
8
|
-
|
|
9
|
-
captchaClass: str = Field(default='hcaptcha')
|
|
10
|
-
metadata : Dict[str, str]
|
|
11
|
-
exampleImageUrls: Optional[List[str]] = None
|
|
12
|
-
exampleImagesBase64: Optional[List[str]] = None
|
|
13
|
-
|
|
14
|
-
@staticmethod
|
|
15
|
-
def _validate_image_array(value, field_name, max_images):
|
|
16
|
-
"""Helper method to validate image array"""
|
|
17
|
-
if value is None:
|
|
18
|
-
return value
|
|
19
|
-
if not isinstance(value, (list, tuple)):
|
|
20
|
-
raise TypeError(f'Expect that type {field_name} array will be <list> or <tuple>, got {type(value)}')
|
|
21
|
-
|
|
22
|
-
if not len(value):
|
|
23
|
-
if 'base64' in field_name.lower():
|
|
24
|
-
raise ZeroImagesErrors(f'At least one image base64 expected, got {len(value)}')
|
|
25
|
-
else:
|
|
26
|
-
raise ZeroImagesErrors(f'At least one image url expected, got {len(value)}')
|
|
27
|
-
|
|
28
|
-
if len(value) > max_images:
|
|
29
|
-
raise NumbersImagesErrors(f'Maximum number of images in list {max_images}, got {len(value)}')
|
|
30
|
-
|
|
31
|
-
contain_types = [isinstance(x, str) for x in value]
|
|
32
|
-
if not all(contain_types):
|
|
33
|
-
if 'base64' in field_name.lower():
|
|
34
|
-
raise TypeError(f'Next images from imagesBase64 array are not string: {contain_types}')
|
|
35
|
-
else:
|
|
36
|
-
raise TypeError(f'Next images from imagesUrls array are not string: {contain_types}')
|
|
37
|
-
return value
|
|
38
|
-
|
|
39
|
-
@validator('metadata')
|
|
40
|
-
def validate_metadata(cls, value):
|
|
41
|
-
if value.get('Task') is None:
|
|
42
|
-
raise TaskNotDefinedError('Expect that task will be defined.')
|
|
43
|
-
else:
|
|
44
|
-
return value
|
|
45
|
-
|
|
46
|
-
@validator('exampleImageUrls')
|
|
47
|
-
def validate_example_image_urls(cls, value):
|
|
48
|
-
return cls._validate_image_array(value, 'exampleImageUrls', 1)
|
|
49
|
-
|
|
50
|
-
@validator('exampleImagesBase64')
|
|
51
|
-
def validate_example_images_base64(cls, value):
|
|
52
|
-
return cls._validate_image_array(value, 'exampleImagesBase64', 1)
|
|
53
|
-
|
|
54
|
-
@validator('imagesUrls')
|
|
55
|
-
def validate_images_urls(cls, value):
|
|
56
|
-
return cls._validate_image_array(value, 'imagesUrls', 18)
|
|
57
|
-
|
|
58
|
-
@validator('imagesBase64')
|
|
59
|
-
def validate_images_base64(cls, value):
|
|
60
|
-
return cls._validate_image_array(value, 'imagesBase64', 18)
|
|
61
|
-
|
|
62
|
-
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
|
63
|
-
|
|
64
|
-
task = {}
|
|
65
|
-
task['type'] = self.taskType
|
|
66
|
-
task['class'] = self.captchaClass
|
|
67
|
-
|
|
68
|
-
# fill with images
|
|
69
|
-
if self.imagesBase64 is None and self.imagesUrls is None:
|
|
70
|
-
raise ZeroImagesErrors('Expect at least one of array(imageBase64 or imageUrls) to contain images.')
|
|
71
|
-
|
|
72
|
-
if self.imagesUrls is not None:
|
|
73
|
-
task['imageUrls'] = self.imagesUrls
|
|
74
|
-
|
|
75
|
-
if self.imagesBase64 is not None:
|
|
76
|
-
task['imagesBase64'] = self.imagesBase64
|
|
77
|
-
|
|
78
|
-
task['metadata'] = self.metadata
|
|
79
|
-
|
|
80
|
-
if self.exampleImageUrls and self.exampleImagesBase64:
|
|
81
|
-
raise ExtraParamsError('Expect only one of [exampleImageUrls, exampleImagesBase64]')
|
|
82
|
-
|
|
83
|
-
if self.exampleImageUrls is not None:
|
|
84
|
-
task['exampleImageUrls'] = self.exampleImageUrls
|
|
85
|
-
|
|
86
|
-
if self.exampleImagesBase64 is not None:
|
|
87
|
-
task['exampleImagesBase64'] = self.exampleImagesBase64
|
|
88
|
-
|
|
89
|
-
if self.userAgent is not None:
|
|
90
|
-
task['userAgent'] = self.userAgent
|
|
91
|
-
|
|
92
|
-
if self.websiteUrl is not None:
|
|
93
|
-
task['websiteUrl'] = self.websiteUrl
|
|
94
|
-
|
|
95
|
-
return task
|
|
96
|
-
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
from pydantic import Field
|
|
2
|
-
from typing import Dict, Union, Optional
|
|
3
|
-
|
|
4
|
-
from .baseRequestWithProxy import BaseRequestWithProxy
|
|
5
|
-
|
|
6
|
-
class HcaptchaRequest(BaseRequestWithProxy):
|
|
7
|
-
type: str = Field(default='HCaptchaTask')
|
|
8
|
-
websiteUrl: str
|
|
9
|
-
websiteKey: str
|
|
10
|
-
is_invisible: Optional[bool] = Field(default=None)
|
|
11
|
-
data: Optional[str] = Field(default=None)
|
|
12
|
-
user_agent: Optional[str] = Field(default=None)
|
|
13
|
-
cookies: Optional[str] = Field(default=None)
|
|
14
|
-
fallbackToActualUA: Optional[bool] = Field(default=None)
|
|
15
|
-
|
|
16
|
-
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
|
17
|
-
|
|
18
|
-
task = {}
|
|
19
|
-
task['type'] = self.type
|
|
20
|
-
task['websiteURL'] = self.websiteUrl
|
|
21
|
-
task['websiteKey'] = self.websiteKey
|
|
22
|
-
if self.proxy:
|
|
23
|
-
task['proxyType'] = self.proxy.proxyType
|
|
24
|
-
task['proxyAddress'] = self.proxy.proxyAddress
|
|
25
|
-
task['proxyPort'] = self.proxy.proxyPort
|
|
26
|
-
task['proxyLogin'] = self.proxy.proxyLogin
|
|
27
|
-
task['proxyPassword'] = self.proxy.proxyPassword
|
|
28
|
-
if self.is_invisible is not None:
|
|
29
|
-
task['isInvisible'] = self.is_invisible
|
|
30
|
-
if self.data is not None:
|
|
31
|
-
task['data'] = self.data
|
|
32
|
-
if self.user_agent is not None:
|
|
33
|
-
task['userAgent'] = self.user_agent
|
|
34
|
-
if self.cookies is not None:
|
|
35
|
-
task['cookies'] = self.cookies
|
|
36
|
-
if self.fallbackToActualUA is not None:
|
|
37
|
-
task['fallbackToActualUA'] = self.fallbackToActualUA
|
|
38
|
-
|
|
39
|
-
return task
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
4.0.0
|
|
File without changes
|
|
File without changes
|
{capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/__init__.py
RENAMED
|
File without changes
|
{capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/captchaResult.py
RENAMED
|
File without changes
|
{capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/clientOptions.py
RENAMED
|
File without changes
|
{capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capmonstercloudclient-4.0.0 → capmonstercloudclient-4.1.0}/capmonstercloud_client/requests/enums.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|