This commit is contained in:
cdle
2021-09-16 10:15:33 +08:00
parent 100b4da0c1
commit 3f7867a43e
3 changed files with 17 additions and 1332 deletions
+17
View File
@@ -155,3 +155,20 @@ func handleMessage(sender im.Sender) {
}
}
}
func FetchCookieValue(ps ...string) string {
var key, cookies string
if len(ps) == 2 {
if len(ps[0]) > len(ps[1]) {
key, cookies = ps[1], ps[0]
} else {
key, cookies = ps[0], ps[1]
}
}
match := regexp.MustCompile(key + `=([^;]*);{0,1}`).FindStringSubmatch(cookies)
if len(match) == 2 {
return match[1]
} else {
return ""
}
}