fix: handle missing serviceToken cookie by validating response and alerting on token expiration
This commit is contained in:
+6
-1
@@ -33,7 +33,12 @@ async def main():
|
||||
sts_url = f"{location}&clientSign={client_sign}"
|
||||
|
||||
async with s.get(sts_url, headers=headers) as r2:
|
||||
service_token = r2.cookies.get("serviceToken", "").value
|
||||
st_cookie = r2.cookies.get("serviceToken")
|
||||
if not st_cookie:
|
||||
print(f"❌ 错误:未能获取 serviceToken。请检查 PASS_TOKEN 是否过期。")
|
||||
print(f"响应状态码: {r2.status}")
|
||||
return
|
||||
service_token = st_cookie.value
|
||||
|
||||
token = {
|
||||
"deviceId": device_id,
|
||||
|
||||
Reference in New Issue
Block a user