2captcha-python 2.0.4__tar.gz → 2.0.5__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: 2captcha-python
3
- Version: 2.0.4
3
+ Version: 2.0.5
4
4
  Summary: Python module for easy integration with 2Captcha API
5
5
  Home-page: https://github.com/2captcha/2captcha-python/
6
6
  Author: 2Captcha
@@ -81,6 +81,7 @@ Examples of API requests for different captcha types are available on the [Pytho
81
81
  - [Prosopo](#prosopo)
82
82
  - [Temu](#temu)
83
83
  - [CyberSiARA](#cybersiara)
84
+ - [Altcha Captcha](#altcha-Captcha)
84
85
  - [Other methods](#other-methods)
85
86
  - [send / get\_result](#send--get_result)
86
87
  - [balance](#balance)
@@ -557,6 +558,17 @@ result = solver.cybersiara(master_url_id='tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv',
557
558
  param1=..., ...)
558
559
  ```
559
560
 
561
+ ### Altcha Captcha
562
+
563
+ <sup>[API method description.](http://2captcha.com/2captcha-api#altchacaptcha)</sup>
564
+
565
+ Use this method to solve Altcha Captcha. Returns a token.
566
+ ```python
567
+ result = solver.altcha(pageurl='https://mysite.com/page/with/altcha',
568
+ challenge_json='{"algorithm":"SHA-256","challenge":"a4c9d8e7f1b23a6c...",..."signature":"7b3e2a9d5c8f1046e2d91c3a..."}',
569
+ # or: challenge_url='https://example.com/altcha-challenge',)
570
+ ```
571
+
560
572
  ## Other methods
561
573
 
562
574
  ### send / get_result
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: 2captcha-python
3
- Version: 2.0.4
3
+ Version: 2.0.5
4
4
  Summary: Python module for easy integration with 2Captcha API
5
5
  Home-page: https://github.com/2captcha/2captcha-python/
6
6
  Author: 2Captcha
@@ -81,6 +81,7 @@ Examples of API requests for different captcha types are available on the [Pytho
81
81
  - [Prosopo](#prosopo)
82
82
  - [Temu](#temu)
83
83
  - [CyberSiARA](#cybersiara)
84
+ - [Altcha Captcha](#altcha-Captcha)
84
85
  - [Other methods](#other-methods)
85
86
  - [send / get\_result](#send--get_result)
86
87
  - [balance](#balance)
@@ -557,6 +558,17 @@ result = solver.cybersiara(master_url_id='tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv',
557
558
  param1=..., ...)
558
559
  ```
559
560
 
561
+ ### Altcha Captcha
562
+
563
+ <sup>[API method description.](http://2captcha.com/2captcha-api#altchacaptcha)</sup>
564
+
565
+ Use this method to solve Altcha Captcha. Returns a token.
566
+ ```python
567
+ result = solver.altcha(pageurl='https://mysite.com/page/with/altcha',
568
+ challenge_json='{"algorithm":"SHA-256","challenge":"a4c9d8e7f1b23a6c...",..."signature":"7b3e2a9d5c8f1046e2d91c3a..."}',
569
+ # or: challenge_url='https://example.com/altcha-challenge',)
570
+ ```
571
+
560
572
  ## Other methods
561
573
 
562
574
  ### send / get_result
@@ -48,6 +48,7 @@ Examples of API requests for different captcha types are available on the [Pytho
48
48
  - [Prosopo](#prosopo)
49
49
  - [Temu](#temu)
50
50
  - [CyberSiARA](#cybersiara)
51
+ - [Altcha Captcha](#altcha-Captcha)
51
52
  - [Other methods](#other-methods)
52
53
  - [send / get\_result](#send--get_result)
53
54
  - [balance](#balance)
@@ -524,6 +525,17 @@ result = solver.cybersiara(master_url_id='tpjOCKjjpdzv3d8Ub2E9COEWKt1vl1Mv',
524
525
  param1=..., ...)
525
526
  ```
526
527
 
528
+ ### Altcha Captcha
529
+
530
+ <sup>[API method description.](http://2captcha.com/2captcha-api#altchacaptcha)</sup>
531
+
532
+ Use this method to solve Altcha Captcha. Returns a token.
533
+ ```python
534
+ result = solver.altcha(pageurl='https://mysite.com/page/with/altcha',
535
+ challenge_json='{"algorithm":"SHA-256","challenge":"a4c9d8e7f1b23a6c...",..."signature":"7b3e2a9d5c8f1046e2d91c3a..."}',
536
+ # or: challenge_url='https://example.com/altcha-challenge',)
537
+ ```
538
+
527
539
  ## Other methods
528
540
 
529
541
  ### send / get_result
@@ -17,4 +17,4 @@ support@2captcha.com
17
17
  """
18
18
 
19
19
  __author__ = '2captcha'
20
- __version__ = '2.0.4'
20
+ __version__ = '2.0.5'
@@ -998,6 +998,41 @@ class AsyncTwoCaptcha():
998
998
  **kwargs)
999
999
  return result
1000
1000
 
1001
+ async def altcha(self, pageurl, challenge_url=None, challenge_json=None, **kwargs):
1002
+ '''Wrapper for solving Altcha Captcha.
1003
+
1004
+ Parameters
1005
+ __________
1006
+ pageurl : str
1007
+ Full URL of the page where you solve the captcha.
1008
+ challenge_url : str
1009
+ The value of the 'challenge_url' parameter for the 'altcha-widget' element containing the captcha on the page.
1010
+ You can send either challenge_url or challenge_json parameter, but not two of it simultaneously.
1011
+ challenge_json : str
1012
+ The contents of the file from the 'challenge_url' parameter. You can send either challenge_url or challenge_json
1013
+ parameter, but not two of it simultaneously.
1014
+ proxy : dict, optional
1015
+ {'type': 'HTTPS', 'uri': 'login:password@IP_address:PORT'}.
1016
+
1017
+ '''
1018
+
1019
+ if (challenge_url is None) == (challenge_json is None):
1020
+ raise ValidationException(
1021
+ 'You must provide exactly one of challenge_url or challenge_json'
1022
+ )
1023
+
1024
+ params = {
1025
+ 'pageurl': pageurl,
1026
+ 'method': 'altcha',
1027
+ **kwargs,}
1028
+
1029
+ if challenge_url is not None:
1030
+ params['challenge_url'] = challenge_url
1031
+ if challenge_json is not None:
1032
+ params['challenge_json'] = challenge_json
1033
+
1034
+ return await self.solve(**params)
1035
+
1001
1036
  async def solve(self, timeout=0, polling_interval=0, **kwargs):
1002
1037
  '''Sends captcha, receives result.
1003
1038
 
@@ -105,6 +105,10 @@ class TwoCaptcha():
105
105
  Use this method to solve DataDome captcha.
106
106
  cybersiara(master_url_id, pageurl, userAgent, **kwargs)
107
107
  Use this method to solve CyberSiARA. Returns a token.
108
+ yandex_smart(self, sitekey, url, **kwargs)
109
+ Wrapper for solving Yandex Smart.
110
+ altcha(self, pageurl, challenge_url=None, challenge_json=None, **kwargs)
111
+ Wrapper for solving Altcha Captcha.
108
112
  solve(timeout=0, polling_interval=0, **kwargs)
109
113
  Sends CAPTCHA data and retrieves the result.
110
114
  balance()
@@ -1128,6 +1132,41 @@ class TwoCaptcha():
1128
1132
  **kwargs)
1129
1133
  return result
1130
1134
 
1135
+ def altcha(self, pageurl, challenge_url=None, challenge_json=None, **kwargs):
1136
+ '''Wrapper for solving Altcha Captcha.
1137
+
1138
+ Parameters
1139
+ __________
1140
+ pageurl : str
1141
+ Full URL of the page where you solve the captcha.
1142
+ challenge_url : str
1143
+ The value of the 'challenge_url' parameter for the 'altcha-widget' element containing the captcha on the page.
1144
+ You can send either challenge_url or challenge_json parameter, but not two of it simultaneously.
1145
+ challenge_json : str
1146
+ The contents of the file from the 'challenge_url' parameter. You can send either challenge_url or challenge_json
1147
+ parameter, but not two of it simultaneously.
1148
+ proxy : dict, optional
1149
+ {'type': 'HTTPS', 'uri': 'login:password@IP_address:PORT'}.
1150
+
1151
+ '''
1152
+
1153
+ if (challenge_url is None) == (challenge_json is None):
1154
+ raise ValidationException(
1155
+ 'You must provide exactly one of challenge_url or challenge_json'
1156
+ )
1157
+ params = {
1158
+ 'pageurl': pageurl,
1159
+ 'method': "altcha",
1160
+ **kwargs,
1161
+ }
1162
+ if challenge_url is not None:
1163
+ params['challenge_url'] = challenge_url
1164
+ if challenge_json is not None:
1165
+ params['challenge_json'] = challenge_json
1166
+
1167
+ return self.solve(**params)
1168
+
1169
+
1131
1170
  def solve(self, timeout=0, polling_interval=0, **kwargs):
1132
1171
  '''Sends captcha, receives result.
1133
1172
 
File without changes