capmonstercloudclient 2.0.0__tar.gz → 3.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-2.0.0 → capmonstercloudclient-3.0.0}/PKG-INFO +1 -1
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/CapMonsterCloudClient.py +34 -41
- capmonstercloudclient-3.0.0/capmonstercloud_client/requests/AmazonWafRequest.py +35 -0
- capmonstercloudclient-3.0.0/capmonstercloud_client/requests/BasiliskCustomTaskRequest.py +24 -0
- capmonstercloudclient-3.0.0/capmonstercloud_client/requests/BinanceTaskRequest.py +29 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/CustomTaskRequestBase.py +3 -3
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/DataDomeCustomTaskRequest.py +9 -8
- capmonstercloudclient-3.0.0/capmonstercloud_client/requests/FuncaptchaRequest.py +29 -0
- capmonstercloudclient-3.0.0/capmonstercloud_client/requests/GeetestRequest.py +53 -0
- capmonstercloudclient-3.0.0/capmonstercloud_client/requests/HcaptchaRequest.py +39 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/ImageToTextRequest.py +1 -1
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/ImpervaCustomTaskRequest.py +9 -8
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/RecaptchaComplexImageTask.py +1 -1
- capmonstercloudclient-3.0.0/capmonstercloud_client/requests/RecaptchaV2EnterpiseRequest.py +28 -0
- capmonstercloudclient-3.0.0/capmonstercloud_client/requests/RecaptchaV2Request.py +37 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/RecognitionComplexImageTaskRequest.py +2 -2
- capmonstercloudclient-3.0.0/capmonstercloud_client/requests/TenDiCustomTaskRequest.py +24 -0
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/TurnstileRequestBase.py → capmonstercloudclient-3.0.0/capmonstercloud_client/requests/TurnstileRequest.py +10 -6
- capmonstercloudclient-3.0.0/capmonstercloud_client/requests/__init__.py +35 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/baseRequest.py +2 -1
- capmonstercloudclient-3.0.0/capmonstercloud_client/requests/baseRequestWithProxy.py +7 -0
- capmonstercloudclient-3.0.0/capmonstercloud_client/version.txt +1 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloudclient.egg-info/PKG-INFO +1 -1
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloudclient.egg-info/SOURCES.txt +1 -24
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/AmazonWafProxylessRequest.py +0 -22
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/AmazonWafRequest.py +0 -28
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/AmazonWafRequestBase.py +0 -13
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/BasiliskCustomTaskProxylessRequest.py +0 -16
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/BasiliskCustomTaskRequest.py +0 -22
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/BasiliskCustomTaskRequestBase.py +0 -11
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/BinanceTaskProxylessRequest.py +0 -17
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/BinanceTaskRequest.py +0 -22
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/BinanceTaskRequestBase.py +0 -11
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/DataDomeCustomTaskProxylessRequest.py +0 -36
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/DataDomeCustomTaskRequestBase.py +0 -8
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/FuncaptchaProxylessRequest.py +0 -18
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/FuncaptchaRequest.py +0 -24
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/FuncaptchaRequestBase.py +0 -10
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/GeetestProxylessRequest.py +0 -31
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/GeetestRequest.py +0 -38
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/GeetestRequestBase.py +0 -20
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/HcaptchaProxylessRequest.py +0 -25
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/HcaptchaRequest.py +0 -32
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/HcaptchaRequestBase.py +0 -13
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/ImpervaCustomTaskProxylessRequest.py +0 -33
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/ImpervaCustomTaskRequestBase.py +0 -8
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/RecaptchaV2EnterpiseRequest.py +0 -24
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/RecaptchaV2EnterpriseProxylessRequest.py +0 -18
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/RecaptchaV2EnterpriseRequestBase.py +0 -11
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/RecaptchaV2ProxylessRequest.py +0 -30
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/RecaptchaV2Request.py +0 -32
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/RecaptchaV2RequestBase.py +0 -12
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/TenDiCustomTaskProxylessRequest.py +0 -16
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/TenDiCustomTaskRequest.py +0 -22
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/TenDiCustomTaskRequestBase.py +0 -11
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/TurnstileProxylessRequest.py +0 -10
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/TurnstileRequest.py +0 -13
- capmonstercloudclient-2.0.0/capmonstercloud_client/requests/__init__.py +0 -42
- capmonstercloudclient-2.0.0/capmonstercloud_client/version.txt +0 -1
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/LICENSE +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/MANIFEST.in +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/README.md +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/GetResultTimeouts.py +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/__init__.py +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/captchaResult.py +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/clientOptions.py +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/exceptions.py +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requestController.py +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/ComplexImageTaskBase.py +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/FuncaptchaComplexImageTask.py +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/HcaptchaComplexImageTask.py +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/RecaptchaV3ProxylessRequest.py +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/enums.py +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/proxy_info.py +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/utils.py +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloudclient.egg-info/dependency_links.txt +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloudclient.egg-info/requires.txt +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/capmonstercloudclient.egg-info/top_level.txt +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/pyproject.toml +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/requirements.txt +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/setup.cfg +0 -0
- {capmonstercloudclient-2.0.0 → capmonstercloudclient-3.0.0}/setup.py +0 -0
@@ -14,22 +14,22 @@ from .utils import parseVersion
|
|
14
14
|
|
15
15
|
|
16
16
|
_instance_config = (
|
17
|
-
((
|
18
|
-
((
|
17
|
+
((RecaptchaV2Request,), getRecaptchaV2Timeouts),
|
18
|
+
((RecaptchaV2EnterpriseRequest,), getRecaptchaV2EnterpriseTimeouts),
|
19
19
|
((RecaptchaV3ProxylessRequest), getRecaptchaV3Timeouts),
|
20
20
|
((ImageToTextRequest), getImage2TextTimeouts),
|
21
|
-
((
|
22
|
-
((
|
23
|
-
((
|
24
|
-
((
|
21
|
+
((FuncaptchaRequest,), getFuncaptchaTimeouts),
|
22
|
+
((HcaptchaRequest,), getHcaptchaTimeouts),
|
23
|
+
((GeetestRequest,), getGeetestTimeouts),
|
24
|
+
((TurnstileRequest,), getTurnstileTimeouts),
|
25
25
|
((RecaptchaComplexImageTaskRequest, HcaptchaComplexImageTaskRequest,
|
26
26
|
FunCaptchaComplexImageTaskRequest), getImage2TextTimeouts),
|
27
|
-
((DataDomeCustomTaskRequest,
|
28
|
-
((TenDiCustomTaskRequest,
|
29
|
-
((BasiliskCustomTaskRequest,
|
30
|
-
((AmazonWafRequest,
|
31
|
-
((BinanceTaskRequest,
|
32
|
-
((ImpervaCustomTaskRequest,
|
27
|
+
((DataDomeCustomTaskRequest,), getDatadomeTimeouts),
|
28
|
+
((TenDiCustomTaskRequest,), getTenDiTimeouts),
|
29
|
+
((BasiliskCustomTaskRequest,), getBasiliskTimeouts),
|
30
|
+
((AmazonWafRequest,), getAmazonWafTimeouts),
|
31
|
+
((BinanceTaskRequest,), getBinanceTimeouts),
|
32
|
+
((ImpervaCustomTaskRequest,), getImpervaTimeouts),
|
33
33
|
((RecognitionComplexImageTaskRequest), getCITTimeouts)
|
34
34
|
)
|
35
35
|
|
@@ -61,29 +61,24 @@ class CapMonsterClient:
|
|
61
61
|
return result
|
62
62
|
|
63
63
|
|
64
|
-
async def solve_captcha(self, request: Union[
|
64
|
+
async def solve_captcha(self, request: Union[
|
65
65
|
RecaptchaV2EnterpriseRequest,
|
66
66
|
RecaptchaV2Request,
|
67
|
-
RecaptchaV2ProxylessRequest,
|
68
67
|
RecaptchaV3ProxylessRequest,
|
69
|
-
ImageToTextRequest,
|
70
|
-
FuncaptchaProxylessRequest,
|
71
|
-
FuncaptchaRequest,
|
72
|
-
HcaptchaRequest,
|
73
|
-
HcaptchaProxylessRequest,
|
74
|
-
GeetestProxylessRequest,
|
75
|
-
GeetestRequest,
|
76
|
-
TurnstileProxylessRequest,
|
77
|
-
TurnstileRequest,
|
78
|
-
HcaptchaComplexImageTaskRequest,
|
79
68
|
RecaptchaComplexImageTaskRequest,
|
69
|
+
ImageToTextRequest,
|
70
|
+
FuncaptchaRequest,
|
80
71
|
FunCaptchaComplexImageTaskRequest,
|
81
|
-
|
72
|
+
HcaptchaRequest,
|
73
|
+
HcaptchaComplexImageTaskRequest,
|
74
|
+
GeetestRequest,
|
82
75
|
DataDomeCustomTaskRequest,
|
76
|
+
TenDiCustomTaskRequest,
|
77
|
+
BasiliskCustomTaskRequest,
|
78
|
+
AmazonWafRequest,
|
83
79
|
BinanceTaskRequest,
|
84
|
-
BinanceTaskProxylessRequest,
|
85
80
|
ImpervaCustomTaskRequest,
|
86
|
-
|
81
|
+
TurnstileRequest,
|
87
82
|
RecognitionComplexImageTaskRequest],
|
88
83
|
) -> Dict[str, str]:
|
89
84
|
'''
|
@@ -99,27 +94,25 @@ class CapMonsterClient:
|
|
99
94
|
raise UnknownRequestInstanceError(f'Unknown request instance "{type(request)}", ' \
|
100
95
|
f'expected that request will belong next instances: {rs_all}')
|
101
96
|
|
102
|
-
async def _solve(self, request: Union[
|
97
|
+
async def _solve(self, request: Union[
|
103
98
|
RecaptchaV2EnterpriseRequest,
|
104
99
|
RecaptchaV2Request,
|
105
|
-
RecaptchaV2ProxylessRequest,
|
106
100
|
RecaptchaV3ProxylessRequest,
|
107
|
-
ImageToTextRequest,
|
108
|
-
FuncaptchaProxylessRequest,
|
109
|
-
FuncaptchaRequest,
|
110
|
-
HcaptchaRequest,
|
111
|
-
HcaptchaProxylessRequest,
|
112
|
-
GeetestProxylessRequest,
|
113
|
-
GeetestRequest,
|
114
|
-
TurnstileProxylessRequest,
|
115
|
-
TurnstileRequest,
|
116
|
-
HcaptchaComplexImageTaskRequest,
|
117
101
|
RecaptchaComplexImageTaskRequest,
|
102
|
+
ImageToTextRequest,
|
103
|
+
FuncaptchaRequest,
|
118
104
|
FunCaptchaComplexImageTaskRequest,
|
105
|
+
HcaptchaRequest,
|
106
|
+
HcaptchaComplexImageTaskRequest,
|
107
|
+
GeetestRequest,
|
108
|
+
DataDomeCustomTaskRequest,
|
109
|
+
TenDiCustomTaskRequest,
|
110
|
+
BasiliskCustomTaskRequest,
|
111
|
+
AmazonWafRequest,
|
119
112
|
BinanceTaskRequest,
|
120
|
-
BinanceTaskProxylessRequest,
|
121
113
|
ImpervaCustomTaskRequest,
|
122
|
-
|
114
|
+
TurnstileRequest,
|
115
|
+
RecognitionComplexImageTaskRequest],
|
123
116
|
timeouts: GetResultTimeouts,
|
124
117
|
) -> Dict[str, str]:
|
125
118
|
|
@@ -0,0 +1,35 @@
|
|
1
|
+
from typing import Dict, Union, Optional
|
2
|
+
from pydantic import Field
|
3
|
+
|
4
|
+
from .baseRequestWithProxy import BaseRequestWithProxy
|
5
|
+
|
6
|
+
class AmazonWafRequest(BaseRequestWithProxy):
|
7
|
+
type: str = 'AmazonTask'
|
8
|
+
websiteUrl: str
|
9
|
+
challengeScript: str
|
10
|
+
captchaScript: str
|
11
|
+
websiteKey: str
|
12
|
+
context: str
|
13
|
+
iv: str
|
14
|
+
cookieSolution: Optional[bool] = Field(default=None)
|
15
|
+
|
16
|
+
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
17
|
+
task = {}
|
18
|
+
task['type'] = self.type
|
19
|
+
task['websiteURL'] = self.websiteUrl
|
20
|
+
task['challengeScript'] = self.challengeScript
|
21
|
+
task['captchaScript'] = self.captchaScript
|
22
|
+
task['websiteKey'] = self.websiteKey
|
23
|
+
task['context'] = self.context
|
24
|
+
task['iv'] = self.iv
|
25
|
+
|
26
|
+
if self.proxy:
|
27
|
+
task['proxyType'] = self.proxy.proxyType
|
28
|
+
task['proxyAddress'] = self.proxy.proxyAddress
|
29
|
+
task['proxyPort'] = self.proxy.proxyPort
|
30
|
+
task['proxyLogin'] = self.proxy.proxyLogin
|
31
|
+
task['proxyPassword'] = self.proxy.proxyPassword
|
32
|
+
|
33
|
+
if self.cookieSolution is not None:
|
34
|
+
task['cookieSolution'] = self.cookieSolution
|
35
|
+
return task
|
@@ -0,0 +1,24 @@
|
|
1
|
+
from typing import Dict, Union
|
2
|
+
from pydantic import Field
|
3
|
+
|
4
|
+
from .CustomTaskRequestBase import CustomTaskRequestBase
|
5
|
+
|
6
|
+
class BasiliskCustomTaskRequest(CustomTaskRequestBase):
|
7
|
+
captchaClass: str = Field(default='Basilisk')
|
8
|
+
websiteKey: str = Field()
|
9
|
+
|
10
|
+
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
11
|
+
task = {}
|
12
|
+
task['type'] = self.type
|
13
|
+
task['class'] = self.captchaClass
|
14
|
+
task['websiteURL'] = self.websiteUrl
|
15
|
+
task['websiteKey'] = self.websiteKey
|
16
|
+
if self.proxy:
|
17
|
+
task['proxyType'] = self.proxy.proxyType
|
18
|
+
task['proxyAddress'] = self.proxy.proxyAddress
|
19
|
+
task['proxyPort'] = self.proxy.proxyPort
|
20
|
+
task['proxyLogin'] = self.proxy.proxyLogin
|
21
|
+
task['proxyPassword'] = self.proxy.proxyPassword
|
22
|
+
if self.userAgent is not None:
|
23
|
+
task['userAgent'] = self.userAgent
|
24
|
+
return task
|
@@ -0,0 +1,29 @@
|
|
1
|
+
from typing import Dict, Union, Optional
|
2
|
+
from pydantic import Field
|
3
|
+
|
4
|
+
from .baseRequestWithProxy import BaseRequestWithProxy
|
5
|
+
|
6
|
+
class BinanceTaskRequest(BaseRequestWithProxy):
|
7
|
+
type: str = Field(default='BinanceTask')
|
8
|
+
websiteKey: str = Field()
|
9
|
+
websiteUrl: str = Field()
|
10
|
+
validateId: str = Field()
|
11
|
+
userAgent: Optional[str] = None
|
12
|
+
|
13
|
+
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
14
|
+
task = {}
|
15
|
+
task['type'] = self.type
|
16
|
+
task['validateId'] = self.validateId
|
17
|
+
task['websiteURL'] = self.websiteUrl
|
18
|
+
task['websiteKey'] = self.websiteKey
|
19
|
+
|
20
|
+
if self.proxy:
|
21
|
+
task['proxyType'] = self.proxy.proxyType
|
22
|
+
task['proxyAddress'] = self.proxy.proxyAddress
|
23
|
+
task['proxyPort'] = self.proxy.proxyPort
|
24
|
+
task['proxyLogin'] = self.proxy.proxyLogin
|
25
|
+
task['proxyPassword'] = self.proxy.proxyPassword
|
26
|
+
|
27
|
+
if self.userAgent is not None:
|
28
|
+
task['userAgent'] = self.userAgent
|
29
|
+
return task
|
@@ -1,8 +1,8 @@
|
|
1
|
-
from typing import Optional, List
|
1
|
+
from typing import Optional, List
|
2
2
|
|
3
|
-
from .
|
3
|
+
from .baseRequestWithProxy import BaseRequestWithProxy
|
4
4
|
|
5
|
-
class CustomTaskRequestBase(
|
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
|
@@ -1,9 +1,9 @@
|
|
1
1
|
from typing import Dict, Union
|
2
2
|
from pydantic import Field, validator
|
3
|
-
from .
|
4
|
-
from .proxy_info import ProxyInfo
|
3
|
+
from .CustomTaskRequestBase import CustomTaskRequestBase
|
5
4
|
|
6
|
-
class DataDomeCustomTaskRequest(
|
5
|
+
class DataDomeCustomTaskRequest(CustomTaskRequestBase):
|
6
|
+
captchaClass: str = Field(default='DataDome')
|
7
7
|
metadata : Dict[str, str]
|
8
8
|
|
9
9
|
@validator('metadata')
|
@@ -28,11 +28,12 @@ class DataDomeCustomTaskRequest(DataDomeCustomTaskRequestBase, ProxyInfo):
|
|
28
28
|
task['type'] = self.type
|
29
29
|
task['class'] = self.captchaClass
|
30
30
|
task['websiteURL'] = self.websiteUrl
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
if self.proxy:
|
32
|
+
task['proxyType'] = self.proxy.proxyType
|
33
|
+
task['proxyAddress'] = self.proxy.proxyAddress
|
34
|
+
task['proxyPort'] = self.proxy.proxyPort
|
35
|
+
task['proxyLogin'] = self.proxy.proxyLogin
|
36
|
+
task['proxyPassword'] = self.proxy.proxyPassword
|
36
37
|
task['domains'] = self.domains
|
37
38
|
task['metadata'] = self.metadata
|
38
39
|
if self.userAgent is not None:
|
@@ -0,0 +1,29 @@
|
|
1
|
+
from typing import Dict, Union, Optional
|
2
|
+
from pydantic import Field
|
3
|
+
|
4
|
+
from .baseRequestWithProxy import BaseRequestWithProxy
|
5
|
+
|
6
|
+
class FuncaptchaRequest(BaseRequestWithProxy):
|
7
|
+
type: str = Field(default='FunCaptchaTask')
|
8
|
+
websiteUrl: str
|
9
|
+
websitePublicKey: str
|
10
|
+
funcaptchaApiJSSubdomain: Optional[str] = Field(default=None)
|
11
|
+
data: Optional[str] = Field(default=None)
|
12
|
+
|
13
|
+
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
14
|
+
task = {}
|
15
|
+
task['type'] = self.type
|
16
|
+
task['websiteURL'] = self.websiteUrl
|
17
|
+
task['websitePublicKey'] = self.websitePublicKey
|
18
|
+
if self.proxy:
|
19
|
+
task['proxyType'] = self.proxy.proxyType
|
20
|
+
task['proxyAddress'] = self.proxy.proxyAddress
|
21
|
+
task['proxyPort'] = self.proxy.proxyPort
|
22
|
+
task['proxyLogin'] = self.proxy.proxyLogin
|
23
|
+
task['proxyPassword'] = self.proxy.proxyPassword
|
24
|
+
|
25
|
+
if self.funcaptchaApiJSSubdomain is not None:
|
26
|
+
task['funcaptchaApiJSSubdomain'] = self.funcaptchaApiJSSubdomain
|
27
|
+
if self.data is not None:
|
28
|
+
task['data'] = self.data
|
29
|
+
return task
|
@@ -0,0 +1,53 @@
|
|
1
|
+
from pydantic import Field, validator
|
2
|
+
from typing import Dict, Union, Optional
|
3
|
+
|
4
|
+
from .baseRequestWithProxy import BaseRequestWithProxy
|
5
|
+
|
6
|
+
|
7
|
+
class GeetestRequest(BaseRequestWithProxy):
|
8
|
+
type: str = Field(default='GeeTestTask')
|
9
|
+
websiteUrl: str
|
10
|
+
gt: str
|
11
|
+
challenge: Optional[str] = Field(default=None)
|
12
|
+
version: int = Field(default=3)
|
13
|
+
initParameters: Optional[Dict] = Field(default=None)
|
14
|
+
geetestApiServerSubdomain: Optional[str] = Field(default=None)
|
15
|
+
geetestGetLib: Optional[str] = Field(default=None)
|
16
|
+
user_agent: Optional[str] = Field(default=None)
|
17
|
+
|
18
|
+
@validator('version')
|
19
|
+
def validate_version(cls, value):
|
20
|
+
if value not in [3, 4]:
|
21
|
+
raise ValueError(f"Geetest version could be 3 or 4, not {value}")
|
22
|
+
return value
|
23
|
+
|
24
|
+
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
25
|
+
task = {}
|
26
|
+
task['type'] = self.type
|
27
|
+
task['websiteURL'] = self.websiteUrl
|
28
|
+
task['gt'] = self.gt
|
29
|
+
task['version'] = self.version
|
30
|
+
|
31
|
+
if self.version == 3:
|
32
|
+
if self.challenge is None:
|
33
|
+
raise ValueError(f'Challenge value is required for 3 version Geetest.')
|
34
|
+
task['challenge'] = self.challenge
|
35
|
+
|
36
|
+
if self.version == 4:
|
37
|
+
if self.initParameters is not None:
|
38
|
+
task['initParameters'] = self.initParameters
|
39
|
+
|
40
|
+
if self.geetestApiServerSubdomain is not None:
|
41
|
+
task['geetestApiServerSubdomain'] = self.geetestApiServerSubdomain
|
42
|
+
if self.geetestGetLib is not None:
|
43
|
+
task['geetestGetLib'] = self.geetestGetLib
|
44
|
+
if self.user_agent is not None:
|
45
|
+
task['userAgent'] = self.user_agent
|
46
|
+
|
47
|
+
if self.proxy:
|
48
|
+
task['proxyType'] = self.proxy.proxyType
|
49
|
+
task['proxyAddress'] = self.proxy.proxyAddress
|
50
|
+
task['proxyPort'] = self.proxy.proxyPort
|
51
|
+
task['proxyLogin'] = self.proxy.proxyLogin
|
52
|
+
task['proxyPassword'] = self.proxy.proxyPassword
|
53
|
+
return task
|
@@ -0,0 +1,39 @@
|
|
1
|
+
from pydantic import Field
|
2
|
+
from typing import Dict, Union, Optional
|
3
|
+
|
4
|
+
from .baseRequestWithProxy import BaseRequestWithProxy
|
5
|
+
|
6
|
+
class HcaptchaRequest(BaseRequestWithProxy):
|
7
|
+
type: str = Field(default='HCaptchaTask')
|
8
|
+
websiteUrl: str
|
9
|
+
websiteKey: str
|
10
|
+
is_invisible: Optional[bool] = Field(default=None)
|
11
|
+
data: Optional[str] = Field(default=None)
|
12
|
+
user_agent: Optional[str] = Field(default=None)
|
13
|
+
cookies: Optional[str] = Field(default=None)
|
14
|
+
fallbackToActualUA: Optional[bool] = Field(default=None)
|
15
|
+
|
16
|
+
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
17
|
+
|
18
|
+
task = {}
|
19
|
+
task['type'] = self.type
|
20
|
+
task['websiteURL'] = self.websiteUrl
|
21
|
+
task['websiteKey'] = self.websiteKey
|
22
|
+
if self.proxy:
|
23
|
+
task['proxyType'] = self.proxy.proxyType
|
24
|
+
task['proxyAddress'] = self.proxy.proxyAddress
|
25
|
+
task['proxyPort'] = self.proxy.proxyPort
|
26
|
+
task['proxyLogin'] = self.proxy.proxyLogin
|
27
|
+
task['proxyPassword'] = self.proxy.proxyPassword
|
28
|
+
if self.is_invisible is not None:
|
29
|
+
task['isInvisible'] = self.is_invisible
|
30
|
+
if self.data is not None:
|
31
|
+
task['data'] = self.data
|
32
|
+
if self.user_agent is not None:
|
33
|
+
task['userAgent'] = self.user_agent
|
34
|
+
if self.cookies is not None:
|
35
|
+
task['cookies'] = self.cookies
|
36
|
+
if self.fallbackToActualUA is not None:
|
37
|
+
task['fallbackToActualUA'] = self.fallbackToActualUA
|
38
|
+
|
39
|
+
return task
|
@@ -1,10 +1,10 @@
|
|
1
1
|
from typing import Dict, Union
|
2
2
|
from pydantic import Field, validator
|
3
3
|
|
4
|
-
from .
|
5
|
-
from .ImpervaCustomTaskRequestBase import ImpervaCustomTaskRequestBase
|
4
|
+
from .CustomTaskRequestBase import CustomTaskRequestBase
|
6
5
|
|
7
|
-
class ImpervaCustomTaskRequest(
|
6
|
+
class ImpervaCustomTaskRequest(CustomTaskRequestBase):
|
7
|
+
captchaClass: str = Field(default='Imperva')
|
8
8
|
metadata : Dict[str, str]
|
9
9
|
|
10
10
|
@validator('metadata')
|
@@ -29,11 +29,12 @@ class ImpervaCustomTaskRequest(ImpervaCustomTaskRequestBase, ProxyInfo):
|
|
29
29
|
task['class'] = self.captchaClass
|
30
30
|
task['websiteURL'] = self.websiteUrl
|
31
31
|
task['metadata'] = self.metadata
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
if self.proxy:
|
33
|
+
task['proxyType'] = self.proxy.proxyType
|
34
|
+
task['proxyAddress'] = self.proxy.proxyAddress
|
35
|
+
task['proxyPort'] = self.proxy.proxyPort
|
36
|
+
task['proxyLogin'] = self.proxy.proxyLogin
|
37
|
+
task['proxyPassword'] = self.proxy.proxyPassword
|
37
38
|
if self.userAgent is not None:
|
38
39
|
task['userAgent'] = self.userAgent
|
39
40
|
return task
|
@@ -0,0 +1,28 @@
|
|
1
|
+
from typing import Dict, Union, Optional
|
2
|
+
from pydantic import Field
|
3
|
+
|
4
|
+
from .baseRequestWithProxy import BaseRequestWithProxy
|
5
|
+
|
6
|
+
class RecaptchaV2EnterpriseRequest(BaseRequestWithProxy):
|
7
|
+
type: str = Field(default='RecaptchaV2EnterpriseTask')
|
8
|
+
websiteUrl: str
|
9
|
+
websiteKey: str
|
10
|
+
enterprisePayload: Optional[str] = Field(default=None)
|
11
|
+
apiDomain: Optional[str] = Field(default=None)
|
12
|
+
|
13
|
+
def getTaskDict(self) -> Dict[str, Union[str, int]]:
|
14
|
+
task = {}
|
15
|
+
task['type'] = self.type
|
16
|
+
task['websiteURL'] = self.websiteUrl
|
17
|
+
task['websiteKey'] = self.websiteKey
|
18
|
+
if self.proxy:
|
19
|
+
task['proxyType'] = self.proxy.proxyType
|
20
|
+
task['proxyAddress'] = self.proxy.proxyAddress
|
21
|
+
task['proxyPort'] = self.proxy.proxyPort
|
22
|
+
task['proxyLogin'] = self.proxy.proxyLogin
|
23
|
+
task['proxyPassword'] = self.proxy.proxyPassword
|
24
|
+
if self.enterprisePayload is not None:
|
25
|
+
task['enterprisePayload'] = {'s': self.enterprisePayload}
|
26
|
+
if self.apiDomain is not None:
|
27
|
+
task['apiDomain'] = self.apiDomain
|
28
|
+
return task
|
@@ -0,0 +1,37 @@
|
|
1
|
+
from typing import Dict, Union, Optional
|
2
|
+
from pydantic import Field
|
3
|
+
from .baseRequestWithProxy import BaseRequestWithProxy
|
4
|
+
|
5
|
+
|
6
|
+
class RecaptchaV2Request(BaseRequestWithProxy):
|
7
|
+
|
8
|
+
type: str = Field(default="NoCaptchaTask")
|
9
|
+
websiteUrl: str
|
10
|
+
websiteKey: str
|
11
|
+
dataSValue: Optional[str] = Field(default=None)
|
12
|
+
userAgent: Optional[str] = Field(default=None)
|
13
|
+
cookies: Optional[str] = Field(default=None)
|
14
|
+
|
15
|
+
def getTaskDict(self) -> Dict[str, Union[str, int]]:
|
16
|
+
task = {}
|
17
|
+
task['type'] = self.type
|
18
|
+
task['websiteURL'] = self.websiteUrl
|
19
|
+
task['websiteKey'] = self.websiteKey
|
20
|
+
if self.proxy:
|
21
|
+
task['proxyType'] = self.proxy.proxyType
|
22
|
+
task['proxyAddress'] = self.proxy.proxyAddress
|
23
|
+
task['proxyPort'] = self.proxy.proxyPort
|
24
|
+
task['proxyLogin'] = self.proxy.proxyLogin
|
25
|
+
task['proxyPassword'] = self.proxy.proxyPassword
|
26
|
+
|
27
|
+
if self.dataSValue is not None:
|
28
|
+
task['recaptchaDataSValue'] = self.dataSValue
|
29
|
+
|
30
|
+
if self.userAgent is not None:
|
31
|
+
task['userAgent'] = self.userAgent
|
32
|
+
|
33
|
+
if self.cookies is not None:
|
34
|
+
task['cookies'] = self.cookies
|
35
|
+
|
36
|
+
return task
|
37
|
+
|
@@ -1,7 +1,7 @@
|
|
1
|
-
from typing import
|
1
|
+
from typing import Dict, Union
|
2
2
|
from pydantic import validator
|
3
3
|
from .ComplexImageTaskBase import ComplexImageTaskRequestBase
|
4
|
-
from ..exceptions import
|
4
|
+
from ..exceptions import ZeroImagesErrors, TaskNotDefinedError
|
5
5
|
|
6
6
|
|
7
7
|
class RecognitionComplexImageTaskRequest(ComplexImageTaskRequestBase):
|
@@ -0,0 +1,24 @@
|
|
1
|
+
from typing import Dict, Union
|
2
|
+
from pydantic import Field
|
3
|
+
|
4
|
+
from .CustomTaskRequestBase import CustomTaskRequestBase
|
5
|
+
|
6
|
+
class TenDiCustomTaskRequest(CustomTaskRequestBase):
|
7
|
+
captchaClass: str = Field(default='TenDI')
|
8
|
+
websiteKey: str = Field()
|
9
|
+
|
10
|
+
def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
|
11
|
+
task = {}
|
12
|
+
task['type'] = self.type
|
13
|
+
task['class'] = self.captchaClass
|
14
|
+
task['websiteURL'] = self.websiteUrl
|
15
|
+
task['websiteKey'] = self.websiteKey
|
16
|
+
if self.proxy:
|
17
|
+
task['proxyType'] = self.proxy.proxyType
|
18
|
+
task['proxyAddress'] = self.proxy.proxyAddress
|
19
|
+
task['proxyPort'] = self.proxy.proxyPort
|
20
|
+
task['proxyLogin'] = self.proxy.proxyLogin
|
21
|
+
task['proxyPassword'] = self.proxy.proxyPassword
|
22
|
+
if self.userAgent is not None:
|
23
|
+
task['userAgent'] = self.userAgent
|
24
|
+
return task
|
@@ -1,10 +1,11 @@
|
|
1
|
-
from
|
2
|
-
from
|
3
|
-
from
|
1
|
+
from typing import Dict, Optional
|
2
|
+
from pydantic import Field, validator, model_validator
|
3
|
+
from .baseRequestWithProxy import BaseRequestWithProxy
|
4
4
|
|
5
5
|
|
6
|
-
class
|
6
|
+
class TurnstileRequest(BaseRequestWithProxy):
|
7
7
|
|
8
|
+
type: str = Field(default="TurnstileTask")
|
8
9
|
websiteURL: str
|
9
10
|
websiteKey: str
|
10
11
|
pageAction: Optional[str] = Field(default=None)
|
@@ -14,7 +15,7 @@ class TurnstileRequestBase(BaseRequest):
|
|
14
15
|
cloudflareTaskType: Optional[str] = Field(default=None)
|
15
16
|
htmlPageBase64: Optional[str] = Field(default=None)
|
16
17
|
apiJsUrl: Optional[str] = Field(default=None)
|
17
|
-
|
18
|
+
|
18
19
|
@validator('cloudflareTaskType')
|
19
20
|
def validate_cloudflare_task(cls, value):
|
20
21
|
if value is not None:
|
@@ -44,4 +45,7 @@ class TurnstileRequestBase(BaseRequest):
|
|
44
45
|
f'when cloudflareTaskType specified.')
|
45
46
|
|
46
47
|
return self
|
47
|
-
|
48
|
+
|
49
|
+
def getTaskDict(self) -> Dict[str, str]:
|
50
|
+
return {k: v for k, v in self.model_dump().items() if v is not None}
|
51
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
from .ImageToTextRequest import ImageToTextRequest
|
2
|
+
from .RecaptchaV2Request import RecaptchaV2Request
|
3
|
+
from .RecaptchaV2EnterpiseRequest import RecaptchaV2EnterpriseRequest
|
4
|
+
from .RecaptchaV3ProxylessRequest import RecaptchaV3ProxylessRequest
|
5
|
+
from .RecaptchaComplexImageTask import RecaptchaComplexImageTaskRequest
|
6
|
+
from .HcaptchaRequest import HcaptchaRequest
|
7
|
+
from .FuncaptchaRequest import FuncaptchaRequest
|
8
|
+
from .FuncaptchaComplexImageTask import FunCaptchaComplexImageTaskRequest
|
9
|
+
from .GeetestRequest import GeetestRequest
|
10
|
+
from .TurnstileRequest import TurnstileRequest
|
11
|
+
from .HcaptchaComplexImageTask import HcaptchaComplexImageTaskRequest
|
12
|
+
from .RecaptchaComplexImageTask import RecaptchaComplexImageTaskRequest
|
13
|
+
from .baseRequest import BaseRequest
|
14
|
+
from .DataDomeCustomTaskRequest import DataDomeCustomTaskRequest
|
15
|
+
from .TenDiCustomTaskRequest import TenDiCustomTaskRequest
|
16
|
+
from .BasiliskCustomTaskRequest import BasiliskCustomTaskRequest
|
17
|
+
from .AmazonWafRequest import AmazonWafRequest
|
18
|
+
from .BinanceTaskRequest import BinanceTaskRequest
|
19
|
+
from .ImpervaCustomTaskRequest import ImpervaCustomTaskRequest
|
20
|
+
from .RecognitionComplexImageTaskRequest import RecognitionComplexImageTaskRequest
|
21
|
+
|
22
|
+
|
23
|
+
REQUESTS = ['RecaptchaV2EnterpiseRequest', 'RecaptchaV2Request', 'RecaptchaV3ProxylessRequest', 'RecaptchaComplexImageTaskRequest'
|
24
|
+
'ImageToTextRequest',
|
25
|
+
'FuncaptchaRequest', 'FunCaptchaComplexImageTaskRequest',
|
26
|
+
'HcaptchaRequest', 'HcaptchaComplexImageTaskRequest'
|
27
|
+
'GeetestRequest',
|
28
|
+
'DataDomeCustomTaskRequest',
|
29
|
+
'TenDiCustomTaskRequest',
|
30
|
+
'BasiliskCustomTaskRequest',
|
31
|
+
'AmazonWafRequest',
|
32
|
+
'BinanceTaskRequest',
|
33
|
+
'ImpervaCustomTaskRequest',
|
34
|
+
'TurnstileRequest',
|
35
|
+
'RecognitionComplexImageTaskRequest']
|
@@ -0,0 +1 @@
|
|
1
|
+
3.0.0
|