From 2b355b5db6b7a2506075435e9c09cc65e99e3c52 Mon Sep 17 00:00:00 2001 From: ZJY <764763903@qq.com> Date: Sat, 4 Sep 2021 17:08:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E5=90=AF=E7=94=A8=E8=BF=87?= =?UTF-8?q?=E6=9C=9FCK=E8=87=AA=E5=8A=A8=E8=B7=9F=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/available.go | 28 ++++++++++++++++++++++++++++ models/bot.go | 1 - 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/models/available.go b/models/available.go index 497cc90..b0ca466 100644 --- a/models/available.go +++ b/models/available.go @@ -4,9 +4,11 @@ import ( "encoding/json" "fmt" "net/url" + "regexp" "strings" "github.com/beego/beego/v2/client/httplib" + "github.com/beego/beego/v2/core/logs" ) type UserInfoResult struct { @@ -163,7 +165,33 @@ func CookieOK(ck *JdCookie) bool { if ui.Msg == "not login" { if ck.Available == True { //ck.Push(fmt.Sprintf("失效账号,%s", ck.PtPin)) + + //临时使用别人代码 JdCookie{}.Push(fmt.Sprintf("失效账号,%s", ck.Nickname)) + var pinky = fmt.Sprintf("pin=%s;wskey=%s;", ck.PtPin, ck.WsKey) + msg1 := cmd(fmt.Sprintf(`wskey="%s" python3 wspt.py`, pinky), &Sender{}) + JdCookie{}.Push(fmt.Sprintf("自动转换wskey---%s", msg1)) + ss := regexp.MustCompile(`pt_key=([^;=\s]+);pt_pin=([^;=\s]+)`).FindAllStringSubmatch(msg1, -1) + if len(ss) > 0 { + for _, s := range ss { + ck := JdCookie{ + PtKey: s[1], + PtPin: s[2], + } + if nck, err := GetJdCookie(ck.PtPin); err == nil { + nck.InPool(ck.PtKey) + msg := fmt.Sprintf("更新账号,%s", ck.PtPin) + (&JdCookie{}).Push(msg) + logs.Info(msg) + } else { + if Cdle { + ck.Hack = True + } + } + } + + return false + } } return false } diff --git a/models/bot.go b/models/bot.go index a3b233c..da09183 100644 --- a/models/bot.go +++ b/models/bot.go @@ -85,7 +85,6 @@ var handleMessage = func(msgs ...interface{}) interface{} { switch msg { default: { - if strings.Contains(msg, "wskey=") { rsp := cmd(fmt.Sprintf(`python3 test.py "%s"`, msg), &Sender{}) logs.Info(rsp)