2

Hello so i am trying to bypass hCaptcha in a website called "stake.games" with using 2captcha bypass but it seems to not work. I am getting the bypass code but when i type it in both "grecaptcha-response" & "hcaptcha-response" and click the check button it doesnt accept the bypass code and asks me to do captcha again. When that happened, i went to 2captchas support and asked him why. He said the site uses "callback" and gave me a code to get callback function (i believe?). Heres the code that he gave me:

window.myInterval = setInterval(() => {
    if (window.hcaptcha) {
        console.log('hcaptcha available, lets redefine render method')
        // if hcaptcha object is defined, we save the original render method into window.originalRender
        window.originalRender = hcaptcha.render
        // then we redefine hcaptcha.render method with our function
        window.hcaptcha.render = (container, params) => {
            console.log(container)
            console.log(params)
            // storing hcaptcha callback globally
            window.hcaptchaCallback = params.callback 
            // returning the original render method call
            return window.originalRender(container, params)
        }
        clearInterval(window.myInterval)
    } else {
        console.log('hcaptcha not available yet')
    }
}, 500)

The result was:

{
    "sitekey": "12c3f8c6-a15c-4b83-8767-8050ee30fb70",
    "size": "invisible",
    "theme": "dark",
    "hl": "en"
}

callback and others

So i didnt understand anything and typed the sitekey, url once again in the python project they give in their site to bypass the hCaptcha but it didnt bypass hCaptcha again.

Code i am trying to bypass hCaptcha:

import sys
import os

sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))

from twocaptcha import TwoCaptcha

api_key = os.getenv('APIKEY_2CAPTCHA', '52aec93fb7d4c1b0e99c6c0f614a11ce')

solver = TwoCaptcha(api_key)

try:
    result = solver.hcaptcha(
        sitekey='12c3f8c6-a15c-4b83-8767-8050ee30fb70',
        url='https://stake.games/settings/offers?code=xd&modal=redeemBonus&type=drop',
    )

except Exception as e:
    sys.exit(e)

else:
    sys.exit('solved: ' + str(result))

So basically i am asking for how to solve hCaptcha with callBack function? My english is not that good but I hope i was able to describe my problem.

if you want to explore the site but don't want to register heres a test account:

account id: testaccount1 account pw: 123456789Oo site: stake.games where to test?: https://stake.games/settings/offers?code=xd&modal=redeemBonus&type=drop

ccz
  • 41
  • 3

1 Answers1

1

It's just window.hcaptchaCallback but you probably need to pass the token:

window.hcaptchaCallback(token)
pguardiario
  • 53,827
  • 19
  • 119
  • 159
  • I've tried it again now. I understand what happened this time. I tried doing the captcha to see the response and when i try to bypass the captcha in python the code seems to be shorter than expected. It works i believe but how am i gonna get the bypass code that i want? I've tried to bypass with the first code but it seems to not work as i described – ccz Jul 06 '21 at 19:14