This module lets you solve reCAPTCHAs (or other CAPTCHAs) outside the browser.
Specially crafted pages displaying CAPTCHA and retrieving it's response are displayed in WebKit.
Look at test/test_recaptcha.py for example usage. Python 3.5 or higher is required, because the module is typed.
Because reCAPTCHA verifies the host it is running on, reCAPTCHAs from a site cannot simply be embedded somewehere else with code extracting the reCAPTCHA challenge response around them. The page extracting the reCAPTCHA challenge response must be served on the original host. [1]
By displaying the CAPTCHA in a WebKitGTK web view we can fake the location
with the base_uri
argument of webkit_web_view_load_html
.
The path taken by the Electron version of running a HTTPS server and a SOCKS5
proxy is therefore not necessary.
To use python's async and the glib event loop together, gtk_main
is called in another thread than the python's native event loop. Because of this
special care needs to be taken when calling glib/GTK functions. Only
DeCaptcha
's run
, solve
, stop
, or cancel_current
are safe to call.
The CAPTCHA requests are processed in the following loop: