Capsolver official python library
- Geetest
- ReCaptchaV2
- ReCaptchav3
- MtCaptcha
- Cloudflare
- Amazon captcha(AWS WAF)
You don't need this source code unless you want to modify the package. If you just want to use the package, just run:
pip3 install --upgrade capsolverInstall from source with:
python setup.py installexport CAPSOLVER_API_KEY='...'Or set capsolver.api_key to its value:
frompathlibimportPathimportosimportbase64importcapsolver# tokenTaskprint("api host",capsolver.api_base)
print("api key",capsolver.api_key)
# capsolver.api_key = "..."solution=capsolver.solve({
"type":"ReCaptchaV2TaskProxyLess",
"websiteKey":"6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
"websiteURL":"https://www.google.com/recaptcha/api2/demo",
})
print(solution)
# RecognitionTaskimg_path=os.path.join(Path(__file__).resolve().parent,"queue-it.jpg")
withopen(img_path,'rb') asf:
solution=capsolver.solve({
"type":"ImageToTextTask",
"module":"queueit",
"body":base64.b64encode(f.read()).decode("utf8")
})
print(solution)
# get current balancebalance=capsolver.balance()
# print the current balanceprint(balance)