diff --git a/python/schemes/DRMToday.py b/python/schemes/DRMToday.py index e99d6cb..3cf5675 100644 --- a/python/schemes/DRMToday.py +++ b/python/schemes/DRMToday.py @@ -1,7 +1,4 @@ -res = await (await pyfetch(licUrl, - method="POST", - headers=licHeaders, - body=challenge -)).json() +res = await corsFetch(licUrl, "POST", licHeaders, challenge, "json") + licence = res['license'] diff --git a/python/schemes/GlobalTV.py b/python/schemes/GlobalTV.py index 116382d..4497794 100644 --- a/python/schemes/GlobalTV.py +++ b/python/schemes/GlobalTV.py @@ -1,8 +1,5 @@ payload = loadBody("json") challengeArr = list(challenge) payload['license_request_data']=challengeArr -licence = await (await pyfetch(licUrl, - method="POST", - headers=licHeaders, - body=json.dumps(payload) -)).bytes() + +licence = await corsFetch(licUrl, "POST", licHeaders, payload, "blob") diff --git a/python/schemes/NosTV.py b/python/schemes/NosTV.py index 1ef2b5b..7a354d6 100644 --- a/python/schemes/NosTV.py +++ b/python/schemes/NosTV.py @@ -1,7 +1,4 @@ b64challenge = base64.b64encode(challenge).decode() -res = await (await pyfetch(licUrl, - method="POST", - headers=licHeaders, - body=json.dumps({"challenge": b64challenge}) -)).json() +res = await corsFetch(licUrl, "POST", licHeaders, {"challenge": b64challenge}, "json") + licence = res["license"][0] diff --git a/python/schemes/Polsat.py b/python/schemes/Polsat.py index ecf02b9..cdadc05 100644 --- a/python/schemes/Polsat.py +++ b/python/schemes/Polsat.py @@ -1,9 +1,6 @@ payload = loadBody("json") challengeB64 = base64.b64encode(challenge).decode() payload['params']['object'] = challengeB64 -licence = await (await pyfetch(licUrl, - method="POST", - headers=licHeaders, - body=json.dumps(payload) -)).json() -licence = licence['result']['object']['license'] +res = await corsFetch(licUrl, "POST", licHeaders, payload, "json") + +licence = res['result']['object']['license'] diff --git a/python/schemes/thePlatform.py b/python/schemes/thePlatform.py index 8b45ab5..1c6a8cf 100644 --- a/python/schemes/thePlatform.py +++ b/python/schemes/thePlatform.py @@ -1,9 +1,6 @@ payload = loadBody("json") b64challenge = base64.b64encode(challenge).decode() payload["getWidevineLicense"]["widevineChallenge"]=b64challenge -res = await (await pyfetch(licUrl, - method="POST", - headers=licHeaders, - body=json.dumps(payload) -)).json() +res = await corsFetch(licUrl, "POST", licHeaders, payload, "json") + licence = res["getWidevineLicenseResponse"]["license"]