diff --git a/README.md b/README.md index b1f1618..01305c1 100644 --- a/README.md +++ b/README.md @@ -391,6 +391,34 @@ cap := api2captcha.MTCaptcha{ } ``` +### Yandex +Use this method to solve Yandex and obtain a token to bypass the protection. +```go +cap := api2captcha.Yandex{ + Url: "https://rutube.ru", + SiteKey: "Y5Lh0tiycconMJGsFd3EbbuNKSp1yaZESUOIHfeV", +} +``` + +### Friendly Captcha +Use this method to solve Friendly Captcha and obtain a token to bypass the protection. +```go +cap := api2captcha.Friendly{ + Url: "https://example.com", + SiteKey: "2FZFEVS1FZCGQ9", +} +``` + +### CutCaptcha +Use this method to solve CutCaptcha and obtain a token to bypass the protection. +```go +cap := api2captcha.CutCaptcha{ + MiseryKey: "a1488b66da00bf332a1488993a5443c79047e752", + DataApiKey: "SAb83IIB", + Url: "https://example.cc/foo/bar.html", +} +``` + ### Amazon WAF Use this method to solve Amazon WAF Captcha also known as AWS WAF Captcha is a part of Intelligent threat mitigation for Amazon AWS. Returns JSON with the token. diff --git a/api2captcha.go b/api2captcha.go index 9d4bc23..e964228 100644 --- a/api2captcha.go +++ b/api2captcha.go @@ -188,6 +188,22 @@ type ( SiteKey string Url string } + + Yandex struct { + Url string + SiteKey string + } + + Friendly struct { + Url string + SiteKey string + } + + CutCaptcha struct { + MiseryKey string + DataApiKey string + Url string + } ) var ( @@ -946,3 +962,52 @@ func (c *MTCaptcha) ToRequest() Request { return req } + +func (c *Yandex) ToRequest() Request { + req := Request{ + Params: map[string]string{"method": "yandex"}, + } + + if c.SiteKey != "" { + req.Params["sitekey"] = c.SiteKey + } + if c.Url != "" { + req.Params["pageurl"] = c.Url + } + + return req +} + + +func (c *Friendly) ToRequest() Request { + req := Request{ + Params: map[string]string{"method": "friendly_captcha"}, + } + + if c.SiteKey != "" { + req.Params["sitekey"] = c.SiteKey + } + if c.Url != "" { + req.Params["pageurl"] = c.Url + } + + return req +} + +func (c *CutCaptcha) ToRequest() Request { + req := Request{ + Params: map[string]string{"method": "cutcaptcha"}, + } + + if c.MiseryKey != "" { + req.Params["misery_key"] = c.MiseryKey + } + if c.DataApiKey != "" { + req.Params["api_key"] = c.DataApiKey + } + if c.Url != "" { + req.Params["pageurl"] = c.Url + } + + return req +}