Skip to content

li0ard/widevine

Repository files navigation

widevine logo

@li0ard/widevine
Simple Widevine CDM implementation
docs



Caution

  • Project doesn't provide private key and Client ID 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 privacy mode with Service certificates
  • Support .wvd deserialization
  • Strictly typed API

Installation

npm i @li0ard/widevine

Example

import { CDM, PSSH, Device, DeviceType, KeyType } from "@li0ard/widevine"; const device = Device.decode( DeviceType.ANDROID, Buffer.from("....", "base64"), Buffer.from("....", "base64") ) // Device.fromWvd(....); const cdm = new CDM(device); const sessionId = cdm.open(); const pssh = PSSH.decode(Buffer.from("....", "base64")); const challenge = cdm.getLicenseChallenge(sessionId, pssh); const license = await (await fetch(`https://cwip-shaka-proxy.appspot.com/no_auth`, { method: "POST", body: challenge })).arrayBuffer(); for(const key of cdm.parseLicense(sessionId, new Uint8Array(license))) console.log(`- [${KeyType[key.type]}] ${bytesToHex(key.kid)}:${bytesToHex(key.key)}`); cdm.close(sessionId);

Links

  • Widevine - Widevine (and Widevine icon) by Google
  • pywidevine - An Open Source Python Implementation of Widevine CDM (greatly inspired)

About

Simple Widevine CDM implementation

Topics

Resources

License

Stars

Watchers

Forks

Contributors