From 3037104bd3401edc7dd1b7a5a54052c621be9968 Mon Sep 17 00:00:00 2001 From: FoxRefire <155989196+FoxRefire@users.noreply.github.com> Date: Thu, 2 May 2024 06:37:00 +0900 Subject: [PATCH] Delightful error message --- python/after.py | 6 +++++- python/pre.py | 3 +++ python/schemes/DRMToday.py | 1 - python/schemes/GlobalTV.py | 1 - python/schemes/Polsat.py | 1 - python/schemes/RedBee.py | 2 -- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/python/after.py b/python/after.py index 945bcd3..555cf4c 100644 --- a/python/after.py +++ b/python/after.py @@ -1,5 +1,9 @@ # parse license challenge -cdm.parse_license(session_id, licence) +try: + cdm.parse_license(session_id, licence) +except Exception as e: + js.document.getElementById('result').value="sch3m3n0t6upp0rt:y0ucanr3qu3st0rsu6mit\n\n[MPD?]\nhttps://gist.github.com/FoxRefire/fd606ec29a9bfa1f1bef897e0dc3a231" + raise Exception(e) # get keys keys="" diff --git a/python/pre.py b/python/pre.py index d07137a..9af6703 100644 --- a/python/pre.py +++ b/python/pre.py @@ -3,6 +3,8 @@ from pywidevine.device import Device, DeviceTypes from pywidevine.pssh import PSSH import json +import js +import base64 from pyodide.http import pyfetch # prepare pssh @@ -25,6 +27,7 @@ except OSError: pKey=await (await pyfetch("private_key.pem")).bytes() except OSError: + js.document.getElementById('result').value="n0suchd3v1c3f113:r3adth3fuck1ngma2ua1\n\n[MPD?]\nhttps://github.com/FoxRefire/wvg?tab=readme-ov-file#instalation" raise FileNotFoundError("CDM Keys not found!, RTFM!") device = Device(client_id=cID, diff --git a/python/schemes/DRMToday.py b/python/schemes/DRMToday.py index 60d1ce4..483eb4e 100644 --- a/python/schemes/DRMToday.py +++ b/python/schemes/DRMToday.py @@ -1,4 +1,3 @@ -import base64 res = await (await pyfetch(licUrl, method="POST", headers=licHeaders, diff --git a/python/schemes/GlobalTV.py b/python/schemes/GlobalTV.py index 321e75f..ac12e55 100644 --- a/python/schemes/GlobalTV.py +++ b/python/schemes/GlobalTV.py @@ -1,4 +1,3 @@ -import base64 payload = json.loads(base64.b64decode(licBody.encode()).decode()) challengeArr = list(challenge) payload['license_request_data']=challengeArr diff --git a/python/schemes/Polsat.py b/python/schemes/Polsat.py index 5cd4390..d330c87 100644 --- a/python/schemes/Polsat.py +++ b/python/schemes/Polsat.py @@ -1,4 +1,3 @@ -import base64 payload = json.loads(base64.b64decode(licBody.encode()).decode()) challengeB64 = base64.b64encode(challenge).decode() payload['params']['object'] = challengeB64 diff --git a/python/schemes/RedBee.py b/python/schemes/RedBee.py index ac0cece..da28ea4 100644 --- a/python/schemes/RedBee.py +++ b/python/schemes/RedBee.py @@ -1,5 +1,3 @@ -import base64 -import js from pyodide.ffi import to_js req = json.loads(base64.b64decode(licBody.encode()).decode()) b64challenge = base64.b64encode(challenge).decode()