临时启用过期CK自动跟新
This commit is contained in:
parent
047063786a
commit
2b355b5db6
@ -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
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user