Python implementation of Google's Widevine DRM CDM (Content Decryption Module)
py.typed
file to support PEP561 and silence Mypy (#43).yaml
dependency as it was only installed alongside the serve
extras group.Cdm.set_service_certificate()
.
To ensure security of the messages, verification will still fail if any of the SignedMessages do not match each other.v1.4.3
or newercreate-device
.staging.google.com
) to Cdm.staging_privacy_cert
.
common_privacy_cert
which would be used on Google's production license server,create-device
.>=3.7
, but <4.0
.
^3.7
, but some dependencies also require <4.0
therefore I cannot, for now.PSSH.parse_key_ids()
method.shaka-packager
subprocess call's return code is now returned from Cdm.decrypt()
.Device
now defaults to a dict, even if not set._Types
enum class to DeviceTypes
.Device.Types
class variable alias to _Types
enum class as a static linter cannot recognize a class
variable as a type. Instead, the actual _Types
(now named DeviceTypes
) enum should be imported and used instead..wvd
files in CLI command create-device
.Cdm.system_id
class variable as it conflicted with the cdm.system_id
class instance variable of the same
name. It's also generally not needed. The same data can be gotten via Cdm.uuid.bytes
.type_
when passed a non-int value in Cdm.get_license_challenge()
.test
CLI command instead of a string.__all__
correctly, add missing __all__
in some of the modules.
__ALL__
and an iterable of objects/variables.__all__
and explicitly a list of Strings...v1.4.3
or newerload_xml()
to parse XML data with lxml ignoring Namespaces.__str__
and __repr__
methods to print the object in more Human-friendly ways.
str(pssh)
is now identical to pssh.dumps()
.repr(pssh)
or just pssh
in some cases will result in a nice overview of the PSSHs contents.to_playready()
method to convert Widevine PSSH Data to PlayReady PSSH Data. Please note that the
Checksums for AES-CTR and COCKTAIL KIDs cannot be calculated as the Content Encryption Key would be needed.PSSH.new()
.
playready_to_widevine()
method has been renamed to just to_widevine()
.key_IDs
field when making the new box in PSSH.new()
.key_IDs
value when creating a new box in PSSH.new()
.PSSH.new()
.key_IDs
field when the version is set to 1
in PSSH.new()
.load_xml()
utility to ignore namespaces so that xpath
can
correctly locate any and all KID tags.v1.4.3
or newerPSSH
. All integer values are converted to a UUID and are loaded big-endian.__init__.py
package constructor to all the user classes.
from pywidevine import PSSH
instead of from pywidevine.pssh import PSSH
.Cdm.set_service_certificate()
.SignedDrmCertificate
.
Cdm.set_service_certificate()
in some edge cases, but also when you
try to remove the certificate by setting it to None
.v1.4.3
or newerUpdated protobuf
dependency to 3.19.5
due to the Security Advisory GHSA-8gq9-2x98-w8hf.
v1.4.3
or newer/get_license_challenge
endpoint can now disable privacy mode per-request, even if a service certificate is
set, as long as privacy mode is not enforced in the Serve API config.get_service_certificate()
to get the currently set service certificate of a Session./open
endpoint's function has been renamed from open()
to open_()
to prevent shadowing the
built-in open
.Updated lxml
dependency to >=4.9.1
due to the Security Advisory GHSA-wrxv-2j5q-m38w.
v1.4.0
to v1.4.2
Cdm.open()
are now initialized with a unique session number.Device
no longer throws ValueError
exceptions on DecodeErrors
if it fails to parse the provided Client ID, or
it's VMP data if any. It will now re-raise DecodeError
.