From e8fef0dde2b8d74f0c65e0ef1f7f7e0700c456b6 Mon Sep 17 00:00:00 2001 From: ZJY <764763903@qq.com> Date: Sun, 12 Sep 2021 11:14:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BD=AC=E6=8D=A2=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E8=87=AA=E5=8A=A8=E6=94=B9=E4=B8=BAfalse=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=B8=83=E6=AC=A1=E6=97=A0=E9=99=90=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/available.go | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/models/available.go b/models/available.go index e52602e..af90056 100644 --- a/models/available.go +++ b/models/available.go @@ -220,33 +220,25 @@ 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)) if len(ck.WsKey) > 0 { var pinky = fmt.Sprintf("pin=%s;wskey=%s;", ck.PtPin, ck.WsKey) - msg1 := cmd(fmt.Sprintf(`python3 test.py "%s"`, 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 - } - (&JdCookie{}).Push("转换失败") - } - } - - return false + msg := cmd(fmt.Sprintf(`python3 test.py "%s"`, pinky), &Sender{}) + JdCookie{}.Push(fmt.Sprintf("自动转换wskey---%s", msg)) + ptKey := FetchJdCookieValue("pt_key", msg) + ptPin := FetchJdCookieValue("pt_pin", msg) + ck := JdCookie{ + PtKey: ptKey, + PtPin: ptPin, + } + 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 { + nck.Update(Available, false) + (&JdCookie{}).Push("转换失败") } }