NextGen🎉
This commit is contained in:
11
python/after.py
Normal file
11
python/after.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# parse license challenge
|
||||
cdm.parse_license(session_id, licence)
|
||||
|
||||
# get keys
|
||||
keys=""
|
||||
for key in cdm.get_keys(session_id):
|
||||
keys+=f"[{key.type}] {key.kid.hex}:{key.key.hex()}\n"
|
||||
|
||||
# close session, disposes of session data
|
||||
cdm.close(session_id)
|
||||
keys
|
||||
26
python/pre.py
Normal file
26
python/pre.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from pywidevine.cdm import Cdm
|
||||
from pywidevine.device import Device
|
||||
from pywidevine.pssh import PSSH
|
||||
|
||||
import json
|
||||
from pyodide.http import pyfetch
|
||||
|
||||
# prepare pssh
|
||||
pssh = PSSH(pssh)
|
||||
|
||||
# load device
|
||||
with open('device.wvd', 'wb') as f:
|
||||
wvdExt=await (await pyfetch("device.wvd")).bytes()
|
||||
f.write(wvdExt)
|
||||
device = Device.load("device.wvd")
|
||||
|
||||
# load cdm
|
||||
cdm = Cdm.from_device(device)
|
||||
|
||||
# open cdm session
|
||||
session_id = cdm.open()
|
||||
|
||||
# get license challenge
|
||||
challenge = cdm.get_license_challenge(session_id, pssh)
|
||||
|
||||
licHeaders=json.loads(licHeaders)
|
||||
5
python/schemes/CommonWV.py
Normal file
5
python/schemes/CommonWV.py
Normal file
@@ -0,0 +1,5 @@
|
||||
licence = await (await pyfetch(licUrl,
|
||||
method="POST",
|
||||
headers=licHeaders,
|
||||
body=challenge
|
||||
)).bytes()
|
||||
Reference in New Issue
Block a user