python3-capsolver 0.9.1__tar.gz → 1.0.0a0__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 (65) hide show
  1. python3_capsolver-1.0.0a0/LICENSE +21 -0
  2. python3_capsolver-1.0.0a0/MANIFEST.in +1 -0
  3. {python3-capsolver-0.9.1 → python3_capsolver-1.0.0a0}/PKG-INFO +26 -47
  4. python3_capsolver-1.0.0a0/README.md +60 -0
  5. python3_capsolver-1.0.0a0/pyproject.toml +105 -0
  6. python3_capsolver-1.0.0a0/src/python3_capsolver/__init__.py +1 -0
  7. python3_capsolver-1.0.0a0/src/python3_capsolver/__version__.py +1 -0
  8. python3_capsolver-1.0.0a0/src/python3_capsolver/aws_waf.py +138 -0
  9. python3_capsolver-1.0.0a0/src/python3_capsolver/cloudflare.py +95 -0
  10. python3_capsolver-1.0.0a0/src/python3_capsolver/control.py +68 -0
  11. python3_capsolver-1.0.0a0/src/python3_capsolver/core/aio_captcha_instrument.py +109 -0
  12. python3_capsolver-1.0.0a0/src/python3_capsolver/core/base.py +81 -0
  13. python3_capsolver-1.0.0a0/src/python3_capsolver/core/captcha_instrument.py +145 -0
  14. python3_capsolver-1.0.0a0/src/python3_capsolver/core/const.py +27 -0
  15. python3_capsolver-1.0.0a0/src/python3_capsolver/core/context_instr.py +25 -0
  16. python3_capsolver-1.0.0a0/src/python3_capsolver/core/enum.py +84 -0
  17. python3_capsolver-1.0.0a0/src/python3_capsolver/core/serializer.py +62 -0
  18. python3_capsolver-1.0.0a0/src/python3_capsolver/core/sio_captcha_instrument.py +116 -0
  19. python3-capsolver-0.9.1/python3_capsolver/core/config.py → python3_capsolver-1.0.0a0/src/python3_capsolver/core/utils.py +1 -10
  20. python3_capsolver-1.0.0a0/src/python3_capsolver/datadome_slider.py +53 -0
  21. python3_capsolver-1.0.0a0/src/python3_capsolver/friendly_captcha.py +69 -0
  22. python3_capsolver-1.0.0a0/src/python3_capsolver/gee_test.py +76 -0
  23. python3_capsolver-1.0.0a0/src/python3_capsolver/image_to_text.py +121 -0
  24. python3_capsolver-1.0.0a0/src/python3_capsolver/mt_captcha.py +47 -0
  25. python3_capsolver-1.0.0a0/src/python3_capsolver/recaptcha.py +81 -0
  26. python3_capsolver-1.0.0a0/src/python3_capsolver/vision_engine.py +102 -0
  27. python3_capsolver-1.0.0a0/src/python3_capsolver/yandex.py +53 -0
  28. {python3-capsolver-0.9.1 → python3_capsolver-1.0.0a0/src}/python3_capsolver.egg-info/PKG-INFO +26 -47
  29. python3_capsolver-1.0.0a0/src/python3_capsolver.egg-info/SOURCES.txt +40 -0
  30. python3_capsolver-1.0.0a0/src/python3_capsolver.egg-info/requires.txt +4 -0
  31. python3_capsolver-1.0.0a0/tests/test_aws_waf.py +37 -0
  32. python3_capsolver-1.0.0a0/tests/test_control.py +38 -0
  33. python3_capsolver-1.0.0a0/tests/test_core.py +117 -0
  34. python3_capsolver-1.0.0a0/tests/test_gee_test.py +27 -0
  35. python3_capsolver-1.0.0a0/tests/test_image_to_text.py +58 -0
  36. python3_capsolver-1.0.0a0/tests/test_instrument.py +57 -0
  37. python3_capsolver-1.0.0a0/tests/test_mt_captcha.py +33 -0
  38. python3_capsolver-1.0.0a0/tests/test_recaptcha.py +43 -0
  39. python3-capsolver-0.9.1/python3_capsolver/__version__.py +0 -1
  40. python3-capsolver-0.9.1/python3_capsolver/akamai.py +0 -192
  41. python3-capsolver-0.9.1/python3_capsolver/aws_waf.py +0 -111
  42. python3-capsolver-0.9.1/python3_capsolver/binance.py +0 -112
  43. python3-capsolver-0.9.1/python3_capsolver/cloudflare.py +0 -114
  44. python3-capsolver-0.9.1/python3_capsolver/control.py +0 -66
  45. python3-capsolver-0.9.1/python3_capsolver/core/__init__.py +0 -0
  46. python3-capsolver-0.9.1/python3_capsolver/core/base.py +0 -227
  47. python3-capsolver-0.9.1/python3_capsolver/core/enum.py +0 -139
  48. python3-capsolver-0.9.1/python3_capsolver/core/serializer.py +0 -156
  49. python3-capsolver-0.9.1/python3_capsolver/cyber_si_ara.py +0 -128
  50. python3-capsolver-0.9.1/python3_capsolver/datadome_slider.py +0 -103
  51. python3-capsolver-0.9.1/python3_capsolver/fun_captcha.py +0 -251
  52. python3-capsolver-0.9.1/python3_capsolver/gee_test.py +0 -108
  53. python3-capsolver-0.9.1/python3_capsolver/hcaptcha.py +0 -197
  54. python3-capsolver-0.9.1/python3_capsolver/image_to_text.py +0 -151
  55. python3-capsolver-0.9.1/python3_capsolver/imperva.py +0 -120
  56. python3-capsolver-0.9.1/python3_capsolver/mt_captcha.py +0 -123
  57. python3-capsolver-0.9.1/python3_capsolver/recaptcha.py +0 -145
  58. python3-capsolver-0.9.1/python3_capsolver.egg-info/SOURCES.txt +0 -28
  59. python3-capsolver-0.9.1/python3_capsolver.egg-info/not-zip-safe +0 -1
  60. python3-capsolver-0.9.1/python3_capsolver.egg-info/requires.txt +0 -4
  61. python3-capsolver-0.9.1/setup.py +0 -141
  62. {python3-capsolver-0.9.1 → python3_capsolver-1.0.0a0}/setup.cfg +0 -0
  63. {python3-capsolver-0.9.1/python3_capsolver → python3_capsolver-1.0.0a0/src/python3_capsolver/core}/__init__.py +0 -0
  64. {python3-capsolver-0.9.1 → python3_capsolver-1.0.0a0/src}/python3_capsolver.egg-info/dependency_links.txt +0 -0
  65. {python3-capsolver-0.9.1 → python3_capsolver-1.0.0a0/src}/python3_capsolver.egg-info/top_level.txt +0 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Andrei
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ include README.md LICENSE
@@ -1,34 +1,15 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: python3-capsolver
3
- Version: 0.9.1
3
+ Version: 1.0.0a0
4
4
  Summary: Python 3.8+ Capsolver library with AIO module.
