-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcapy.py
36 lines (28 loc) · 1.19 KB
/
capy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/python2.7
from bestcaptchasolverapi3.bestcaptchasolverapi import BestCaptchaSolverAPI
from time import sleep
ACCESS_TOKEN = 'ACCESS_TOKEN_HERE'
# for more details check https://bestcaptchasolver.com/captchabypass-api
def test_api():
bcs = BestCaptchaSolverAPI(ACCESS_TOKEN) # get access token from: https://bestcaptchasolver.com/account
# check account balance
# ---------------------------
balance = bcs.account_balance() # get account balance
print(f'Balance: {balance}')
print ('Waiting for capy to be solved ...')
solution = None
captcha_id = bcs.submit_capy({'page_url': 'PAGE_URL_HERE', 'site_key': 'SITEKEY_HERE'}) # , 'proxy': 'user:pass@123.45.67.89:3031', 'user_agent': 'your user agent'})
while solution is None: # while it's still in progress
resp = bcs.retrieve(captcha_id)
solution = resp['solution']
sleep(10) # sleep for 10 seconds and recheck
print (solution)
# bcs.set_captcha_bad(2) # set captcha with ID 2, bad
# main method
def main():
try:
test_api()
except Exception as ex:
print(f'[!] Error occurred: {ex}')
if __name__ == "__main__":
main()