Closed yunielrc closed 2 years ago
Could you elaborate a bit more on this? I'm not sure I understand what you mean.
Hi @Furry,
It's a waste of time to wait more than 5 seconds if the captcha isn't ready.
According to the 2captcha api documentation on https://2captcha.com/2captcha-api: The process of solving captchas with 2captcha is really easy and it's mostly the same for all types of captchas: .... Step 4. Submit a HTTP GET request to our API URL: http://2captcha.com/res.php to get the result. If captcha is already solved server will return the answer in format corresponding to the type of your captcha. By default answers are returned as plain text like: OK|Your answer. But answer can also be returned as JSON {"status":1,"request":"TEXT"} if json parameter is used.
LOOK AT HERE---> If captcha is not solved yet server will return CAPCHA_NOT_READY result. Repeat your request in 5 seconds. ...
About the issue raised and pull request. And this quote:
https://2captcha.com/2captcha-api: If captcha is not solved yet server will return CAPCHA_NOT_READY result. Repeat your request in 5 seconds.
In my opinion, these 5 seconds are just a suggestion and should be changed by the user. Otherwise 2captcha could control the request limit on the server and return the error to us, which is not the case.
This piece of code and number 5000ms is very strict:
case "CAPCHA_NOT_READY": return this.pollResponse(id, 5000);
I think it would be better to put the same pollingFreq
instead and suggest it to the user in the documentation for 5 seconds.
Imagine that the captcha is ready and you have to wait at least 5 seconds for no reason.
Even if you do not have a plan for this change, it is better to delete this parameter altogether, because at the moment, the amount of interrupt we want to use only once at the beginning of the request is useless and also misleads the user.
Thanks for bringing it to my attention, I'll take a look and fix this later today after my classes!
seem you closed without review, maybe forgotten :)
I blame the 'close with comment' button
I've manually reverted the changes in https://github.com/Furry/2captcha/pull/10/files#diff-3923be146c30923916f3053402106966289a51bceaea0691ffdd4b30a9f0f376R144, substituting the previous 5000ms delay with this.pollingFrequency 50743ac
It's better, Thanks.
Hi, @Furry I can improve the code and send you a pull request