Created
October 10, 2023 09:16
-
-
Save Mufanc/cbcc605c41ed2ed2bf2757b8e739b74d to your computer and use it in GitHub Desktop.
解析小爱导出的课程表
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from base64 import b64decode | |
from urllib.parse import unquote | |
import httpx | |
share_url = httpx.URL(input()) | |
params = b64decode(httpx.QueryParams(share_url.params)['linkToken']).decode() | |
params = unquote(params).split('&') | |
resp = httpx.get('https://i.ai.mi.com/course-multi/table', params={ | |
'userId': params[0], | |
'deviceId': params[1], | |
'ctId': params[4] | |
}) | |
print(json.dumps(resp.json(), indent=4, ensure_ascii=False)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment