Real world example
Site name is hidden
import asyncio
from pylcaptcha.http import BrowserHTTP
async def main(imei_number: str):
async with BrowserHTTP() as protocol:
await protocol.get('https://hidden', browser=True) # solve captcha on loading
await protocol.sync_csrf_token(
selector='meta[name="csrf-token"]',
header_name='x-csrf-token'
)
await protocol.get('https://hidden/ajax/model', params={'query': imei_number})
result = await protocol.post('https://hidden/ajax/imei', data={
'imei': imei_number,
'token': await protocol.get_cf_token()
})
return result.text
if __name__ == '__main__':
asyncio.run(main('3541...'))
As you can see the BrowserHTTP() handles captcha automatically under the hood. It finds that, solve, store tokens and auto add them to further requests. User simply should specify when to open browser for solution with browser=True. This page use cloudflare captcha. The same apply to google captcha -> auto defined, solved and token attached automatically.
How It Solves the Hard Stuff Under the Hood
Beating Behavior Telemetry with Bézier Math
Modern anti-bot systems track not only your IP and captcha results. Straight lines or instant jumps flag you as a bot immediately. To bypass this, the library drives interaction elements using a custom human-simulation class. It calculates dynamic Bézier curves mapped to a cubic-out easing function. The mouse pointer accelerates rapidly outwards and heavily decelerates as it approaches the checkbox target, matching human physics perfectly.
On-the-Fly Computer Vision for reCAPTCHA v2
The most complex part of this project was tackling visual challenges. There are two kinds of challanges: click image and squares.
Click image
This is less complex than click squares. For this purpose i've trained classification models, that determine whether this image has Car, Bicycle or else object. If threeshold is high enough, it clicks the image. To achieve this, the 3x3 or 4x4 grid is split to separate images. Every image is feed to classification model.
Click squares
This is where i had to work most of the time. You must find the actual object borders on an image. This required to train detection model, remove away borders from challange, find object, map to coordinates on challange and get final squares to check.
This library is currently a work-in-progress and is a personal engineering playground rather than a bulletproof production suite. Image recognition sets always need more training data, and edge firewalls are a moving target.
I would love to hear feedback from the community regarding how you handle session synchronization across dynamic async workers!













