Skip to content

Commit

Permalink
Update login.py (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
HandSonic authored Jan 21, 2025
1 parent f5e7ef0 commit a4d09ba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions utils/api/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,14 @@ def get_cookies_by_passtk(self, user_id: str, pass_token: str):
"https://api-alpha.vip.miui.com/page/login",
params=params,
headers=headers,
allow_redirects=False
)
url = response.headers.get("location")

response = get(url, cookies=cookies, headers=headers)
response = get(url, cookies=cookies, headers=headers, allow_redirects=False)
url = response.headers.get("location")

response = get(url, cookies=cookies, headers=headers)
response = get(url, cookies=cookies, headers=headers, allow_redirects=False)
return dict(response.cookies)
except Exception: # pylint: disable=broad-exception-caught
log.exception("从passToken获取 Cookie 失败")
Expand Down

1 comment on commit a4d09ba

@ouyangmland
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image
还是获取不到token

Please sign in to comment.