capmonstercloudclient 1.6.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.
Files changed (84) hide show
  1. {capmonstercloudclient-1.6.0/capmonstercloudclient.egg-info → capmonstercloudclient-3.0.0}/PKG-INFO +21 -4
  2. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/CapMonsterCloudClient.py +36 -41
  3. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/GetResultTimeouts.py +3 -0
  4. capmonstercloudclient-3.0.0/capmonstercloud_client/requests/AmazonWafRequest.py +35 -0
  5. capmonstercloudclient-3.0.0/capmonstercloud_client/requests/BasiliskCustomTaskRequest.py +24 -0
  6. capmonstercloudclient-3.0.0/capmonstercloud_client/requests/BinanceTaskRequest.py +29 -0
  7. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/CustomTaskRequestBase.py +3 -3
  8. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/DataDomeCustomTaskRequest.py +9 -8
  9. capmonstercloudclient-3.0.0/capmonstercloud_client/requests/FuncaptchaRequest.py +29 -0
  10. capmonstercloudclient-3.0.0/capmonstercloud_client/requests/GeetestRequest.py +53 -0
  11. capmonstercloudclient-3.0.0/capmonstercloud_client/requests/HcaptchaRequest.py +39 -0
  12. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/ImageToTextRequest.py +1 -1
  13. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/ImpervaCustomTaskRequest.py +9 -8
  14. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/RecaptchaComplexImageTask.py +2 -2
  15. capmonstercloudclient-3.0.0/capmonstercloud_client/requests/RecaptchaV2EnterpiseRequest.py +28 -0
  16. capmonstercloudclient-3.0.0/capmonstercloud_client/requests/RecaptchaV2Request.py +37 -0
  17. capmonstercloudclient-3.0.0/capmonstercloud_client/requests/RecognitionComplexImageTaskRequest.py +45 -0
  18. capmonstercloudclient-3.0.0/capmonstercloud_client/requests/TenDiCustomTaskRequest.py +24 -0
  19. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/TurnstileRequestBase.py → capmonstercloudclient-3.0.0/capmonstercloud_client/requests/TurnstileRequest.py +10 -6
  20. capmonstercloudclient-3.0.0/capmonstercloud_client/requests/__init__.py +35 -0
  21. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/baseRequest.py +2 -1
  22. capmonstercloudclient-3.0.0/capmonstercloud_client/requests/baseRequestWithProxy.py +7 -0
  23. capmonstercloudclient-3.0.0/capmonstercloud_client/version.txt +1 -0
  24. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0/capmonstercloudclient.egg-info}/PKG-INFO +21 -4
  25. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloudclient.egg-info/SOURCES.txt +2 -24
  26. capmonstercloudclient-3.0.0/capmonstercloudclient.egg-info/requires.txt +30 -0
  27. capmonstercloudclient-3.0.0/requirements.txt +18 -0
  28. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/AmazonWafProxylessRequest.py +0 -22
  29. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/AmazonWafRequest.py +0 -28
  30. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/AmazonWafRequestBase.py +0 -13
  31. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/BasiliskCustomTaskProxylessRequest.py +0 -16
  32. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/BasiliskCustomTaskRequest.py +0 -22
  33. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/BasiliskCustomTaskRequestBase.py +0 -11
  34. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/BinanceTaskProxylessRequest.py +0 -17
  35. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/BinanceTaskRequest.py +0 -22
  36. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/BinanceTaskRequestBase.py +0 -11
  37. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/DataDomeCustomTaskProxylessRequest.py +0 -36
  38. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/DataDomeCustomTaskRequestBase.py +0 -8
  39. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/FuncaptchaProxylessRequest.py +0 -18
  40. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/FuncaptchaRequest.py +0 -24
  41. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/FuncaptchaRequestBase.py +0 -10
  42. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/GeetestProxylessRequest.py +0 -31
  43. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/GeetestRequest.py +0 -38
  44. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/GeetestRequestBase.py +0 -20
  45. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/HcaptchaProxylessRequest.py +0 -25
  46. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/HcaptchaRequest.py +0 -32
  47. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/HcaptchaRequestBase.py +0 -13
  48. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/ImpervaCustomTaskProxylessRequest.py +0 -33
  49. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/ImpervaCustomTaskRequestBase.py +0 -8
  50. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/RecaptchaV2EnterpiseRequest.py +0 -24
  51. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/RecaptchaV2EnterpriseProxylessRequest.py +0 -18
  52. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/RecaptchaV2EnterpriseRequestBase.py +0 -11
  53. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/RecaptchaV2ProxylessRequest.py +0 -30
  54. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/RecaptchaV2Request.py +0 -32
  55. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/RecaptchaV2RequestBase.py +0 -12
  56. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/TenDiCustomTaskProxylessRequest.py +0 -16
  57. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/TenDiCustomTaskRequest.py +0 -22
  58. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/TenDiCustomTaskRequestBase.py +0 -11
  59. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/TurnstileProxylessRequest.py +0 -10
  60. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/TurnstileRequest.py +0 -13
  61. capmonstercloudclient-1.6.0/capmonstercloud_client/requests/__init__.py +0 -41
  62. capmonstercloudclient-1.6.0/capmonstercloud_client/version.txt +0 -1
  63. capmonstercloudclient-1.6.0/capmonstercloudclient.egg-info/requires.txt +0 -2
  64. capmonstercloudclient-1.6.0/requirements.txt +0 -2
  65. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/LICENSE +0 -0
  66. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/MANIFEST.in +0 -0
  67. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/README.md +0 -0
  68. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/__init__.py +0 -0
  69. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/captchaResult.py +0 -0
  70. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/clientOptions.py +0 -0
  71. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/exceptions.py +0 -0
  72. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requestController.py +0 -0
  73. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/ComplexImageTaskBase.py +0 -0
  74. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/FuncaptchaComplexImageTask.py +0 -0
  75. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/HcaptchaComplexImageTask.py +0 -0
  76. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/RecaptchaV3ProxylessRequest.py +0 -0
  77. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/enums.py +0 -0
  78. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/requests/proxy_info.py +0 -0
  79. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloud_client/utils.py +0 -0
  80. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloudclient.egg-info/dependency_links.txt +0 -0
  81. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/capmonstercloudclient.egg-info/top_level.txt +0 -0
  82. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/pyproject.toml +0 -0
  83. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/setup.cfg +0 -0
  84. {capmonstercloudclient-1.6.0 → capmonstercloudclient-3.0.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: capmonstercloudclient
3
- Version: 1.6.0
3
+ Version: 3.0.0
4
4
  Summary: Official CapMonsterCloud Client: https://capmonster.cloud/
5
5
  Home-page: https://github.com/ZennoLab/capmonstercloud-client-python
6
6
  Author: Andrey Ilyin
@@ -33,8 +33,24 @@ Classifier: Operating System :: MacOS
33
33
  Requires-Python: >=3.6
34
34
  Description-Content-Type: text/markdown
35
35
  License-File: LICENSE
36
- Requires-Dist: aiohttp>=3.7.4
37
- Requires-Dist: pydantic==2.1.*
36
+ Requires-Dist: aiohappyeyeballs==2.4.4; python_version >= "3.9" and python_version <= "3.13"
37
+ Requires-Dist: aiohttp==3.11.10; python_version >= "3.9" and python_version <= "3.13"
38
+ Requires-Dist: aiosignal==1.3.1; python_version >= "3.9" and python_version <= "3.13"
39
+ Requires-Dist: annotated-types==0.7.0; python_version >= "3.9" and python_version <= "3.13"
40
+ Requires-Dist: async-timeout==5.0.1; python_version >= "3.9" and python_version <= "3.11"
41
+ Requires-Dist: attrs==24.2.0; python_version >= "3.9" and python_version <= "3.13"
42
+ Requires-Dist: frozenlist==1.5.0; python_version >= "3.9" and python_version <= "3.13"
43
+ Requires-Dist: idna==3.10; python_version >= "3.9" and python_version <= "3.13"
44
+ Requires-Dist: multidict==6.1.0; python_version >= "3.9" and python_version <= "3.13"
45
+ Requires-Dist: propcache==0.2.1; python_version >= "3.9" and python_version <= "3.13"
46
+ Requires-Dist: pydantic-core==2.27.1; python_version >= "3.9" and python_version <= "3.13"
47
+ Requires-Dist: pydantic==2.10.3; python_version >= "3.9" and python_version <= "3.13"
48
+ Requires-Dist: typing-extensions==4.12.2; python_version >= "3.9" and python_version <= "3.13"
49
+ Requires-Dist: yarl==1.18.3; python_version >= "3.9" and python_version <= "3.13"
50
+ Requires-Dist: aiohttp==3.7.4; python_version >= "3.6" and python_version <= "3.8"
51
+ Requires-Dist: pydantic==2.10.3; python_version >= "3.8" and python_version < "3.9"
52
+ Requires-Dist: pydantic==2.5.3; python_version >= "3.7" and python_version < "3.8"
53
+ Requires-Dist: pydantic==2.1.*; python_version < "3.7"
38
54
  Dynamic: author
39
55
  Dynamic: author-email
40
56
  Dynamic: classifier
@@ -43,6 +59,7 @@ Dynamic: description-content-type
43
59
  Dynamic: home-page
44
60
  Dynamic: keywords
45
61
  Dynamic: license
62
+ Dynamic: license-file
46
63
  Dynamic: requires-dist
47
64
  Dynamic: requires-python
48
65
  Dynamic: summary
@@ -14,22 +14,23 @@ from .utils import parseVersion
14
14
 
15
15
 
16
16
  _instance_config = (
17
- ((RecaptchaV2ProxylessRequest, RecaptchaV2Request), getRecaptchaV2Timeouts),
18
- ((RecaptchaV2EnterpriseProxylessRequest, RecaptchaV2EnterpriseRequest), getRecaptchaV2EnterpriseTimeouts),
17
+ ((RecaptchaV2Request,), getRecaptchaV2Timeouts),
18
+ ((RecaptchaV2EnterpriseRequest,), getRecaptchaV2EnterpriseTimeouts),
19
19
  ((RecaptchaV3ProxylessRequest), getRecaptchaV3Timeouts),
20
20
  ((ImageToTextRequest), getImage2TextTimeouts),
21
- ((FuncaptchaProxylessRequest, FuncaptchaRequest), getFuncaptchaTimeouts),
22
- ((HcaptchaProxylessRequest, HcaptchaRequest), getHcaptchaTimeouts),
23
- ((GeetestProxylessRequest, GeetestRequest), getGeetestTimeouts),
24
- ((TurnstileProxylessRequest, TurnstileRequest), getTurnstileTimeouts),
21
+ ((FuncaptchaRequest,), getFuncaptchaTimeouts),
22
+ ((HcaptchaRequest,), getHcaptchaTimeouts),
23
+ ((GeetestRequest,), getGeetestTimeouts),
24
+ ((TurnstileRequest,), getTurnstileTimeouts),
25
25
  ((RecaptchaComplexImageTaskRequest, HcaptchaComplexImageTaskRequest,
26
26
  FunCaptchaComplexImageTaskRequest), getImage2TextTimeouts),
27
- ((DataDomeCustomTaskRequest, DataDomeCustomTaskProxylessRequest), getDatadomeTimeouts),
28
- ((TenDiCustomTaskRequest, TenDiCustomTaskProxylessRequest), getTenDiTimeouts),
29
- ((BasiliskCustomTaskRequest, BasiliskCustomTaskProxylessRequest), getBasiliskTimeouts),
30
- ((AmazonWafRequest, AmazonWafProxylessRequest), getAmazonWafTimeouts),
31
- ((BinanceTaskRequest, BinanceTaskProxylessRequest), getBinanceTimeouts),
32
- ((ImpervaCustomTaskRequest, ImpervaCustomTaskProxylessRequest), getImpervaTimeouts)
27
+ ((DataDomeCustomTaskRequest,), getDatadomeTimeouts),
28
+ ((TenDiCustomTaskRequest,), getTenDiTimeouts),
29
+ ((BasiliskCustomTaskRequest,), getBasiliskTimeouts),
30
+ ((AmazonWafRequest,), getAmazonWafTimeouts),
31
+ ((BinanceTaskRequest,), getBinanceTimeouts),
32
+ ((ImpervaCustomTaskRequest,), getImpervaTimeouts),
33
+ ((RecognitionComplexImageTaskRequest), getCITTimeouts)
33
34
  )
34
35
 
35
36
 
@@ -60,29 +61,25 @@ class CapMonsterClient:
60
61
  return result
61
62
 
62
63
 
63
- async def solve_captcha(self, request: Union[RecaptchaV2EnterpriseProxylessRequest,
64
+ async def solve_captcha(self, request: Union[
64
65
  RecaptchaV2EnterpriseRequest,
65
66
  RecaptchaV2Request,
66
- RecaptchaV2ProxylessRequest,
67
67
  RecaptchaV3ProxylessRequest,
68
- ImageToTextRequest,
69
- FuncaptchaProxylessRequest,
70
- FuncaptchaRequest,
71
- HcaptchaRequest,
72
- HcaptchaProxylessRequest,
73
- GeetestProxylessRequest,
74
- GeetestRequest,
75
- TurnstileProxylessRequest,
76
- TurnstileRequest,
77
- HcaptchaComplexImageTaskRequest,
78
68
  RecaptchaComplexImageTaskRequest,
69
+ ImageToTextRequest,
70
+ FuncaptchaRequest,
79
71
  FunCaptchaComplexImageTaskRequest,
80
- DataDomeCustomTaskProxylessRequest,
72
+ HcaptchaRequest,
73
+ HcaptchaComplexImageTaskRequest,
74
+ GeetestRequest,
81
75
  DataDomeCustomTaskRequest,
76
+ TenDiCustomTaskRequest,
77
+ BasiliskCustomTaskRequest,
78
+ AmazonWafRequest,
82
79
  BinanceTaskRequest,
83
- BinanceTaskProxylessRequest,
84
80
  ImpervaCustomTaskRequest,
85
- ImpervaCustomTaskProxylessRequest],
81
+ TurnstileRequest,
82
+ RecognitionComplexImageTaskRequest],
86
83
  ) -> Dict[str, str]:
87
84
  '''
88
85
  Non-blocking method for captcha solving.
@@ -97,27 +94,25 @@ class CapMonsterClient:
97
94
  raise UnknownRequestInstanceError(f'Unknown request instance "{type(request)}", ' \
98
95
  f'expected that request will belong next instances: {rs_all}')
99
96
 
100
- async def _solve(self, request: Union[RecaptchaV2EnterpriseProxylessRequest,
97
+ async def _solve(self, request: Union[
101
98
  RecaptchaV2EnterpriseRequest,
102
99
  RecaptchaV2Request,
103
- RecaptchaV2ProxylessRequest,
104
100
  RecaptchaV3ProxylessRequest,
105
- ImageToTextRequest,
106
- FuncaptchaProxylessRequest,
107
- FuncaptchaRequest,
108
- HcaptchaRequest,
109
- HcaptchaProxylessRequest,
110
- GeetestProxylessRequest,
111
- GeetestRequest,
112
- TurnstileProxylessRequest,
113
- TurnstileRequest,
114
- HcaptchaComplexImageTaskRequest,
115
101
  RecaptchaComplexImageTaskRequest,
102
+ ImageToTextRequest,
103
+ FuncaptchaRequest,
116
104
  FunCaptchaComplexImageTaskRequest,
105
+ HcaptchaRequest,
106
+ HcaptchaComplexImageTaskRequest,
107
+ GeetestRequest,
108
+ DataDomeCustomTaskRequest,
109
+ TenDiCustomTaskRequest,
110
+ BasiliskCustomTaskRequest,
111
+ AmazonWafRequest,
117
112
  BinanceTaskRequest,
118
- BinanceTaskProxylessRequest,
119
113
  ImpervaCustomTaskRequest,
120
- ImpervaCustomTaskProxylessRequest],
114
+ TurnstileRequest,
115
+ RecognitionComplexImageTaskRequest],
121
116
  timeouts: GetResultTimeouts,
122
117
  ) -> Dict[str, str]:
123
118
 
@@ -49,3 +49,6 @@ def getBinanceTimeouts() -> GetResultTimeouts:
49
49
 
50
50
  def getImpervaTimeouts() -> GetResultTimeouts:
51
51
  return GetResultTimeouts(1, 0, 1, 20)
52
+
53
+ def getCITTimeouts() -> GetResultTimeouts:
54
+ return GetResultTimeouts(0.35, 0, 0.2, 10)
@@ -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, Dict
1
+ from typing import Optional, List
2
2
 
3
- from .baseRequest import BaseRequest
3
+ from .baseRequestWithProxy import BaseRequestWithProxy
4
4
 
5
- class CustomTaskRequestBase(BaseRequest):
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 .DataDomeCustomTaskRequestBase import DataDomeCustomTaskRequestBase
4
- from .proxy_info import ProxyInfo
3
+ from .CustomTaskRequestBase import CustomTaskRequestBase
5
4
 
6
- class DataDomeCustomTaskRequest(DataDomeCustomTaskRequestBase, ProxyInfo):
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
- task['proxyType'] = self.proxyType
32
- task['proxyAddress'] = self.proxyAddress
33
- task['proxyPort'] = self.proxyPort
34
- task['proxyLogin'] = self.proxyLogin
35
- task['proxyPassword'] = self.proxyPassword
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,6 +1,6 @@
1
1
  import base64
2
2
 
3
- from pydantic import validator, Field, BaseModel
3
+ from pydantic import validator, Field
4
4
  from typing import Optional, Dict, Union
5
5
  from .baseRequest import BaseRequest
6
6
  from .enums import TextModules
@@ -1,10 +1,10 @@
1
1
  from typing import Dict, Union
2
2
  from pydantic import Field, validator
3
3
 
4
- from .proxy_info import ProxyInfo
5
- from .ImpervaCustomTaskRequestBase import ImpervaCustomTaskRequestBase
4
+ from .CustomTaskRequestBase import CustomTaskRequestBase
6
5
 
7
- class ImpervaCustomTaskRequest(ImpervaCustomTaskRequestBase, ProxyInfo):
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
- task['proxyType'] = self.proxyType
33
- task['proxyAddress'] = self.proxyAddress
34
- task['proxyPort'] = self.proxyPort
35
- task['proxyLogin'] = self.proxyLogin
36
- task['proxyPassword'] = self.proxyPassword
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
@@ -1,4 +1,4 @@
1
- from typing import Dict, Union, Optional
1
+ from typing import Dict, Union
2
2
  from pydantic import Field, validator
3
3
 
4
4
  from .ComplexImageTaskBase import ComplexImageTaskRequestBase
@@ -71,7 +71,7 @@ class RecaptchaComplexImageTaskRequest(ComplexImageTaskRequestBase):
71
71
 
72
72
  if self.websiteUrl is not None:
73
73
  task["websiteUrl"] = self.websiteUrl
74
-
74
+
75
75
  return task
76
76
 
77
77
 
@@ -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
+
@@ -0,0 +1,45 @@
1
+ from typing import Dict, Union
2
+ from pydantic import validator
3
+ from .ComplexImageTaskBase import ComplexImageTaskRequestBase
4
+ from ..exceptions import ZeroImagesErrors, TaskNotDefinedError
5
+
6
+
7
+ class RecognitionComplexImageTaskRequest(ComplexImageTaskRequestBase):
8
+ captchaClass: str = 'recognition'
9
+ metadata: Dict[str, str]
10
+
11
+ @validator('metadata')
12
+ def validate_metadata(cls, value):
13
+ if value.get('Task') is None:
14
+ raise TaskNotDefinedError(f'Expect that Task will be defined.')
15
+ else:
16
+ if not isinstance(value.get('Task'), str):
17
+ raise TypeError(f'Expect that Task will be str.')
18
+ if not set(value.keys()).issubset(set(["Task", "TaskArgument"])):
19
+ raise TypeError(f'Allowed keys for metadata are "Task" and "TaskArgument"')
20
+ return value
21
+
22
+ @validator('imagesBase64')
23
+ def validate_images_array(cls, value):
24
+ if value is not None:
25
+ if not isinstance(value, (list, tuple)):
26
+ raise TypeError(f'Expect that type imagesBase64 array will be <list> or <tuple>, got {type(value)}')
27
+ elif not len(value):
28
+ raise ZeroImagesErrors(f'At least one image base64 expected, got {len(value)}')
29
+ # Check for each element type
30
+ contain_types = [isinstance(x, str) for x in value]
31
+ if not all(contain_types):
32
+ raise TypeError(f'Next images from imagesBase64 array are not string: {contain_types}')
33
+ else:
34
+ raise ZeroImagesErrors(f'At least one image base64 expected, got {len(value)}')
35
+ return value
36
+
37
+ def getTaskDict(self) -> Dict[str, Union[str, int, bool]]:
38
+ task = {}
39
+ task['type'] = self.taskType
40
+ task['class'] = self.captchaClass
41
+ task['imagesBase64'] = self.imagesBase64
42
+ task['metadata'] = self.metadata
43
+ if self.userAgent is not None:
44
+ task['userAgent'] = self.userAgent
45
+ 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 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