2022-07-22 10:54:19

golang接入2captcha api自动过验证码认证

2CAPTCHA 说明

Demo

执行 go get -u "github.com/2captcha/2captcha-go"安装该库,以下以自动过hCaptcha验证码为例:

import ( "github.com/2captcha/2captcha-go" ) client := api2captcha.NewClient("YOUR_API_KEY") //替换成你的apikey client.DefaultTimeout = 120 client.RecaptchaTimeout = 600 client.PollingInterval = 100 cap := api2captcha.HCaptcha{ SiteKey: "10000000-ffff-ffff-ffff-000000000001", //替换成目标网站的sitekey Url: "https://mysite.com/captcha.html", //替换成目标网站验证码页面URL } req := cap.ToRequest() req.SetProxy("HTTPS", "login:password@IP_address:PORT") code, err := client.solve(req)

本文链接:https://www.wuxiaowei.com/post/2captcha.html

-- EOF --