python3-capsolver 0.9.4__py3-none-any.whl → 1.0.1__py3-none-any.whl

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 (33) hide show
  1. python3_capsolver/__version__.py +1 -1
  2. python3_capsolver/aws_waf.py +122 -95
  3. python3_capsolver/cloudflare.py +113 -96
  4. python3_capsolver/control.py +31 -29
  5. python3_capsolver/core/aio_captcha_instrument.py +109 -0
  6. python3_capsolver/core/base.py +49 -194
  7. python3_capsolver/core/captcha_instrument.py +145 -0
  8. python3_capsolver/core/const.py +27 -0
  9. python3_capsolver/core/context_instr.py +25 -0
  10. python3_capsolver/core/enum.py +21 -76
  11. python3_capsolver/core/serializer.py +35 -128
  12. python3_capsolver/core/sio_captcha_instrument.py +116 -0
  13. python3_capsolver/core/{config.py → utils.py} +1 -10
  14. python3_capsolver/datadome_slider.py +56 -84
  15. python3_capsolver/friendly_captcha.py +105 -0
  16. python3_capsolver/gee_test.py +58 -90
  17. python3_capsolver/image_to_text.py +86 -116
  18. python3_capsolver/mt_captcha.py +49 -108
  19. python3_capsolver/recaptcha.py +65 -129
  20. python3_capsolver/vision_engine.py +102 -0
  21. python3_capsolver/yandex.py +73 -0
  22. {python3_capsolver-0.9.4.dist-info → python3_capsolver-1.0.1.dist-info}/METADATA +12 -12
  23. python3_capsolver-1.0.1.dist-info/RECORD +28 -0
  24. {python3_capsolver-0.9.4.dist-info → python3_capsolver-1.0.1.dist-info}/WHEEL +1 -1
  25. python3_capsolver/akamai.py +0 -192
  26. python3_capsolver/binance.py +0 -112
  27. python3_capsolver/cyber_si_ara.py +0 -128
  28. python3_capsolver/fun_captcha.py +0 -251
  29. python3_capsolver/hcaptcha.py +0 -197
  30. python3_capsolver/imperva.py +0 -120
  31. python3_capsolver-0.9.4.dist-info/RECORD +0 -26
  32. {python3_capsolver-0.9.4.dist-info → python3_capsolver-1.0.1.dist-info}/LICENSE +0 -0
  33. {python3_capsolver-0.9.4.dist-info → python3_capsolver-1.0.1.dist-info}/top_level.txt +0 -0
