2captcha-python icon indicating copy to clipboard operation
2captcha-python copied to clipboard

What should I put in data parameter inside the response with already solved hCaptcha?

Open korovokliu opened this issue 2 years ago • 2 comments

When I'm requesting page with requests library I receive this respoce from a server:

{'captcha_key': ['You need to update your app to join this server.'], 'captcha_sitekey': 'a9b5fb07-92ff-493f-86fe-352a2803b3df', 'captcha_service': 'hcaptcha', 'captcha_rqdata': 'OccZocPS0udA/9MOyn4qvfLuti5qTqBYoyNljA7F5cT8JBJrhBWRhw0TEDEFDTOOHMnE6jvE2WzhbGjvDN4hk9fxZkcvQ7Bgjjd/QEJEXReGJWyyxhB0HFSjFjRjn6H23PJjdTyRWpDrTjhV6l/qDb4O14C9XiiXfKF2hQgh', 'captcha_rqtoken': 'IlZFamJXMkdPZ1BiMTJsYlJhQ2NMYlFOaHJTWWdtUjl0NjBhQ0cyZTFCWmhtd01xc0pYeCtMMHhENXNKcmpWRHJPN0FrM2c9PWk5Zk5NUmRRdTNjdFRTTDQi.Yn7Hbw.CNj-_pg2pNmt47a-9OG8PyevmHA'}

then I'm using twocaptcha for solving this captcha in that manner: recaptcha_answer = solver.hcaptcha(sitekey="a9b5fb07-92ff-493f-86fe-352a2803b3df", url=f'https://discord.com/api/v9/invites/{my_invite}', defaultTimeout=600)

and this function return captchaId and code.

The question is where and what should I put in data parameter if captcha is invisible? Cause If I requesting this page again with just a code as captcha_key server response for solving captcha again. I think I just give the wrong payload.

korovokliu avatar May 13 '22 22:05 korovokliu

I'm not 100% sure but For the url you'll just have to use https://discord.com/channels/@me And you'll have to pass the rq_data in the data parameter. I suppose you're also writing in discord.py-self. I'm also working with this module so if I have it figured out I'll get back to you.

5t0n1e avatar Jul 07 '22 16:07 5t0n1e

Just pass the rqdata to data and it'll work. Make sure you're running the twocaptcha part in an executor otherwise it'll be blocking.

result = solver.hcaptcha(
        sitekey=data['captcha_sitekey'],
        url='https://discord.com/channels/@me',
        data=data['captcha_rqdata'],
    )

5t0n1e avatar Jul 07 '22 18:07 5t0n1e