2captcha / 2captcha-go

Golang Module for easy integration with the API of 2captcha captcha solving service to bypass recaptcha, funcaptcha, geetest and solve any other captchas.
https://2captcha.com
MIT License
108 stars 42 forks source link

Updating DefaultTimeout and PollIntervals for timeout prevention #2

Closed Gnyblast closed 3 years ago

Gnyblast commented 3 years ago

Hey,

I realized that for hcaptcha, if requests takes more then enough to be solved and return CAPCHA_NOT_READY, it just polls one more time after 10 seconds, and if that still not ready dies. This has two downsides, 1st is; it keeps you waiting 10 more seconds which actually it might be ready in 3rd or 4th second and you keep waiting extra 6 seconds. 2nd is; if it still not solved after 10 seconds it dies.

I changed these numbers to 20 and 5 in which it polls every 5 seconds for 4 times and eliminates those downsides as much as possible. I tested and got significant positive effects on my code.

Thanks.

Gnyblast commented 3 years ago

Nwm. Just realized client struct can be accessed outside to change these values.