Skip to main content

imagetyperz-async

An asynchronous client for the ImageTyperz CAPTCHA-solving API.

httpx powers the HTTP requests.

At the moment, only image CAPTCHAS and reCAPTCHAs are supported.

Installation

pip install imagetyperz-async

Usage

import asyncio

from imagetyperz import ImageTyperzClient, reCAPTCHAType
from imagetyperz.exceptions import NotDecoded

async def demo():
    ###
    # Context manager will handle the closing of connections in the underlying
    # httpx AsyncClient at block end.
    #
    # Alternatively, `await ita.aclose()` may be manually called to perform
    # cleanup.
    #
    # If no cleanup is performed, a warning may be emitted at Python exit.
    #
    async with ImageTyperzClient('6F0848592604C9E14F0EBEA7368493C5') as ita:
        print(await ita.retrieve_balance())
        #: 8.8325

        # Submit reCAPTCHA job
        job_id = await ita.submit_recaptcha(
            page_url='https://example.com/login',
            site_key='scraped-site-key',
            recaptcha_type=reCAPTCHAType.INVISIBLE,
        )
        print(job_id)
        #: 176140709

        # Check for results of the reCAPTCHA job
        while True:
            try:
                g_response = await ita.retrieve_recaptcha(job_id)
            except NotDecoded:
                await asyncio.sleep(5)
                continue
            else:
                print(g_response)
                #: 03AGdBq25hDTCjOq4QywdrY...
                break

        # Alternatively, use complete_recaptcha to automatically handle the polling
        # for results — returning with the result when ready.
        g_response = await ita.complete_recaptcha(
            page_url='https://example.com/login',
            site_key='scraped-site-key',
            recaptcha_type=reCAPTCHAType.INVISIBLE,
        )
        print(g_response)
        #: 03AGdBq25hDTCjOq4QywdrY...

Metadata

Release files for imagetyperz-async 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for imagetyperz-async 0.3.2
File Size Uploaded
imagetyperz_async-0.3.2.tar.gz 9.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for imagetyperz-async 0.3.2
File Interpreter ABI Platform
imagetyperz_async-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 19.2 kB

Release files / imagetyperz_async-0.3.2.tar.gz

Download URL imagetyperz_async-0.3.2.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
39726de75af0b472adf497870f3df873ee2349c0dc4933a6a849bb4d5b4abae2
BLAKE2b-256 checksum
How to use checksums
7525814eb36d328fd30e3a6d7e06fcea4beefa0b80ca565d2d2d426e52bd5783
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.11.1 Linux/5.13.0-52-generic

Release files / imagetyperz_async-0.3.2-py3-none-any.whl

Download URL imagetyperz_async-0.3.2-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f0d055a70d2629bcf1916c09e441a4ce416381af929317a658a498e754d7a001
BLAKE2b-256 checksum
How to use checksums
1d0ede3047bfac8d911a7011a01344f000fd0b5128cf6aa11765d001cff19206
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.11.1 Linux/5.13.0-52-generic

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page