Skip to content

Instantly share code, notes, and snippets.

@Mufanc
Created October 10, 2023 09:16
Show Gist options
  • Save Mufanc/cbcc605c41ed2ed2bf2757b8e739b74d to your computer and use it in GitHub Desktop.
Save Mufanc/cbcc605c41ed2ed2bf2757b8e739b74d to your computer and use it in GitHub Desktop.
解析小爱导出的课程表
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