TwoCaptcha - Wrapper
TwoCaptcha - Wrapper is a wrapper for the 2Captcha API (Recaptcha V2 Token method only) that solves your CAPTCHA with high accuracy.
Intallation
pip
pip install twocaptcha
Source
git clone https://github.com/tiagocardosoweb/twocaptcha-wrapper.git cd twocaptcha python setup.py install
How to start?
First you need a 2Captcha Account, you can Register Here, after register your account: * Login into your account. * Add some money. * Go to “2Captcha API” * Get “CAPTCHA Key”
Usage
Getting your balance
from twocaptcha import TwoCaptcha two= TwoCaptcha(<api_key>, <soft_id=None>, <log=None>) print two.get_balance() This function will return your account balance (string).
Uploading a captcha
from twocaptcha import TwoCaptcha two = TwoCaptcha(<api_key>, <soft_id=None>, <log=None>) print two.upload(<google_key>,<page_url>) This function will upload the captcha request and then return the request ID (string).
Response from a captcha
from twocaptcha import TwoCaptcha two = TwoCaptcha(<api_key>, <soft_id=None>, <log=None>) print two.get_response(<request_id>,<except=False>) This function will request the token from the a request and return you the resolution token (string). **NOTE:** If you want the method to raise an exception in case something goes wrong, set <except> to *True*
Solving a captcha
from twocaptcha import TwoCaptcha two = TwoCaptcha(<api_key>, <soft_id=None>, <log=None>>) print two.resolve_captcha(<google_key>,<page_url>,<waittime=15>) This function will upload the captcha request & ask back the captcha solution and return the token (string). *How it works?* 15 seconds timeout + (5 seconds timeout * while token is not returned )
Solving a captcha via Pingback
from twocaptcha import TwoCaptcha two = TwoCaptcha(<api_key>, <soft_id=None>, <log=None>, <extra_data_file_path=None>) print two.upload(<google_key>,<page_url>,<pingback_url>) This function will upload the captcha request and then return it via a POST request to your Pingback URL.
Adding a Pingback URL
from twocaptcha import TwoCaptcha two = TwoCaptcha(<api_key>, <soft_id=None>, <log=None>, <extra_data_file_path=None>) print two.add_pingback(<url>)
Getting your Pingback List
from twocaptcha import TwoCaptcha two = TwoCaptcha(<api_key>, <soft_id=None>, <log=None>) print two.add_pingback(<url>)
Deleting a Pingback URL
from twocaptcha import TwoCaptcha two = TwoCaptcha(<api_key>, <soft_id=None>, <log=None>) print two.delete_pingback(<url=None>, <all=False>) You must provie and URL or set <all> to *True*
Complain
from twocaptcha import TwoCaptcha two = TwoCaptcha(<api_key>, <soft_id=None>, <log=Log Here>) print two.complain(<request_id>)
Logger
from twocaptcha import TwoCaptcha two = TwoCaptcha(<api_key>, <soft_id=None>, <log=Log Here>) print two.getbalance()
Exceptions
All methods throw up exceptions, so be sure to import them from twocaptcha import AccessDeniedException - AccessDeniedException - CaptchaException - BalanceException - PingbackException - KeyException
Metadata
Release files for twocaptcha-wrapper 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| twocaptcha-wrapper-0.1.2.tar.gz | 4.5 kB | Without provenance | Details for twocaptcha-wrapper-0.1.2.tar.gz |
Release files / twocaptcha-wrapper-0.1.2.tar.gz
| Download URL | twocaptcha-wrapper-0.1.2.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5b10066b72fe83364f63a97c249fb690021baab12026ba7445fae316f6d313f8
|
|
BLAKE2b-256 checksum How to use checksums |
16db9e40af1f432b6729563f7bbd89cdcc0b9284472a91612770ea330d96e06a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for twocaptcha-wrapper 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.