capmonstercloudclient 3.3.0__tar.gz → 4.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.
- {capmonstercloudclient-3.3.0/capmonstercloudclient.egg-info → capmonstercloudclient-4.0.0}/PKG-INFO +1 -1
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/CapMonsterCloudClient.py +41 -19
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/GetResultTimeouts.py +15 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/clientOptions.py +4 -1
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/exceptions.py +2 -0
- capmonstercloudclient-4.0.0/capmonstercloud_client/requests/AltchaCustomTaskRequest.py +36 -0
- capmonstercloudclient-4.0.0/capmonstercloud_client/requests/CastleCustomTaskRequest.py +42 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/CustomTaskRequestBase.py +2 -2
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/DataDomeCustomTaskRequest.py +17 -10
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/FuncaptchaRequest.py +3 -0
- capmonstercloudclient-4.0.0/capmonstercloud_client/requests/HuntCustomTaskRequest.py +41 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/ImpervaCustomTaskRequest.py +13 -7
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/RecaptchaV2EnterpiseRequest.py +10 -1
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/RecaptchaV2Request.py +6 -2
- capmonstercloudclient-4.0.0/capmonstercloud_client/requests/RecaptchaV3EnterpriseRequest.py +22 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/RecaptchaV3ProxylessRequest.py +4 -4
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/TenDiCustomTaskRequest.py +14 -2
- capmonstercloudclient-4.0.0/capmonstercloud_client/requests/TspdCustomTaskRequest.py +44 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/TurnstileRequest.py +6 -6
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/YidunRequest.py +15 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/__init__.py +13 -4
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/proxy_info.py +20 -0
- capmonstercloudclient-4.0.0/capmonstercloud_client/version.txt +1 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0/capmonstercloudclient.egg-info}/PKG-INFO +1 -1
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloudclient.egg-info/SOURCES.txt +5 -0
- capmonstercloudclient-4.0.0/pyproject.toml +3 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/setup.py +3 -3
- capmonstercloudclient-3.3.0/capmonstercloud_client/version.txt +0 -1
- capmonstercloudclient-3.3.0/pyproject.toml +0 -3
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/LICENSE +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/MANIFEST.in +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/README.md +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/__init__.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/captchaResult.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requestController.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/AmazonWafRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/BasiliskCustomTaskRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/BinanceTaskRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/ComplexImageTaskBase.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/FuncaptchaComplexImageTask.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/GeetestRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/HcaptchaComplexImageTask.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/HcaptchaRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/ImageToTextRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/MTCaptchaRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/ProsopoTaskRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/RecaptchaComplexImageTask.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/RecognitionComplexImageTaskRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/TemuCustomTaskRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/baseRequest.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/baseRequestWithProxy.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/enums.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/utils.py +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloudclient.egg-info/dependency_links.txt +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloudclient.egg-info/requires.txt +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloudclient.egg-info/top_level.txt +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/requirements.txt +0 -0
- {capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/setup.cfg +0 -0
|
@@ -16,8 +16,9 @@ from .utils import parseVersion
|
|
|
16
16
|
_instance_config = (
|
|
17
17
|
((RecaptchaV2Request,), getRecaptchaV2Timeouts),
|
|
18
18
|
((RecaptchaV2EnterpriseRequest,), getRecaptchaV2EnterpriseTimeouts),
|
|
19
|
-
((RecaptchaV3ProxylessRequest), getRecaptchaV3Timeouts),
|
|
20
|
-
((
|
|
19
|
+
((RecaptchaV3ProxylessRequest,), getRecaptchaV3Timeouts),
|
|
20
|
+
((RecaptchaV3EnterpriseRequest,), getRecaptchaV3Timeouts),
|
|
21
|
+
((ImageToTextRequest,), getImage2TextTimeouts),
|
|
21
22
|
((FuncaptchaRequest,), getFuncaptchaTimeouts),
|
|
22
23
|
((HcaptchaRequest,), getHcaptchaTimeouts),
|
|
23
24
|
((GeetestRequest,), getGeetestTimeouts),
|
|
@@ -30,11 +31,15 @@ _instance_config = (
|
|
|
30
31
|
((AmazonWafRequest,), getAmazonWafTimeouts),
|
|
31
32
|
((BinanceTaskRequest,), getBinanceTimeouts),
|
|
32
33
|
((ImpervaCustomTaskRequest,), getImpervaTimeouts),
|
|
33
|
-
((RecognitionComplexImageTaskRequest), getCITTimeouts),
|
|
34
|
-
((MTCaptchaRequest), getImage2TextTimeouts),
|
|
35
|
-
((YidunRequest), getYidunTimeouts),
|
|
36
|
-
((TemuCustomTaskRequest), getTemuTimeouts),
|
|
37
|
-
((ProsopoTaskRequest), getProsopoTimeouts),
|
|
34
|
+
((RecognitionComplexImageTaskRequest,), getCITTimeouts),
|
|
35
|
+
((MTCaptchaRequest,), getImage2TextTimeouts),
|
|
36
|
+
((YidunRequest,), getYidunTimeouts),
|
|
37
|
+
((TemuCustomTaskRequest,), getTemuTimeouts),
|
|
38
|
+
((ProsopoTaskRequest,), getProsopoTimeouts),
|
|
39
|
+
((AltchaCustomTaskRequest,), getAltchaTimeouts),
|
|
40
|
+
((CastleCustomTaskRequest,), getCastleTimeouts),
|
|
41
|
+
((TspdCustomTaskRequest,), getTspdTimeouts),
|
|
42
|
+
((HuntCustomTaskRequest,), getHuntTimeouts),
|
|
38
43
|
)
|
|
39
44
|
|
|
40
45
|
|
|
@@ -44,6 +49,14 @@ class CapMonsterClient:
|
|
|
44
49
|
self.options = options
|
|
45
50
|
self._headers = {'User-Agent':
|
|
46
51
|
f'Zennolab.CapMonsterCloud.Client.Python/{parseVersion()}'}
|
|
52
|
+
if self.options.client_proxy:
|
|
53
|
+
if self.options.client_proxy.proxyType not in ['http', 'https']:
|
|
54
|
+
raise UnsupportedProxyTypeError(f'Supported client proxy types are: [HTTP, HTTPS]')
|
|
55
|
+
if self.options.client_proxy.proxyLogin and self.options.client_proxy.proxyPassword:
|
|
56
|
+
auth = f"{self.options.client_proxy.proxyLogin}:{self.options.client_proxy.proxyPassword}@"
|
|
57
|
+
self.client_proxy_string = f"{self.options.client_proxy.proxyType}://{auth}{self.options.client_proxy.proxyAddress}:{self.options.client_proxy.proxyPort}"
|
|
58
|
+
else:
|
|
59
|
+
self.client_proxy_string = None
|
|
47
60
|
|
|
48
61
|
@property
|
|
49
62
|
def headers(self):
|
|
@@ -56,7 +69,8 @@ class CapMonsterClient:
|
|
|
56
69
|
async with aiohttp.ClientSession() as session:
|
|
57
70
|
async with session.post(url=self.options.service_url + '/getBalance',
|
|
58
71
|
json=body,
|
|
59
|
-
timeout=aiohttp.ClientTimeout(total=self.options.client_timeout)
|
|
72
|
+
timeout=aiohttp.ClientTimeout(total=self.options.client_timeout),
|
|
73
|
+
proxy=self.client_proxy_string) as resp:
|
|
60
74
|
if resp.status != 200:
|
|
61
75
|
raise HTTPException(f'Cannot create task. Status code: {resp.status}.')
|
|
62
76
|
result = await resp.json(content_type=None)
|
|
@@ -69,6 +83,7 @@ class CapMonsterClient:
|
|
|
69
83
|
RecaptchaV2EnterpriseRequest,
|
|
70
84
|
RecaptchaV2Request,
|
|
71
85
|
RecaptchaV3ProxylessRequest,
|
|
86
|
+
RecaptchaV3EnterpriseRequest,
|
|
72
87
|
RecaptchaComplexImageTaskRequest,
|
|
73
88
|
ImageToTextRequest,
|
|
74
89
|
FuncaptchaRequest,
|
|
@@ -87,7 +102,11 @@ class CapMonsterClient:
|
|
|
87
102
|
MTCaptchaRequest,
|
|
88
103
|
YidunRequest,
|
|
89
104
|
TemuCustomTaskRequest,
|
|
90
|
-
ProsopoTaskRequest
|
|
105
|
+
ProsopoTaskRequest,
|
|
106
|
+
AltchaCustomTaskRequest,
|
|
107
|
+
CastleCustomTaskRequest,
|
|
108
|
+
TspdCustomTaskRequest,
|
|
109
|
+
HuntCustomTaskRequest],
|
|
91
110
|
) -> Dict[str, str]:
|
|
92
111
|
'''
|
|
93
112
|
Non-blocking method for captcha solving.
|
|
@@ -106,6 +125,7 @@ class CapMonsterClient:
|
|
|
106
125
|
RecaptchaV2EnterpriseRequest,
|
|
107
126
|
RecaptchaV2Request,
|
|
108
127
|
RecaptchaV3ProxylessRequest,
|
|
128
|
+
RecaptchaV3EnterpriseRequest,
|
|
109
129
|
RecaptchaComplexImageTaskRequest,
|
|
110
130
|
ImageToTextRequest,
|
|
111
131
|
FuncaptchaRequest,
|
|
@@ -124,7 +144,8 @@ class CapMonsterClient:
|
|
|
124
144
|
MTCaptchaRequest,
|
|
125
145
|
YidunRequest,
|
|
126
146
|
TemuCustomTaskRequest,
|
|
127
|
-
ProsopoTaskRequest
|
|
147
|
+
ProsopoTaskRequest,
|
|
148
|
+
AltchaCustomTaskRequest],
|
|
128
149
|
timeouts: GetResultTimeouts,
|
|
129
150
|
) -> Dict[str, str]:
|
|
130
151
|
|
|
@@ -133,6 +154,7 @@ class CapMonsterClient:
|
|
|
133
154
|
raise GetTaskError(f'[{getTaskResponse.get("errorCode")}] ' \
|
|
134
155
|
f'{getTaskResponse.get("errorDescription")}.')
|
|
135
156
|
timer = RequestController(timeout=timeouts.timeout)
|
|
157
|
+
timer.run()
|
|
136
158
|
await asyncio.sleep(timeouts.firstRequestDelay)
|
|
137
159
|
result = CaptchaResult()
|
|
138
160
|
while not timer.cancel:
|
|
@@ -150,13 +172,10 @@ class CapMonsterClient:
|
|
|
150
172
|
elif getResultResponse.get('status') == 'ready':
|
|
151
173
|
timer.stop()
|
|
152
174
|
result.solution = getResultResponse.get('solution')
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
else:
|
|
158
|
-
raise TimeoutError('Failed to get a solution within the maximum ' \
|
|
159
|
-
f'response waiting interval: {timeouts.timeout:0.1f} sec.')
|
|
175
|
+
return result.solution
|
|
176
|
+
|
|
177
|
+
raise TimeoutError('Failed to get a solution within the maximum ' \
|
|
178
|
+
f'response waiting interval: {timeouts.timeout:0.1f} sec.')
|
|
160
179
|
|
|
161
180
|
|
|
162
181
|
async def _getTaskResult(self, task_id: str) -> Dict[str, Union[int, str, None]]:
|
|
@@ -168,7 +187,8 @@ class CapMonsterClient:
|
|
|
168
187
|
async with session.post(url=self.options.service_url + '/getTaskResult',
|
|
169
188
|
json=body,
|
|
170
189
|
timeout=aiohttp.ClientTimeout(total=self.options.client_timeout),
|
|
171
|
-
headers=self.headers
|
|
190
|
+
headers=self.headers,
|
|
191
|
+
proxy=self.client_proxy_string) as resp:
|
|
172
192
|
if resp.status != 200:
|
|
173
193
|
if resp.status == 500:
|
|
174
194
|
return {'errorId': 0, 'status': 'processing'}
|
|
@@ -184,11 +204,13 @@ class CapMonsterClient:
|
|
|
184
204
|
"task": task,
|
|
185
205
|
"softId": self.options.default_soft_id
|
|
186
206
|
}
|
|
207
|
+
|
|
187
208
|
async with aiohttp.ClientSession() as session:
|
|
188
209
|
async with session.post(url=self.options.service_url + '/createTask',
|
|
189
210
|
json=body,
|
|
190
211
|
timeout=aiohttp.ClientTimeout(total=self.options.client_timeout),
|
|
191
|
-
headers=self.headers
|
|
212
|
+
headers=self.headers,
|
|
213
|
+
proxy=self.client_proxy_string) as resp:
|
|
192
214
|
if resp.status != 200:
|
|
193
215
|
raise HTTPException(f'Cannot create task. Status code: {resp.status}.')
|
|
194
216
|
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,18 @@ 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
|
+
|
|
59
|
+
def getCastleTimeouts() -> GetResultTimeouts:
|
|
60
|
+
return GetResultTimeouts(1, 0, 1, 60)
|
|
61
|
+
|
|
62
|
+
def getTspdTimeouts() -> GetResultTimeouts:
|
|
63
|
+
return GetResultTimeouts(1, 0, 1, 60)
|
|
64
|
+
|
|
65
|
+
def getHuntTimeouts() -> GetResultTimeouts:
|
|
66
|
+
return GetResultTimeouts(1, 0, 1, 60)
|
|
67
|
+
|
|
53
68
|
def getCITTimeouts() -> GetResultTimeouts:
|
|
54
69
|
return GetResultTimeouts(0.35, 0, 0.2, 10)
|
|
55
70
|
|
{capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.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
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
from typing import Dict, Union
|
|
2
|
+
from pydantic import Field, validator
|
|
3
|
+
|
|
4
|
+
from .CustomTaskRequestBase import CustomTaskRequestBase
|
|
5
|
+
|
|
6
|
+
class CastleCustomTaskRequest(CustomTaskRequestBase):
|
|
7
|
+
captchaClass: str = Field(default='Castle')
|
|
8
|
+
websiteKey: str = Field()
|
|
9
|
+
metadata: Dict[str, Union[str, int]]
|
|
10
|
+
|
|
11
|
+
@validator('metadata')
|
|
12
|
+
def validate_metadata(cls, value):
|
|
13
|
+
if value.get('wUrl') is None:
|
|
14
|
+
raise TypeError(f'Expected that wUrl is defined.')
|
|
15
|
+
else:
|
|
16
|
+
if not isinstance(value.get('wUrl'), str):
|
|
17
|
+
raise TypeError(f'Expected that wUrl is str.')
|
|
18
|
+
if value.get('swUrl') is None:
|
|
19
|
+
raise TypeError(f'Expected that swUrl is defined.')
|
|
20
|
+
else:
|
|
21
|
+
if not isinstance(value.get('swUrl'), str):
|
|
22
|
+
raise TypeError(f'Expected that swUrl is str.')
|
|
23
|
+
if value.get('count') is not None and not isinstance(value.get('count'), int):
|
|
24
|
+
raise TypeError(f'Expected that count is int.')
|
|
25
|
+
return value
|
|
26
|
+
|
|
27
|
+
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
|
28
|
+
task = {}
|
|
29
|
+
task['type'] = self.type
|
|
30
|
+
task['class'] = self.captchaClass
|
|
31
|
+
task['websiteURL'] = self.websiteUrl
|
|
32
|
+
task['websiteKey'] = self.websiteKey
|
|
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
|
|
@@ -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
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
from typing import Dict, Union
|
|
2
|
-
from pydantic import Field, validator
|
|
2
|
+
from pydantic import Field, validator, model_validator
|
|
3
3
|
from .CustomTaskRequestBase import CustomTaskRequestBase
|
|
4
4
|
|
|
5
5
|
class DataDomeCustomTaskRequest(CustomTaskRequestBase):
|
|
6
6
|
captchaClass: str = Field(default='DataDome')
|
|
7
7
|
metadata : Dict[str, str]
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
@validator('metadata')
|
|
10
10
|
def validate_metadata(cls, value):
|
|
11
11
|
if value.get('datadomeCookie') is None:
|
|
12
12
|
raise TypeError(f'Expect that datadomeCookie will be defined.')
|
|
13
|
+
if value.get('datadomeVersion') is not None and not isinstance(value.get('datadomeVersion'), str):
|
|
14
|
+
raise TypeError(f'Expected datadomeVersion to be str')
|
|
13
15
|
if value.get('captchaUrl') and value.get('htmlPageBase64'):
|
|
14
16
|
raise TypeError(f'Expected only one of [captchaUrl, htmlPageBase64]')
|
|
15
17
|
elif value.get('captchaUrl'):
|
|
@@ -18,19 +20,24 @@ class DataDomeCustomTaskRequest(CustomTaskRequestBase):
|
|
|
18
20
|
return {i: value[i] for i in value if i != 'captchaUrl'}
|
|
19
21
|
else:
|
|
20
22
|
raise TypeError(f'Expected one of [captchaUrl, htmlPageBase64]')
|
|
21
|
-
|
|
23
|
+
|
|
24
|
+
@model_validator(mode='before')
|
|
25
|
+
def validate_datadome_proxy(cls, values):
|
|
26
|
+
proxy = values.get('proxy')
|
|
27
|
+
if proxy is None:
|
|
28
|
+
raise RuntimeError(f'You are required to use your own proxies.')
|
|
29
|
+
return values
|
|
30
|
+
|
|
22
31
|
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
|
23
32
|
task = {}
|
|
24
33
|
task['type'] = self.type
|
|
25
34
|
task['class'] = self.captchaClass
|
|
26
35
|
task['websiteURL'] = self.websiteUrl
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
task['proxyPassword'] = self.proxy.proxyPassword
|
|
33
|
-
task['domains'] = self.domains
|
|
36
|
+
task['proxyType'] = self.proxy.proxyType
|
|
37
|
+
task['proxyAddress'] = self.proxy.proxyAddress
|
|
38
|
+
task['proxyPort'] = self.proxy.proxyPort
|
|
39
|
+
task['proxyLogin'] = self.proxy.proxyLogin
|
|
40
|
+
task['proxyPassword'] = self.proxy.proxyPassword
|
|
34
41
|
task['metadata'] = self.metadata
|
|
35
42
|
if self.userAgent is not None:
|
|
36
43
|
task['userAgent'] = self.userAgent
|
|
@@ -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
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
from typing import Dict, Union
|
|
2
|
+
from pydantic import Field, validator, model_validator
|
|
3
|
+
|
|
4
|
+
from .CustomTaskRequestBase import CustomTaskRequestBase
|
|
5
|
+
|
|
6
|
+
class HuntCustomTaskRequest(CustomTaskRequestBase):
|
|
7
|
+
captchaClass: str = Field(default='HUNT')
|
|
8
|
+
metadata: Dict[str, str]
|
|
9
|
+
|
|
10
|
+
@validator('metadata')
|
|
11
|
+
def validate_metadata(cls, value):
|
|
12
|
+
if value.get('apiGetLib') is None:
|
|
13
|
+
raise TypeError(f'Expect that apiGetLib will be defined.')
|
|
14
|
+
else:
|
|
15
|
+
if not isinstance(value.get('apiGetLib'), str):
|
|
16
|
+
raise TypeError(f'Expect that apiGetLib will be str.')
|
|
17
|
+
if value.get('data') is not None and not isinstance(value.get('data'), str):
|
|
18
|
+
raise TypeError(f'Expect that data will be str.')
|
|
19
|
+
return value
|
|
20
|
+
|
|
21
|
+
@model_validator(mode='before')
|
|
22
|
+
def validate_hunt_proxy(cls, values):
|
|
23
|
+
proxy = values.get('proxy')
|
|
24
|
+
if proxy is None:
|
|
25
|
+
raise RuntimeError(f'You are required to use your own proxies.')
|
|
26
|
+
return values
|
|
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
|
+
task['proxyType'] = self.proxy.proxyType
|
|
35
|
+
task['proxyAddress'] = self.proxy.proxyAddress
|
|
36
|
+
task['proxyPort'] = self.proxy.proxyPort
|
|
37
|
+
task['proxyLogin'] = self.proxy.proxyLogin
|
|
38
|
+
task['proxyPassword'] = self.proxy.proxyPassword
|
|
39
|
+
if self.userAgent is not None:
|
|
40
|
+
task['userAgent'] = self.userAgent
|
|
41
|
+
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,7 +9,10 @@ class RecaptchaV2EnterpriseRequest(BaseRequestWithProxy):
|
|
|
9
9
|
websiteKey: str
|
|
10
10
|
enterprisePayload: Optional[str] = Field(default=None)
|
|
11
11
|
apiDomain: Optional[str] = Field(default=None)
|
|
12
|
-
|
|
12
|
+
pageAction: Optional[str] = Field(default=None)
|
|
13
|
+
userAgent: Optional[str] = Field(default=None)
|
|
14
|
+
cookies: Optional[str] = Field(default=None)
|
|
15
|
+
|
|
13
16
|
def getTaskDict(self) -> Dict[str, Union[str, int]]:
|
|
14
17
|
task = {}
|
|
15
18
|
task['type'] = self.type
|
|
@@ -25,4 +28,10 @@ class RecaptchaV2EnterpriseRequest(BaseRequestWithProxy):
|
|
|
25
28
|
task['enterprisePayload'] = {'s': self.enterprisePayload}
|
|
26
29
|
if self.apiDomain is not None:
|
|
27
30
|
task['apiDomain'] = self.apiDomain
|
|
31
|
+
if self.pageAction is not None:
|
|
32
|
+
task['pageAction'] = self.pageAction
|
|
33
|
+
if self.userAgent is not None:
|
|
34
|
+
task['userAgent'] = self.userAgent
|
|
35
|
+
if self.cookies is not None:
|
|
36
|
+
task['cookies'] = self.cookies
|
|
28
37
|
return task
|
|
@@ -11,8 +11,9 @@ class RecaptchaV2Request(BaseRequestWithProxy):
|
|
|
11
11
|
dataSValue: Optional[str] = Field(default=None)
|
|
12
12
|
userAgent: Optional[str] = Field(default=None)
|
|
13
13
|
cookies: Optional[str] = Field(default=None)
|
|
14
|
+
isInvisible: Optional[bool] = Field(default=None)
|
|
14
15
|
|
|
15
|
-
def getTaskDict(self) -> Dict[str, Union[str, int]]:
|
|
16
|
+
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
|
16
17
|
task = {}
|
|
17
18
|
task['type'] = self.type
|
|
18
19
|
task['websiteURL'] = self.websiteUrl
|
|
@@ -26,12 +27,15 @@ class RecaptchaV2Request(BaseRequestWithProxy):
|
|
|
26
27
|
|
|
27
28
|
if self.dataSValue is not None:
|
|
28
29
|
task['recaptchaDataSValue'] = self.dataSValue
|
|
29
|
-
|
|
30
|
+
|
|
30
31
|
if self.userAgent is not None:
|
|
31
32
|
task['userAgent'] = self.userAgent
|
|
32
33
|
|
|
33
34
|
if self.cookies is not None:
|
|
34
35
|
task['cookies'] = self.cookies
|
|
35
36
|
|
|
37
|
+
if self.isInvisible is not None:
|
|
38
|
+
task['isInvisible'] = self.isInvisible
|
|
39
|
+
|
|
36
40
|
return task
|
|
37
41
|
|
|
@@ -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
|
|
@@ -7,10 +7,10 @@ class RecaptchaV3ProxylessRequest(BaseRequest):
|
|
|
7
7
|
websiteUrl: str
|
|
8
8
|
websiteKey: str
|
|
9
9
|
type: str = Field(default='RecaptchaV3TaskProxyless')
|
|
10
|
-
|
|
10
|
+
minScore: Optional[float] = Field(default=None)
|
|
11
11
|
pageAction: Optional[str] = Field(default=None)
|
|
12
12
|
|
|
13
|
-
@validator('
|
|
13
|
+
@validator('minScore')
|
|
14
14
|
def validate_min_score(cls, value):
|
|
15
15
|
if value is not None:
|
|
16
16
|
if not 0.1 <= value <= 0.9:
|
|
@@ -23,8 +23,8 @@ class RecaptchaV3ProxylessRequest(BaseRequest):
|
|
|
23
23
|
task['type'] = self.type
|
|
24
24
|
task['websiteURL'] = self.websiteUrl
|
|
25
25
|
task['websiteKey'] = self.websiteKey
|
|
26
|
-
if self.
|
|
27
|
-
task['minScore'] = self.
|
|
26
|
+
if self.minScore is not None:
|
|
27
|
+
task['minScore'] = self.minScore
|
|
28
28
|
if self.pageAction is not None:
|
|
29
29
|
task['pageAction'] = self.pageAction
|
|
30
30
|
return task
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
from typing import Dict, Union
|
|
2
|
-
from pydantic import Field
|
|
1
|
+
from typing import Dict, Optional, Union
|
|
2
|
+
from pydantic import Field, validator
|
|
3
3
|
|
|
4
4
|
from .CustomTaskRequestBase import CustomTaskRequestBase
|
|
5
5
|
|
|
6
6
|
class TenDiCustomTaskRequest(CustomTaskRequestBase):
|
|
7
7
|
captchaClass: str = Field(default='TenDI')
|
|
8
8
|
websiteKey: str = Field()
|
|
9
|
+
metadata: Optional[Dict[str, str]] = Field(default=None)
|
|
10
|
+
|
|
11
|
+
@validator('metadata')
|
|
12
|
+
def validate_metadata(cls, value):
|
|
13
|
+
if value is not None:
|
|
14
|
+
if not set(value.keys()).issubset(set(["captchaUrl"])):
|
|
15
|
+
raise TypeError(f'Allowed keys for metadata are "captchaUrl"')
|
|
16
|
+
if value.get('captchaUrl') is not None and not isinstance(value.get('captchaUrl'), str):
|
|
17
|
+
raise TypeError(f'Expect that captchaUrl will be str.')
|
|
18
|
+
return value
|
|
9
19
|
|
|
10
20
|
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
|
11
21
|
task = {}
|
|
@@ -21,4 +31,6 @@ class TenDiCustomTaskRequest(CustomTaskRequestBase):
|
|
|
21
31
|
task['proxyPassword'] = self.proxy.proxyPassword
|
|
22
32
|
if self.userAgent is not None:
|
|
23
33
|
task['userAgent'] = self.userAgent
|
|
34
|
+
if self.metadata is not None:
|
|
35
|
+
task['metadata'] = self.metadata
|
|
24
36
|
return task
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from typing import Dict, Union
|
|
2
|
+
from pydantic import Field, validator, model_validator
|
|
3
|
+
|
|
4
|
+
from .CustomTaskRequestBase import CustomTaskRequestBase
|
|
5
|
+
|
|
6
|
+
class TspdCustomTaskRequest(CustomTaskRequestBase):
|
|
7
|
+
captchaClass: str = Field(default='tspd')
|
|
8
|
+
userAgent: str = Field()
|
|
9
|
+
metadata: Dict[str, str]
|
|
10
|
+
|
|
11
|
+
@validator('metadata')
|
|
12
|
+
def validate_metadata(cls, value):
|
|
13
|
+
if value.get('tspdCookie') is None:
|
|
14
|
+
raise TypeError(f'Expect that tspdCookie will be defined.')
|
|
15
|
+
else:
|
|
16
|
+
if not isinstance(value.get('tspdCookie'), str):
|
|
17
|
+
raise TypeError(f'Expect that tspdCookie will be str.')
|
|
18
|
+
if value.get('htmlPageBase64') is None:
|
|
19
|
+
raise TypeError(f'Expect that htmlPageBase64 will be defined.')
|
|
20
|
+
else:
|
|
21
|
+
if not isinstance(value.get('htmlPageBase64'), str):
|
|
22
|
+
raise TypeError(f'Expect that htmlPageBase64 will be str.')
|
|
23
|
+
return value
|
|
24
|
+
|
|
25
|
+
@model_validator(mode='before')
|
|
26
|
+
def validate_tspd_proxy(cls, values):
|
|
27
|
+
proxy = values.get('proxy')
|
|
28
|
+
if proxy is None:
|
|
29
|
+
raise RuntimeError(f'You are required to use your own proxies.')
|
|
30
|
+
return values
|
|
31
|
+
|
|
32
|
+
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
|
33
|
+
task = {}
|
|
34
|
+
task['type'] = self.type
|
|
35
|
+
task['class'] = self.captchaClass
|
|
36
|
+
task['websiteURL'] = self.websiteUrl
|
|
37
|
+
task['metadata'] = self.metadata
|
|
38
|
+
task['userAgent'] = self.userAgent
|
|
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
|
|
44
|
+
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.')
|
|
@@ -8,6 +8,11 @@ class YidunRequest(BaseRequestWithProxy):
|
|
|
8
8
|
websiteUrl: str
|
|
9
9
|
websiteKey: str
|
|
10
10
|
userAgent: Optional[str] = Field(default=None)
|
|
11
|
+
yidunGetLib: Optional[str] = Field(default=None)
|
|
12
|
+
yidunApiServerSubdomain: Optional[str] = Field(default=None)
|
|
13
|
+
challenge: Optional[str] = Field(default=None)
|
|
14
|
+
hcg: Optional[str] = Field(default=None)
|
|
15
|
+
hct: Optional[int] = Field(default=None)
|
|
11
16
|
|
|
12
17
|
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
|
13
18
|
task = {}
|
|
@@ -16,6 +21,16 @@ class YidunRequest(BaseRequestWithProxy):
|
|
|
16
21
|
task["websiteKey"] = self.websiteKey
|
|
17
22
|
if self.userAgent is not None:
|
|
18
23
|
task["userAgent"] = self.userAgent
|
|
24
|
+
if self.yidunGetLib is not None:
|
|
25
|
+
task["yidunGetLib"] = self.yidunGetLib
|
|
26
|
+
if self.yidunApiServerSubdomain is not None:
|
|
27
|
+
task["yidunApiServerSubdomain"] = self.yidunApiServerSubdomain
|
|
28
|
+
if self.challenge is not None:
|
|
29
|
+
task["challenge"] = self.challenge
|
|
30
|
+
if self.hcg is not None:
|
|
31
|
+
task["hcg"] = self.hcg
|
|
32
|
+
if self.hct is not None:
|
|
33
|
+
task["hct"] = self.hct
|
|
19
34
|
if self.proxy:
|
|
20
35
|
task["proxyType"] = self.proxy.proxyType
|
|
21
36
|
task["proxyAddress"] = self.proxy.proxyAddress
|
|
@@ -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,13 +23,17 @@ 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 .CastleCustomTaskRequest import CastleCustomTaskRequest
|
|
28
|
+
from .TspdCustomTaskRequest import TspdCustomTaskRequest
|
|
29
|
+
from .HuntCustomTaskRequest import HuntCustomTaskRequest
|
|
30
|
+
from .proxy_info import ProxyInfo, ClientProxyInfo
|
|
26
31
|
|
|
27
32
|
|
|
28
|
-
REQUESTS = ['RecaptchaV2EnterpiseRequest', 'RecaptchaV2Request', 'RecaptchaV3ProxylessRequest', 'RecaptchaComplexImageTaskRequest'
|
|
33
|
+
REQUESTS = ['RecaptchaV2EnterpiseRequest', 'RecaptchaV2Request', 'RecaptchaV3ProxylessRequest', 'RecaptchaComplexImageTaskRequest', 'RecaptchaV3EnterpriseRequest',
|
|
29
34
|
'ImageToTextRequest',
|
|
30
35
|
'FuncaptchaRequest', 'FunCaptchaComplexImageTaskRequest',
|
|
31
|
-
'HcaptchaRequest', 'HcaptchaComplexImageTaskRequest'
|
|
36
|
+
'HcaptchaRequest', 'HcaptchaComplexImageTaskRequest',
|
|
32
37
|
'GeetestRequest',
|
|
33
38
|
'DataDomeCustomTaskRequest',
|
|
34
39
|
'TenDiCustomTaskRequest',
|
|
@@ -41,5 +46,9 @@ REQUESTS = ['RecaptchaV2EnterpiseRequest', 'RecaptchaV2Request', 'RecaptchaV3Pro
|
|
|
41
46
|
'MTCaptchaRequest',
|
|
42
47
|
'YidunRequest',
|
|
43
48
|
'ProsopoTaskRequest',
|
|
44
|
-
'TemuCustomTaskRequest'
|
|
49
|
+
'TemuCustomTaskRequest',
|
|
50
|
+
'AltchaCustomTaskRequest',
|
|
51
|
+
'CastleCustomTaskRequest',
|
|
52
|
+
'TspdCustomTaskRequest',
|
|
53
|
+
'HuntCustomTaskRequest'
|
|
45
54
|
]
|
|
@@ -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
|
+
4.0.0
|
|
@@ -13,9 +13,11 @@ 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
|
|
20
|
+
capmonstercloud_client/requests/CastleCustomTaskRequest.py
|
|
19
21
|
capmonstercloud_client/requests/ComplexImageTaskBase.py
|
|
20
22
|
capmonstercloud_client/requests/CustomTaskRequestBase.py
|
|
21
23
|
capmonstercloud_client/requests/DataDomeCustomTaskRequest.py
|
|
@@ -24,6 +26,7 @@ capmonstercloud_client/requests/FuncaptchaRequest.py
|
|
|
24
26
|
capmonstercloud_client/requests/GeetestRequest.py
|
|
25
27
|
capmonstercloud_client/requests/HcaptchaComplexImageTask.py
|
|
26
28
|
capmonstercloud_client/requests/HcaptchaRequest.py
|
|
29
|
+
capmonstercloud_client/requests/HuntCustomTaskRequest.py
|
|
27
30
|
capmonstercloud_client/requests/ImageToTextRequest.py
|
|
28
31
|
capmonstercloud_client/requests/ImpervaCustomTaskRequest.py
|
|
29
32
|
capmonstercloud_client/requests/MTCaptchaRequest.py
|
|
@@ -31,10 +34,12 @@ capmonstercloud_client/requests/ProsopoTaskRequest.py
|
|
|
31
34
|
capmonstercloud_client/requests/RecaptchaComplexImageTask.py
|
|
32
35
|
capmonstercloud_client/requests/RecaptchaV2EnterpiseRequest.py
|
|
33
36
|
capmonstercloud_client/requests/RecaptchaV2Request.py
|
|
37
|
+
capmonstercloud_client/requests/RecaptchaV3EnterpriseRequest.py
|
|
34
38
|
capmonstercloud_client/requests/RecaptchaV3ProxylessRequest.py
|
|
35
39
|
capmonstercloud_client/requests/RecognitionComplexImageTaskRequest.py
|
|
36
40
|
capmonstercloud_client/requests/TemuCustomTaskRequest.py
|
|
37
41
|
capmonstercloud_client/requests/TenDiCustomTaskRequest.py
|
|
42
|
+
capmonstercloud_client/requests/TspdCustomTaskRequest.py
|
|
38
43
|
capmonstercloud_client/requests/TurnstileRequest.py
|
|
39
44
|
capmonstercloud_client/requests/YidunRequest.py
|
|
40
45
|
capmonstercloud_client/requests/__init__.py
|
|
@@ -5,7 +5,7 @@ if sys.version_info < (3,):
|
|
|
5
5
|
sys.exit(-1)
|
|
6
6
|
|
|
7
7
|
from pathlib import Path
|
|
8
|
-
from pkg_resources import parse_requirements
|
|
8
|
+
#from pkg_resources import parse_requirements
|
|
9
9
|
from setuptools import setup
|
|
10
10
|
|
|
11
11
|
|
|
@@ -15,8 +15,8 @@ EMAIL = 'andrey.ilyin@zennolab.com'
|
|
|
15
15
|
AUTHOR = 'Andrey Ilyin'
|
|
16
16
|
with open('capmonstercloud_client/version.txt', 'r') as f:
|
|
17
17
|
VERSION = f.read()
|
|
18
|
-
with open("requirements.txt"
|
|
19
|
-
REQUIRED = [
|
|
18
|
+
with open("requirements.txt") as f:
|
|
19
|
+
REQUIRED = [line.strip() for line in f if line.strip() and not line.startswith("#")]
|
|
20
20
|
URL='https://github.com/ZennoLab/capmonstercloud-client-python'
|
|
21
21
|
|
|
22
22
|
this_directory = Path(__file__).parent
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
3.3.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/__init__.py
RENAMED
|
File without changes
|
{capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.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
|
{capmonstercloudclient-3.3.0 → capmonstercloudclient-4.0.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
|