Commit Graph

230 Commits

Author SHA1 Message Date
rlaphoenix 52fd5e74ba Extract Key ID to UUID parsing to parse_key_ids method 2023-11-08 19:25:30 +00:00
rlaphoenix 2656a795c3 Remove unused f-strings and unused import 2023-11-08 19:01:23 +00:00
rlaphoenix bbbaeafbb6 Lessen restriction on Python version and update deps 2023-11-08 17:20:20 +00:00
mediaminister c71f867a72
Use std-lib xml instead of lxml (#35)
Allows for support on ARM devices and reduces dependencies.

---------

Co-authored-by: rlaphoenix <rlaphoenix@pm.me>
2023-10-17 20:40:47 +01:00
rlaphoenix dad32e728b Add isort config, run isort across project 2023-09-19 12:05:41 +01:00
rlaphoenix db7bf977a1 Update dependencies and GitHub Workflows 2023-09-19 11:57:00 +01:00
rlaphoenix bfaae20e81 Prevent overwriting files when using create-device 2023-07-07 20:10:08 +01:00
rlaphoenix 728a3e7575 Add ability to specify output filename when using create-device 2023-07-07 20:09:34 +01:00
rlaphoenix 29693bedf6 Ensure output directory exists when using create-device 2023-07-07 19:48:11 +01:00
rlaphoenix db6eaef450
Merge pull request #27 from rlaphoenix/dependabot/pip/requests-2.31.0
Bump requests from 2.28.1 to 2.31.0
2023-05-27 20:12:50 +01:00
dependabot[bot] 6a7f8b9a39
Bump requests from 2.28.1 to 2.31.0
Bumps [requests](https://github.com/psf/requests) from 2.28.1 to 2.31.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.28.1...v2.31.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-05-23 04:32:36 +00:00
rlaphoenix e4a8316227 Use Python 3.11 in GitHub Workflows 2023-02-03 07:04:22 +00:00
rlaphoenix 9568d7fdb9 Update Poetry Version used in GitHub Workflows 2023-02-03 07:03:36 +00:00
rlaphoenix ece0914920 Update Changelog for v1.6.0 2023-02-03 07:00:56 +00:00
rlaphoenix 2ab659eab6 Bump to v1.6.0 2023-02-03 06:58:00 +00:00
rlaphoenix 99aef63354 Add export-device command to export WVDs back as files
In reality you wouldn't need this for use with pywidevine, but a lot have asked me for this feature so they can use WVDs in other ways or with other software that does not support WVDs.
2023-02-03 06:53:55 +00:00
rlaphoenix fd3df13e9c Add Support Python 3.11 2023-02-03 06:26:50 +00:00
rlaphoenix 2e9c09d5f1 Update Changelog for v1.5.3 2022-12-27 20:07:52 +00:00
rlaphoenix 2e25f9c7bd Bump to v1.5.3 2022-12-27 20:07:37 +00:00
rlaphoenix ddc66f0a2b PSSH: Simplify the PSSH Data conversion function names 2022-12-27 00:26:05 +00:00
rlaphoenix c9f55c6e6b PSSH: Implement Widevine to PlayReady conversion
The XML creation is a bit dodgy because I despise XML. If you like lxml, feel free to make a pull request.
2022-12-27 00:24:15 +00:00
rlaphoenix 2648d1c669 PSSH: Return Base64 representation with `__str__` 2022-12-26 23:47:43 +00:00
rlaphoenix bc2b5beef4 PSSH: Update class doc-string
It's no longer as Widevine-biased as it once was.
2022-12-26 23:46:40 +00:00
rlaphoenix 11284eddfb PSSH: Allow specifying the System ID to use 2022-12-26 23:44:58 +00:00
rlaphoenix 61097ce6de PSSH: Parse PlayReadyObjects efficiently, parse multiple records
The previous method was overall fine, but assumed only one PlayReadyHeader was in the PlayReadyObject. It also incorrectly assumed the start data to be garbage data when it's actually the header for the PlayReadyObject.
2022-12-26 23:35:29 +00:00
rlaphoenix 3a910bd03a PSSH: Fix loading of PlayReadyHeaders
Previously it would load PlayReadyHeader data under Widevine's SystemId breaking all PlayReady checks.

The actual PlayReadyHeader init_data still needs code to parse it into an object.
2022-12-26 23:27:51 +00:00
rlaphoenix e31ba61302 PSSH: Create a string representation 2022-12-26 22:39:34 +00:00
rlaphoenix 0e4275bd1e Create and use utility to strip namespaces from XML data
Namespaces cause problems with the xpath calls when dealing with PlayReadyHeader's on some versions.
2022-12-26 22:38:02 +00:00
rlaphoenix e0365ff2bb
Merge pull request #21 from rlaphoenix/dependabot/pip/certifi-2022.12.7
Bump certifi from 2022.6.15 to 2022.12.7
2022-12-09 20:22:23 +00:00
dependabot[bot] ae95aeec96
Bump certifi from 2022.6.15 to 2022.12.7
Bumps [certifi](https://github.com/certifi/python-certifi) from 2022.6.15 to 2022.12.7.
- [Release notes](https://github.com/certifi/python-certifi/releases)
- [Commits](https://github.com/certifi/python-certifi/compare/2022.06.15...2022.12.07)

---
updated-dependencies:
- dependency-name: certifi
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-09 07:17:48 +00:00
rlaphoenix 1b40c2b369 PSSH: Set Key IDs more effectively via set_key_ids()
This reduces reading complexity of why and when pssh.set_key_ids() was being run. Generally less code repetition effectively.
2022-11-18 09:40:55 +00:00
rlaphoenix 05b30b3a89 PSSH: Only craft PSSH with key_IDs set if version is 1 2022-11-18 09:18:52 +00:00
rlaphoenix 7a993206a1 PSSH: Ensure key IDs are UUIDs instead of Bytes
This reduces code duplication when actually using those key_ids.
2022-11-18 09:09:01 +00:00
rlaphoenix 2d2359f9a2 PSSH: Fix key_IDs field when creating a new PSSH box 2022-11-18 08:49:33 +00:00
rlaphoenix 8146e055e6 Update Changelog for v1.5.2 2022-11-10 18:20:06 +00:00
rlaphoenix 58208ab68f Bump to v1.5.2 2022-11-10 18:19:55 +00:00
rlaphoenix 7996a3d91c Cdm: Add support for Signatures by OEM Crypto API v16
OEM Crypto API v16 changed slightly how the Signature algorithm was calculated. The `oemcrypto_core_message` field is now basically prefixed to the full license message for the signature.

This fixes support for devices like Roku OS 11.5.0, among others.
2022-11-01 11:04:11 +00:00
rlaphoenix 37d466b9a8 Update Changelog for v1.5.1 2022-10-23 15:20:59 +01:00
rlaphoenix 05b6753aa6 Bump to v1.5.1 2022-10-23 15:20:49 +01:00
rlaphoenix ada7cb009e Cdm: Improve reliability of computing some License Signatures 2022-10-23 15:07:15 +01:00
rlaphoenix 7c91f2c59a PSSH: Dump the same version as the loaded data
Currently, even though self.version would be 0, it would dump as a version=1 box with key_IDs set to data (where possible).

This is because pymp4 sets the version to 1 if key_IDs is set with data, as that would make it a v1 PSSH box. So effectively .dump() and .dumps() forces a v1 box as output even if you loaded or created a v0 box.

Fixes #16
2022-10-13 11:21:47 +01:00
rlaphoenix eaa26399e0 Cdm: Reduce maximum concurrent sessions to 16
It seems 16 is the more common limit on moderm OEM Crypto API systems (at least L1). It's also a more reasonable limit.

This also encourages people to .close() their session more. It also makes it quicker to notice if a codebase is forgetting to do a .close() call somewhere as you will reach the limit faster and easier now.

In normal use cases, a limit of 16 sessions will not be a problem as long as the sessions are being closed correctly.
2022-09-28 07:54:09 +01:00
rlaphoenix 74f960aeba Store Service Certificate in session as SignedDrmCertificate
This is for less effort to use the Service Certificate later on. We have no reason to keep the SignedMessage shell as it's just a way to send it as a message from License Acquisition APIs.
2022-09-28 07:46:52 +01:00
rlaphoenix 42b825dcd5 Cdm: Add parsing error handlers to Service Cert DrmCertificates 2022-09-28 07:37:17 +01:00
rlaphoenix fa00bbd8e4 Cdm: Fix acquisition of provider_id when removing a service cert
The logic of parsing the session's stored service cert to get the provider_id was wrong. It assumed it was a SignedDrmCertificate, when in reality it was a SignedMessage containing a SignedDrmCertificate.

It would also panic if you try to remove a certificate when none was set.
2022-09-28 06:49:41 +01:00
rlaphoenix a4c6f98650 Add import path shortcuts for Classes
This is so you don't have to do e.g., `from pywidevine.pssh import PSSH` and instead can do `from  pywidevine import PSSH`. You can still do it the other way, but now you have the choice.
2022-09-28 06:40:52 +01:00
rlaphoenix 24297d577e PSSH: Initialize System IDs via UUIDs hex arg
This is just to lower the overall character count for the same end result.
2022-09-28 06:36:26 +01:00
rlaphoenix e90371922c PSSH: Add support for Key IDs of lengths other than 16 bytes
This is required for cases like Google's testing DASH manifests, e.g., 'tears' MPD. It assumes the Key ID as a number, which can support up to 16 bytes in this fashion (therefore technically 15 in our scenario as 16 byte Key_IDs can load normally).

Fixes #13
2022-09-28 06:21:28 +01:00
rlaphoenix c5c620ea84 Update Changelog for v1.5.0 2022-09-24 12:07:14 +01:00
rlaphoenix d698b1d3c4 Bump to v1.5.0 2022-09-24 12:05:53 +01:00