capmonstercloudclient 3.4.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.4.0 → capmonstercloudclient-4.0.0}/PKG-INFO +1 -1
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/CapMonsterCloudClient.py +21 -17
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/GetResultTimeouts.py +9 -0
- capmonstercloudclient-4.0.0/capmonstercloud_client/requests/CastleCustomTaskRequest.py +42 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/DataDomeCustomTaskRequest.py +16 -12
- capmonstercloudclient-4.0.0/capmonstercloud_client/requests/HuntCustomTaskRequest.py +41 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/RecaptchaV2EnterpiseRequest.py +7 -1
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/RecaptchaV2Request.py +6 -2
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/RecaptchaV3ProxylessRequest.py +4 -4
- {capmonstercloudclient-3.4.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.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/YidunRequest.py +15 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/__init__.py +9 -3
- capmonstercloudclient-4.0.0/capmonstercloud_client/version.txt +1 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloudclient.egg-info/PKG-INFO +1 -1
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloudclient.egg-info/SOURCES.txt +3 -0
- capmonstercloudclient-4.0.0/pyproject.toml +3 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/setup.py +3 -3
- capmonstercloudclient-3.4.0/capmonstercloud_client/version.txt +0 -1
- capmonstercloudclient-3.4.0/pyproject.toml +0 -3
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/LICENSE +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/MANIFEST.in +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/README.md +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/__init__.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/captchaResult.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/clientOptions.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/exceptions.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requestController.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/AltchaCustomTaskRequest.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/AmazonWafRequest.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/BasiliskCustomTaskRequest.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/BinanceTaskRequest.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/ComplexImageTaskBase.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/CustomTaskRequestBase.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/FuncaptchaComplexImageTask.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/FuncaptchaRequest.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/GeetestRequest.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/HcaptchaComplexImageTask.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/HcaptchaRequest.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/ImageToTextRequest.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/ImpervaCustomTaskRequest.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/MTCaptchaRequest.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/ProsopoTaskRequest.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/RecaptchaComplexImageTask.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/RecaptchaV3EnterpriseRequest.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/RecognitionComplexImageTaskRequest.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/TemuCustomTaskRequest.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/TurnstileRequest.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/baseRequest.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/baseRequestWithProxy.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/enums.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/requests/proxy_info.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/utils.py +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloudclient.egg-info/dependency_links.txt +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloudclient.egg-info/requires.txt +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloudclient.egg-info/top_level.txt +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/requirements.txt +0 -0
- {capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/setup.cfg +0 -0
|
@@ -16,9 +16,9 @@ from .utils import parseVersion
|
|
|
16
16
|
_instance_config = (
|
|
17
17
|
((RecaptchaV2Request,), getRecaptchaV2Timeouts),
|
|
18
18
|
((RecaptchaV2EnterpriseRequest,), getRecaptchaV2EnterpriseTimeouts),
|
|
19
|
-
((RecaptchaV3ProxylessRequest), getRecaptchaV3Timeouts),
|
|
20
|
-
((RecaptchaV3EnterpriseRequest), getRecaptchaV3Timeouts),
|
|
21
|
-
((ImageToTextRequest), getImage2TextTimeouts),
|
|
19
|
+
((RecaptchaV3ProxylessRequest,), getRecaptchaV3Timeouts),
|
|
20
|
+
((RecaptchaV3EnterpriseRequest,), getRecaptchaV3Timeouts),
|
|
21
|
+
((ImageToTextRequest,), getImage2TextTimeouts),
|
|
22
22
|
((FuncaptchaRequest,), getFuncaptchaTimeouts),
|
|
23
23
|
((HcaptchaRequest,), getHcaptchaTimeouts),
|
|
24
24
|
((GeetestRequest,), getGeetestTimeouts),
|
|
@@ -31,12 +31,15 @@ _instance_config = (
|
|
|
31
31
|
((AmazonWafRequest,), getAmazonWafTimeouts),
|
|
32
32
|
((BinanceTaskRequest,), getBinanceTimeouts),
|
|
33
33
|
((ImpervaCustomTaskRequest,), getImpervaTimeouts),
|
|
34
|
-
((RecognitionComplexImageTaskRequest), getCITTimeouts),
|
|
35
|
-
((MTCaptchaRequest), getImage2TextTimeouts),
|
|
36
|
-
((YidunRequest), getYidunTimeouts),
|
|
37
|
-
((TemuCustomTaskRequest), getTemuTimeouts),
|
|
38
|
-
((ProsopoTaskRequest), getProsopoTimeouts),
|
|
39
|
-
((AltchaCustomTaskRequest), getAltchaTimeouts),
|
|
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),
|
|
40
43
|
)
|
|
41
44
|
|
|
42
45
|
|
|
@@ -100,7 +103,10 @@ class CapMonsterClient:
|
|
|
100
103
|
YidunRequest,
|
|
101
104
|
TemuCustomTaskRequest,
|
|
102
105
|
ProsopoTaskRequest,
|
|
103
|
-
AltchaCustomTaskRequest
|
|
106
|
+
AltchaCustomTaskRequest,
|
|
107
|
+
CastleCustomTaskRequest,
|
|
108
|
+
TspdCustomTaskRequest,
|
|
109
|
+
HuntCustomTaskRequest],
|
|
104
110
|
) -> Dict[str, str]:
|
|
105
111
|
'''
|
|
106
112
|
Non-blocking method for captcha solving.
|
|
@@ -148,6 +154,7 @@ class CapMonsterClient:
|
|
|
148
154
|
raise GetTaskError(f'[{getTaskResponse.get("errorCode")}] ' \
|
|
149
155
|
f'{getTaskResponse.get("errorDescription")}.')
|
|
150
156
|
timer = RequestController(timeout=timeouts.timeout)
|
|
157
|
+
timer.run()
|
|
151
158
|
await asyncio.sleep(timeouts.firstRequestDelay)
|
|
152
159
|
result = CaptchaResult()
|
|
153
160
|
while not timer.cancel:
|
|
@@ -165,13 +172,10 @@ class CapMonsterClient:
|
|
|
165
172
|
elif getResultResponse.get('status') == 'ready':
|
|
166
173
|
timer.stop()
|
|
167
174
|
result.solution = getResultResponse.get('solution')
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
else:
|
|
173
|
-
raise TimeoutError('Failed to get a solution within the maximum ' \
|
|
174
|
-
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.')
|
|
175
179
|
|
|
176
180
|
|
|
177
181
|
async def _getTaskResult(self, task_id: str) -> Dict[str, Union[int, str, None]]:
|
|
@@ -56,6 +56,15 @@ def getImpervaTimeouts() -> GetResultTimeouts:
|
|
|
56
56
|
def getAltchaTimeouts() -> GetResultTimeouts:
|
|
57
57
|
return GetResultTimeouts(1, 0, 1, 50)
|
|
58
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
|
+
|
|
59
68
|
def getCITTimeouts() -> GetResultTimeouts:
|
|
60
69
|
return GetResultTimeouts(0.35, 0, 0.2, 10)
|
|
61
70
|
|
|
@@ -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
|
|
@@ -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,22 +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
|
-
if value.get('datadomeVersion') and not isinstance(value.get('datadomeVersion'), str):
|
|
22
|
-
raise TypeError(f'Expected datadomeVersion to be str')
|
|
23
23
|
|
|
24
|
-
|
|
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
|
+
|
|
25
31
|
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
|
26
32
|
task = {}
|
|
27
33
|
task['type'] = self.type
|
|
28
34
|
task['class'] = self.captchaClass
|
|
29
35
|
task['websiteURL'] = self.websiteUrl
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
task['proxyPassword'] = self.proxy.proxyPassword
|
|
36
|
-
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
|
|
37
41
|
task['metadata'] = self.metadata
|
|
38
42
|
if self.userAgent is not None:
|
|
39
43
|
task['userAgent'] = self.userAgent
|
|
@@ -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
|
|
@@ -10,7 +10,9 @@ class RecaptchaV2EnterpriseRequest(BaseRequestWithProxy):
|
|
|
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
|
-
|
|
13
|
+
userAgent: Optional[str] = Field(default=None)
|
|
14
|
+
cookies: Optional[str] = Field(default=None)
|
|
15
|
+
|
|
14
16
|
def getTaskDict(self) -> Dict[str, Union[str, int]]:
|
|
15
17
|
task = {}
|
|
16
18
|
task['type'] = self.type
|
|
@@ -28,4 +30,8 @@ class RecaptchaV2EnterpriseRequest(BaseRequestWithProxy):
|
|
|
28
30
|
task['apiDomain'] = self.apiDomain
|
|
29
31
|
if self.pageAction is not None:
|
|
30
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
|
|
31
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
|
|
|
@@ -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
|
|
@@ -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
|
|
@@ -24,13 +24,16 @@ from .YidunRequest import YidunRequest
|
|
|
24
24
|
from .ProsopoTaskRequest import ProsopoTaskRequest
|
|
25
25
|
from .TemuCustomTaskRequest import TemuCustomTaskRequest
|
|
26
26
|
from .AltchaCustomTaskRequest import AltchaCustomTaskRequest
|
|
27
|
+
from .CastleCustomTaskRequest import CastleCustomTaskRequest
|
|
28
|
+
from .TspdCustomTaskRequest import TspdCustomTaskRequest
|
|
29
|
+
from .HuntCustomTaskRequest import HuntCustomTaskRequest
|
|
27
30
|
from .proxy_info import ProxyInfo, ClientProxyInfo
|
|
28
31
|
|
|
29
32
|
|
|
30
|
-
REQUESTS = ['RecaptchaV2EnterpiseRequest', 'RecaptchaV2Request', 'RecaptchaV3ProxylessRequest', 'RecaptchaComplexImageTaskRequest', 'RecaptchaV3EnterpriseRequest'
|
|
33
|
+
REQUESTS = ['RecaptchaV2EnterpiseRequest', 'RecaptchaV2Request', 'RecaptchaV3ProxylessRequest', 'RecaptchaComplexImageTaskRequest', 'RecaptchaV3EnterpriseRequest',
|
|
31
34
|
'ImageToTextRequest',
|
|
32
35
|
'FuncaptchaRequest', 'FunCaptchaComplexImageTaskRequest',
|
|
33
|
-
'HcaptchaRequest', 'HcaptchaComplexImageTaskRequest'
|
|
36
|
+
'HcaptchaRequest', 'HcaptchaComplexImageTaskRequest',
|
|
34
37
|
'GeetestRequest',
|
|
35
38
|
'DataDomeCustomTaskRequest',
|
|
36
39
|
'TenDiCustomTaskRequest',
|
|
@@ -44,5 +47,8 @@ REQUESTS = ['RecaptchaV2EnterpiseRequest', 'RecaptchaV2Request', 'RecaptchaV3Pro
|
|
|
44
47
|
'YidunRequest',
|
|
45
48
|
'ProsopoTaskRequest',
|
|
46
49
|
'TemuCustomTaskRequest',
|
|
47
|
-
'AltchaCustomTaskRequest'
|
|
50
|
+
'AltchaCustomTaskRequest',
|
|
51
|
+
'CastleCustomTaskRequest',
|
|
52
|
+
'TspdCustomTaskRequest',
|
|
53
|
+
'HuntCustomTaskRequest'
|
|
48
54
|
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4.0.0
|
|
@@ -17,6 +17,7 @@ capmonstercloud_client/requests/AltchaCustomTaskRequest.py
|
|
|
17
17
|
capmonstercloud_client/requests/AmazonWafRequest.py
|
|
18
18
|
capmonstercloud_client/requests/BasiliskCustomTaskRequest.py
|
|
19
19
|
capmonstercloud_client/requests/BinanceTaskRequest.py
|
|
20
|
+
capmonstercloud_client/requests/CastleCustomTaskRequest.py
|
|
20
21
|
capmonstercloud_client/requests/ComplexImageTaskBase.py
|
|
21
22
|
capmonstercloud_client/requests/CustomTaskRequestBase.py
|
|
22
23
|
capmonstercloud_client/requests/DataDomeCustomTaskRequest.py
|
|
@@ -25,6 +26,7 @@ capmonstercloud_client/requests/FuncaptchaRequest.py
|
|
|
25
26
|
capmonstercloud_client/requests/GeetestRequest.py
|
|
26
27
|
capmonstercloud_client/requests/HcaptchaComplexImageTask.py
|
|
27
28
|
capmonstercloud_client/requests/HcaptchaRequest.py
|
|
29
|
+
capmonstercloud_client/requests/HuntCustomTaskRequest.py
|
|
28
30
|
capmonstercloud_client/requests/ImageToTextRequest.py
|
|
29
31
|
capmonstercloud_client/requests/ImpervaCustomTaskRequest.py
|
|
30
32
|
capmonstercloud_client/requests/MTCaptchaRequest.py
|
|
@@ -37,6 +39,7 @@ capmonstercloud_client/requests/RecaptchaV3ProxylessRequest.py
|
|
|
37
39
|
capmonstercloud_client/requests/RecognitionComplexImageTaskRequest.py
|
|
38
40
|
capmonstercloud_client/requests/TemuCustomTaskRequest.py
|
|
39
41
|
capmonstercloud_client/requests/TenDiCustomTaskRequest.py
|
|
42
|
+
capmonstercloud_client/requests/TspdCustomTaskRequest.py
|
|
40
43
|
capmonstercloud_client/requests/TurnstileRequest.py
|
|
41
44
|
capmonstercloud_client/requests/YidunRequest.py
|
|
42
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.4.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/__init__.py
RENAMED
|
File without changes
|
{capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/captchaResult.py
RENAMED
|
File without changes
|
{capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.0}/capmonstercloud_client/clientOptions.py
RENAMED
|
File without changes
|
{capmonstercloudclient-3.4.0 → capmonstercloudclient-4.0.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
|
{capmonstercloudclient-3.4.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
|
|
File without changes
|