@li0ard/playready
v0.1.1
Published
PlayReady CDM implementation in pure TypeScript
Downloads
178
Readme
[!CAUTION]
- Project doesn't provide encryption/signing key and group certificate for any purposes
- Project doesn't condone piracy or any action against the terms of the DRM systems
- Project is for study and research only. Please don't use it for commercial purposes
Features
- Support
.prddeserialization - Strictly typed API
Installation
npm i @li0ard/playreadyExample
import { Device, CDM, KeyType, CipherType, PSSH } from "@li0ard/playready";
const device = Device.decode(
Buffer.from("....", "base64"),
Buffer.from("....", "base64"),
Buffer.from("....", "base64")
); // Device.fromPrd(....);
const cdm = new CDM(device);
const pssh = PSSH.decode(Buffer.from("....", "base64"));
const challenge = cdm.getLicenseChallenge(pssh.decodedPayload as string);
const license = await (await fetch(`https://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(persist:false,sl:2000)`, {
headers: {
'Content-Type': 'text/xml; charset=UTF-8'
},
method: "POST",
body: challenge
})).text();
for(const key of cdm.parseLicense(license))
console.log(`- [${KeyType[key.type]}/${CipherType[key.cipher]}] ${key.kid.toHex()}:${key.key.toHex()}`);Links
- PlayReady - PlayReady by Microsoft
- pyplayready - An Open Source Python Implementation of PlayReady CDM (greatly inspired)
