You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
您好,这两种方式计算出来的x_s参数都是可用的嘛
方式一:
encrypt_params = context_page.evaluate("([url, data]) => window._webmsxyw(url, data)", [uri, data])
return {
"x-s": encrypt_params["X-s"],
"x-t": str(encrypt_params["X-t"])
}
方式二:
def h(n):
m = ""
d = "A4NjFqYu5wPHsO0XTdDgMa2r1ZQocVte9UJBvk6/7=yRnhISGKblCWi+LpfE8xzm3"
for i in range(0, 32, 3):
o = ord(n[i])
g = ord(n[i + 1]) if i + 1 < 32 else 0
h = ord(n[i + 2]) if i + 2 < 32 else 0
x = ((o & 3) << 4) | (g >> 4)
p = ((15 & g) << 2) | (h >> 6)
v = o >> 2
b = h & 63 if h else 64
if not g:
p = b = 64
m += d[v] + d[x] + d[p] + d[b]
return m
v = int(round(time.time() * 1000) if not ctime else ctime)
raw_str = f"{v}test{uri}{json.dumps(data, separators=(',', ':'), ensure_ascii=False) if isinstance(data, dict) else ''}"
md5_str = hashlib.md5(raw_str.encode('utf-8')).hexdigest()
x_s = h(md5_str)
The text was updated successfully, but these errors were encountered:
您好,这两种方式计算出来的x_s参数都是可用的嘛
方式一:
encrypt_params = context_page.evaluate("([url, data]) => window._webmsxyw(url, data)", [uri, data])
return {
"x-s": encrypt_params["X-s"],
"x-t": str(encrypt_params["X-t"])
}
方式二:
def h(n):
m = ""
d = "A4NjFqYu5wPHsO0XTdDgMa2r1ZQocVte9UJBvk6/7=yRnhISGKblCWi+LpfE8xzm3"
for i in range(0, 32, 3):
o = ord(n[i])
g = ord(n[i + 1]) if i + 1 < 32 else 0
h = ord(n[i + 2]) if i + 2 < 32 else 0
x = ((o & 3) << 4) | (g >> 4)
p = ((15 & g) << 2) | (h >> 6)
v = o >> 2
b = h & 63 if h else 64
if not g:
p = b = 64
m += d[v] + d[x] + d[p] + d[b]
return m
The text was updated successfully, but these errors were encountered: