fix youku (#24)

solve https://github.com/FoxRefire/wvg/issues/14
This commit is contained in:
dreammu 2024-06-09 00:20:14 +08:00 committed by GitHub
parent b6555c3e3a
commit 823d328543
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,9 +1,11 @@
import urllib.parse
payload = urllib.parse.parse_qs(loadBody("str"))
challengeB64 = base64.b64encode(challenge).decode()
payload['licenseRequest'] = challengeB64
# keep payload value as list
payload['licenseRequest'] = [challengeB64]
# convert payload to a dictionary with a single value
payload = {k: v[0] for k, v in payload.items()}
payload = urllib.parse.urlencode(payload)
res = await corsFetch(licUrl, "POST", licHeaders, payload, "json")
licence = res['data']