Menu

HCaptchaTask:通过代理服务器破解 HCaptcha 谜题

hCaptcha 开发人员将其人机验证称为“Recaptcha 的短期替代品”。我们尝试在我们的 API 中创建同样的任务,以使任务属性与 RecaptchaV2Task 中的任务属性完全相同,除了“type”属性。

关于User-Agent值的重要通知。以前可以为任务指定你自己的用户代理,但这已经改变了。相反,我们提供工作者的用户代理,你需要用它来绕过Hcaptcha的付费版本。这是因为现在几乎不可能在另一个平台上模拟一个外来的用户代理,例如Firefox的Chrome用户代理。浏览器除了navigator.userAgent之外,还有大量的辅助工具,它们专门属于一个或另一个平台。

验证码示例

任务对象

属性类型必须使用用途
type字符串HCaptchaTask
websiteURL字符串目标网页的地址。可位于网站中的任何位置,甚至可位于会员区中。我们的工作人员不会转到该位置,而是会模拟其访问操作。
websiteKey字符串hCaptcha 网站密钥
proxyType字符串代理类型
http - 普通 http/https 代理
socks4 - socks4 代理
socks5 - socks5 代理
proxyAddress字符串ipv4/ipv6 代理服务器 IP 地址。禁止使用主机名或本地网络中的 IP 地址。
proxyPort整数代理服务器端口
proxyLogin字符串用于需要授权(基本授权)的代理服务器的登录名
proxyPassword字符串代理服务器密码
userAgent字符串提供您用来浏览网站的用户代理。我们的工作人员在解决Hcaptcha的过程中会使用相同的值。
废弃了。取而代之的是使用来自我们工人的User-Agent,它由 "getTaskResult "方法返回。
isInvisible布尔值指定Hcaptcha是否不可见。这将为我们的工人渲染一个适当的小部件。
isEnterprise布尔值如果希望使用 Hcaptcha 分数最高的工作人员来解决 Hcaptcha,请使用此参数。请注意,这会使解码成本增加三倍。
enterprisePayload对象额外的参数,我们将用于渲染企业版的Hcaptcha部件。

属性类型必须使用
rqdata字符串
sentry布尔值
apiEndpoint字符串
endpoint字符串
reportapi字符串
assethost字符串
imghost字符串

请求示例

Python
Javascript
PHP
Java
C#
bash
#pip3 install anticaptchaofficial

from anticaptchaofficial.hcaptchaproxyon import *

solver = hCaptchaProxyon()
solver.set_verbose(1)
solver.set_key("YOUR_API_KEY_HERE")
solver.set_website_url("https://hcaptcha.com/")
solver.set_website_key("00000000-0000-0000-0000-000000000000")
solver.set_proxy_address("PROXY_ADDRESS")
solver.set_proxy_port(1234)
solver.set_proxy_login("proxylogin")
solver.set_proxy_password("proxypassword")
solver.set_user_agent("Mozilla/5.0")
solver.set_cookies("test=true")

# tell API that Hcaptcha is invisible
#solver.set_is_invisible(1)

# tell API that Hcaptcha is Enterprise
#solver.set_is_enterprise(1)

# set here parameters like rqdata, sentry, apiEndpoint, endpoint, reportapi, assethost, imghost
#solver.set_enterprise_payload({
#    "rqdata": "rq data value from target website",
#    "sentry": True
#})

# Specify softId to earn 10% commission with your app.
# Get your softId here: https://anti-captcha.com/clients/tools/devcenter
solver.set_soft_id(0)

g_response = solver.solve_and_return_solution()
if g_response != 0:
    print "g-response: "+g_response
else:
    print "task finished with error "+solver.error_code

任务破解结果对象

属性类型用途
gRecaptchaResponse字符串与目标网站中的提交窗体发生相互作用所需的标记字符串。
respKey字符串window.hcaptcha.getRespKey() "函数可用时的输出。一些网站使用它来进行额外的验证。
userAgent字符串工作者的浏览器的用户代理。在提交响应标记时使用它。

回应示例

{
    "errorId":0,
    "status":"ready",
    "solution":
    {
        "gRecaptchaResponse":"3AHJ_VuvYIBNBW5yyv0zRYJ75VkOKvhKj9_xGBJKnQimF72rfoq3Iy-DyGHMwLAo6a3......",
        "respKey":"E0_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjoiQk5vb1JuZ0FPSHBCM2EyWURSSC......",
        "userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0"
    },
    "cost":"0.001500",
    "ip":"46.98.54.221",
    "createTime":1472205564,
    "endTime":1472205570,
    "solveCount":"0"
}