replaycli-go/api/anticaptcha/cli.go

46 lines
788 B
Go
Raw Permalink Normal View History

2021-09-30 00:00:49 +00:00
package anticaptcha
import (
"go.digitalcircle.com.br/open/replaycli-go/api"
)
type Cli struct {
}
type Req struct {
Site string `json:"site"`
Data string `json:"data"`
Img []byte `json:"img"`
To int `json:"to"`
}
2021-11-14 13:31:07 +00:00
func (c *Cli) Recaptchav2(site string, data string, copts ...*api.CallOpts) (string, error) {
2021-09-30 00:00:49 +00:00
ret := ""
req := &Req{
Site: site,
Data: data,
Img: nil,
To: 300,
}
2021-11-14 13:31:07 +00:00
err := api.Call("anticaptcha.recaptchav2", req, &ret, copts...)
2021-09-30 00:00:49 +00:00
return ret, err
}
2021-11-14 13:31:07 +00:00
func (c *Cli) Image2text(site string, data []byte, copts ...*api.CallOpts) (string, error) {
2021-09-30 00:00:49 +00:00
ret := ""
req := &Req{
Site: site,
Img: data,
To: 300,
}
2021-11-14 13:31:07 +00:00
err := api.Call("anticaptcha.image2text", req, &ret, copts...)
2021-09-30 00:00:49 +00:00
return ret, err
2021-11-14 13:31:07 +00:00
2021-09-30 00:00:49 +00:00
}
func NewCli() *Cli {
2021-11-14 13:31:07 +00:00
ret := &Cli{}
2021-09-30 00:00:49 +00:00
return ret
}