Send requests to a single CapMonster instance from scripts/programs on workstations/servers that do not belong to the same LAN.
ZennoLab's CapMonster is a Windows software package for recognizing captchas and is a self-hosted alternative to CapMonster.cloud. Depending on your volume, CapMonster (Windows) is even more cost-effective than CapMonster.cloud. CapMonster2 automatically intercepts captchas from local programs and can be configured to receive requests from a local network. This repo is a basic middleware that lets your CapMonster instance receive and solve ReCaptchas from anywhere.
Please be aware that the CapMonster TOS states you "may only use the software for personal purposes." This middleware should not be used for paid recognition services.
server.py
runs alongside a single license of ZennoLab's CapMonster 2.
client.py
includes examples of submitting jobs directly to the DB or API.
If you're integrating this into your own applications and trust every client.py
with DB rw privileges, fastapi is not necessary.
However, integration into 3rd party apps will be difficult/impossible without an API endpoint.
Allows clients to make requests to a custom domain (FastAPI endpoints) that handles ReCaptcha job requests.
Includes endpoints that mimic 2Captcha's API as well as verbose pydantic (JSON) response models.
/local/server.py
feeds queue items to a single instance of CapMonster 2.
Unlike /local/client.py
, client requests do not need DB rw access.
In other words, clients make requests to a custom domain/FastAPI endpoints versus submitting jobs directly into the DB.
- Create a "Free & Hobby Cluster" with MongoDB Atlas
- License of ZennoLab's CapMonster 2
- Windows machine to run CapMonster
- DigitalOcean Basic Droplet or other server instance & domain
/local
- Running instance of CapMonster with Recaptcha2 Sitekey Addon
- Clone the full repo (Depends on schema from
capmonster/fastapi/app/schema
) - Install requirements
pip install -r requirements.txt
- Copy
.env.example
to.env
and add your settings - Run
python3 ./server.py
server.py
must be running on the same PC as CapMonster. It listens for new jobs, submits them to CapMonster via captcha_solver.py
, and updates the DB with results. captcha_solver.py
uses the 2CaptchaAPI to communicate with CapMonster.
client.py
is a simple implementation example. client.py
can run anywhere so long as it has r/w access to the MongoDB collection server.py
monitors.
/fastapi
- Install docker & docker-compose on a server, such as DigitalOcean's Basic Droplet. Docker with developer tools is also available as a DigitalOcean 1-Click Applications.
- Copy the repo & follow instructions in /capmonster/fastapi/README.md
Replace any 2Captcha API calls with FastAPI endpoints. Or, intercept applications making 2Captcha requests by editing the machine's host file.
Purge garbage (old ReCaptcha jobs) in the DB after any minute interval using the remove_garbage
flag locally in
server
or with the FastAPI endpoint /api/v1/garbage
.
Using Windows Task Scheduler, add "Start a Program" Tasks to launch C:\[...]\CapMonster
and C:\[...]\local\server.py
, triggered by sys startup.
docker-compose.prod.yml
file includes restart: unless-stopped
.
TestingProd submit job function for client.py- Optimize MDB connections/instances
FastAPI interfacePydantic models already in use(schema.py)- Multiple Authentication/keys/users
Proxy username/pass- Pull from pool of rotating proxies if no proxy submitted