Skip to main content

Simple Python package: pass CAPTCHA image URL and get extracted text

Project description

captcha-url-reader

Simple package: user passes captcha image URL, package reads and returns text.

Install

pip install -e .

Usage

from captcha_image_reader import read_captcha_from_url

# Default mode (recommended for Amazon-style captchas)
captcha_text = read_captcha_from_url("https://images-na.ssl-images-amazon.com/captcha/sgkknrsj/Captcha_iwrdailhkf.jpg")
if captcha_text:
    print(f"CAPTCHA text extracted: {captcha_text}")
else:
    print("No text extracted from image URL.")

Overlap-heavy captcha mode

Use forced overlap mode only when text is merged/overlapping and default mode is not accurate.

from captcha_image_reader import read_captcha_from_url

captcha_text = read_captcha_from_url(
    "https://2captcha.com/dist/web/assets/captcha-rn1S3orp.jpg",
    force_overlap_risk=True,
)

When to use which mode

  • Use default mode for clean or mostly non-overlapping text (for example, most Amazon captchas).
  • Use force_overlap_risk=True only when characters are merged and default extraction is wrong.

Example scripts

  • Default/Amazon style: examples/read_amazon_default.py
  • Overlap-heavy style: examples/read_overlap_captcha.py

Run them directly:

./.venv/bin/python examples/read_amazon_default.py
./.venv/bin/python examples/read_overlap_captcha.py

GPU behavior

  • Uses GPU first by default.
  • If GPU is not available or fails, automatically falls back to CPU.

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_url_reader-1.0.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

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

captcha_url_reader-1.0.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file captcha_url_reader-1.0.1.tar.gz.

File metadata

  • Download URL: captcha_url_reader-1.0.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for captcha_url_reader-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c9ea81ee131cd87707072505b1e6be95a358398eae3151ec8d795693ef09d083
MD5 eb36964fea8f8f7db98563646e16c3cb
BLAKE2b-256 b4f431442ff90a47c4d94ac5d070fa3fe9b39e614573ac67e5ae31634692552f

See more details on using hashes here.

File details

Details for the file captcha_url_reader-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for captcha_url_reader-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 86392cca147ee5200928a5e86a40581d20d4edd4b4c74f7c79636aedaf9661e8
MD5 6d031d1ebf0435052cb4fb9a0dd33217
BLAKE2b-256 a7ab8887f807894fcdad7777e514ff0960fc30a85eddb7bcbd8291cd5cc96cc3

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