Skip to content
Documentation menu

Widevine / EME (DRM)

Play DRM-protected video (and match a real Chrome's EME surface) by opting in to the Widevine CDM — fetched at runtime exactly the way a stock Chrome receives it.

Why it's opt-in

Because Clearcote is 100% open source, the binary ships the EME/Widevine plumbing compiled in (enable_widevine) but not Google's proprietary CDM — that closed blob can't live in a FOSS package. Without a CDM, navigator.requestMediaKeySystemAccess('com.widevine.alpha') rejects, which is both a broken-DRM problem and a coherence tell (a real Chrome resolves it). So you trigger the download — Clearcote never distributes the CDM.

Enable it

On a persistent context, pass widevine. The SDK downloads the CDM once from Google's own component server, verifies its SHA-256, seeds it into the profile, and enables it — then DRM pages play:

python
from clearcote import launch_persistent_context

ctx = launch_persistent_context("./profile-drm", widevine=True)   # fetch + seed + enable the CDM
page = ctx.pages()[0] if ctx.pages() else ctx.new_page()
page.goto("https://your-drm-site.example")
# navigator.requestMediaKeySystemAccess('com.widevine.alpha') now resolves
javascript
import { launchPersistentContext, fetchWidevine } from "clearcote";

// optional: pre-fetch the CDM ahead of time (cached under ~/.clearcote/WidevineCdm)
await fetchWidevine();

const ctx = await launchPersistentContext("./profile-drm", { widevine: true });

How it works & limits

  • Opt-in, user-triggered — the CDM is fetched once from Google's component server, SHA-256 verified (a missing hash is refused — it's a native DLL), and cached under ~/.clearcote/WidevineCdm. Pre-fetch with fetch_widevine() / fetchWidevine().
  • Persistent context required — the CDM lives in the profile, so use launch_persistent_context (not the incognito launch()). The SDK un-suppresses the component updater and forces a fast-update scan so the engine registers the CDM.
  • Software-secure (L3) playback; hardware-secure (L1) is out of scope.
  • Best-effort — if the CDM can't be fetched, the launch proceeds without DRM rather than failing.
DRM support is one more piece of a coherent identity: a real Chrome answers the Widevine query, so a persona that can't is a tell. See How detection works.