mirror of
https://github.com/Cp0204/quark-auto-save.git
synced 2026-01-14 00:10:43 +08:00
feat(mparam): new regular expression matching method
This commit is contained in:
parent
c5662644da
commit
e0945ab82a
@ -110,11 +110,16 @@ class Quark:
|
||||
|
||||
def match_mparam_form_cookie(self, cookie):
|
||||
mparam = {}
|
||||
kps_match = re.search(r"(?<!\w)kps=([a-zA-Z0-9%]+)[;&]?", cookie)
|
||||
sign_match = re.search(r"(?<!\w)sign=([a-zA-Z0-9%]+)[;&]?", cookie)
|
||||
vcode_match = re.search(r"(?<!\w)vcode=([a-zA-Z0-9%]+)[;&]?", cookie)
|
||||
kps_match = re.search(r"(?<!\w)kps=([a-zA-Z0-9%+/=]+)[;&]?", cookie)
|
||||
sign_match = re.search(r"(?<!\w)sign=([a-zA-Z0-9%+/=]+)[;&]?", cookie)
|
||||
vcode_match = re.search(r"(?<!\w)vcode=([a-zA-Z0-9%+/=]+)[;&]?", cookie)
|
||||
if kps_match and sign_match and vcode_match:
|
||||
mparam = {
|
||||
# from urllib.parse import unquote
|
||||
# "kps": unquote(kps_match.group(1)),
|
||||
# "sign": unquote(sign_match.group(1)),
|
||||
# "vcode": unquote(vcode_match.group(1)),
|
||||
|
||||
"kps": kps_match.group(1).replace("%25", "%"),
|
||||
"sign": sign_match.group(1).replace("%25", "%"),
|
||||
"vcode": vcode_match.group(1).replace("%25", "%"),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user