wvg/python/schemes/Comcast.py
FoxRefire 0ec39a5da9 Refactor: Define corsFetch as Python API
corsFetch is used to requesting license server that requires Origin header.
Pyfetch does not retain the Origin header due to browser security restrictions.
This change will make it easier to create schemes using corsFetch API.
2024-06-06 12:38:08 +09:00

6 lines
266 B
Python

req = json.loads(base64.b64decode(licBody.encode()).decode())
b64challenge = base64.b64encode(challenge).decode()
req['licenseRequest'] = b64challenge
res = await corsFetch(licUrl, "POST", licHeaders, req, "json")
licence = base64.b64decode(res['license'].encode())