aw1875 / puppeteer-hcaptcha

A library to solve hcaptcha challenges that are automated within puppeteer. You can automatically set response values where they should be so the only thing left for you is submitting the page or you can get the response token.
https://www.npmjs.com/package/puppeteer-hcaptcha
137 stars 38 forks source link

[Question]: Is it still alive ? #61

Closed dadodasyra closed 2 years ago

dadodasyra commented 2 years ago

I'm currently trying to use the extension has showed in the ReadMe (with the autofill). It seems to partially work, like 1 on 4 times. I saw that sometimes the token returned is undefined. So I tried to debug it a little bit and found that there was an error 400 Bad request. And in this case the code doesnt seems to try to retry the captcha complete but return an undefined token

StatusCodeError: 400 - {"c":{"type":"hsw","req":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmIjowLCJzIjoxNiwidCI6InciLCJkIjoiTFdvZmxoQmRsZE0xSVZibzhyNjN2V29rWG9jM042RGdVQlhzMTI5WlQ1QUd4NWlCcklyMTFpaG5hSWMzbG5TcktVd0pUZFlQOE5TZUoxUzY
5cU8rQXArSlNjZzlNcVVCbU84MHZmL01yeXNOS2ZtOHJvcEt5ak4xbkR6N0VKcERlWVNTdzJkSGhpUGY4dVBqLzFyaUNESDBFV2pLaGtsR2pVK0FueTQ2eUxtR2dzamJpT29qR0oxM2FqUT1POGRIYWpTbnBVQmZFT0VVIiwibCI6Imh0dHBzOi8vbmV3YXNzZXRzLmhjYXB0Y2hhLmNvbS9jLzUwYWM2NTY4
IiwiZSI6MTY1NTM4MTYzNX0.2QksjzqSupZBHq4yX9-dPP-pm0zXXzr7tIubKsY-L90"},"pass":false,"error":"invalid"}
dadodasyra commented 2 years ago

After more digging I found that it freeze on https://hcaptcha.com/checkcaptcha/${key}?s=${sitekey} https://github.com/aw1875/puppeteer-hcaptcha/blob/master/hcaptcha.js#L285

dadodasyra commented 2 years ago

And the error is catched here https://github.com/aw1875/puppeteer-hcaptcha/blob/master/hcaptcha.js#L285. Maybe we should trigger a retry, and at least search a little bit why we're getting a 400 bad request

aw1875 commented 2 years ago

I've been quite busy so haven't really taken a look at hCaptcha but after a quick inspection of the code it looks like the issue is related to the TensorFlow model not correctly identifying the images. Right now the entire answer block comes back as false every time I run the code. So, when I have a little more free time I'll try to dive into that and see exactly what is happening there.

aw1875 commented 2 years ago

@dadodasyra Ran some more tests today and it looks like they seem to be passing now. Not sure if there is really anything I can do aside from training my own model or finding a better source for the image recognition. I'm going to close this issue now but if you have any alternative solutions for the image recognition please let me know.