+ Resolved conflicting dependencies by downgrading to construct 2.8.8

This commit is contained in:
BuildTools 2024-11-27 13:41:23 +01:00
parent 27c666915d
commit 887a7cd38f
6 changed files with 18 additions and 12 deletions

View File

@ -10,4 +10,4 @@ from .session import *
from .xml_key import * from .xml_key import *
from .xmrlicense import * from .xmrlicense import *
__version__ = "0.3.6" __version__ = "0.3.7"

View File

@ -1,4 +1,9 @@
from __future__ import annotations from __future__ import annotations
import collections.abc
# monkey patch for construct 2.8.8 compatibility
if not hasattr(collections, 'Sequence'):
collections.Sequence = collections.abc.Sequence
import base64 import base64
from pathlib import Path from pathlib import Path

View File

@ -2,7 +2,7 @@ import base64
from typing import Union from typing import Union
from uuid import UUID from uuid import UUID
from construct import Struct, Int32ul, Int16ul, Array, this, Bytes, PaddedString, Switch, Int32ub, Const, Container from construct import Struct, Int32ul, Int16ul, Array, this, Bytes, Switch, Int32ub, Const, Container
from pyplayready.wrmheader import WRMHeader from pyplayready.wrmheader import WRMHeader
@ -23,7 +23,7 @@ class _PlayreadyPSSHStructs:
"data" / Switch( "data" / Switch(
this.type, this.type,
{ {
1: PaddedString(this.length, "utf16") 1: Bytes(this.length * 2)
}, },
default=Bytes(this.length) default=Bytes(this.length)
) )
@ -96,4 +96,4 @@ class PSSH:
def _read_wrm_headers(wrm_header: Container): def _read_wrm_headers(wrm_header: Container):
for record in wrm_header.records: for record in wrm_header.records:
if record.type == 1: if record.type == 1:
yield record.data yield record.data.decode("utf-16-le")

View File

@ -4,7 +4,8 @@ import base64
from pathlib import Path from pathlib import Path
from typing import Union from typing import Union
from construct import Const, GreedyRange, Struct, Int32ub, Bytes, Int16ub, this, Switch, LazyBound, Array, Container from construct import Const, GreedyRange, Struct, Int32ub, Bytes, Int16ub, this, Switch, LazyBound, Array, Container, \
If, Byte
class _XMRLicenseStructs: class _XMRLicenseStructs:
@ -151,12 +152,12 @@ class _XMRLicenseStructs:
"minimum_move_protection_level" / Int32ub "minimum_move_protection_level" / Int32ub
) )
XMRObject = Struct( XmrObject = Struct(
"flags" / Int16ub, "flags" / Int16ub,
"type" / Int16ub, "type" / Int16ub,
"length" / Int32ub, "length" / Int32ub,
"data" / Switch( "data" / Switch(
lambda this_: this_.type, lambda ctx: ctx.type,
{ {
0x0005: OutputProtectionLevelRestrictionObject, 0x0005: OutputProtectionLevelRestrictionObject,
0x0008: AnalogVideoOutputConfigurationRestriction, 0x0008: AnalogVideoOutputConfigurationRestriction,
@ -187,7 +188,7 @@ class _XMRLicenseStructs:
0x005a: SecureStopRestrictionObject, 0x005a: SecureStopRestrictionObject,
0x0059: DigitalVideoOutputRestrictionObject 0x0059: DigitalVideoOutputRestrictionObject
}, },
default=LazyBound(lambda: _XMRLicenseStructs.XMRObject) default=LazyBound(lambda ctx: _XMRLicenseStructs.XmrObject)
) )
) )
@ -195,7 +196,7 @@ class _XMRLicenseStructs:
"signature" / Const(b"XMR\x00"), "signature" / Const(b"XMR\x00"),
"xmr_version" / Int32ub, "xmr_version" / Int32ub,
"rights_id" / Bytes(16), "rights_id" / Bytes(16),
"containers" / GreedyRange(XMRObject) "containers" / GreedyRange(XmrObject)
) )

View File

@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry] [tool.poetry]
name = "pyplayready" name = "pyplayready"
version = "0.3.6" version = "0.3.7"
description = "pyplayready CDM (Content Decryption Module) implementation in Python." description = "pyplayready CDM (Content Decryption Module) implementation in Python."
license = "CC BY-NC-ND 4.0" license = "CC BY-NC-ND 4.0"
authors = ["DevLARLEY, Erevoc", "DevataDev"] authors = ["DevLARLEY, Erevoc", "DevataDev"]
@ -33,7 +33,7 @@ include = [
python = ">=3.8,<4.0" python = ">=3.8,<4.0"
requests = "^2.32.3" requests = "^2.32.3"
pycryptodome = "^3.21.0" pycryptodome = "^3.21.0"
construct = "^2.10.70" construct = "2.8.8"
ECPy = "^1.2.5" ECPy = "^1.2.5"
click = "^8.1.7" click = "^8.1.7"
xmltodict = "^0.14.2" xmltodict = "^0.14.2"

View File

@ -1,7 +1,7 @@
requests requests
pycryptodome pycryptodome
ecpy ecpy
construct construct==2.8.8
click click
PyYAML PyYAML
aiohttp aiohttp