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: /Users/arif.shah/PycharmProjects/captcha-url-reader/examples/read_amazon_default.py
  • Overlap-heavy style: /Users/arif.shah/PycharmProjects/captcha-url-reader/examples/read_overlap_captcha.py

Run them directly:

./.venv/bin/python /Users/arif.shah/PycharmProjects/captcha-url-reader/examples/read_amazon_default.py
./.venv/bin/python /Users/arif.shah/PycharmProjects/captcha-url-reader/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.0.tar.gz (6.5 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.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: captcha_url_reader-1.0.0.tar.gz
  • Upload date:
  • Size: 6.5 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.0.tar.gz
Algorithm Hash digest
SHA256 37c1559f9e937545f821dcd7e222084fb2aab89495b7954ddb1bd5b0e8032662
MD5 6803b53b865a5e8bfd0bf61997299afe
BLAKE2b-256 6515cfbf790375d9df0c7adc7112e6066302bc23f46d72ddeaa8f6a6ac3ff8c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for captcha_url_reader-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c85745c759876c75270084a41a03f27a2242b4b9de928482696220c1264fe5fb
MD5 47a3bfddcaf325772d592864e4694eee
BLAKE2b-256 b474450e6acc0e29744c3065d0c77cb2b05bc6b7711def638c0d80052559246b

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