5
- Home-page: https://andreidrang.github.io/python3-capsolver/
6
- Author: AndreiDrang
7
- Author-email: python-captcha@pm.me
8
- License: MIT
5
+ Author-email: AndreiDrang <python-captcha@pm.me>
6
+ License: MIT License
7
+ Project-URL: Homepage, https://andreidrang.github.io/python3-capsolver/
9
8
  Project-URL: Documentation, https://andreidrang.github.io/python3-capsolver/
10
- Project-URL: Source, https://github.com/AndreiDrang/python3-capsolver
11
- Keywords: captcha
12
- recaptcha
13
- geetest
14
- hcaptcha
15
- capypuzzle
16
- rotatecaptcha
17
- funcaptcha
18
- keycaptcha
19
- python3
20
- python-library
21
- capsolver
22
- datadomeslider
23
- datadome
24
- mtcaptcha
25
- turnstile
26
- cloudflare
27
- amazon
28
- amazon_waf
29
- akamai
30
- imperva
31
- binance
9
+ Project-URL: Repository, https://github.com/AndreiDrang/python3-capsolver
10
+ Project-URL: Issues, https://github.com/AndreiDrang/python3-capsolver/issues
11
+ Project-URL: Changelog, https://github.com/AndreiDrang/python3-capsolver/releases
12
+ Keywords: captcha,recaptcha,geetest,hcaptcha,capypuzzle,rotatecaptcha,funcaptcha,keycaptcha,python3,python-library,capsolver,datadomeslider,datadome,mtcaptcha,turnstile,cloudflare,amazon,amazon_waf,akamai,imperva,binance
32
13
  Classifier: License :: OSI Approved :: MIT License
33
14
  Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
34
15
  Classifier: Development Status :: 5 - Production/Stable
