Skip to main content
PyPI PyPI - Python Version SourceForge - Downloads PyPI - License PyPI - Status

GoodByeCaptcha

An async Python library to automate solving ReCAPTCHA v2 by images/audio using Mozilla’s DeepSpeech, PocketSphinx, Microsoft Azure’s, Wit.AI, Google Speech or Amazon’s Transcribe Speech-to-Text API. Also image recognition to detect the object suggested in the captcha. Built with Pyppeteer for Chrome automation framework and similarities to Puppeteer, PyDub for easily converting MP3 files into WAV, aiohttp for async minimalistic web-server, and Python’s built-in AsyncIO for convenience.

Disclaimer

This project is for educational and research purposes only. Any actions and/or activities related to the material contained on this GitHub Repository is solely your responsibility. The misuse of the information in this GitHub Repository can result in criminal charges brought against the persons in question. The author will not be held responsible in the event any criminal charges be brought against any individuals misusing the information in this GitHub Repository to break the law.

Compatibility

Linux, macOS, and Windows!

Requirements

Python 3.7, FFmpeg, a Microsoft Azure account for Bing Speech API access, an Amazon Web Services account for Transcribe and S3 access, a Wit.AI or for Pocketsphinx. You’ll need pulseaudio, swig, libasound2-dev, and libpulse-dev under Debian.

Train the yolov3 neural network to improve image recognition.

Training YoloV3

I recommend training yolov3 to improve the recaptcha resolution with the following information:
  • Dataset

  • Tutorial Video

  • Object classes: bicycle, bridge, bus, car, chimneys, crosswalk, fire hydrant, motorcycle, palm trees, parking meters, stair, taxis, tractors, traffic light, trees

Installation

$ apt-get update && apt-get install -y libpangocairo-1.0-0 libx11-xcb1 libxcomposite1 libxcursor1 libxdamage1 libxi6 libxtst6 libnss3 libcups2 libxss1 libxrandr2 libgconf-2-4 libasound2 libasound2-dev libatk1.0-0 libgtk-3-0 gconf-service libappindicator1 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgdk-pixbuf2.0-0 libglib2.0-0 libnspr4 libpango-1.0-0 libpulse-dev libstdc++6 libx11-6 libxcb1 libxext6 libxfixes3 libxrender1 libxtst6 ca-certificates fonts-liberation lsb-release xdg-utils build-essential ffmpeg swig software-properties-common curl
$ pip install goodbyecaptcha

Install tutorial

https://img.youtube.com/vi/hPYMUdQ2aV8/0.jpg

Configuration

Please edit goodbyecaptcha.example.yaml and save as goodbyecaptcha.yaml

Usage

If you want to use it in your own script

from goodbyecaptcha.solver import Solver

pageurl = "https://www.google.com/recaptcha/api2/demo"

proxy = "127.0.0.1:1000"
auth_details = {"username": "user", "password": "pass"}
args = ["--timeout 5"]
options = {"ignoreHTTPSErrors": True, "args": args}  # References: https://miyakogi.github.io/pyppeteer/reference.html
client = Solver(
    # With Proxy
    # pageurl, lang='en-US', options=options, proxy=proxy, proxy_auth=auth_details
    # Without Proxy
    pageurl, lang='en-US', options=options
)

solution = client.loop.run_until_complete(client.start())
if solution:
    print(solution)

If you want to use events

from goodbyecaptcha.solver import Solver

pageurl = "https://www.google.com/recaptcha/api2/demo"

proxy = "127.0.0.1:1000"
auth_details = {"username": "user", "password": "pass"}
args = ["--timeout 5"]
options = {"ignoreHTTPSErrors": True, "args": args}  # References: https://miyakogi.github.io/pyppeteer/reference.html


class MySolver(Solver):
    async def on_goto(self):
        # Set Cookies and other stuff
        await self.page.setCookie({
            'name': 'cookie1',
            'value': 'value1',
            'domain': '.google.com'
        })
        self.log('Cookies ready!')

    async def on_start(self):
        # Set or Change data
        self.log('Set data in form ...')
        await self.page.type('input[name="input1"]', 'value')

    async def on_finish(self):
        # Click button Send
        self.log('Clicking send button ...')
        await self.page.click('input[id="recaptcha-demo-submit"]')
        await self.page.waitForNavigation()
        await self.page.screenshot({'path': 'image.png'})


client = MySolver(
    # With Proxy
    # pageurl, lang='en-US', options=options, proxy=proxy, proxy_auth=auth_details
    # Without Proxy
    pageurl, lang='en-US', options=options
)

client.loop.run_until_complete(client.start())

Release files for goodbyecaptcha 2.4.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 goodbyecaptcha 2.4.2
File Size Uploaded
goodbyecaptcha-2.4.2.tar.gz 66.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for goodbyecaptcha 2.4.2
File Interpreter ABI Platform
goodbyecaptcha-2.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 145.2 kB

Release files / goodbyecaptcha-2.4.2.tar.gz

Download URL goodbyecaptcha-2.4.2.tar.gz
Size 66.0 kB
Tags Source
SHA-256 checksum
How to use checksums
93072c2c86dc93fa2ca59d6f5a2fe2fbd35d80d65382942b3cdd8f32c03d25f8
BLAKE2b-256 checksum
How to use checksums
2db768fbe9d3e3a4dccf527cbe88ec036a683ce0bd507406b5bfe047d494bc9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.2.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.0b4

Release files / goodbyecaptcha-2.4.2-py3-none-any.whl

Download URL goodbyecaptcha-2.4.2-py3-none-any.whl
Size 79.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d34a2c23a1feaa04af101111112355dbe42ac063c10de43495925693f944ca0
BLAKE2b-256 checksum
How to use checksums
7553e20b1ba54de29453eaed89c8bc1db01fa4809bd6c4370596e727881a2d6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.2.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.0b4

Release history Release notifications | RSS feed

This release

2.4.2 This release

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.3

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3

2 release files

2.2.1

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