python-rucaptcha 6.1.1__tar.gz → 6.1.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.
Files changed (41) hide show
  1. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/PKG-INFO +2 -1
  2. python-rucaptcha-6.1.2/python_rucaptcha/__version__.py +1 -0
  3. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/core/enums.py +5 -0
  4. python-rucaptcha-6.1.2/python_rucaptcha/friendly_captcha.py +124 -0
  5. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha.egg-info/PKG-INFO +2 -1
  6. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha.egg-info/SOURCES.txt +1 -0
  7. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/setup.py +1 -0
  8. python-rucaptcha-6.1.1/python_rucaptcha/__version__.py +0 -1
  9. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/__init__.py +0 -0
  10. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/amazon_waf.py +0 -0
  11. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/audio_captcha.py +0 -0
  12. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/bounding_box_captcha.py +0 -0
  13. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/capy_puzzle.py +0 -0
  14. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/control.py +0 -0
  15. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/coordinates_captcha.py +0 -0
  16. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/core/__init__.py +0 -0
  17. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/core/base.py +0 -0
  18. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/core/config.py +0 -0
  19. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/core/result_handler.py +0 -0
  20. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/core/serializer.py +0 -0
  21. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/cutcaptcha.py +0 -0
  22. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/cyber_siara_captcha.py +0 -0
  23. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/datadome_captcha.py +0 -0
  24. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/draw_around_captcha.py +0 -0
  25. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/fun_captcha.py +0 -0
  26. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/gee_test.py +0 -0
  27. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/grid_captcha.py +0 -0
  28. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/hcaptcha.py +0 -0
  29. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/image_captcha.py +0 -0
  30. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/key_captcha.py +0 -0
  31. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/lemin_captcha.py +0 -0
  32. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/mt_captcha.py +0 -0
  33. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/re_captcha.py +0 -0
  34. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/rotate_captcha.py +0 -0
  35. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/text_captcha.py +0 -0
  36. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha/turnstile.py +0 -0
  37. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha.egg-info/dependency_links.txt +0 -0
  38. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha.egg-info/not-zip-safe +0 -0
  39. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha.egg-info/requires.txt +0 -0
  40. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/python_rucaptcha.egg-info/top_level.txt +0 -0
  41. {python-rucaptcha-6.1.1 → python-rucaptcha-6.1.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-rucaptcha
3
- Version: 6.1.1
3
+ Version: 6.1.2
4
4
  Summary: Python 3.9+ RuCaptcha library with AIO module.
5
5
  Home-page: https://andreidrang.github.io/python-rucaptcha/
6
6
  Author: AndreiDrang, redV0ID
@@ -34,6 +34,7 @@ Keywords: captcha
34
34
  turnstile
35
35
  amazon
36
36
  amazon_waf
37
+ friendly-captcha
37
38
  Classifier: License :: OSI Approved :: MIT License
38
39
  Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
39
40
  Classifier: Programming Language :: Python
@@ -0,0 +1 @@
1
+ __version__ = "6.1.2"
@@ -144,3 +144,8 @@ class CoordinatesCaptchaEnm(str, MyEnum):
144
144
 
145
145
  class GridCaptchaEnm(str, MyEnum):
146
146
  GridTask = "GridTask"
147
+
148
+
149
+ class FriendlyCaptchaEnm(str, MyEnum):
150
+ FriendlyCaptchaTaskProxyless = "FriendlyCaptchaTaskProxyless"
151
+ FriendlyCaptchaTask = "FriendlyCaptchaTask"
@@ -0,0 +1,124 @@
1
+ from typing import Union
2
+
3
+ from .core.base import BaseCaptcha
4
+ from .core.enums import FriendlyCaptchaEnm
5
+
6
+
7
+ class FriendlyCaptcha(BaseCaptcha):
8
+ def __init__(
9
+ self,
10
+ websiteURL: str,
11
+ websiteKey: str,
12
+ method: Union[str, FriendlyCaptchaEnm] = FriendlyCaptchaEnm.FriendlyCaptchaTaskProxyless,
13
+ *args,
14
+ **kwargs,
15
+ ):
16
+ """
17
+ The class is used to work with Friendly Captcha.
18
+
19
+ Args:
20
+ rucaptcha_key: User API key
21
+ websiteURL: The full URL of target web page where the captcha is loaded. We do not open the page,
22
+ not a problem if it is available only for authenticated users
23
+ websiteKey: The value of `data-sitekey` attribute of captcha's `div` element on page.
24
+ method: Captcha type
25
+
26
+ Examples:
27
+ >>> FriendlyCaptcha(rucaptcha_key="aa9011f31111181111168611f1151122",
28
+ ... websiteKey="2FZFEVS1FZCGQ9",
29
+ ... websiteURL="https://example.com",
30
+ ... method=FriendlyCaptchaEnm.FriendlyCaptchaTaskProxyless.value
31
+ ... ).captcha_handler()
32
+ {
33
+ "errorId":0,
34
+ "status":"ready",
35
+ "solution":{
36
+ "token":"PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v"
37
+ },
38
+ "cost":"0.00299",
39
+ "ip":"1.2.3.4",
40
+ "createTime":1692863536,
41
+ "endTime":1692863556,
42
+ "solveCount":1,
43
+ "taskId":75190409731
44
+ }
45
+
46
+ >>> FriendlyCaptcha(rucaptcha_key="aa9011f31111181111168611f1151122",
47
+ ... websiteKey="2FZFEVS1FZCGQ9",
48
+ ... websiteURL="https://example.com",
49
+ ... method=FriendlyCaptchaEnm.FriendlyCaptchaTaskProxyless.value
50
+ ... ).captcha_handler()
51
+ {
52
+ "errorId":0,
53
+ "status":"ready",
54
+ "solution":{
55
+ "token":"PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v"
56
+ },
57
+ "cost":"0.00299",
58
+ "ip":"1.2.3.4",
59
+ "createTime":1692863536,
60
+ "endTime":1692863556,
61
+ "solveCount":1,
62
+ "taskId":75190409731
63
+ }
64
+
65
+ >>> await FriendlyCaptcha(rucaptcha_key="aa9011f31111181111168611f1151122",
66
+ ... websiteKey="2FZFEVS1FZCGQ9",
67
+ ... websiteURL="https://example.com",
68
+ ... method=FriendlyCaptchaEnm.FriendlyCaptchaTaskProxyless.value
69
+ ... ).aio_captcha_handler()
70
+ {
71
+ "errorId":0,
72
+ "status":"ready",
73
+ "solution":{
74
+ "token":"PUZZLE_Abc1dEFghIJKLM2no34P56q7rStu8v"
75
+ },
76
+ "cost":"0.00299",
77
+ "ip":"1.2.3.4",
78
+ "createTime":1692863536,
79
+ "endTime":1692863556,
80
+ "solveCount":1,
81
+ "taskId":75190409731
82
+ }
83
+
84
+ Returns:
85
+ Dict with full server response
86
+
87
+ Notes:
88
+ https://rucaptcha.com/api-docs/friendly-captcha
89
+ """
90
+ super().__init__(method=method, *args, **kwargs)
91
+
92
+ self.create_task_payload["task"].update({"websiteURL": websiteURL, "websiteKey": websiteKey})
93
+
94
+ # check user params
95
+ if method not in FriendlyCaptchaEnm.list_values():
96
+ raise ValueError(f"Invalid method parameter set, available - {FriendlyCaptchaEnm.list_values()}")
97
+
98
+ def captcha_handler(self, **kwargs) -> dict:
99
+ """
100
+ Sync solving method
101
+
102
+ Args:
103
+ kwargs: additional params for `requests` library
104
+
105
+ Returns:
106
+ Dict with full server response
107
+
108
+ Notes:
109
+ Check class docstirng for more info
110
+ """
111
+
112
+ return self._processing_response(**kwargs)
113
+
114
+ async def aio_captcha_handler(self) -> dict:
115
+ """
116
+ Async solving method
117
+
118
+ Returns:
119
+ Dict with full server response
120
+
121
+ Notes:
122
+ Check class docstirng for more info
123
+ """
124
+ return await self._aio_processing_response()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-rucaptcha
3
- Version: 6.1.1
3
+ Version: 6.1.2
4
4
  Summary: Python 3.9+ RuCaptcha library with AIO module.
5
5
  Home-page: https://andreidrang.github.io/python-rucaptcha/
6
6
  Author: AndreiDrang, redV0ID
@@ -34,6 +34,7 @@ Keywords: captcha
34
34
  turnstile
35
35
  amazon
36
36
  amazon_waf
37
+ friendly-captcha
37
38
  Classifier: License :: OSI Approved :: MIT License
38
39
  Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
39
40
  Classifier: Programming Language :: Python
@@ -11,6 +11,7 @@ python_rucaptcha/cutcaptcha.py
11
11
  python_rucaptcha/cyber_siara_captcha.py
12
12
  python_rucaptcha/datadome_captcha.py
13
13
  python_rucaptcha/draw_around_captcha.py
14
+ python_rucaptcha/friendly_captcha.py
14
15
  python_rucaptcha/fun_captcha.py
15
16
  python_rucaptcha/gee_test.py
16
17
  python_rucaptcha/grid_captcha.py
@@ -115,6 +115,7 @@ setup(
115
115
  turnstile
116
116
  amazon
117
117
  amazon_waf
118
+ friendly-captcha
118
119
  """,
119
120
  python_requires=REQUIRES_PYTHON,
120
121
  zip_safe=False,
@@ -1 +0,0 @@
1
- __version__ = "6.1.1"