playready - v0.1.1
    Preparing search index...

    playready - v0.1.1

    playready logo

    @li0ard/playready
    Simple PlayReady CDM implementation
    docs



    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
    • Support .prd deserialization
    • Strictly typed API
    npm i @li0ard/playready
    
    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()}`);
    • PlayReady - PlayReady by Microsoft
    • pyplayready - An Open Source Python Implementation of PlayReady CDM (greatly inspired)