@@ -39,29 +20,30 @@ Classifier: Programming Language :: Python :: 3.8
39
20
  Classifier: Programming Language :: Python :: 3.9
40
21
  Classifier: Programming Language :: Python :: 3.10
41
22
  Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
42
24
  Classifier: Framework :: AsyncIO
43
25
  Classifier: Operating System :: Unix
44
26
  Classifier: Operating System :: Microsoft :: Windows
45
27
  Classifier: Operating System :: MacOS
46
- Requires-Python: >=3.8.0
28
+ Requires-Python: >=3.8
47
29
  Description-Content-Type: text/markdown
48
-
30
+ License-File: LICENSE
31
+ Requires-Dist: requests>=2.21.0
32
+ Requires-Dist: aiohttp>=3.9.2
33
+ Requires-Dist: msgspec<0.20,>=0.18
34
+ Requires-Dist: tenacity<10,>=8
49
35
 
50
36
  # python3-capsolver
51
- ![Python3-Capsolver](https://github.com/AndreiDrang/python3-capsolver/blob/main/files/CapsolverSm.png)
52
37
 
53
- <a href="https://dashboard.capsolver.com/passport/register?inviteCode=kQTn-tG07Jb1">
54
- <img src="https://cdn.discordapp.com/attachments/1105172394655625306/1105180101802471575/20221207-160749.gif" alt="Capsolver's Banner">
55
- </a>
56
- <br>
57
- At the lowest price on the market, you may receive a variety of solutions, including reCAPTCHA V2, reCAPTCHA V3, hCaptcha, hCaptcha Click, FunCaptcha, picture-to-text, and more. With this service, 0.1s is the slowest speed ever measured.
38
+ [![Capsolver.png](https://s.vyjava.xyz/files/2024/12-December/17/109278aa/Capsolver.png)](https://vyjava.xyz/dashboard/image/109278aa-961a-4503-bed0-0a9c838dcef2)
39
+
58
40
  <hr>
59
41
 
60
42
  [![PyPI version](https://badge.fury.io/py/python3-capsolver.svg)](https://badge.fury.io/py/python3-capsolver)
61
43
  [![Python versions](https://img.shields.io/pypi/pyversions/python3-capsolver.svg?logo=python&logoColor=FBE072)](https://badge.fury.io/py/python3-capsolver)
62
44
  [![Downloads](https://static.pepy.tech/badge/python3-capsolver/month)](https://pepy.tech/project/python3-capsolver)
45
+ [![Static Badge](https://img.shields.io/badge/docs-Sphinx-green?label=Documentation&labelColor=gray)](https://andreidrang.github.io/python3-capsolver/)
63
46
 
64
- [![Maintainability](https://api.codeclimate.com/v1/badges/3c30167b5fb37a0775ea/maintainability)](https://codeclimate.com/github/AndreiDrang/python3-capsolver/maintainability)
65
47
  [![Codacy Badge](https://app.codacy.com/project/badge/Grade/323d4eda0fe1477bbea8fe8902b9e97e)](https://www.codacy.com/gh/AndreiDrang/python3-capsolver/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=AndreiDrang/python3-capsolver&amp;utm_campaign=Badge_Grade)
66
48
  [![codecov](https://codecov.io/gh/AndreiDrang/python3-capsolver/branch/main/graph/badge.svg?token=2L4VVIF4G8)](https://codecov.io/gh/AndreiDrang/python3-capsolver)
67
49
 
@@ -73,19 +55,10 @@ At the lowest price on the market, you may receive a variety of solutions, inclu
73
55
 
74
56
 
75
57
  Python 3 library for [Capsolver](https://dashboard.capsolver.com/passport/register?inviteCode=kQTn-tG07Jb1) service API.
76
-
77
58
  Tested on UNIX based OS.
78
59
 
79
60
  The library is intended for software developers and is used to work with the [Capsolver](https://dashboard.capsolver.com/passport/register?inviteCode=kQTn-tG07Jb1) service API.
80
61
 
81
- ***
82
-
83
- If you have any questions, please send a message to the [Telegram](https://t.me/pythoncaptcha) chat room.
84
-
85
- Or email python-captcha@pm.me
86
-
87
- ***
88
-
89
62
  ## How to install?
90
63
 
91
64
  We recommend using the latest version of Python. `python3-capsolver` supports Python 3.7+.
@@ -113,4 +86,10 @@ Check [releases page](https://github.com/AndreiDrang/python3-capsolver/releases)
113
86
 
114
87
  ### How to get API Key to work with the library
115
88
  1. On the page - https://dashboard.capsolver.com/overview/user-center
116
- 2. Find it: ![img.png](files/img.png)
89
+ 2. Find it: [![img.png](https://s.vyjava.xyz/files/2024/12-December/17/ae8d4fbf/img.png)](https://vyjava.xyz/dashboard/image/ae8d4fbf-7451-441d-8984-79b1a7adbe27)
90
+
91
+ ### Contacts
92
+
93
+ If you have any questions, please send a message to the [Telegram](https://t.me/pythoncaptcha) chat room.
94
+
95
+ Or email python-captcha@pm.me
@@ -0,0 +1,60 @@
1
+ # python3-capsolver
2
+
3
+ [![Capsolver.png](https://s.vyjava.xyz/files/2024/12-December/17/109278aa/Capsolver.png)](https://vyjava.xyz/dashboard/image/109278aa-961a-4503-bed0-0a9c838dcef2)
4
+
5
+ <hr>
6
+
7
+ [![PyPI version](https://badge.fury.io/py/python3-capsolver.svg)](https://badge.fury.io/py/python3-capsolver)
8
+ [![Python versions](https://img.shields.io/pypi/pyversions/python3-capsolver.svg?logo=python&logoColor=FBE072)](https://badge.fury.io/py/python3-capsolver)
9
+ [![Downloads](https://static.pepy.tech/badge/python3-capsolver/month)](https://pepy.tech/project/python3-capsolver)
10
+ [![Static Badge](https://img.shields.io/badge/docs-Sphinx-green?label=Documentation&labelColor=gray)](https://andreidrang.github.io/python3-capsolver/)
11
+
12
+ [![Codacy Badge](https://app.codacy.com/project/badge/Grade/323d4eda0fe1477bbea8fe8902b9e97e)](https://www.codacy.com/gh/AndreiDrang/python3-capsolver/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=AndreiDrang/python3-capsolver&amp;utm_campaign=Badge_Grade)
13
+ [![codecov](https://codecov.io/gh/AndreiDrang/python3-capsolver/branch/main/graph/badge.svg?token=2L4VVIF4G8)](https://codecov.io/gh/AndreiDrang/python3-capsolver)
14
+
15
+ [![Sphinx build](https://github.com/AndreiDrang/python3-capsolver/actions/workflows/sphinx.yml/badge.svg?branch=release)](https://github.com/AndreiDrang/python3-capsolver/actions/workflows/sphinx.yml)
16
+ [![Build](https://github.com/AndreiDrang/python3-capsolver/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/AndreiDrang/python3-capsolver/actions/workflows/build.yml)
17
+ [![Installation](https://github.com/AndreiDrang/python3-capsolver/actions/workflows/install.yml/badge.svg?branch=main)](https://github.com/AndreiDrang/python3-capsolver/actions/workflows/install.yml)
18
+ [![Tests](https://github.com/AndreiDrang/python3-capsolver/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/AndreiDrang/python3-capsolver/actions/workflows/test.yml)
19
+ [![Lint](https://github.com/AndreiDrang/python3-capsolver/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/AndreiDrang/python3-capsolver/actions/workflows/lint.yml)
20
+
21
+
22
+ Python 3 library for [Capsolver](https://dashboard.capsolver.com/passport/register?inviteCode=kQTn-tG07Jb1) service API.
23
+ Tested on UNIX based OS.
24
+
25
+ The library is intended for software developers and is used to work with the [Capsolver](https://dashboard.capsolver.com/passport/register?inviteCode=kQTn-tG07Jb1) service API.
26
+
27
+ ## How to install?
28
+
29
+ We recommend using the latest version of Python. `python3-capsolver` supports Python 3.7+.
30
+
31
+ ### pip
32
+
33
+ ```bash
34
+ pip install python3-capsolver
35
+ ```
36
+
37
+ ## How to use?
38
+
39
+ Is described in the [documentation-website](https://andreidrang.github.io/python3-capsolver/).
40
+
41
+
42
+ ## How to test?
43
+
44
+ 1. You need set ``API_KEY`` in your environment(get this value from you account).
45
+ 2. Run command ``make tests``, from root directory.
46
+
47
+
48
+ ### Changelog
49
+
50
+ Check [releases page](https://github.com/AndreiDrang/python3-capsolver/releases).
51
+
52
+ ### How to get API Key to work with the library
53
+ 1. On the page - https://dashboard.capsolver.com/overview/user-center
54
+ 2. Find it: [![img.png](https://s.vyjava.xyz/files/2024/12-December/17/ae8d4fbf/img.png)](https://vyjava.xyz/dashboard/image/ae8d4fbf-7451-441d-8984-79b1a7adbe27)
55
+
56
+ ### Contacts
57
+
58
+ If you have any questions, please send a message to the [Telegram](https://t.me/pythoncaptcha) chat room.
59
+
60
+ Or email python-captcha@pm.me
@@ -0,0 +1,105 @@
1
+ [tool.black]
2
+ line-length = 120
3
+ target-version = ['py310']
4
+ include = '\.pyi?$'
5
+ exclude = '''
6
+ /(
7
+ \.git
8
+ | \.hg
9
+ | \.mypy_cache
10
+ | \.tox
11
+ | \.venv
12
+ | _build
13
+ | buck-out
14
+ | build
15
+ | dist
16
+ )/
17
+ '''
18
+
19
+ [tool.isort]
20
+ profile = "black"
21
+ line_length = 120
22
+ length_sort = true
23
+
24
+ [tool.pytest.ini_options]
25
+ minversion = "7.0"
26
+ asyncio_mode = "auto"
27
+ asyncio_default_fixture_loop_scope = "function"
28
+ testpaths = [
29
+ "tests",
30
+ ]
31
+ addopts = "-vv --tb=short --durations=10"
32
+
33
+ [build-system]
34
+ requires = ["setuptools"]
35
+ build-backend = "setuptools.build_meta"
36
+
37
+ [project]
38
+ name = "python3-capsolver"
39
+ dynamic = ["version"]
40
+ authors = [
41
+ {name = "AndreiDrang", email = "python-captcha@pm.me"},
42
+ ]
43
+ description = "Python 3.8+ Capsolver library with AIO module."
44
+ readme = "README.md"
45
+ requires-python = ">=3.8"
46
+ keywords = [ "captcha",
47
+ "recaptcha",
48
+ "geetest",
49
+ "hcaptcha",
50
+ "capypuzzle",
51
+ "rotatecaptcha",
52
+ "funcaptcha",
53
+ "keycaptcha",
54
+ "python3",
55
+ "python-library",
56
+ "capsolver",
57
+ "datadomeslider",
58
+ "datadome",
59
+ "mtcaptcha",
60
+ "turnstile",
61
+ "cloudflare",
62
+ "amazon",
63
+ "amazon_waf",
64
+ "akamai",
65
+ "imperva",
66
+ "binance"
67
+ ]
68
+ license = {text = "MIT License"}
69
+ classifiers = [
70
+ "License :: OSI Approved :: MIT License",
71
+ "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
72
+ "Development Status :: 5 - Production/Stable",
73
+ "Programming Language :: Python",
74
+ "Programming Language :: Python :: 3",
75
+ "Programming Language :: Python :: 3 :: Only",
76
+ "Programming Language :: Python :: 3.8",
77
+ "Programming Language :: Python :: 3.9",
78
+ "Programming Language :: Python :: 3.10",
79
+ "Programming Language :: Python :: 3.11",
80
+ "Programming Language :: Python :: 3.12",
81
+ "Framework :: AsyncIO",
82
+ "Operating System :: Unix",
83
+ "Operating System :: Microsoft :: Windows",
84
+ "Operating System :: MacOS",
85
+ ]
86
+ dependencies = [
87
+ "requests>=2.21.0",
88
+ "aiohttp>=3.9.2",
89
+ "msgspec>=0.18,<0.20",
90
+ "tenacity>=8,<10"
91
+ ]
92
+
93
+ [tool.setuptools.packages.find]
94
+ where = ["src"]
95
+ include = ["python3_capsolver*"]
96
+
97
+ [tool.setuptools.dynamic]
98
+ version = {attr = "python3_capsolver.__version__"}
99
+
100
+ [project.urls]
101
+ Homepage = "https://andreidrang.github.io/python3-capsolver/"
102
+ Documentation = "https://andreidrang.github.io/python3-capsolver/"
103
+ Repository = "https://github.com/AndreiDrang/python3-capsolver"
104
+ Issues = "https://github.com/AndreiDrang/python3-capsolver/issues"
105
+ Changelog = "https://github.com/AndreiDrang/python3-capsolver/releases"
@@ -0,0 +1 @@
1
+ from python3_capsolver.__version__ import __version__ # noqa
@@ -0,0 +1 @@
1
+ __version__ = "1.0.0a"
@@ -0,0 +1,138 @@
1
+ from typing import Union
2
+
3
+ from .core.base import CaptchaParams
4
+ from .core.enum import CaptchaTypeEnm
5
+
6
+ __all__ = ("AwsWaf",)
7
+
8
+
9
+ class AwsWaf(CaptchaParams):
10
+ """
11
+ The class is used to work with Capsolver AwsWaf methods:
12
+ - AntiAwsWafTask
13
+ - AntiAwsWafTaskProxyLess
14
+ - AwsWafClassification
15
+
16
+ Args:
17
+ api_key: Capsolver API key
18
+ captcha_type: Captcha type name, like ``AntiAwsWafTask`` and etc.
19
+ kwargs: additional params for client, like captcha waiting time
20
+ available keys:
21
+ - sleep_time: int - captcha solution waintig time in sec
22
+ - request_url: str - API address for sending requests,
23
+ else official will be used
24
+
25
+
26
+ Examples:
27
+ >>> from python3_capsolver.aws_waf import AwsWaf
28
+ >>> from python3_capsolver.core.captcha_instrument import FileInstrument
29
+ >>> image = FileInstrument().file_processing(captcha_file="waf_captcha.png")
30
+ >>> AwsWaf(api_key="CAP-XXXXX",
31
+ ... captcha_type=CaptchaTypeEnm.AwsWafClassification
32
+ ... ).captcha_handler(task_payload={
33
+ ... "images": [image],
34
+ ... "question": "some question",
35
+ ... "websiteURL": "https://xxxx.com",
36
+ ... })
37
+ {
38
+ "errorId":0,
39
+ "errorCode":"None",
40
+ "errorDescription":"None",
41
+ "taskId":"db0a3153-621d-4f5e-8554-a1c032597ee7",
42
+ "status":"ready",
43
+ "solution":{
44
+ //carcity point
45
+ "box": [
46
+ 116.7,
47
+ 164.1
48
+ ],
49
+ // grid type, objects means the image index that matches the question
50
+ "objects": [0, 1, 3, 4, 6],
51
+ //if question include `bifurcatedzoo`
52
+ "distance": 500
53
+ }
54
+ }
55
+
56
+
57
+ >>> import asyncio
58
+ >>> from python3_capsolver.aws_waf import AwsWaf
59
+ >>> from python3_capsolver.core.captcha_instrument import FileInstrument
60
+ >>> image = FileInstrument().file_processing(captcha_file="waf_captcha.png")
61
+ >>> asyncio.run(AwsWaf(api_key="CAP-XXXXX",
62
+ ... captcha_type=CaptchaTypeEnm.AwsWafClassification
63
+ ... ).aio_captcha_handler(task_payload={
64
+ ... "images": [image],
65
+ ... "question": "some question",
66
+ ... "websiteURL": "https://xxxx.com",
67
+ ... }))
68
+ {
69
+ "errorId":0,
70
+ "errorCode":"None",
71
+ "errorDescription":"None",
72
+ "taskId":"db0a3153-621d-4f5e-8554-a1c032597ee7",
73
+ "status":"ready",
74
+ "solution":{
75
+ //carcity point
76
+ "box": [
77
+ 116.7,
78
+ 164.1
79
+ ],
80
+ // grid type, objects means the image index that matches the question
81
+ "objects": [0, 1, 3, 4, 6],
82
+ //if question include `bifurcatedzoo`
83
+ "distance": 500
84
+ }
85
+ }
86
+
87
+ >>> from python3_capsolver.aws_waf import AwsWaf
88
+ >>> from python3_capsolver.core.captcha_instrument import FileInstrument
89
+ >>> image = FileInstrument().file_processing(captcha_file="waf_captcha.png")
90
+ >>> AwsWaf(api_key="CAP-XXXXX",
91
+ ... captcha_type=CaptchaTypeEnm.AntiAwsWafTaskProxyLess
92
+ ... ).captcha_handler(task_payload={
93
+ ... "websiteURL": "https://xxxxxx/latest",
94
+ ... "awsKey": "AQIDAHjcYu/GjX+QlghicBg......shMIKvZswZemrVVqA==",
95
+ ... "awsChallengeJS": "https://xxxxx/challenge.js",
96
+ ... })
97
+ {
98
+ "errorId":0,
99
+ "errorCode":"None",
100
+ "errorDescription":"None",
101
+ "taskId":"db0a3153-621d-4f5e-8554-a1c032597ee7",
102
+ "status":"ready",
103
+ "solution":{
104
+ "cookie": "223d1f60-xxxxxxxx"
105
+ }
106
+ }
107
+
108
+ >>> from python3_capsolver.aws_waf import AwsWaf
109
+ >>> from python3_capsolver.core.captcha_instrument import FileInstrument
110
+ >>> image = FileInstrument().file_processing(captcha_file="waf_captcha.png")
111
+ >>> AwsWaf(api_key="CAP-XXXXX",
112
+ ... captcha_type=CaptchaTypeEnm.AntiAwsWafTask
113
+ ... ).captcha_handler(task_payload={
114
+ ... "websiteURL": "https://xxxxxx/latest",
115
+ ... "awsKey": "AQIDAHjcYu/GjX+QlghicBg......shMIKvZswZemrVVqA==",
116
+ ... "awsChallengeJS": "https://xxxxx/challenge.js",
117
+ ... "proxy": "ip:port:user:pass"
118
+ ... })
119
+ {
120
+ "errorId":0,
121
+ "errorCode":"None",
122
+ "errorDescription":"None",
123
+ "taskId":"db0a3153-621d-4f5e-8554-a1c032597ee7",
124
+ "status":"ready",
125
+ "solution":{
126
+ "cookie": "223d1f60-xxxxxxxx"
127
+ }
128
+ }
129
+
130
+ Notes:
131
+ https://docs.capsolver.com/en/guide/captcha/awsWaf/
132
+
133
+ https://docs.capsolver.com/en/guide/recognition/AwsWafClassification/
134
+ """
135
+
136
+ def __init__(self, api_key: str, captcha_type: Union[CaptchaTypeEnm, str], **kwargs):
137
+
138
+ super().__init__(api_key=api_key, captcha_type=captcha_type, **kwargs)
@@ -0,0 +1,95 @@
1
+ from typing import Union
2
+
3
+ from .core.base import CaptchaParams
4
+ from .core.enum import CaptchaTypeEnm
5
+
6
+ __all__ = ("Cloudflare",)
7
+
8
+
9
+ class Cloudflare(CaptchaParams):
10
+ """
11
+ The class is used to work with Capsolver AntiTurnstileTaskProxyLess captcha solving method
12
+
13
+ Args:
14
+ api_key: Capsolver API key
15
+ captcha_type: Captcha type name, like ``AntiTurnstileTaskProxyLess`` and etc.
16
+ kwargs: additional params for client, like captcha waiting time
17
+ available keys:
18
+ - sleep_time: int - captcha solution waintig time in sec
19
+ - request_url: str - API address for sending requests,
20
+ else official will be used
21
+
22
+ Examples:
23
+ >>> from python3_capsolver.cloudflare import Cloudflare
24
+ >>> from python3_capsolver.core.enum import CaptchaTypeEnm
25
+ >>> Cloudflare(api_key="CAI-12345....",
26
+ ... captcha_type=CaptchaTypeEnm.AntiTurnstileTaskProxyLess)
27
+ ... .captcha_handler(task_payload={
28
+ ... "websiteKey": "0x4XXXXXXXXXXXXXXXXX",
29
+ ... "metadata": {
30
+ ... "action": "login",
31
+ ... "cdata": "0000-1111-2222-3333-example-cdata"
32
+ ... }
33
+ ... })
34
+ {
35
+ "errorId":0,
36
+ "errorCode":"None",
37
+ "errorDescription":"None",
38
+ "taskId":"db0a3153-621d-4f5e-8554-a1c032597ee7",
39
+ "status":"ready",
40
+ "solution":{
41
+ "token": "0.mF74FV8wEufAWxxxx",
42
+ "type": "turnstile",
43
+ "userAgent": "Mozilla/5.0 xxxx"
44
+ }
45
+ }
46
+
47
+ >>> from python3_capsolver.cloudflare import Cloudflare
48
+ >>> from python3_capsolver.core.enum import CaptchaTypeEnm
49
+ >>> Cloudflare(api_key="CAI-12345....",
50
+ ... captcha_type=CaptchaTypeEnm.AntiCloudflareTask)
51
+ ... .captcha_handler(task_payload={
52
+ ... "websiteURL": "https://www.yourwebsite.com",
53
+ ... "proxy": "ip:port:user:pass",
54
+ ... })
55
+ {
56
+ "errorId":0,
57
+ "errorCode":"None",
58
+ "errorDescription":"None",
59
+ "taskId":"db0a3153-621d-4f5e-8554-a1c032597ee7",
60
+ "status":"ready",
61
+ "solution":{
62
+ "cookies": "cf_clearance=_VPxxxx",
63
+ "headers": {
64
+ "sec-ch-ua": "\"Chromium\";v=\"130\", \"Google Chrome\";v=\"130\", \"Not?A_Brand\";v=\"99\"",
65
+ "sec-ch-ua-platform": "\"Windows\"",
66
+ "accept": "text/html,axxxx",
67
+ "User-Agent": "Mozilla/5.0xxxx",
68
+ "sec-ch-ua-mobile": "?0",
69
+ "sec-fetch-user": "?1",
70
+ "referer": "https://www.yourwebsite.com",
71
+ "Sec-Fetch-Dest": "document",
72
+ "Sec-Fetch-Mode": "navigate",
73
+ "Sec-Fetch-Site": "same-origin",
74
+ "accept-language": "en",
75
+ },
76
+ "page_url": "https://www.yourwebsite.com",
77
+ "proxy": "your proxyxxxx",
78
+ "token": "_VPCTZXP5bhinxxxx"
79
+ }
80
+ }
81
+
82
+ Notes:
83
+ https://docs.capsolver.com/en/guide/captcha/cloudflare_turnstile/
84
+
85
+ https://docs.capsolver.com/en/guide/captcha/cloudflare_challenge/
86
+ """
87
+
88
+ def __init__(
89
+ self,
90
+ api_key: str,
91
+ captcha_type: Union[CaptchaTypeEnm, str] = CaptchaTypeEnm.AntiTurnstileTaskProxyLess,
92
+ **kwargs,
93
+ ):
94
+
95
+ super().__init__(api_key=api_key, captcha_type=captcha_type, **kwargs)
@@ -0,0 +1,68 @@
1
+ from .core.base import CaptchaParams
2
+ from .core.enum import CaptchaTypeEnm
3
+ from .core.const import GET_BALANCE_POSTFIX
4
+ from .core.aio_captcha_instrument import AIOCaptchaInstrument
5
+ from .core.sio_captcha_instrument import SIOCaptchaInstrument
6
+
7
+ __all__ = ("Control",)
8
+
9
+
10
+ class Control(CaptchaParams):
11
+ """
12
+ The class is used to work with Capsolver control methods.
13
+
14
+ Args:
15
+ api_key: Capsolver API key
16
+
17
+ Notes:
18
+ https://docs.capsolver.com/en/guide/api-getbalance/
19
+ """
20
+
21
+ def __init__(
22
+ self,
23
+ api_key: str,
24
+ ):
25
+ super().__init__(api_key=api_key, captcha_type=CaptchaTypeEnm.Control)
26
+
27
+ def get_balance(self) -> dict:
28
+ """
29
+ Synchronous method to view the balance
30
+
31
+ Examples:
32
+ >>> from python3_capsolver.control import Control
33
+ >>> Control(api_key="CAI-1324...").get_balance()
34
+ {'balance': 48.6361, 'errorId': 0, 'packages': []}
35
+
36
+ Returns:
37
+ Dict with full server response
38
+
39
+ Notes:
40
+ Check class docstring for more info
41
+ """
42
+ self._captcha_handling_instrument = SIOCaptchaInstrument(captcha_params=self)
43
+ return self._captcha_handling_instrument.send_post_request(
44
+ session=self._captcha_handling_instrument.session,
45
+ url_postfix=GET_BALANCE_POSTFIX,
46
+ payload={"clientKey": self.create_task_payload.clientKey},
47
+ )
48
+
49
+ async def aio_get_balance(self) -> dict:
50
+ """
51
+ Asynchronous method to view the balance
52
+
53
+ Examples:
54
+ >>> import asyncio
55
+ >>> from python3_capsolver.control import Control
56
+ >>> asyncio.run(Control(api_key="CAI-1324...").aio_get_balance())
57
+ {'balance': 48.6361, 'errorId': 0, 'packages': []}
58
+
59
+ Returns:
60
+ Dict with full server response
61
+
62
+ Notes:
63
+ Check class docstring for more info
64
+ """
65
+ return await AIOCaptchaInstrument.send_post_request(
66
+ url_postfix=GET_BALANCE_POSTFIX,
67
+ payload={"clientKey": self.create_task_payload.clientKey},
68
+ )