问题描述
您好,我正在尝试使用 2captcha 绕过在名为“stake.games”的网站中绕过 hCaptcha,但它似乎不起作用。我正在获取绕过代码,但是当我在“grecaptcha-response”和“hcaptcha-response”中输入它并单击检查按钮时,它不接受绕过代码并要求我再次执行验证码。当这种情况发生时,我去了 2captchas 支持并问他为什么。他说该站点使用“回调”并给了我一个代码来获取回调函数(我相信?)。这是他给我的代码:
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)
结果是:
{
"sitekey": "12c3f8c6-a15c-4b83-8767-8050ee30fb70","size": "invisible","theme": "dark","hl": "en"
}
所以我什么都不明白,并在他们在他们网站上提供的 python 项目中再次输入了 sitekey、url 以绕过 hCaptcha,但它没有再次绕过 hCaptcha。
我试图绕过 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))
所以基本上我问的是如何用回调函数解决hCaptcha?我的英语不是很好,但我希望我能够描述我的问题。
如果您想浏览该网站但不想在此处注册测试帐户:
账户 ID:testaccount1 账户密码:123456789Oo 站点:stake.games 在哪里测试?:https://stake.games/settings/offers?code=xd&modal=redeemBonus&type=drop
解决方法
它只是 window.hcaptchaCallback
但您可能需要传递令牌:
window.hcaptchaCallback(token)