Menu

Risolvi HCaptcha con un proxy

Gli sviluppatori Hcaptcha chiamano il loro captcha "un rimpiazzamento drop-in per Recaptcha". Abbiamo provato a creare la stessa cosa nella nostra API, così le proprietà dell'attività sono assolutamente le stesse come in RecaptchaV2Task tranne per la proprietà "tipo".

Nota importante sul valore User-Agent. Prima era possibile specificare il tuo User-Agent per le attività, ma le cose sono cambiate. Ora forniamo lo user-agent dell'operatore di cui hai bisogno per bypassare la versione a pagamento di Hcaptcha. È stata apportata questa modifica poichè al giorno d'oggi è quasi impossibile emulare un user-agent estraneo in un'altra piattaforma, per esempio un user-agent Chrome su Firefox. I browser hanno un gran numero di elementi secondari oltre a navigator.userAgent, che appartengono in modo specifico ad una o all'altra piattaforma.

esempio Captcha

Oggetto attività

ProprietàTipoRichiestoScopo
typeStringaHCaptchaTask
websiteURLStringaIndirizzo di una pagina web target. Può trovarsi in qualsiasi punto del sito web, anche nell'area riservata. I nostri operatori non navigano in quest'area, ma simulano la visita.
websiteKeyStringachiave del sito hCaptcha
proxyTypeStringaTipo di proxy
http - tipico proxy http/https
socks4 - proxy socks4
socks5 - proxy socks5
proxyAddressStringaIndirizzo IP proxy ipv4/ipv6. Nessun host name o indirizzo IP dalle reti locali.
proxyPortInteroPorta proxy
proxyLoginStringaLogin per proxy che richiede un'autorizzazione (base)
proxyPasswordStringaPassword proxy
userAgentStringaFornisci lo User Agent che stai usando per navigare sul sito web. I nostri operatori useranno lo stesso valore nel processo di risoluzione Hcaptcha.
Obsoleto. Piuttosto usa User-Agent dai nostri operatori e restituito dal metodo "getTaskResult".
isInvisibleBooleanNoSpecifica se Hcaptcha è invisible o no. Ciò fornirà un widget appropriato per i nostri operatori.
isEnterpriseBooleanNoUsa questo parametro se vuoi che il tuo Hcaptcha venga risolto da operatori con il punteggio Hcaptcha più alto. Tieni presente che ciò triplicherà il costo per la risoluzione.
enterprisePayloadOggettoNoParametri aggiuntivi che useremo per rfeature3,ender widget Hcaptcha per la versione Enterprise.

ProprietàTipoRichiesto
rqdataStringaNo
sentryBooleanNo
apiEndpointStringaNo
endpointStringaNo
reportapiStringaNo
assethostStringaNo
imghostStringaNo

Richiedi esempio

Python
Javascript
Go
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)
    print("user-agent, use it to post the form: ", solver.get_user_agent())
    print("respkey, if any: ", solver.get_respkey())
else:
    print("task finished with error "+solver.error_code)

Oggetto soluzione attività

ProprietàTipoScopo
gRecaptchaResponseStringaStringa token richiesta per interagire con l'evento submit sul sito web target.
respKeyStringaOutput della funzione "window.hcaptcha.getRespKey()" quando è disponibile. Alcuni siti web lo usano per una verifica aggiuntiva.
userAgentStringaUser-Agent del browser dell'operatore. Usalo quando invii il token di risposta.

Esempio di risposta

{
    "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"
}