Skip to content

Commit d57f321

Browse files
author
Mark Miller
committed
v1.1.0
1 parent 81652ff commit d57f321

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Also there are few options that can be configured:
4343

4444
```python
4545
config = {
46+
'server': '2captcha.com',
4647
'apiKey': 'YOUR_API_KEY',
4748
'softId': 123,
4849
'callback': 'https://your.site/result-receiver',
@@ -57,6 +58,7 @@ solver = TwoCaptcha(**config)
5758

5859
|Option|Default value|Description|
5960
|---|---|---|
61+
|server|`2captcha.com`|API server. You can set it to `rucaptcha.com` if your account is registered there|
6062
|softId|-|your software ID obtained after publishing in [2captcha sofware catalog]|
6163
|callback|-|URL of your web-sever that receives the captcha recognition result. The URl should be first registered in [pingback settings] of your account|
6264
|defaultTimeout|120|Polling timeout in seconds for all captcha types except ReCaptcha. Defines how long the module tries to get the answer from `res.php` API endpoint|
@@ -182,7 +184,7 @@ result = solver.coordinates('path/to/captcha.jpg', param1=..., ...)
182184
### Rotate
183185
This method can be used to solve a captcha that asks to rotate an object. Mostly used to bypass FunCaptcha. Returns the rotation angle.
184186
```python
185-
result = solver.rotate(['path/to/captcha1.jpg', 'path/to/captcha2.jpg', ...], param1=..., ...)
187+
result = solver.rotate('path/to/captcha.jpg', param1=..., ...)
186188
```
187189

188190
## Other methods

tests/test_recaptcha.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ def test_v2(self):
2525
'method' : 'userrecaptcha',
2626
'googlekey' : '6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
2727
'pageurl' : 'https://mysite.com/page/with/recaptcha',
28-
'invisible' : 1,
28+
'invisible': 1,
29+
'enterprise': 0,
2930
'action' : 'verify',
3031
'version' : 'v2',
3132
}
@@ -47,7 +48,8 @@ def test_v3(self):
4748
'method' : 'userrecaptcha',
4849
'googlekey' : '6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-',
4950
'pageurl' : 'https://mysite.com/page/with/recaptcha',
50-
'invisible' : 1,
51+
'invisible' : 1,
52+
'enterprise': 0,
5153
'action' : 'verify',
5254
'version' : 'v3',
5355
}

twocaptcha/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
from .solver import (TwoCaptcha, SolverExceptions, ValidationException,
33
NetworkException, ApiException, TimeoutException)
44

5-
__version__ = '1.0.3'
5+
__version__ = '1.1.0'

twocaptcha/solver.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def text(self, text, **kwargs):
9595
result = self.solve(text=text, method='post', **kwargs)
9696
return result
9797

98-
def recaptcha(self, sitekey, url, version='v2', **kwargs):
98+
def recaptcha(self, sitekey, url, version='v2', enterprise=0, **kwargs):
9999
'''
100100
Wrapper for solving recaptcha (v2, v3)
101101
@@ -107,6 +107,7 @@ def recaptcha(self, sitekey, url, version='v2', **kwargs):
107107
108108
invisible
109109
version
110+
enterprise
110111
action
111112
score
112113
softId
@@ -119,6 +120,7 @@ def recaptcha(self, sitekey, url, version='v2', **kwargs):
119120
'url': url,
120121
'method': 'userrecaptcha',
121122
'version': version,
123+
'enterprise': enterprise,
122124
**kwargs,
123125
}
124126

@@ -182,7 +184,9 @@ def hcaptcha(self, sitekey, url, **kwargs):
182184
url
183185
184186
Optional params:
185-
187+
188+
invisible
189+
data
186190
softId
187191
callback
188192
proxy = {'type': 'HTTPS', 'uri': 'login:password@IP_address:PORT'})

0 commit comments

Comments
 (0)