Skip to content

Commit 436731f

Browse files
committed
- Added documentation for the TwoCaptcha class constructor in solver.py
- And several minor changes in the documentation for captcha methods Signed-off-by: Maxim S <[email protected]>
1 parent d6190f4 commit 436731f

File tree

1 file changed

+35
-4
lines changed

1 file changed

+35
-4
lines changed

twocaptcha/solver.py

+35-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,38 @@ def __init__(self,
4343
pollingInterval=10,
4444
server = '2captcha.com',
4545
extendedResponse=None):
46+
"""
47+
Class constructor for interacting with the 2captcha API.
4648
49+
Parameters
50+
__________
51+
apiKey : str
52+
Your personal API key in your account settings.
53+
softId : int, optional
54+
Your software ID obtained after publishing in 2captcha software catalog - https://2captcha.com/software.
55+
Default: 4580.
56+
callback : str, optional
57+
URL of your web server that receives the captcha recognition result.
58+
The URL should be first registered in pingback - https://2captcha.com/setting/pingback - settings of your account.
59+
Default: None.
60+
defaultTimeout : int, optional
61+
Polling timeout in seconds for all captcha types except reCAPTCHA.
62+
Defines how long the module tries to get the answer from the res.php API endpoint.
63+
Default: 120.
64+
recaptchaTimeout : int, optional
65+
Polling timeout for reCAPTCHA in seconds. Defines how long the module tries to get the answer from the res.php API endpoint.
66+
Default: 600.
67+
pollingInterval : int, optional
68+
Interval in seconds between requests to the res.php API endpoint. Setting values less than 5 seconds is not recommended.
69+
Default: 10.
70+
server : str, optional
71+
API server. You can set it to rucaptcha.com if your account is registered there.
72+
Default: 2captcha.com.
73+
extendedResponse : bool, optional
74+
Set to True to get the response with additional fields or in more practical format (enables JSON response from
75+
res.php API endpoint). Suitable for hCaptcha, ClickCaptcha, Canvas.
76+
Default: None.
77+
"""
4778
self.API_KEY = apiKey
4879
self.soft_id = softId
4980
self.callback = callback
@@ -162,7 +193,7 @@ def recaptcha(self, sitekey, url, version='v2', enterprise=0, **kwargs):
162193
'''Wrapper for solving recaptcha (v2, v3).
163194
164195
Parameters
165-
_______________
196+
__________
166197
sitekey : str
167198
Value of sitekey parameter you found on page.
168199
url : str
@@ -224,7 +255,7 @@ def funcaptcha(self, sitekey, url, **kwargs):
224255
Tells us to use your user-agent value.
225256
data[key] : str, optional
226257
Custom data to pass to FunCaptcha. For example: data[blob]=stringValue.
227-
softId : str, optional
258+
softId : int, optional
228259
ID of software developer. Developers who integrated their software with 2Captcha get reward: 10% of
229260
spendings of their software users.
230261
callback : str, optional
@@ -243,7 +274,7 @@ def funcaptcha(self, sitekey, url, **kwargs):
243274
def geetest(self, gt, challenge, url, **kwargs):
244275
'''Wrapper for solving geetest captcha.
245276
246-
Parameters:
277+
Parameters
247278
__________
248279
gt : str
249280
Value of gt parameter you found on target website.
@@ -933,7 +964,7 @@ def send(self, **kwargs):
933964
"""This method can be used for manual captcha submission
934965
935966
Parameters
936-
_________
967+
__________
937968
method : str
938969
The name of the method must be found in the documentation https://2captcha.com/2captcha-api
939970
kwargs: dict

0 commit comments

Comments
 (0)