Skip to main content

Client library for solve captchas with Anticaptcha.com support.

Project description

Code issues Python package

Client library for solve captchas with Anticaptcha.com support. The library supports both Python 2.7 and Python 3.

Getting Started

Install as standard for Python packages using:

pip install python-anticaptcha

Usage

To use this library do you need Anticaptcha.com API key.

Recaptcha

Example snippet for Recaptcha:

from python_anticaptcha import AnticaptchaClient, NoCaptchaTaskProxylessTask

api_key = '174faff8fbc769e94a5862391ecfd010'
site_key = '6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-'  # grab from site
url = 'https://www.google.com/recaptcha/api2/demo'

client = AnticaptchaClient(api_key)
task = NoCaptchaTaskProxylessTask(url, site_key)
job = client.createTask(task)
job.join()
print job.get_solution_response()

The full integration example is available in file examples/recaptcha.py.

Text captcha

Example snippet for text captcha:

from python_anticaptcha import AnticaptchaClient, ImageToTextTask

api_key = '174faff8fbc769e94a5862391ecfd010'
captcha_fp = open('examples/captcha_ms.jpeg', 'rb')
client = AnticaptchaClient(api_key)
task = ImageToTextTask(captcha_fp)
job = client.createTask(task)
job.join()
print job.get_captcha_text()

Funcaptcha

Example snippet for funcaptcha:

from python_anticaptcha import AnticaptchaClient, FunCaptchaTask, Proxy
UA = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 ' \
     '(KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'

api_key = '174faff8fbc769e94a5862391ecfd010'
site_key = 'DE0B0BB7-1EE4-4D70-1853-31B835D4506B'  # grab from site
url = 'https://www.google.com/recaptcha/api2/demo'
proxy = Proxy.parse_url("socks5://login:password@123.123.123.123")

client = AnticaptchaClient(api_key)
task = FunCaptchaTask(url, site_key, proxy=proxy, user_agent=user_agent)
job = client.createTask(task)
job.join()
print job.get_token_response()

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Adam Dobrawy - Initial work - ad-m

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-anticaptcha-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_anticaptcha-0.1.0-py2-none-any.whl (7.8 kB view details)

Uploaded Python 2

File details

Details for the file python-anticaptcha-0.1.0.tar.gz.

File metadata

File hashes

Hashes for python-anticaptcha-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f6c0d6138d47c86a6bb0cc527032a66c358090d23f8164db3e39ec8c881e16f2
MD5 eceb57435d29f5f4ccfbb016da0dba47
BLAKE2b-256 82a1abc7640cfb931aebd775798b17239044621c0501fac24a7c53f811306cbf

See more details on using hashes here.

File details

Details for the file python_anticaptcha-0.1.0-py2-none-any.whl.

File metadata

File hashes

Hashes for python_anticaptcha-0.1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 6252e128a984fdf93583a6096b78c2d5c3da72410edab68b1e49b6c939434785
MD5 bb4f5b6858d9f76772d3a97908d977e4
BLAKE2b-256 7d599b54c3212d72061b866c0f1856d829f3dd1b6ebef8c593dc031cf94703dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page