dzmitry-duboyski / 2captcha-ts

JavaScript package for easy integration with the API of 2captcha captcha solving service to bypass recaptcha, hcaptcha, funcaptcha, geetest and solve any other captchas.
https://www.npmjs.com/package/2captcha-ts
MIT License
17 stars 3 forks source link

hcaptcha - rqdata + useragent #1

Closed NotGoodCoding closed 1 year ago

NotGoodCoding commented 1 year ago

Hi, did you implement rqdata + useragent parameters? If so, how would I construct the request on include this?

Thanks.

dzmitry-duboyski commented 1 year ago

@NotGoodCoding hi. Yes, you can send rqdata using the data parameter. Note that when sending rqdata, you must also send the invisible and userAgent parameters.

Here is an example of how to send hCaptcha in your case:

const solver = new Captcha.Solver(APIKEY);

solver.hcaptcha({
    pageurl: "https://2captcha.com/demo/hcaptcha?difficulty=moderate",
    sitekey: "b76cd927-d266-4cfb-a328-3b03ae07ded6",
    invisible: 1,
    data: "the_rqdata_value_you_found",
    userAgent: "User-Agent_that_you_use_when_interacting_with_the_site"
})
.then((res) => {
    console.log(res);
})
.catch((err) => {
    console.log(err);
})

Please check if this solution worked for you and let me know if there are any problems.

dzmitry-duboyski commented 1 year ago

@NotGoodCoding Hello again. Today I released v1.3.1 in which I updated the JSDOC documentation for methods. Added the missing parameters for methods, including information about the rqdata and useragent parameters for method hcaptcha.

Screenshot: chaptcha

NotGoodCoding commented 1 year ago

@NotGoodCoding Hello again. Today I released v1.3.1 in which I updated the JSDOC documentation for methods. Added the missing parameters for methods, including information about the rqdata and useragent parameters for method hcaptcha.

Screenshot: chaptcha chaptcha

Thanks a lot!!!

dzmitry-duboyski commented 1 year ago

@NotGoodCoding you're welcome.