@@ -1,197 +0,0 @@
1
- from typing import List, Union
2
-
3
- from python3_capsolver.core.base import BaseCaptcha
4
- from python3_capsolver.core.enum import HCaptchaTypeEnm, HCaptchaClassificationTypeEnm
5
- from python3_capsolver.core.serializer import (
6
- CaptchaResponseSer,
7
- WebsiteDataOptionsSer,
8
- HCaptchaClassificationOptionsSer,
9
- )
10
-
11
-
12
- class HCaptcha(BaseCaptcha):
13
- """
14
- The class is used to work with Capsolver HCaptcha methods.
15
-
16
- Args:
17
- api_key: Capsolver API key
18
- captcha_type: Captcha type name, like ``HCaptchaTaskProxyless`` and etc.
19
- websiteURL: Address of a webpage with hCaptcha
20
- websiteKey: hCaptcha website key
21
-
22
- Examples:
23
- >>> HCaptcha(api_key="CAI-BA9XXXXXXXXXXXXX2702E010",
24
- ... captcha_type='HCaptchaTaskProxyless',
25
- ... websiteURL="https://accounts.hcaptcha.com/demo",
26
- ... websiteKey="a5f74b19-9e45-40e0-b45d-47ff91b7a6c2",
27
- ... ).captcha_handler()
28
- CaptchaResponseSer(errorId=0,
29
- errorCode=None,
30
- errorDescription=None,
31
- taskId='73bdcd28-6c77-4414-8....',
32
- status=<ResponseStatusEnm.Ready: 'ready'>,
33
- solution={'gRecaptchaResponse': '44795sds...'}
34
- )
35
-
36
- >>> HCaptcha(api_key="CAI-BA9XXXXXXXXXXXXX2702E010",
37
- ... captcha_type=HCaptchaTypeEnm.HCaptchaEnterpriseTaskProxyLess,
38
- ... websiteURL="https://accounts.hcaptcha.com/demo",
39
- ... websiteKey="a5f74b19-9e45-40e0-b45d-47ff91b7a6c2",
40
- ... ).captcha_handler()
41
- CaptchaResponseSer(errorId=0,
42
- errorCode=None,
43
- errorDescription=None,
44
- taskId='73bdcd28-6c77-4414-8....',
45
- status=<ResponseStatusEnm.Ready: 'ready'>,
46
- solution={'gRecaptchaResponse': '44795sds...'}
47
- )
48
-
49
- >>> HCaptcha(api_key="CAI-BA9XXXXXXXXXXXXX2702E010",
50
- ... captcha_type=HCaptchaTypeEnm.HCaptchaTask,
51
- ... websiteURL="https://accounts.hcaptcha.com/demo",
52
- ... websiteKey="a5f74b19-9e45-40e0-b45d-47ff91b7a6c2",
53
- ... proxy="socks5:192.191.100.10:4780:user:pwd"
54
- ... isInvisible=True
55
- ... ).captcha_handler()
56
- CaptchaResponseSer(errorId=0,
57
- errorCode=None,
58
- errorDescription=None,
59
- taskId='73bdcd28-6c77-4414-8....',
60
- status=<ResponseStatusEnm.Ready: 'ready'>,
61
- solution={'gRecaptchaResponse': '44795sds...'}
62
- )
63
-
64
- >>> await HCaptcha(api_key="CAI-BA9650D2B9C2786B21120D512702E010",
65
- ... captcha_type=HCaptchaTypeEnm.HCaptchaTaskProxyless,
66
- ... websiteURL="https://accounts.hcaptcha.com/demo",
67
- ... websiteKey="a5f74b19-9e45-40e0-b45d-47ff91b7a6c2",
68
- ... ).aio_captcha_handler()
69
- CaptchaResponseSer(errorId=0,
70
- errorCode=None,
71
- errorDescription=None,
72
- taskId='73bdcd28-6c77-4414-8....',
73
- status=<ResponseStatusEnm.Ready: 'ready'>,
74
- solution={'gRecaptchaResponse': '44795sds...'}
75
- )
76
-
77
- Returns:
78
- CaptchaResponseSer model with full server response
79
-
80
- Notes:
81
- https://docs.capsolver.com/guide/captcha/HCaptcha.html
82
- """
83
-
84
- def __init__(self, captcha_type: Union[HCaptchaTypeEnm, str], websiteURL: str, websiteKey: str, *args, **kwargs):
85
- super().__init__(*args, **kwargs)
86
-
87
- if captcha_type in HCaptchaTypeEnm.list():
88
- self.task_params = WebsiteDataOptionsSer(**locals()).dict()
89
- else:
90
- raise ValueError(
91
- f"""Invalid `captcha_type` parameter set for `{self.__class__.__name__}`,
92
- available - {HCaptchaTypeEnm.list_values()}"""
93
- )
94
-
95
- for key in kwargs:
96
- self.task_params.update({key: kwargs[key]})
97
-
98
- def captcha_handler(self) -> CaptchaResponseSer:
99
- """
100
- Sync solving method
101
-
102
- Returns:
103
- CaptchaResponseSer model with full service response
104
-
105
- Notes:
106
- Check class docstring for more info
107
- """
108
- return self._processing_captcha(create_params=self.task_params)
109
-
110
- async def aio_captcha_handler(self) -> CaptchaResponseSer:
111
- """
112
- Async method for captcha solving
113
-
114
- Returns:
115
- CaptchaResponseSer model with full service response
116
-
117
- Notes:
118
- Check class docstring for more info
119
- """
120
- return await self._aio_processing_captcha(create_params=self.task_params)
121
-
122
-
123
- class HCaptchaClassification(BaseCaptcha):
124
- """
125
- The class is used to work with Capsolver HCaptchaClassification methods.
126
-
127
- Args:
128
- api_key: Capsolver API key
129
- captcha_type: Captcha type name, like ``HCaptchaClassification`` and etc.
130
- queries: Base64 encoded image, do not include "data:image/***; base64," Assembles the picture as a list: [base64,base64,base64...]
131
- question: English is supported only. Please convert other languages by yourself
132
-
133
- Examples:
134
- >>> HCaptchaClassification(api_key="CAI-BA9XXXXXXXXXXXXX2702E010",
135
- ... captcha_type='HCaptchaClassification',
136
- ... images=["/9j/4AAQS.....", "/9j/4AAQ2.....",],
137
- ... question="Please click each image containing a chair",
138
- ... ).captcha_handler()
139
- CaptchaResponseSer(errorId=0,
140
- errorCode=None,
141
- errorDescription=None,
142
- taskId='73bdcd28-6c77-4414-8....',
143
- status=<ResponseStatusEnm.Ready: 'ready'>,
144
- solution={'gRecaptchaResponse': '44795sds...'}
145
- )
146
-
147
- Returns:
148
- CaptchaResponseSer model with full server response
149
-
150
- Notes:
151
- https://docs.capsolver.com/guide/recognition/HCaptchaClassification.html
152
- """
153
-
154
- def __init__(
155
- self,
156
- queries: List[str],
157
- question: str,
158
- captcha_type: Union[HCaptchaClassificationTypeEnm, str] = HCaptchaClassificationTypeEnm.HCaptchaClassification,
159
- *args,
160
- **kwargs,
161
- ):
162
- super().__init__(*args, **kwargs)
163
-
164
- if captcha_type in HCaptchaClassificationTypeEnm.list():
165
- self.task_params = HCaptchaClassificationOptionsSer(**locals()).dict()
166
- else:
167
- raise ValueError(
168
- f"""Invalid `captcha_type` parameter set for `{self.__class__.__name__}`,
169
- available - {HCaptchaClassificationTypeEnm.list_values()}"""
170
- )
171
-
172
- for key in kwargs:
173
- self.task_params.update({key: kwargs[key]})
174
-
175
- def captcha_handler(self) -> CaptchaResponseSer:
176
- """
177
- Sync solving method
178
-
179
- Returns:
180
- CaptchaResponseSer model with full service response
181
-
182
- Notes:
183
- Check class docstring for more info
184
- """
185
- return self._processing_captcha(create_params=self.task_params)
186
-
187
- async def aio_captcha_handler(self) -> CaptchaResponseSer:
188
- """
189
- Async method for captcha solving
190
-
191
- Returns:
192
- CaptchaResponseSer model with full service response
193
-
194
- Notes:
195
- Check class docstring for more info
196
- """
197
- return await self._aio_processing_captcha(create_params=self.task_params)
@@ -1,120 +0,0 @@
1
- from typing import Union
2
-
3
- from python3_capsolver.core.base import BaseCaptcha
4
- from python3_capsolver.core.enum import AntiImpervaTaskEnm
5
- from python3_capsolver.core.serializer import AntiImpervaTaskSer, CaptchaResponseSer
6
-
7
-
8
- class Imperva(BaseCaptcha):
9
- """
10
- The class is used to work with Capsolver Imperva method.
11
-
12
- Args:
13
- api_key: Capsolver API key
14
- captcha_type: Captcha type name, like ``AntiImpervaTask`` and etc.
15
- websiteUrl: The website url
16
- userAgent: Browser userAgent
17
-
18
- Examples:
19
- >>> Imperva(api_key="CAI-BA9XXXXXXXXXXXXX2702E010",
20
- ... captcha_type="AntiImpervaTask",
21
- ... websiteUrl="https://www.milanuncios.com/",
22
- ... userAgent="Mozilla/5.0 (Windows ....",
23
- ... proxy="socks5:98.181.137.83:4145",
24
- ... utmvc=True,
25
- ... reese84=True,
26
- ... reeseScriptUrl="https://www.milanuncios.com/librarym.js",
27
- ... ).captcha_handler()
28
- CaptchaResponseSer(errorId=0,
29
- errorCode=None,
30
- errorDescription=None,
31
- taskId='73bdcd28-6c77-4414-8....',
32
- status=<ResponseStatusEnm.Ready: 'ready'>,
33
- solution={'token': '90F9EAF...'}
34
- )
35
-
36
- >>> Imperva(api_key="CAI-BA9XXXXXXXXXXXXX2702E010",
37
- ... captcha_type=AntiImpervaTaskEnm.AntiImpervaTask,
38
- ... websiteUrl="https://www.milanuncios.com/",
39
- ... userAgent="Mozilla/5.0 (Windows ....",
40
- ... proxy="socks5:98.181.137.83:4145",
41
- ... utmvc=True,
42
- ... reese84=True,
43
- ... reeseScriptUrl="https://www.milanuncios.com/librarym.js",
44
- ... ).captcha_handler()
45
- CaptchaResponseSer(errorId=0,
46
- errorCode=None,
47
- errorDescription=None,
48
- taskId='73bdcd28-6c77-4414-8....',
49
- status=<ResponseStatusEnm.Ready: 'ready'>,
50
- solution={'token': '90F9EAF...'}
51
- )
52
-
53
- >>> await Imperva(api_key="CAI-BA9650D2B9C2786B21120D512702E010",
54
- ... captcha_type=AntiImpervaTaskEnm.AntiImpervaTask,
55
- ... websiteUrl="https://www.milanuncios.com/",
56
- ... userAgent="Mozilla/5.0 (Windows ....",
57
- ... proxy="socks5:98.181.137.83:4145",
58
- ... utmvc=True,
59
- ... reese84=True,
60
- ... reeseScriptUrl="https://www.milanuncios.com/librarym.js",
61
- ... ).aio_captcha_handler()
62
- CaptchaResponseSer(errorId=0,
63
- errorCode=None,
64
- errorDescription=None,
65
- taskId='73bdcd28-6c77-4414-8....',
66
- status=<ResponseStatusEnm.Ready: 'ready'>,
67
- solution={'token': '90F9EAF...'}
68
- )
69
-
70
- Returns:
71
- CaptchaResponseSer model with full server response
72
-
73
- Notes:
74
- https://docs.capsolver.com/guide/antibots/imperva.html
75
- """
76
-
77
- def __init__(
78
- self,
79
- captcha_type: Union[AntiImpervaTaskEnm, str],
80
- websiteUrl: str,
81
- userAgent: str,
82
- *args,
83
- **kwargs,
84
- ):
85
- super().__init__(*args, **kwargs)
86
-
87
- if captcha_type == AntiImpervaTaskEnm.AntiImpervaTask:
88
- self.task_params = AntiImpervaTaskSer(**locals()).dict()
89
- else:
90
- raise ValueError(
91
- f"""Invalid `captcha_type` parameter set for `{self.__class__.__name__}`,
92
- available - {AntiImpervaTaskEnm.list_values()}"""
93
- )
94
-
95
- for key in kwargs:
96
- self.task_params.update({key: kwargs[key]})
97
-
98
- def captcha_handler(self) -> CaptchaResponseSer:
99
- """
100
- Sync solving method
101
-
102
- Returns:
103
- CaptchaResponseSer model with full service response
104
-
105
- Notes:
106
- Check class docstring for more info
107
- """
108
- return self._processing_captcha(create_params=self.task_params)
109
-
110
- async def aio_captcha_handler(self) -> CaptchaResponseSer:
111
- """
112
- Async method for captcha solving
113
-
114
- Returns:
115
- CaptchaResponseSer model with full service response
116
-
117
- Notes:
118
- Check class docstring for more info
119
- """
120
- return await self._aio_processing_captcha(create_params=self.task_params)
@@ -1,26 +0,0 @@
1
- python3_capsolver/__init__.py,sha256=141uoiYvgRblIWZAy7AhQJz6iVqzY4b5cLxExIaKUlg,62
2
- python3_capsolver/__version__.py,sha256=e56AvHfJCtG2ZwwINqsxINVbehWdKxMYgIDbjd7P-II,22
3
- python3_capsolver/akamai.py,sha256=bV518CXWxRJ7X2By2e9-cpG1dps5JsdTjoJRNR89lD4,7988
4
- python3_capsolver/aws_waf.py,sha256=bDFHBxFaeC2R_D4zejRIySySjiOWG9Q8S3YbzGvmeWY,4538
5
- python3_capsolver/binance.py,sha256=RVKslF6FlzPNLXPKU7bcL93MP3phdJT8u131JAky_qg,4202
6
- python3_capsolver/cloudflare.py,sha256=9QBK291EP71_lGgdqt8sOCx6XqP_M7Hq2n8vTvbLtwA,4468
7
- python3_capsolver/control.py,sha256=hWVRIrY6KEivzY0VMErWjVAK_LTBnO-hGRU7T7M1D34,1958
8
- python3_capsolver/cyber_si_ara.py,sha256=i7v4zeselPj-KLQb1Y5mFybNaagl0BAQ8rEFG3YkAeg,5247
9
- python3_capsolver/datadome_slider.py,sha256=lAeOQGNJCqCusJtRSs2lQJg8xFed-RCJmi3h099A5gc,3938
10
- python3_capsolver/fun_captcha.py,sha256=fZIdMPx9sIYgE7j4D6apTWGK6KfiO2k9N0TW1OpoYnc,10707
11
- python3_capsolver/gee_test.py,sha256=KraqcQGWw53X9-DqFfJontMgro_hpSQZ6FbVDQGU4Cc,4310
12
- python3_capsolver/hcaptcha.py,sha256=FKqU4ZIVQlZq6HoE0zivDHC0_oHlj1Qsb85_8yl6sqk,7684
13
- python3_capsolver/image_to_text.py,sha256=YRzI1MS7Xk31jk00HZ6nSA7MI2cIElBM2TC1jVPThsg,6271
14
- python3_capsolver/imperva.py,sha256=FB9ed3eFI4h3G0j8yyvnJaiAk4Jl7s7BXbQNxlwxnGM,4612
15
- python3_capsolver/mt_captcha.py,sha256=f7c8ir1aZ0sGxhwshNAKmKptGKA7NNKevhZKr9xcOwQ,4948
16
- python3_capsolver/recaptcha.py,sha256=dduWmfKh-Gztw7OMnsNo7bmJYpYwuF4LBxlAdOqDHjE,6374
17
- python3_capsolver/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
- python3_capsolver/core/base.py,sha256=AkvvsTVuDZe-rtwmWZrLgBIvYS1vqwNjiGbMzLKJVmE,8722
19
- python3_capsolver/core/config.py,sha256=-iBgQwY3MDny3Pz8fZTJdkpY2nfxAChywQCy5wlYoaU,1018
20
- python3_capsolver/core/enum.py,sha256=ui3do1zarzEZ04BAQ53tVe9DnL_OPTE97vyRvt7uzI0,3803
21
- python3_capsolver/core/serializer.py,sha256=H1Vym6BFNrD4SrDplSQfPdNsVSHu4ZFtmUHekKa2g-c,5385
22
- python3_capsolver-0.9.4.dist-info/LICENSE,sha256=N_utAsqhTp1pXXp-PTE-CFMg5BfIIqTbF-phwwzOHeQ,1063
23
- python3_capsolver-0.9.4.dist-info/METADATA,sha256=7EsRqNpWV7Mu1AYjTB9gUSSzzUUxBFQNMzR9cf4Tj2w,4975
24
- python3_capsolver-0.9.4.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
25
- python3_capsolver-0.9.4.dist-info/top_level.txt,sha256=yws7CqjoBfrn2ebCkAQmEaVlZ-zhbtflqpCDwAEX4kI,18
26
- python3_capsolver-0.9.4.dist-info/RECORD,,