3
3
from bestcaptchasolverapi3 .bestcaptchasolverapi import BestCaptchaSolverAPI
4
4
from time import sleep
5
5
6
- ACCESS_TOKEN = 'your_access_token '
7
- PAGE_URL = 'your_page_url '
8
- SITE_KEY = 'your_site_key '
6
+ ACCESS_TOKEN = 'access_token_here '
7
+ PAGE_URL = 'page_url_here '
8
+ SITE_KEY = 'site_key_here '
9
9
10
10
11
11
# solve captcha
@@ -20,9 +20,12 @@ def test_api():
20
20
21
21
# solve image captcha
22
22
# --------------------
23
- # works with URL as well, if authenticated with token
24
23
print ('Solving image captcha ...' )
25
- id = bcs .submit_image_captcha ('captcha.jpg' , False ) # submit image captcha (case_sensitive param optional)
24
+ data = {}
25
+ data ['image' ] = 'captcha.jpg'
26
+ # data['case_sensitive'] = True #, default: False
27
+ # data['affiliate_id'] = 'affiliate_id from /account'
28
+ id = bcs .submit_image_captcha (data ) # submit image captcha (case_sensitive param optional)
26
29
image_text = None
27
30
# None is returned if completion is still in pending
28
31
while image_text == None :
@@ -32,9 +35,23 @@ def test_api():
32
35
print ('Captcha text: {}' .format (image_text ))
33
36
34
37
# solve recaptcha
35
- # -----------------------------------------------------------------------------------------------
38
+ # ---------------
36
39
print ('Solving recaptcha ...' )
37
- captcha_id = bcs .submit_recaptcha (PAGE_URL , SITE_KEY ) # submit captcha first, to get ID
40
+ data = {}
41
+ data ['page_url' ] = PAGE_URL
42
+ data ['site_key' ] = SITE_KEY
43
+
44
+ # other parameters
45
+ # ----------------------------------------------------------------------
46
+ # data['type'] = 1 # 1 - regular, 2 - invisible, 3 - v3, default 1
47
+ # data['v3_action'] = 'v3 recaptcha action'
48
+ # data['v3_min_score'] = '0.3'
49
+ # data['user_agent'] = 'Your user agent'
50
+ # data['proxy'] = '123.456.678:3031'
51
+ # data['proxy'] = 'user:[email protected] :3031'
52
+ # data['affiliate_id'] = 'affiliate_id from /account'
53
+ captcha_id = bcs .submit_recaptcha (data ) # submit captcha first, to get ID
54
+
38
55
# check if it's still in progress (waiting to be solved), every 10 seconds
39
56
print ('Waiting for recaptcha to be solved ...' )
40
57
gresponse = None
@@ -44,14 +61,9 @@ def test_api():
44
61
sleep (10 ) # sleep for 10 seconds and recheck
45
62
46
63
print ('Recaptcha response: {}' .format (gresponse )) # print google response
47
- #proxy_status = resp['proxy_status'] # get status of proxy
48
-
49
- # bcs.submit_image_captcha('captcha.jpg', True) # case sensitive captcha image solving
50
- # bcs.submit_recaptcha(PAGE_URL, SITE_KEY, '123.45.67.89:3012') # solve through proxy
51
- # bcs.submit_recaptcha(PAGE_URL, SITE_KEY, 'user:[email protected] :3012') # solve through proxy with auth
64
+ # proxy_status = resp['proxy_status'] # get status of proxy
52
65
# bcs.set_captcha_bad(2) # set captcha with ID 2, bad
53
66
54
-
55
67
# main method
56
68
def main ():
57
69
try :
0 commit comments