A basic python 2captcha.com modulee
Project description
Welcome to py2captcha python module👋
A basic python 2captcha.com module
Install
pip install py2captcha
Usage
import base64
import py2captcha
py2c = captcha.py2c("YOUR_2CAPTCHA_API_KEY")
#Text Image:
with open("captcha.png", "rb") as f:
img_b64 = base64.b64encode(f.read())
solved = py2c.solveCaptcha(img_b64)
print(solved)
#ReCaptcha:
key = py2c.get_sitekey(driver) #driver - selenium webbrowser object
token = solveReCaptcha(key,driver.current_url)
if token:
driver.execute_script(
"document.getElementById('g-recaptcha-response').innerHTML='{}';".format(token)
)
#getBalance:
balance = py2c.getBalance()
print(balance)
#report Correct resolve:
py2c.reportCorrect()
#report Incorrect resolve:
py2c.reportIncorrect()
Show your support
Give a ⭐️ if this project helped you!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
basicpy2captcha-1.0.0.tar.gz
(1.8 kB
view hashes)
Built Distribution
Close
Hashes for basicpy2captcha-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3b620a9cc8007a0e2c05d8becc9801673a2b8bec112af34c5a22c7af0adb9d0 |
|
MD5 | 083b564ae945122e1415250ab8556b1e |
|
BLAKE2b-256 | 82dc2f67e9c21cd528d73c0f3f69825ef3d7a6999de045139ee9e3ab3cf60072 |