python3-capsolver 0.8__tar.gz → 0.9.2__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.
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/PKG-INFO +10 -2
- python3-capsolver-0.9.2/python3_capsolver/__version__.py +1 -0
- python3-capsolver-0.9.2/python3_capsolver/binance.py +112 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver/cloudflare.py +9 -15
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver/core/enum.py +10 -2
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver/core/serializer.py +22 -10
- python3-capsolver-0.9.2/python3_capsolver/imperva.py +120 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver.egg-info/PKG-INFO +10 -2
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver.egg-info/SOURCES.txt +2 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver.egg-info/requires.txt +1 -1
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/setup.py +3 -0
- python3-capsolver-0.8/python3_capsolver/__version__.py +0 -1
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver/__init__.py +0 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver/akamai.py +0 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver/aws_waf.py +0 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver/control.py +0 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver/core/__init__.py +0 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver/core/base.py +0 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver/core/config.py +0 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver/cyber_si_ara.py +0 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver/datadome_slider.py +0 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver/fun_captcha.py +0 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver/gee_test.py +0 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver/hcaptcha.py +0 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver/image_to_text.py +0 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver/mt_captcha.py +0 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver/recaptcha.py +0 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver.egg-info/dependency_links.txt +0 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver.egg-info/not-zip-safe +0 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver.egg-info/top_level.txt +0 -0
- {python3-capsolver-0.8 → python3-capsolver-0.9.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python3-capsolver
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.2
|
|
4
4
|
Summary: Python 3.8+ Capsolver library with AIO module.
|
|
5
5
|
Home-page: https://andreidrang.github.io/python3-capsolver/
|
|
6
6
|
Author: AndreiDrang
|
|
@@ -26,6 +26,9 @@ Keywords: captcha
|
|
|
26
26
|
cloudflare
|
|
27
27
|
amazon
|
|
28
28
|
amazon_waf
|
|
29
|
+
akamai
|
|
30
|
+
imperva
|
|
31
|
+
binance
|
|
29
32
|
Classifier: License :: OSI Approved :: MIT License
|
|
30
33
|
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
|
|
31
34
|
Classifier: Development Status :: 5 - Production/Stable
|
|
@@ -45,7 +48,8 @@ Description-Content-Type: text/markdown
|
|
|
45
48
|
|
|
46
49
|
|
|
47
50
|
# python3-capsolver
|
|
48
|
-
|
|
51
|
+
|
|
52
|
+

|
|
49
53
|
|
|
50
54
|
<a href="https://dashboard.capsolver.com/passport/register?inviteCode=kQTn-tG07Jb1">
|
|
51
55
|
<img src="https://cdn.discordapp.com/attachments/1105172394655625306/1105180101802471575/20221207-160749.gif" alt="Capsolver's Banner">
|
|
@@ -83,6 +87,10 @@ Or email python-captcha@pm.me
|
|
|
83
87
|
|
|
84
88
|
***
|
|
85
89
|
|
|
90
|
+
You can check our other projects here - [RedPandaDev group](https://red-panda-dev.xyz/blog/). For example - [Torrents Tracker bot](https://t.me/torrents_tracker_bot) for Telegram.
|
|
91
|
+
|
|
92
|
+
***
|
|
93
|
+
|
|
86
94
|
## How to install?
|
|
87
95
|
|
|
88
96
|
We recommend using the latest version of Python. `python3-capsolver` supports Python 3.7+.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.9.2"
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
from typing import Union
|
|
2
|
+
|
|
3
|
+
from python3_capsolver.core.base import BaseCaptcha
|
|
4
|
+
from python3_capsolver.core.enum import BinanceCaptchaTaskEnm
|
|
5
|
+
from python3_capsolver.core.serializer import CaptchaResponseSer, BinanceCaptchaTaskSer
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Binance(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
|
+
>>> Binance(api_key="CAI-BA9XXXXXXXXXXXXX2702E010",
|
|
20
|
+
... captcha_type="BinanceCaptchaTask",
|
|
21
|
+
... websiteURL="https://www.milanuncios.com/",
|
|
22
|
+
... websiteKey="login",
|
|
23
|
+
... validateId="3621a4fef82f4ab4a00e8b07465761c5",
|
|
24
|
+
... ).captcha_handler()
|
|
25
|
+
CaptchaResponseSer(errorId=0,
|
|
26
|
+
errorCode=None,
|
|
27
|
+
errorDescription=None,
|
|
28
|
+
taskId='73bdcd28-6c77-4414-8....',
|
|
29
|
+
status=<ResponseStatusEnm.Ready: 'ready'>,
|
|
30
|
+
solution={'token': '90F9EAF...'}
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
>>> Binance(api_key="CAI-BA9XXXXXXXXXXXXX2702E010",
|
|
34
|
+
... captcha_type=BinanceCaptchaTaskEnm.BinanceCaptchaTask,
|
|
35
|
+
... websiteURL="https://www.milanuncios.com/",
|
|
36
|
+
... websiteKey="login",
|
|
37
|
+
... validateId="3621a4fef82f4ab4a00e8b07465761c5",
|
|
38
|
+
... ).captcha_handler()
|
|
39
|
+
CaptchaResponseSer(errorId=0,
|
|
40
|
+
errorCode=None,
|
|
41
|
+
errorDescription=None,
|
|
42
|
+
taskId='73bdcd28-6c77-4414-8....',
|
|
43
|
+
status=<ResponseStatusEnm.Ready: 'ready'>,
|
|
44
|
+
solution={'token': '90F9EAF...'}
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
>>> await Binance(api_key="CAI-BA9650D2B9C2786B21120D512702E010",
|
|
48
|
+
... captcha_type=BinanceCaptchaTaskEnm.BinanceCaptchaTask,
|
|
49
|
+
... websiteURL="https://www.milanuncios.com/",
|
|
50
|
+
... websiteKey="login",
|
|
51
|
+
... validateId="3621a4fef82f4ab4a00e8b07465761c5",
|
|
52
|
+
... ).aio_captcha_handler()
|
|
53
|
+
CaptchaResponseSer(errorId=0,
|
|
54
|
+
errorCode=None,
|
|
55
|
+
errorDescription=None,
|
|
56
|
+
taskId='73bdcd28-6c77-4414-8....',
|
|
57
|
+
status=<ResponseStatusEnm.Ready: 'ready'>,
|
|
58
|
+
solution={'token': '90F9EAF...'}
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
Returns:
|
|
62
|
+
CaptchaResponseSer model with full server response
|
|
63
|
+
|
|
64
|
+
Notes:
|
|
65
|
+
https://docs.capsolver.com/guide/captcha/BnCaptcha.html
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
def __init__(
|
|
69
|
+
self,
|
|
70
|
+
captcha_type: Union[BinanceCaptchaTaskEnm, str],
|
|
71
|
+
websiteURL: str,
|
|
72
|
+
validateId: str,
|
|
73
|
+
websiteKey: str = "login",
|
|
74
|
+
*args,
|
|
75
|
+
**kwargs,
|
|
76
|
+
):
|
|
77
|
+
super().__init__(*args, **kwargs)
|
|
78
|
+
|
|
79
|
+
if captcha_type == BinanceCaptchaTaskEnm.BinanceCaptchaTask:
|
|
80
|
+
self.task_params = BinanceCaptchaTaskSer(**locals()).dict()
|
|
81
|
+
else:
|
|
82
|
+
raise ValueError(
|
|
83
|
+
f"""Invalid `captcha_type` parameter set for `{self.__class__.__name__}`,
|
|
84
|
+
available - {BinanceCaptchaTaskEnm.list_values()}"""
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
for key in kwargs:
|
|
88
|
+
self.task_params.update({key: kwargs[key]})
|
|
89
|
+
|
|
90
|
+
def captcha_handler(self) -> CaptchaResponseSer:
|
|
91
|
+
"""
|
|
92
|
+
Sync solving method
|
|
93
|
+
|
|
94
|
+
Returns:
|
|
95
|
+
CaptchaResponseSer model with full service response
|
|
96
|
+
|
|
97
|
+
Notes:
|
|
98
|
+
Check class docstring for more info
|
|
99
|
+
"""
|
|
100
|
+
return self._processing_captcha(create_params=self.task_params)
|
|
101
|
+
|
|
102
|
+
async def aio_captcha_handler(self) -> CaptchaResponseSer:
|
|
103
|
+
"""
|
|
104
|
+
Async method for captcha solving
|
|
105
|
+
|
|
106
|
+
Returns:
|
|
107
|
+
CaptchaResponseSer model with full service response
|
|
108
|
+
|
|
109
|
+
Notes:
|
|
110
|
+
Check class docstring for more info
|
|
111
|
+
"""
|
|
112
|
+
return await self._aio_processing_captcha(create_params=self.task_params)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import
|
|
1
|
+
from typing import Union, Optional
|
|
2
2
|
|
|
3
3
|
from python3_capsolver.core.base import BaseCaptcha
|
|
4
4
|
from python3_capsolver.core.enum import CloudflareTypeEnm
|
|
@@ -22,46 +22,42 @@ class Cloudflare(BaseCaptcha):
|
|
|
22
22
|
>>> Cloudflare(api_key="CAI-1324...",
|
|
23
23
|
... captcha_type=CloudflareTypeEnm.AntiCloudflareTask,
|
|
24
24
|
... websiteURL="https://bck.websiteurl.com/registry",
|
|
25
|
-
... websiteKey='
|
|
26
|
-
... proxy="socks5:158.120.100.23:334:user:pass"
|
|
27
|
-
... metadata={'type': 'turnstile', 'acton':'login', 'cdata': '0000-1111-2222-3333-example-cdata'}
|
|
25
|
+
... websiteKey='0x4AAAAAAABS7vwvV6VFfMcD',
|
|
26
|
+
... proxy="socks5:158.120.100.23:334:user:pass"
|
|
28
27
|
... ).captcha_handler()
|
|
29
28
|
CaptchaResponseSer(errorId=0,
|
|
30
29
|
errorCode=None,
|
|
31
30
|
errorDescription=None,
|
|
32
31
|
taskId='73bdcd28-6c77-4414-8....',
|
|
33
32
|
status=<ResponseStatusEnm.Ready: 'ready'>,
|
|
34
|
-
solution={'
|
|
33
|
+
solution={'token': '44795sds...'}
|
|
35
34
|
)
|
|
36
35
|
|
|
37
36
|
>>> Cloudflare(api_key="CAI-1324...",
|
|
38
37
|
... captcha_type=CloudflareTypeEnm.AntiCloudflareTask,
|
|
39
38
|
... websiteURL="https://bck.websiteurl.com/registry",
|
|
40
|
-
... proxy="socks5:158.120.100.23:334:user:pass"
|
|
41
|
-
... metadata={'type': 'challenge'}
|
|
42
|
-
... html="<your challenge html source code>",
|
|
39
|
+
... proxy="socks5:158.120.100.23:334:user:pass"
|
|
43
40
|
... ).captcha_handler()
|
|
44
41
|
CaptchaResponseSer(errorId=0,
|
|
45
42
|
errorCode=None,
|
|
46
43
|
errorDescription=None,
|
|
47
44
|
taskId='73bdcd28-6c77-4414-8....',
|
|
48
45
|
status=<ResponseStatusEnm.Ready: 'ready'>,
|
|
49
|
-
solution={'
|
|
46
|
+
solution={'token': '44795sds...'}
|
|
50
47
|
)
|
|
51
48
|
|
|
52
49
|
>>> await Cloudflare(api_key="CAI-1324...",
|
|
53
50
|
... captcha_type=CloudflareTypeEnm.AntiCloudflareTask,
|
|
54
51
|
... websiteURL="https://bck.websiteurl.com/registry",
|
|
55
|
-
... websiteKey='
|
|
56
|
-
... proxy="socks5:158.120.100.23:334:user:pass"
|
|
57
|
-
... metadata={'type': 'challenge', 'acton':'login', 'cdata': '0000-1111-2222-3333-example-cdata'}
|
|
52
|
+
... websiteKey='0x4AAAAAAABS7vwvV6VFfMcD',
|
|
53
|
+
... proxy="socks5:158.120.100.23:334:user:pass"
|
|
58
54
|
... ).aio_captcha_handler()
|
|
59
55
|
CaptchaResponseSer(errorId=0,
|
|
60
56
|
errorCode=None,
|
|
61
57
|
errorDescription=None,
|
|
62
58
|
taskId='73bdcd28-6c77-4414-8....',
|
|
63
59
|
status=<ResponseStatusEnm.Ready: 'ready'>,
|
|
64
|
-
solution={'
|
|
60
|
+
solution={'token': '44795sds...'}
|
|
65
61
|
)
|
|
66
62
|
|
|
67
63
|
Returns:
|
|
@@ -76,9 +72,7 @@ class Cloudflare(BaseCaptcha):
|
|
|
76
72
|
self,
|
|
77
73
|
captcha_type: Union[CloudflareTypeEnm, str],
|
|
78
74
|
websiteURL: str,
|
|
79
|
-
metadata: Dict[str, str],
|
|
80
75
|
websiteKey: Optional[str] = None,
|
|
81
|
-
html: Optional[str] = None,
|
|
82
76
|
*args,
|
|
83
77
|
**kwargs,
|
|
84
78
|
):
|
|
@@ -39,8 +39,8 @@ class EndpointPostfixEnm(str, MyEnum):
|
|
|
39
39
|
GET_BALANCE = "getBalance"
|
|
40
40
|
CREATE_TASK = "createTask"
|
|
41
41
|
GET_TASK_RESULT = "getTaskResult"
|
|
42
|
-
AKAMAI_BMP_INVOKE = "
|
|
43
|
-
AKAMAI_WEB_INVOKE = "
|
|
42
|
+
AKAMAI_BMP_INVOKE = "akamaibmp/invoke"
|
|
43
|
+
AKAMAI_WEB_INVOKE = "akamaiweb/invoke"
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
class ImageToTextTaskTypeEnm(str, MyEnum):
|
|
@@ -117,6 +117,14 @@ class AntiAkamaiTaskEnm(str, MyEnum):
|
|
|
117
117
|
AntiAkamaiWebTask = "AntiAkamaiWebTask"
|
|
118
118
|
|
|
119
119
|
|
|
120
|
+
class AntiImpervaTaskEnm(str, MyEnum):
|
|
121
|
+
AntiImpervaTask = "AntiImpervaTask"
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
class BinanceCaptchaTaskEnm(str, MyEnum):
|
|
125
|
+
BinanceCaptchaTask = "BinanceCaptchaTask"
|
|
126
|
+
|
|
127
|
+
|
|
120
128
|
class ResponseStatusEnm(str, MyEnum):
|
|
121
129
|
"""
|
|
122
130
|
Enum store results `status` field variants
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Any, Dict, List, Optional
|
|
1
|
+
from typing import Any, Dict, List, Literal, Optional
|
|
2
2
|
|
|
3
3
|
from pydantic import Field, BaseModel, conint
|
|
4
4
|
|
|
@@ -20,7 +20,7 @@ class TaskSer(BaseModel):
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class RequestCreateTaskSer(PostRequestSer):
|
|
23
|
-
appId:
|
|
23
|
+
appId: Literal[APP_ID] = APP_ID
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class RequestGetTaskResultSer(PostRequestSer):
|
|
@@ -80,14 +80,14 @@ class ReCaptchaV3Ser(WebsiteDataOptionsSer):
|
|
|
80
80
|
)
|
|
81
81
|
|
|
82
82
|
|
|
83
|
-
class HCaptchaClassificationOptionsSer(
|
|
83
|
+
class HCaptchaClassificationOptionsSer(TaskSer):
|
|
84
84
|
queries: List[str] = Field(..., description="Base64-encoded images, do not include 'data:image/***;base64,'")
|
|
85
85
|
question: str = Field(
|
|
86
86
|
..., description="Question ID. Support English and Chinese, other languages please convert yourself"
|
|
87
87
|
)
|
|
88
88
|
|
|
89
89
|
|
|
90
|
-
class FunCaptchaClassificationOptionsSer(
|
|
90
|
+
class FunCaptchaClassificationOptionsSer(TaskSer):
|
|
91
91
|
images: List[str] = Field(..., description="Base64-encoded images, do not include 'data:image/***;base64,'")
|
|
92
92
|
question: str = Field(
|
|
93
93
|
...,
|
|
@@ -121,10 +121,7 @@ class DatadomeSliderSer(TaskSer):
|
|
|
121
121
|
|
|
122
122
|
|
|
123
123
|
class CloudflareTurnstileSer(WebsiteDataOptionsSer):
|
|
124
|
-
|
|
125
|
-
html: Optional[str] = Field(
|
|
126
|
-
None, description="You can pass in the entire html source code for the challenge directly."
|
|
127
|
-
)
|
|
124
|
+
...
|
|
128
125
|
|
|
129
126
|
|
|
130
127
|
class CyberSiAraSer(WebsiteDataOptionsSer):
|
|
@@ -134,11 +131,26 @@ class CyberSiAraSer(WebsiteDataOptionsSer):
|
|
|
134
131
|
UserAgent: str = Field(..., description="Browser userAgent, you need submit your userAgent")
|
|
135
132
|
|
|
136
133
|
|
|
137
|
-
class AntiAkamaiBMPTaskSer(
|
|
134
|
+
class AntiAkamaiBMPTaskSer(TaskSer):
|
|
138
135
|
packageName: str = Field("de.zalando.iphone", description="Package name of AkamaiBMP mobile APP")
|
|
139
136
|
version: str = Field("3.2.6", description="AKAMAI BMP Version number")
|
|
140
137
|
country: str = Field("US", description="AKAMAI BMP country")
|
|
141
138
|
|
|
142
139
|
|
|
143
|
-
class AntiAkamaiWebTaskSer(
|
|
140
|
+
class AntiAkamaiWebTaskSer(TaskSer):
|
|
144
141
|
url: str = Field(..., description="Browser url address")
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
class AntiImpervaTaskSer(TaskSer):
|
|
145
|
+
websiteUrl: str = Field(..., description="The website url")
|
|
146
|
+
userAgent: str = Field(..., description="Browser userAgent")
|
|
147
|
+
utmvc: bool = Field(
|
|
148
|
+
True, description="If cookie contains `incap_see_xxx`, `nlbi_xxx`, `visid_inap_xxx`, mean is true"
|
|
149
|
+
)
|
|
150
|
+
reese84: bool = Field(True, description="if cookie conains `reese84`, set it true")
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
class BinanceCaptchaTaskSer(TaskSer):
|
|
154
|
+
websiteURL: str = Field(..., description="Address of a webpage with Binance captcha")
|
|
155
|
+
websiteKey: str = Field("login", description="`bizId` always be `login`")
|
|
156
|
+
validateId: str = Field(..., description="`validateId` bncaptcha validateId field")
|
|
@@ -0,0 +1,120 @@
|
|
|
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,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python3-capsolver
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.2
|
|
4
4
|
Summary: Python 3.8+ Capsolver library with AIO module.
|
|
5
5
|
Home-page: https://andreidrang.github.io/python3-capsolver/
|
|
6
6
|
Author: AndreiDrang
|
|
@@ -26,6 +26,9 @@ Keywords: captcha
|
|
|
26
26
|
cloudflare
|
|
27
27
|
amazon
|
|
28
28
|
amazon_waf
|
|
29
|
+
akamai
|
|
30
|
+
imperva
|
|
31
|
+
binance
|
|
29
32
|
Classifier: License :: OSI Approved :: MIT License
|
|
30
33
|
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
|
|
31
34
|
Classifier: Development Status :: 5 - Production/Stable
|
|
@@ -45,7 +48,8 @@ Description-Content-Type: text/markdown
|
|
|
45
48
|
|
|
46
49
|
|
|
47
50
|
# python3-capsolver
|
|
48
|
-
|
|
51
|
+
|
|
52
|
+

|
|
49
53
|
|
|
50
54
|
<a href="https://dashboard.capsolver.com/passport/register?inviteCode=kQTn-tG07Jb1">
|
|
51
55
|
<img src="https://cdn.discordapp.com/attachments/1105172394655625306/1105180101802471575/20221207-160749.gif" alt="Capsolver's Banner">
|
|
@@ -83,6 +87,10 @@ Or email python-captcha@pm.me
|
|
|
83
87
|
|
|
84
88
|
***
|
|
85
89
|
|
|
90
|
+
You can check our other projects here - [RedPandaDev group](https://red-panda-dev.xyz/blog/). For example - [Torrents Tracker bot](https://t.me/torrents_tracker_bot) for Telegram.
|
|
91
|
+
|
|
92
|
+
***
|
|
93
|
+
|
|
86
94
|
## How to install?
|
|
87
95
|
|
|
88
96
|
We recommend using the latest version of Python. `python3-capsolver` supports Python 3.7+.
|
|
@@ -3,6 +3,7 @@ python3_capsolver/__init__.py
|
|
|
3
3
|
python3_capsolver/__version__.py
|
|
4
4
|
python3_capsolver/akamai.py
|
|
5
5
|
python3_capsolver/aws_waf.py
|
|
6
|
+
python3_capsolver/binance.py
|
|
6
7
|
python3_capsolver/cloudflare.py
|
|
7
8
|
python3_capsolver/control.py
|
|
8
9
|
python3_capsolver/cyber_si_ara.py
|
|
@@ -11,6 +12,7 @@ python3_capsolver/fun_captcha.py
|
|
|
11
12
|
python3_capsolver/gee_test.py
|
|
12
13
|
python3_capsolver/hcaptcha.py
|
|
13
14
|
python3_capsolver/image_to_text.py
|
|
15
|
+
python3_capsolver/imperva.py
|
|
14
16
|
python3_capsolver/mt_captcha.py
|
|
15
17
|
python3_capsolver/recaptcha.py
|
|
16
18
|
python3_capsolver.egg-info/PKG-INFO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.8"
|
|
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
|
{python3-capsolver-0.8 → python3-capsolver-0.9.2}/python3_capsolver.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|