Skip to main content

CaptchaManager

Project description

captchamanager abstracts captcha token retrieval.

Motivation

Some programs may require the retrieval of valid captcha tokens. Often, this is accomplished through services like 2Captcha that return a valid token given an API key and the challenge site key. captchamanager abstracts this functionality so programs can receive a single token or can load a queue of tokens. Tokens are represented by their value, generation time, and expiration time.

Note

Currently, captchamanager only supports 2Captcha.

Installation

captchamanager is available via pip

$ pip install captcha-manager

Usage

from captchamanager import CaptchaManager

TWO_CAPTCHA_API_KEY = 'ABC123'
SITE_KEY = 'DEF456'
PAGE_URL = 'https://example.com'
captcha_manager = CaptchaManager(TWO_CAPTCHA_API_KEY, SITE_KEY, PAGE_URL)
token = captcha_manager.get_captcha_token() # Returns a single token ASAP

captcha_manager.start_captcha_queue()
# Do something
token = captcha_manager.wait_for_captcha_token() # Returns one valid token from queue

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

captcha-manager-0.0.2.1.tar.gz (3.2 kB view details)

Uploaded Source

File details

Details for the file captcha-manager-0.0.2.1.tar.gz.

File metadata

File hashes

Hashes for captcha-manager-0.0.2.1.tar.gz
Algorithm Hash digest
SHA256 790ce98bb8f086fbaa13bb17cfa993cec77747691177c5fdcbd8126b87d2fdc3
MD5 d5cea900d4535c11a0e63805ecd546c1
BLAKE2b-256 47a741145d502891605b5711e0fa7f96e1df7bd9cbd1e11f7331c50eab2f8f2e

See more details on using hashes here.

Supported by

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