Commit Graph

244 Commits

Author SHA1 Message Date
rlaphoenix ba83e29147 Overhaul tooling, linting, editor configs, and README 2023-11-09 00:29:29 +00:00
rlaphoenix 49315eceb8 Fix usage of __all__, add missing __all__ assignments 2023-11-08 22:56:37 +00:00
rlaphoenix 5087da31a0 Fix test CLI function's PSSH type 2023-11-08 22:42:14 +00:00
rlaphoenix 79cdbc007c Remove `Types` shortcut from Device, rename to DeviceTypes
This is because a static linter cannot recognize a class variable as a type. If we instead directly reference the enum, it can.
2023-11-08 22:42:14 +00:00
rlaphoenix c362192c11 Improve and simplify creation of protobuffer objects 2023-11-08 22:27:33 +00:00
rlaphoenix 0e6aa1d5e8 Various typing/linting fixes and improvements 2023-11-08 22:18:12 +00:00
rlaphoenix 97ec2e1c60 Have Device Flags be an empty dict if none set 2023-11-08 21:24:44 +00:00
rlaphoenix 0c31f88d23 Return subprocess returncode in decrypt() 2023-11-08 21:23:05 +00:00
rlaphoenix 2d8163f76d Fix typing and casting of `type_` in get_license_challenge 2023-11-08 21:20:54 +00:00
rlaphoenix 797799a5aa Slight correction to typing and doc-string of set_service_certificate 2023-11-08 20:52:03 +00:00
rlaphoenix dfdba71caf Remove system_id class variable from Cdm
The variable name `system_id` conflicts with the `system_id` of the class *instance* variable.

There's no need to have this variable there anyway, when it's easily accessible as bytes via `Cdm.uuid.bytes`.
2023-11-08 20:38:38 +00:00
rlaphoenix 65d8135e2a Ignore empty KID values in v4.0.0.0 PlayReadyHeaders 2023-11-08 19:47:37 +00:00
rlaphoenix 2fb3b21e4a Raise an exception if PlayReadyHeader KID VALUE doesn't exist 2023-11-08 19:47:37 +00:00
rlaphoenix cd990e0f4e Have set_key_ids method call parse_key_ids directly
This improves user-experience by allowing set_key_ids to accept more types of Key ID formats directly. This also reduces code duplication because the parse function also checks the validity of the Key IDs list for set_key_ids.
2023-11-08 19:47:37 +00:00
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