From d5c986df8e53ea74096e737d63189f4c3e6d0788 Mon Sep 17 00:00:00 2001 From: Pedro de Oliveira Guedes Date: Tue, 28 Dec 2021 12:49:57 -0300 Subject: [PATCH 1/2] Fixing chromeSend. --- api/chrome/cli.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/chrome/cli.go b/api/chrome/cli.go index c73e328..f6a7e66 100644 --- a/api/chrome/cli.go +++ b/api/chrome/cli.go @@ -64,16 +64,16 @@ func (c *Cli) Wait(id string, s string, to int) (string, error) { json.Unmarshal(bs, &ret) return ret, err } -func (c *Cli) Send(id string, m string, ps map[string]interface{}) (string, error) { +func (c *Cli) Send(id string, m string, ps map[string]interface{}) (interface{}, error) { // id -> ID do Websocket no qual se deseja realizar a alteração. - ret := "" + var ret interface{} in := map[string]interface{}{ "method": m, "params": ps, } - err := c.HttpCli().JsonPost("/ipc/chrome/eval/"+id, in, &ret) + err := c.HttpCli().JsonPost("/ipc/chrome/send/"+id, in, &ret) return ret, err - // ret -> + // ret -> Retorno do comando (Referência em: https://chromedevtools.github.io/devtools-protocol/) } func (c *Cli) OpenTabs() (ret []map[string]string, err error) { From 13626dcde9b24f3a5c71899b8458d438818f2bef Mon Sep 17 00:00:00 2001 From: Pedro de Oliveira Guedes Date: Tue, 28 Dec 2021 12:51:01 -0300 Subject: [PATCH 2/2] Fixing recatcha-v2 and image2text methods. --- api/anticaptcha/cli.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/anticaptcha/cli.go b/api/anticaptcha/cli.go index f7649e0..7bf6ef2 100644 --- a/api/anticaptcha/cli.go +++ b/api/anticaptcha/cli.go @@ -17,7 +17,7 @@ type Cli struct { type Req struct { Site string `json:"site"` Data string `json:"data"` - Img []byte `json:"img"` + Img string `json:"img"` To int `json:"to"` } @@ -26,14 +26,14 @@ func (c *Cli) Recaptchav2(site string, data string) (string, error) { req := &Req{ Site: site, Data: data, - Img: nil, + Img: "", To: 300, } err := c.HttpCli().JsonPost("/ipc/anticaptcha/recaptchav2", req, &ret) return ret, err } -func (c *Cli) Image2text(site string, data []byte) (string, error) { +func (c *Cli) Image2text(site string, data string) (string, error) { ret := "" req := &Req{ Site: site,