2captcha-python 2.0.5__py3-none-any.whl → 2.0.7__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: 2captcha-python
3
- Version: 2.0.5
3
+ Version: 2.0.7
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
@@ -82,6 +82,7 @@ Examples of API requests for different captcha types are available on the [Pytho
82
82
  - [Temu](#temu)
83
83
  - [CyberSiARA](#cybersiara)
84
84
  - [Altcha Captcha](#altcha-Captcha)
85
+ - [Binance](#binance)
85
86
  - [Other methods](#other-methods)
86
87
  - [send / get\_result](#send--get_result)
87
88
  - [balance](#balance)
@@ -566,7 +567,18 @@ Use this method to solve Altcha Captcha. Returns a token.
566
567
  ```python
567
568
  result = solver.altcha(pageurl='https://mysite.com/page/with/altcha',
568
569
  challenge_json='{"algorithm":"SHA-256","challenge":"a4c9d8e7f1b23a6c...",..."signature":"7b3e2a9d5c8f1046e2d91c3a..."}',
569
- # or: challenge_url='https://example.com/altcha-challenge',)
570
+ # challenge_url='https://example.com/altcha-challenge',)
571
+ ```
572
+
573
+ ### Binance
574
+
575
+ <sup>[API method description.](https://2captcha.com/2captcha-api#binance)</sup>
576
+
577
+ Use this method to solve Binance Captcha. Returns a token.
578
+ ```python
579
+ result = solver.binance(sitekey='register',
580
+ pageurl='https://mysite.com/page/with/binance',
581
+ validate_id='e20c622fa9384952832fc1c2a6b75c0a',)
570
582
  ```
571
583
 
572
584
  ## Other methods
@@ -0,0 +1,13 @@
1
+ 2captcha_python-2.0.7.dist-info/licenses/LICENSE,sha256=sbILKjQcxUC6dAvBbivnRX9YCshBI9XRvvk1LGkpMEo,1065
2
+ twocaptcha/__init__.py,sha256=fJ1lUFhNr4FDbVsU07SmVdhxqFxknUDdS9QW8Iys-Fw,542
3
+ twocaptcha/api.py,sha256=vlYOhc3rGIHOVGq4hZjJ54tUxBpBzI2FgWPctllb7D0,2826
4
+ twocaptcha/async_api.py,sha256=L467rsgdVVrgWaLkvengoTE8GvCgQAfM2PmVO2kfad4,3534
5
+ twocaptcha/async_solver.py,sha256=i-jtaEh8RChp10mxqpldy8bygGe9lC628HCJfTB7tAg,52418
6
+ twocaptcha/solver.py,sha256=Ladd3dbje1Un7TxVIwga2uXhCFCtNNApCDCBKd0AIUo,58998
7
+ twocaptcha/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ twocaptcha/exceptions/api.py,sha256=N810fZxcNE2AwCM9EyFrXpDpzAKsKi_tHCnRJn4CH7s,86
9
+ twocaptcha/exceptions/solver.py,sha256=hvKUebPMvC51ve6MSmv_3q1J9vkhS90XO2ivoVToyoU,255
10
+ 2captcha_python-2.0.7.dist-info/METADATA,sha256=N_1y7PXJiXYu2Rw8_XJ0dIP_saPImg4XCRsil0rM9wQ,31876
11
+ 2captcha_python-2.0.7.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
12
+ 2captcha_python-2.0.7.dist-info/top_level.txt,sha256=AvFZdM89oM6Vo97ZTxT9AxHWpwoO3_Qf5ORMV3NClFE,11
13
+ 2captcha_python-2.0.7.dist-info/RECORD,,
twocaptcha/__init__.py CHANGED
@@ -17,4 +17,4 @@ support@2captcha.com
17
17
  """
18
18
 
19
19
  __author__ = '2captcha'
20
- __version__ = '2.0.5'
20
+ __version__ = '2.0.7'
@@ -998,40 +998,52 @@ class AsyncTwoCaptcha():
998
998
  **kwargs)
999
999
  return result
1000
1000
 
1001
- async def altcha(self, pageurl, challenge_url=None, challenge_json=None, **kwargs):
1001
+ async def altcha(self, pageurl, **kwargs):
1002
1002
  '''Wrapper for solving Altcha Captcha.
1003
1003
 
1004
1004
  Parameters
1005
1005
  __________
1006
1006
  pageurl : str
1007
1007
  Full URL of the page where you solve the captcha.
1008
- challenge_url : str
1008
+ challenge_url : str, optional
1009
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.
1010
+ At least one of the parameters 'challenge_url', 'challenge_json' must be passed.
1011
+ challenge_json : str, optional
1012
+ The contents of the file from the 'challenge_url' parameter.
1013
+ At least one of the parameters 'challenge_url', 'challenge_json' must be passed.
1014
1014
  proxy : dict, optional
1015
1015
  {'type': 'HTTPS', 'uri': 'login:password@IP_address:PORT'}.
1016
-
1017
1016
  '''
1018
1017
 
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
- )
1018
+ result = self.solve(pageurl=pageurl,
1019
+ method='altcha',
1020
+ **kwargs)
1023
1021
 
1024
- params = {
1025
- 'pageurl': pageurl,
1026
- 'method': 'altcha',
1027
- **kwargs,}
1022
+ return await result
1028
1023
 
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
1024
+ async def binance(self, pageurl, sitekey, validate_id, **kwargs):
1025
+ '''Wrapper for solving Binance captcha.
1026
+
1027
+ Parameters
1028
+ __________
1029
+ pageurl : str
1030
+ Full URL of the page where you solve the captcha.
1031
+ sitekey : str
1032
+ Value of 'bizId', 'bizType', or 'bizCode' from page requests.
1033
+ validate_id : str
1034
+ Dynamic value of 'validateId', 'securityId', or 'securityCheckResponseValidateId'.
1035
+ useragent : str, optional
1036
+ Browser User-Agent. We recommend sending a valid Windows browser string.
1037
+ proxy : dict, optional
1038
+ {'type': 'HTTPS', 'uri': 'login:password@IP_address:PORT'}.
1039
+ '''
1040
+ result = self.solve(method="binance",
1041
+ pageurl=pageurl,
1042
+ sitekey=sitekey,
1043
+ validate_id=validate_id,
1044
+ **kwargs)
1033
1045
 
1034
- return await self.solve(**params)
1046
+ return await result
1035
1047
 
1036
1048
  async def solve(self, timeout=0, polling_interval=0, **kwargs):
1037
1049
  '''Sends captcha, receives result.
twocaptcha/solver.py CHANGED
@@ -1132,39 +1132,55 @@ class TwoCaptcha():
1132
1132
  **kwargs)
1133
1133
  return result
1134
1134
 
1135
- def altcha(self, pageurl, challenge_url=None, challenge_json=None, **kwargs):
1135
+ def altcha(self, pageurl, **kwargs):
1136
1136
  '''Wrapper for solving Altcha Captcha.
1137
1137
 
1138
1138
  Parameters
1139
1139
  __________
1140
1140
  pageurl : str
1141
1141
  Full URL of the page where you solve the captcha.
1142
- challenge_url : str
1142
+ challenge_url : str, optional
1143
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.
1144
+ At least one of the parameters 'challenge_url', 'challenge_json' must be passed.
1145
+ challenge_json : str, optional
1146
+ The contents of the file from the 'challenge_url' parameter.
1147
+ At least one of the parameters 'challenge_url', 'challenge_json' must be passed.
1148
1148
  proxy : dict, optional
1149
1149
  {'type': 'HTTPS', 'uri': 'login:password@IP_address:PORT'}.
1150
1150
 
1151
1151
  '''
1152
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
1153
+ result = self.solve(
1154
+ pageurl=pageurl,
1155
+ method="altcha",
1156
+ **kwargs)
1166
1157
 
1167
- return self.solve(**params)
1158
+ return result
1159
+
1160
+ def binance(self, pageurl, sitekey, validate_id, **kwargs):
1161
+ '''Wrapper for solving Binance captcha.
1162
+
1163
+ Parameters
1164
+ __________
1165
+ pageurl : str
1166
+ Full URL of the page where you solve the captcha.
1167
+ sitekey : str
1168
+ Value of 'bizId', 'bizType', or 'bizCode' from page requests.
1169
+ validate_id : str
1170
+ Dynamic value of 'validateId', 'securityId', or 'securityCheckResponseValidateId'.
1171
+ useragent : str, optional
1172
+ Browser User-Agent. We recommend sending a valid Windows browser string.
1173
+ proxy : dict, optional
1174
+ {'type': 'HTTPS', 'uri': 'login:password@IP_address:PORT'}.
1175
+ '''
1176
+ result = self.solve(
1177
+ method="binance",
1178
+ pageurl=pageurl,
1179
+ sitekey=sitekey,
1180
+ validate_id=validate_id,
1181
+ **kwargs)
1182
+
1183
+ return result
1168
1184
 
1169
1185
 
1170
1186
  def solve(self, timeout=0, polling_interval=0, **kwargs):
@@ -1,13 +0,0 @@
1
- 2captcha_python-2.0.5.dist-info/licenses/LICENSE,sha256=sbILKjQcxUC6dAvBbivnRX9YCshBI9XRvvk1LGkpMEo,1065
2
- twocaptcha/__init__.py,sha256=xF6LYkx3mPn10XiEwC_MYCEovkihJ8JD8WRZDiVm4Hs,542
3
- twocaptcha/api.py,sha256=vlYOhc3rGIHOVGq4hZjJ54tUxBpBzI2FgWPctllb7D0,2826
4
- twocaptcha/async_api.py,sha256=L467rsgdVVrgWaLkvengoTE8GvCgQAfM2PmVO2kfad4,3534
5
- twocaptcha/async_solver.py,sha256=A5dvMWM8s5QwevwkW6SaM596V8fXdRcPnO08i6YXylc,51887
6
- twocaptcha/solver.py,sha256=fYy4HfsgKC3CWwvFhJYz-nF69tThJnd9Zl7XO_jw1gU,58563
7
- twocaptcha/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- twocaptcha/exceptions/api.py,sha256=N810fZxcNE2AwCM9EyFrXpDpzAKsKi_tHCnRJn4CH7s,86
9
- twocaptcha/exceptions/solver.py,sha256=hvKUebPMvC51ve6MSmv_3q1J9vkhS90XO2ivoVToyoU,255
10
- 2captcha_python-2.0.5.dist-info/METADATA,sha256=YYSwt8uT0zFlkkpqlrmJxfzUEZ60ztL53WeDYQML5KM,31497
11
- 2captcha_python-2.0.5.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
12
- 2captcha_python-2.0.5.dist-info/top_level.txt,sha256=AvFZdM89oM6Vo97ZTxT9AxHWpwoO3_Qf5ORMV3NClFE,11
13
- 2captcha_python-2.0.5.dist-info/RECORD,,