Skip to content

Commit

Permalink
Update package (#25)
Browse files Browse the repository at this point in the history
* added yandex method

* Friendly captcha tyoe

* Cutcaptcha addings
  • Loading branch information
PBadicean authored May 8, 2024
1 parent 65a6591 commit 662fa50
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
65 changes: 65 additions & 0 deletions api2captcha.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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
}

0 comments on commit 662fa50

Please sign in to comment.