Widevine / EME (DRM)
Play DRM-protected video, and match a real Chrome's EME surface, with the Widevine CDM, fetched at runtime exactly the way a stock Chrome receives it.
- Linux: on by default for licensed launches (since SDK 0.48.0).
- Windows and macOS: off by default on every build up to r62, and on again from r63. Those builds send the DRM licence request with the client id in the clear, which a real Chrome never does. Turn it on anyway with
widevine=True.
Why the SDK fetches it
Clearcote ships the EME/Widevine plumbing compiled in (enable_widevine) but not Google's proprietary CDM, which Clearcote does not redistribute — and which could not ship in the open-source build. 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 the SDK fetches the CDM on your machine, from Google's own component server; Clearcote never distributes it.
When it is on by default
When a licence key is found (the license_key option, CLEARCOTE_LICENSE_KEY or ~/.clearcote/license.key) and the browser is licensed 154 r32 or newer, every local launch turns Widevine on: launch(), persistent contexts, serve(), the Python async API and the .NET launches. Nothing to pass. The first launch downloads the CDM; later launches use the cached copy at once.
- Windows and macOS: only on a build that sends its licence request the way Chrome does (SDK 0.70.2 and later). Licensed builds up to r62 send the DRM licence request with the client id in the clear; Chrome encrypts it, and a page can read the difference. On such a build the default leaves Widevine off and the SDK says so once.
widevine=TrueorCLEARCOTE_WIDEVINE=1still turns it on. From r63 the default is on again by itself. Linux is unchanged. - Turn it off with
widevine=False(Node{ widevine: false }, .NETWidevine = false) orCLEARCOTE_WIDEVINE=0. - Turn it on without a key (the open build) with
widevine=TrueorCLEARCOTE_WIDEVINE=1. A launch with no key stays without Widevine unless you ask, as before. - Never blocks a launch. The default waits at most 15 seconds for the CDM (
CLEARCOTE_WIDEVINE_TIMEOUT_SECONDS); if it cannot be loaded, the browser starts without it and the SDK warns once.
from clearcote import launch
browser = launch() # licence key found: Widevine is on
page = browser.new_page()
page.goto("https://your-drm-site.example")
# navigator.requestMediaKeySystemAccess('com.widevine.alpha') resolves
plain = launch(widevine=False) # or CLEARCOTE_WIDEVINE=0import { launch, fetchWidevine } from "clearcote";
// optional: pre-fetch the CDM ahead of time (cached under ~/.clearcote/WidevineCdm)
await fetchWidevine();
const browser = await launch(); // licence key found: Widevine is on
const plain = await launch({ widevine: false }); // or CLEARCOTE_WIDEVINE=0How it works & limits
- Fetched once, cached. The CDM is downloaded from Google's component server, SHA-256 verified (a missing hash is refused: it's a native library), and cached under
~/.clearcote/WidevineCdm(move it withCLEARCOTE_WIDEVINE_DIR). Launches that run at the same time share one download. Pre-fetch withfetch_widevine()/fetchWidevine(). - One version check a day. A cached CDM checked in the last 24 hours is used with no network at all; after that, one version check goes to Google's update server, directly from this machine rather than through your proxy. Offline, the cached CDM is used.
- Licensed 154 r32 and newer: the engine takes
--widevine-cdm-path, a CDM directory it registers at startup in every profile, incognito and Playwright's throwaway ones included. From SDK 0.41.0 awidevinelaunch passes it for you, and from 0.48.0 every licensed launch does. Older builds need a profile:widevine=Truewith the synclaunch()or a persistent context seeds the CDM into it and lets the component updater register it. A--widevine-cdm-path=<dir>of your own inargsalways wins. - Python, Node and .NET (.NET since 0.48.0:
LaunchOptions.Widevineand theWidevineclass). Works on Windows and Linux. - Docker: the official image turns it on by default for a Windows persona (
CC_WIDEVINE=0to turn it off). Hosted browsers carry their own. - Software-secure (L3) playback; hardware-secure (L1) is out of scope.
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 — and the default persona presents as Google Chrome, which ships the CDM on every desktop platform. See How detection works.