capmonstercloudclient 3.3.0__tar.gz → 3.4.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-3.3.0/capmonstercloudclient.egg-info → capmonstercloudclient-3.4.0}/PKG-INFO +1 -1
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/CapMonsterCloudClient.py +23 -5
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/GetResultTimeouts.py +6 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/clientOptions.py +4 -1
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/exceptions.py +2 -0
- capmonstercloudclient-3.4.0/capmonstercloud_client/requests/AltchaCustomTaskRequest.py +36 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/CustomTaskRequestBase.py +2 -2
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/DataDomeCustomTaskRequest.py +3 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/FuncaptchaRequest.py +3 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/ImpervaCustomTaskRequest.py +13 -7
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/RecaptchaV2EnterpiseRequest.py +3 -0
- capmonstercloudclient-3.4.0/capmonstercloud_client/requests/RecaptchaV3EnterpriseRequest.py +22 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/TurnstileRequest.py +6 -6
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/__init__.py +6 -3
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/proxy_info.py +20 -0
- capmonstercloudclient-3.4.0/capmonstercloud_client/version.txt +1 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0/capmonstercloudclient.egg-info}/PKG-INFO +1 -1
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloudclient.egg-info/SOURCES.txt +2 -0
- capmonstercloudclient-3.3.0/capmonstercloud_client/version.txt +0 -1
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/LICENSE +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/MANIFEST.in +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/README.md +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/__init__.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/captchaResult.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requestController.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/AmazonWafRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/BasiliskCustomTaskRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/BinanceTaskRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/ComplexImageTaskBase.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/FuncaptchaComplexImageTask.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/GeetestRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/HcaptchaComplexImageTask.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/HcaptchaRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/ImageToTextRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/MTCaptchaRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/ProsopoTaskRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/RecaptchaComplexImageTask.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/RecaptchaV2Request.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/RecaptchaV3ProxylessRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/RecognitionComplexImageTaskRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/TemuCustomTaskRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/TenDiCustomTaskRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/YidunRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/baseRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/baseRequestWithProxy.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/requests/enums.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/utils.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloudclient.egg-info/dependency_links.txt +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloudclient.egg-info/requires.txt +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloudclient.egg-info/top_level.txt +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/pyproject.toml +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/requirements.txt +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/setup.cfg +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/setup.py +0 -0
|
@@ -17,6 +17,7 @@ _instance_config = (
|
|
|
17
17
|
((RecaptchaV2Request,), getRecaptchaV2Timeouts),
|
|
18
18
|
((RecaptchaV2EnterpriseRequest,), getRecaptchaV2EnterpriseTimeouts),
|
|
19
19
|
((RecaptchaV3ProxylessRequest), getRecaptchaV3Timeouts),
|
|
20
|
+
((RecaptchaV3EnterpriseRequest), getRecaptchaV3Timeouts),
|
|
20
21
|
((ImageToTextRequest), getImage2TextTimeouts),
|
|
21
22
|
((FuncaptchaRequest,), getFuncaptchaTimeouts),
|
|
22
23
|
((HcaptchaRequest,), getHcaptchaTimeouts),
|
|
@@ -35,6 +36,7 @@ _instance_config = (
|
|
|
35
36
|
((YidunRequest), getYidunTimeouts),
|
|
36
37
|
((TemuCustomTaskRequest), getTemuTimeouts),
|
|
37
38
|
((ProsopoTaskRequest), getProsopoTimeouts),
|
|
39
|
+
((AltchaCustomTaskRequest), getAltchaTimeouts),
|
|
38
40
|
)
|
|
39
41
|
|
|
40
42
|
|
|
@@ -44,6 +46,14 @@ class CapMonsterClient:
|
|
|
44
46
|
self.options = options
|
|
45
47
|
self._headers = {'User-Agent':
|
|
46
48
|
f'Zennolab.CapMonsterCloud.Client.Python/{parseVersion()}'}
|
|
49
|
+
if self.options.client_proxy:
|
|
50
|
+
if self.options.client_proxy.proxyType not in ['http', 'https']:
|
|
51
|
+
raise UnsupportedProxyTypeError(f'Supported client proxy types are: [HTTP, HTTPS]')
|
|
52
|
+
if self.options.client_proxy.proxyLogin and self.options.client_proxy.proxyPassword:
|
|
53
|
+
auth = f"{self.options.client_proxy.proxyLogin}:{self.options.client_proxy.proxyPassword}@"
|
|
54
|
+
self.client_proxy_string = f"{self.options.client_proxy.proxyType}://{auth}{self.options.client_proxy.proxyAddress}:{self.options.client_proxy.proxyPort}"
|
|
55
|
+
else:
|
|
56
|
+
self.client_proxy_string = None
|
|
47
57
|
|
|
48
58
|
@property
|
|
49
59
|
def headers(self):
|
|
@@ -56,7 +66,8 @@ class CapMonsterClient:
|
|
|
56
66
|
async with aiohttp.ClientSession() as session:
|
|
57
67
|
async with session.post(url=self.options.service_url + '/getBalance',
|
|
58
68
|
json=body,
|
|
59
|
-
timeout=aiohttp.ClientTimeout(total=self.options.client_timeout)
|
|
69
|
+
timeout=aiohttp.ClientTimeout(total=self.options.client_timeout),
|
|
70
|
+
proxy=self.client_proxy_string) as resp:
|
|
60
71
|
if resp.status != 200:
|
|
61
72
|
raise HTTPException(f'Cannot create task. Status code: {resp.status}.')
|
|
62
73
|
result = await resp.json(content_type=None)
|
|
@@ -69,6 +80,7 @@ class CapMonsterClient:
|
|
|
69
80
|
RecaptchaV2EnterpriseRequest,
|
|
70
81
|
RecaptchaV2Request,
|
|
71
82
|
RecaptchaV3ProxylessRequest,
|
|
83
|
+
RecaptchaV3EnterpriseRequest,
|
|
72
84
|
RecaptchaComplexImageTaskRequest,
|
|
73
85
|
ImageToTextRequest,
|
|
74
86
|
FuncaptchaRequest,
|
|
@@ -87,7 +99,8 @@ class CapMonsterClient:
|
|
|
87
99
|
MTCaptchaRequest,
|
|
88
100
|
YidunRequest,
|
|
89
101
|
TemuCustomTaskRequest,
|
|
90
|
-
ProsopoTaskRequest
|
|
102
|
+
ProsopoTaskRequest,
|
|
103
|
+
AltchaCustomTaskRequest],
|
|
91
104
|
) -> Dict[str, str]:
|
|
92
105
|
'''
|
|
93
106
|
Non-blocking method for captcha solving.
|
|
@@ -106,6 +119,7 @@ class CapMonsterClient:
|
|
|
106
119
|
RecaptchaV2EnterpriseRequest,
|
|
107
120
|
RecaptchaV2Request,
|
|
108
121
|
RecaptchaV3ProxylessRequest,
|
|
122
|
+
RecaptchaV3EnterpriseRequest,
|
|
109
123
|
RecaptchaComplexImageTaskRequest,
|
|
110
124
|
ImageToTextRequest,
|
|
111
125
|
FuncaptchaRequest,
|
|
@@ -124,7 +138,8 @@ class CapMonsterClient:
|
|
|
124
138
|
MTCaptchaRequest,
|
|
125
139
|
YidunRequest,
|
|
126
140
|
TemuCustomTaskRequest,
|
|
127
|
-
ProsopoTaskRequest
|
|
141
|
+
ProsopoTaskRequest,
|
|
142
|
+
AltchaCustomTaskRequest],
|
|
128
143
|
timeouts: GetResultTimeouts,
|
|
129
144
|
) -> Dict[str, str]:
|
|
130
145
|
|
|
@@ -168,7 +183,8 @@ class CapMonsterClient:
|
|
|
168
183
|
async with session.post(url=self.options.service_url + '/getTaskResult',
|
|
169
184
|
json=body,
|
|
170
185
|
timeout=aiohttp.ClientTimeout(total=self.options.client_timeout),
|
|
171
|
-
headers=self.headers
|
|
186
|
+
headers=self.headers,
|
|
187
|
+
proxy=self.client_proxy_string) as resp:
|
|
172
188
|
if resp.status != 200:
|
|
173
189
|
if resp.status == 500:
|
|
174
190
|
return {'errorId': 0, 'status': 'processing'}
|
|
@@ -184,11 +200,13 @@ class CapMonsterClient:
|
|
|
184
200
|
"task": task,
|
|
185
201
|
"softId": self.options.default_soft_id
|
|
186
202
|
}
|
|
203
|
+
|
|
187
204
|
async with aiohttp.ClientSession() as session:
|
|
188
205
|
async with session.post(url=self.options.service_url + '/createTask',
|
|
189
206
|
json=body,
|
|
190
207
|
timeout=aiohttp.ClientTimeout(total=self.options.client_timeout),
|
|
191
|
-
headers=self.headers
|
|
208
|
+
headers=self.headers,
|
|
209
|
+
proxy=self.client_proxy_string) as resp:
|
|
192
210
|
if resp.status != 200:
|
|
193
211
|
raise HTTPException(f'Cannot create task. Status code: {resp.status}.')
|
|
194
212
|
else:
|
|
@@ -17,6 +17,9 @@ def getRecaptchaV2EnterpriseTimeouts() -> GetResultTimeouts:
|
|
|
17
17
|
def getRecaptchaV3Timeouts() -> GetResultTimeouts:
|
|
18
18
|
return GetResultTimeouts(1, 10, 3, 180)
|
|
19
19
|
|
|
20
|
+
def getRecaptchaV3EnterpriseTimeouts() -> GetResultTimeouts:
|
|
21
|
+
return GetResultTimeouts(1, 10, 3, 150)
|
|
22
|
+
|
|
20
23
|
def getImage2TextTimeouts() -> GetResultTimeouts:
|
|
21
24
|
return GetResultTimeouts(0.35, 0, 0.2, 10)
|
|
22
25
|
|
|
@@ -50,6 +53,9 @@ def getBinanceTimeouts() -> GetResultTimeouts:
|
|
|
50
53
|
def getImpervaTimeouts() -> GetResultTimeouts:
|
|
51
54
|
return GetResultTimeouts(1, 0, 1, 20)
|
|
52
55
|
|
|
56
|
+
def getAltchaTimeouts() -> GetResultTimeouts:
|
|
57
|
+
return GetResultTimeouts(1, 0, 1, 50)
|
|
58
|
+
|
|
53
59
|
def getCITTimeouts() -> GetResultTimeouts:
|
|
54
60
|
return GetResultTimeouts(0.35, 0, 0.2, 10)
|
|
55
61
|
|
{capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/clientOptions.py
RENAMED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
from pydantic import BaseModel, validator, Field
|
|
2
|
-
|
|
2
|
+
from .requests import ClientProxyInfo
|
|
3
|
+
from typing import Optional
|
|
3
4
|
|
|
4
5
|
class ClientOptions(BaseModel):
|
|
5
6
|
api_key: str
|
|
7
|
+
client_proxy: Optional[ClientProxyInfo] = None
|
|
6
8
|
service_url: str = Field(default="https://api.capmonster.cloud")
|
|
7
9
|
default_soft_id: int = Field(default=55)
|
|
8
10
|
client_timeout: float = Field(default=20.0)
|
|
11
|
+
|
|
9
12
|
|
|
10
13
|
@validator('api_key')
|
|
11
14
|
def validate_api_key(cls, value):
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from typing import Dict, Union
|
|
2
|
+
from pydantic import Field, validator
|
|
3
|
+
|
|
4
|
+
from .CustomTaskRequestBase import CustomTaskRequestBase
|
|
5
|
+
|
|
6
|
+
class AltchaCustomTaskRequest(CustomTaskRequestBase):
|
|
7
|
+
captchaClass: str = Field(default='altcha')
|
|
8
|
+
websiteKey: str = Field()
|
|
9
|
+
metadata : Dict[str, str]
|
|
10
|
+
|
|
11
|
+
@validator('metadata')
|
|
12
|
+
def validate_metadata(cls, value):
|
|
13
|
+
for key in ['challenge', 'iterations', 'salt', 'signature']:
|
|
14
|
+
if value.get(key) is None:
|
|
15
|
+
raise TypeError(f'Expect that {key} will be defined.')
|
|
16
|
+
else:
|
|
17
|
+
if not isinstance(value.get(key), str):
|
|
18
|
+
raise TypeError(f'Expect that {key} will be str.')
|
|
19
|
+
return value
|
|
20
|
+
|
|
21
|
+
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
|
22
|
+
task = {}
|
|
23
|
+
task['type'] = self.type
|
|
24
|
+
task['class'] = self.captchaClass
|
|
25
|
+
task['websiteURL'] = self.websiteUrl
|
|
26
|
+
task['websiteKey'] = self.websiteKey
|
|
27
|
+
task['metadata'] = self.metadata
|
|
28
|
+
if self.proxy:
|
|
29
|
+
task['proxyType'] = self.proxy.proxyType
|
|
30
|
+
task['proxyAddress'] = self.proxy.proxyAddress
|
|
31
|
+
task['proxyPort'] = self.proxy.proxyPort
|
|
32
|
+
task['proxyLogin'] = self.proxy.proxyLogin
|
|
33
|
+
task['proxyPassword'] = self.proxy.proxyPassword
|
|
34
|
+
if self.userAgent is not None:
|
|
35
|
+
task['userAgent'] = self.userAgent
|
|
36
|
+
return task
|
|
@@ -6,5 +6,5 @@ class CustomTaskRequestBase(BaseRequestWithProxy):
|
|
|
6
6
|
captchaClass: str # Class(subtype) of ComplexImageTask
|
|
7
7
|
type: str = "CustomTask" # Recognition task type
|
|
8
8
|
websiteUrl: str # Address of a webpage with captcha
|
|
9
|
-
userAgent: Optional[str] = None
|
|
10
|
-
domains: Optional[List[str]] = None
|
|
9
|
+
userAgent: Optional[str] = None
|
|
10
|
+
domains: Optional[List[str]] = None
|
|
@@ -18,6 +18,9 @@ class DataDomeCustomTaskRequest(CustomTaskRequestBase):
|
|
|
18
18
|
return {i: value[i] for i in value if i != 'captchaUrl'}
|
|
19
19
|
else:
|
|
20
20
|
raise TypeError(f'Expected one of [captchaUrl, htmlPageBase64]')
|
|
21
|
+
if value.get('datadomeVersion') and not isinstance(value.get('datadomeVersion'), str):
|
|
22
|
+
raise TypeError(f'Expected datadomeVersion to be str')
|
|
23
|
+
|
|
21
24
|
|
|
22
25
|
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
|
23
26
|
task = {}
|
|
@@ -9,6 +9,7 @@ class FuncaptchaRequest(BaseRequestWithProxy):
|
|
|
9
9
|
websitePublicKey: str
|
|
10
10
|
funcaptchaApiJSSubdomain: Optional[str] = Field(default=None)
|
|
11
11
|
data: Optional[str] = Field(default=None)
|
|
12
|
+
cookies: Optional[str] = Field(default=None)
|
|
12
13
|
|
|
13
14
|
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
|
14
15
|
task = {}
|
|
@@ -26,4 +27,6 @@ class FuncaptchaRequest(BaseRequestWithProxy):
|
|
|
26
27
|
task['funcaptchaApiJSSubdomain'] = self.funcaptchaApiJSSubdomain
|
|
27
28
|
if self.data is not None:
|
|
28
29
|
task['data'] = self.data
|
|
30
|
+
if self.cookies is not None:
|
|
31
|
+
task['cookies'] = self.cookies
|
|
29
32
|
return task
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from typing import Dict, Union
|
|
2
|
-
from pydantic import Field, validator
|
|
2
|
+
from pydantic import Field, validator, model_validator
|
|
3
3
|
|
|
4
4
|
from .CustomTaskRequestBase import CustomTaskRequestBase
|
|
5
5
|
|
|
@@ -23,18 +23,24 @@ class ImpervaCustomTaskRequest(CustomTaskRequestBase):
|
|
|
23
23
|
raise TypeError(f'Expect that reese84UrlEndpoint will be str.')
|
|
24
24
|
return value
|
|
25
25
|
|
|
26
|
+
@model_validator(mode='before')
|
|
27
|
+
def validate_imperva_proxy(cls, values):
|
|
28
|
+
proxy = values.get('proxy')
|
|
29
|
+
if proxy is None:
|
|
30
|
+
raise RuntimeError(f'You are required to use your own proxies.')
|
|
31
|
+
return values
|
|
32
|
+
|
|
26
33
|
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
|
27
34
|
task = {}
|
|
28
35
|
task['type'] = self.type
|
|
29
36
|
task['class'] = self.captchaClass
|
|
30
37
|
task['websiteURL'] = self.websiteUrl
|
|
31
38
|
task['metadata'] = self.metadata
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
task['proxyPassword'] = self.proxy.proxyPassword
|
|
39
|
+
task['proxyType'] = self.proxy.proxyType
|
|
40
|
+
task['proxyAddress'] = self.proxy.proxyAddress
|
|
41
|
+
task['proxyPort'] = self.proxy.proxyPort
|
|
42
|
+
task['proxyLogin'] = self.proxy.proxyLogin
|
|
43
|
+
task['proxyPassword'] = self.proxy.proxyPassword
|
|
38
44
|
if self.userAgent is not None:
|
|
39
45
|
task['userAgent'] = self.userAgent
|
|
40
46
|
return task
|
|
@@ -9,6 +9,7 @@ class RecaptchaV2EnterpriseRequest(BaseRequestWithProxy):
|
|
|
9
9
|
websiteKey: str
|
|
10
10
|
enterprisePayload: Optional[str] = Field(default=None)
|
|
11
11
|
apiDomain: Optional[str] = Field(default=None)
|
|
12
|
+
pageAction: Optional[str] = Field(default=None)
|
|
12
13
|
|
|
13
14
|
def getTaskDict(self) -> Dict[str, Union[str, int]]:
|
|
14
15
|
task = {}
|
|
@@ -25,4 +26,6 @@ class RecaptchaV2EnterpriseRequest(BaseRequestWithProxy):
|
|
|
25
26
|
task['enterprisePayload'] = {'s': self.enterprisePayload}
|
|
26
27
|
if self.apiDomain is not None:
|
|
27
28
|
task['apiDomain'] = self.apiDomain
|
|
29
|
+
if self.pageAction is not None:
|
|
30
|
+
task['pageAction'] = self.pageAction
|
|
28
31
|
return task
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from typing import Dict, Union, Optional
|
|
2
|
+
from pydantic import Field
|
|
3
|
+
|
|
4
|
+
from .baseRequest import BaseRequest
|
|
5
|
+
|
|
6
|
+
class RecaptchaV3EnterpriseRequest(BaseRequest):
|
|
7
|
+
type: str = Field(default='RecaptchaV3EnterpriseTask')
|
|
8
|
+
websiteUrl: str
|
|
9
|
+
websiteKey: str
|
|
10
|
+
minScore: Optional[float] = Field(default=None)
|
|
11
|
+
pageAction: Optional[str] = Field(default=None)
|
|
12
|
+
|
|
13
|
+
def getTaskDict(self) -> Dict[str, Union[str, int, float]]:
|
|
14
|
+
task = {}
|
|
15
|
+
task['type'] = self.type
|
|
16
|
+
task['websiteURL'] = self.websiteUrl
|
|
17
|
+
task['websiteKey'] = self.websiteKey
|
|
18
|
+
if self.minScore is not None:
|
|
19
|
+
task['minScore'] = self.minScore
|
|
20
|
+
if self.pageAction is not None:
|
|
21
|
+
task['pageAction'] = self.pageAction
|
|
22
|
+
return task
|
|
@@ -19,7 +19,7 @@ class TurnstileRequest(BaseRequestWithProxy):
|
|
|
19
19
|
@validator('cloudflareTaskType')
|
|
20
20
|
def validate_cloudflare_task(cls, value):
|
|
21
21
|
if value is not None:
|
|
22
|
-
if value not in ['cf_clearance', 'token']:
|
|
22
|
+
if value not in ['cf_clearance', 'token', 'wait_room']:
|
|
23
23
|
raise ValueError(f'cloudflareTaskType could be "cf_clearance" if you need cookie or ' \
|
|
24
24
|
f'"token" if required token from Turnstile.')
|
|
25
25
|
return value
|
|
@@ -28,13 +28,13 @@ class TurnstileRequest(BaseRequestWithProxy):
|
|
|
28
28
|
def validate_cloudflare_type_token(self):
|
|
29
29
|
|
|
30
30
|
if self.get('htmlPageBase64') is None:
|
|
31
|
-
if self.get('cloudflareTaskType')
|
|
31
|
+
if self.get('cloudflareTaskType') in ['cf_clearance', 'wait_room']:
|
|
32
32
|
raise RuntimeError(f'Expect that "htmlPageBase64" will be filled ' \
|
|
33
|
-
f'when cloudflareTaskType is "cf_clearance"')
|
|
33
|
+
f'when cloudflareTaskType is "cf_clearance" or "wait_room')
|
|
34
34
|
|
|
35
35
|
if self.get('proxy') is None:
|
|
36
|
-
if self.get('cloudflareTaskType')
|
|
37
|
-
raise RuntimeError(f'You are working using queries, and you need cf_clearance cookies ' \
|
|
36
|
+
if self.get('cloudflareTaskType') in ['cf_clearance', 'wait_room']:
|
|
37
|
+
raise RuntimeError(f'You are working using queries, and you need cf_clearance cookies or wait_room ' \
|
|
38
38
|
f'it is required that you need your proxies.')
|
|
39
39
|
|
|
40
40
|
if self.get('cloudflareTaskType') == 'token':
|
|
@@ -44,7 +44,7 @@ class TurnstileRequest(BaseRequestWithProxy):
|
|
|
44
44
|
f'when "cloudflareTaskType" = "token".')
|
|
45
45
|
|
|
46
46
|
if self.get('cloudflareTaskType') is not None:
|
|
47
|
-
if self.get('cloudflareTaskType') in ['cf_clearance', 'token']:
|
|
47
|
+
if self.get('cloudflareTaskType') in ['cf_clearance', 'token', 'wait_room']:
|
|
48
48
|
if self.get('userAgent') is None:
|
|
49
49
|
raise RuntimeError(f'Expect that userAgent will be filled ' \
|
|
50
50
|
f'when cloudflareTaskType specified.')
|
|
@@ -2,6 +2,7 @@ from .ImageToTextRequest import ImageToTextRequest
|
|
|
2
2
|
from .RecaptchaV2Request import RecaptchaV2Request
|
|
3
3
|
from .RecaptchaV2EnterpiseRequest import RecaptchaV2EnterpriseRequest
|
|
4
4
|
from .RecaptchaV3ProxylessRequest import RecaptchaV3ProxylessRequest
|
|
5
|
+
from .RecaptchaV3EnterpriseRequest import RecaptchaV3EnterpriseRequest
|
|
5
6
|
from .RecaptchaComplexImageTask import RecaptchaComplexImageTaskRequest
|
|
6
7
|
from .HcaptchaRequest import HcaptchaRequest
|
|
7
8
|
from .FuncaptchaRequest import FuncaptchaRequest
|
|
@@ -22,10 +23,11 @@ from .MTCaptchaRequest import MTCaptchaRequest
|
|
|
22
23
|
from .YidunRequest import YidunRequest
|
|
23
24
|
from .ProsopoTaskRequest import ProsopoTaskRequest
|
|
24
25
|
from .TemuCustomTaskRequest import TemuCustomTaskRequest
|
|
25
|
-
from .
|
|
26
|
+
from .AltchaCustomTaskRequest import AltchaCustomTaskRequest
|
|
27
|
+
from .proxy_info import ProxyInfo, ClientProxyInfo
|
|
26
28
|
|
|
27
29
|
|
|
28
|
-
REQUESTS = ['RecaptchaV2EnterpiseRequest', 'RecaptchaV2Request', 'RecaptchaV3ProxylessRequest', 'RecaptchaComplexImageTaskRequest'
|
|
30
|
+
REQUESTS = ['RecaptchaV2EnterpiseRequest', 'RecaptchaV2Request', 'RecaptchaV3ProxylessRequest', 'RecaptchaComplexImageTaskRequest', 'RecaptchaV3EnterpriseRequest'
|
|
29
31
|
'ImageToTextRequest',
|
|
30
32
|
'FuncaptchaRequest', 'FunCaptchaComplexImageTaskRequest',
|
|
31
33
|
'HcaptchaRequest', 'HcaptchaComplexImageTaskRequest'
|
|
@@ -41,5 +43,6 @@ REQUESTS = ['RecaptchaV2EnterpiseRequest', 'RecaptchaV2Request', 'RecaptchaV3Pro
|
|
|
41
43
|
'MTCaptchaRequest',
|
|
42
44
|
'YidunRequest',
|
|
43
45
|
'ProsopoTaskRequest',
|
|
44
|
-
'TemuCustomTaskRequest'
|
|
46
|
+
'TemuCustomTaskRequest',
|
|
47
|
+
'AltchaCustomTaskRequest'
|
|
45
48
|
]
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from pydantic import BaseModel, validator
|
|
2
2
|
from .enums import ProxyTypes
|
|
3
|
+
from typing import Optional
|
|
3
4
|
|
|
4
5
|
class ProxyInfo(BaseModel):
|
|
5
6
|
proxyType: str
|
|
@@ -19,3 +20,22 @@ class ProxyInfo(BaseModel):
|
|
|
19
20
|
if not isinstance(value, int):
|
|
20
21
|
raise TypeError(f'Expect that port value will be <int> type, got {type(value)}')
|
|
21
22
|
return value
|
|
23
|
+
|
|
24
|
+
class ClientProxyInfo(BaseModel):
|
|
25
|
+
proxyType: str
|
|
26
|
+
proxyAddress: str
|
|
27
|
+
proxyPort: int
|
|
28
|
+
proxyLogin: Optional[str] = None
|
|
29
|
+
proxyPassword: Optional[str] = None
|
|
30
|
+
|
|
31
|
+
@validator('proxyType')
|
|
32
|
+
def validate_proxy_type(cls, value):
|
|
33
|
+
if value not in ProxyTypes.list_values():
|
|
34
|
+
raise ValueError(f'Expected that proxy type will be in {ProxyTypes.list_values()}, got "{value}"')
|
|
35
|
+
return value
|
|
36
|
+
|
|
37
|
+
@validator('proxyPort')
|
|
38
|
+
def validate_port(cls, value):
|
|
39
|
+
if not isinstance(value, int):
|
|
40
|
+
raise TypeError(f'Expect that port value will be <int> type, got {type(value)}')
|
|
41
|
+
return value
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.4.0
|
|
@@ -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/AltchaCustomTaskRequest.py
|
|
16
17
|
capmonstercloud_client/requests/AmazonWafRequest.py
|
|
17
18
|
capmonstercloud_client/requests/BasiliskCustomTaskRequest.py
|
|
18
19
|
capmonstercloud_client/requests/BinanceTaskRequest.py
|
|
@@ -31,6 +32,7 @@ capmonstercloud_client/requests/ProsopoTaskRequest.py
|
|
|
31
32
|
capmonstercloud_client/requests/RecaptchaComplexImageTask.py
|
|
32
33
|
capmonstercloud_client/requests/RecaptchaV2EnterpiseRequest.py
|
|
33
34
|
capmonstercloud_client/requests/RecaptchaV2Request.py
|
|
35
|
+
capmonstercloud_client/requests/RecaptchaV3EnterpriseRequest.py
|
|
34
36
|
capmonstercloud_client/requests/RecaptchaV3ProxylessRequest.py
|
|
35
37
|
capmonstercloud_client/requests/RecognitionComplexImageTaskRequest.py
|
|
36
38
|
capmonstercloud_client/requests/TemuCustomTaskRequest.py
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3.3.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/__init__.py
RENAMED
|
File without changes
|
{capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.0}/capmonstercloud_client/captchaResult.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
|
{capmonstercloudclient-3.3.0 → capmonstercloudclient-3.4.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
|