测试
This commit is contained in:
parent
1d386bb339
commit
4228a7aa9d
@ -184,44 +184,6 @@ func updateCookie() {
|
||||
}
|
||||
|
||||
}
|
||||
for i := 0; i < l-1; i++ {
|
||||
if len(cks[i].WsKey) > 0 {
|
||||
rsp := cmd(fmt.Sprintf(`python3 test.py "%s"`, cks[i].WsKey), &Sender{})
|
||||
ss := regexp.MustCompile(`pt_key=([^;=\s]+);pt_pin=([^;=\s]+)`).FindAllStringSubmatch(rsp, -1)
|
||||
if len(ss) > 0 {
|
||||
|
||||
xyb := 0
|
||||
for _, s := range ss {
|
||||
ck := JdCookie{
|
||||
PtKey: s[1],
|
||||
PtPin: s[2],
|
||||
}
|
||||
if CookieOK(&ck) {
|
||||
xyb++
|
||||
if HasKey(ck.PtKey) {
|
||||
(&JdCookie{}).Push(fmt.Sprintf("重复提交"))
|
||||
} else {
|
||||
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 {
|
||||
NewJdCookie(&ck)
|
||||
msg := fmt.Sprintf("添加账号,账号名:%s", ck.PtPin)
|
||||
logs.Info(msg)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
(&JdCookie{}).Push(fmt.Sprintf("无效CK转换失败,%s", ck.PtPin))
|
||||
}
|
||||
}
|
||||
}
|
||||
go func() {
|
||||
Save <- &JdCookie{}
|
||||
}()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func CookieOK(ck *JdCookie) bool {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user