From 29b87cbac7b71773f0389875643c8eff3857ce7a Mon Sep 17 00:00:00 2001 From: PBadicean Date: Wed, 28 Jun 2023 13:38:24 +0300 Subject: [PATCH] added parametr enterprise (#20) --- README.md | 29 +++++++++++++++++++++++++++++ api2captcha.go | 4 ++++ 2 files changed, 33 insertions(+) diff --git a/README.md b/README.md index 3ff2a8f..7bac73c 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ The easiest way to quickly integrate [2Captcha] into your code to automate solvi - [Text](#text-captcha) - [ReCaptcha v2](#recaptcha-v2) - [ReCaptcha v3](#recaptcha-v3) + - [reCAPTCHA Enterprise](#recaptcha-enterprise) - [FunCaptcha](#funcaptcha) - [GeeTest](#geetest) - [hCaptcha](#hcaptcha) @@ -167,6 +168,34 @@ req.SetProxy("HTTPS", "login:password@IP_address:PORT") code, err := client.Solve(req) ``` +### reCAPTCHA Enterprise +reCAPTCHA Enterprise can be used as reCAPTCHA V2 and reCAPTCHA V3. Below is a usage example for both versions. + +```go +// reCAPTCHA V2 +cap := api2captcha.ReCaptcha({ + SiteKey: "6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-", + Url: "https://mysite.com/page/with/recaptcha", + Invisible: true, + Action: "verify", + Enterprise: true, +}) + +// reCAPTCHA V3 +cap := api2captcha.ReCaptcha{ + SiteKey: "6Le-wvkSVVABCPBMRTvw0Q4Muexq1bi0DJwx_mJ-", + Url: "https://mysite.com/page/with/recaptcha", + Version: "v3", + Action: "verify", + Score: 0.3, + Enterprise: true, +} + +req := cap.ToRequest() +req.SetProxy("HTTPS", "login:password@IP_address:PORT") +code, err := client.Solve(req) +``` + ### FunCaptcha FunCaptcha (Arkoselabs) solving method. Returns a token. diff --git a/api2captcha.go b/api2captcha.go index 146d479..39b981a 100644 --- a/api2captcha.go +++ b/api2captcha.go @@ -122,6 +122,7 @@ type ( SiteKey string Url string Invisible bool + Enterprise bool Version string Action string Score float64 @@ -717,6 +718,9 @@ func (c *ReCaptcha) ToRequest() Request { if c.Invisible { req.Params["invisible"] = "1" } + if c.Enterprise { + req.Params["enterprise"] = "1" + } if c.Version != "" { req.Params["version"] = c.Version }