mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-04 06:55:09 +00:00
refactor(drm): hand the server key batch to one installer as a KeyBatch value
This commit is contained in:
@@ -9,6 +9,7 @@ import pytest
|
||||
from tests.core.key_resolver import MemoryVault, key_table, resolver, vaults_of
|
||||
from unshackle.core.drm import key_resolution
|
||||
from unshackle.core.drm.key_resolution import ContentKeyResolver
|
||||
from unshackle.core.title_source import HeldKeys, KeyBatch
|
||||
from unshackle.core.vault import RateLimited, vault_session
|
||||
from unshackle.core.vaults import Vaults
|
||||
from unshackle.vaults.API import API, Exceptions
|
||||
@@ -97,8 +98,8 @@ class BatchDRM(SimpleNamespace):
|
||||
|
||||
|
||||
SERVER = SimpleNamespace(
|
||||
resolve_server_keys=lambda title: [d.content_keys.update(d.batch) for t in title.tracks for d in t.drm],
|
||||
vault_source=lambda kid, key: None,
|
||||
batch_keys=lambda title: KeyBatch({t.id: HeldKeys(t.drm[0].batch, own_drm=True) for t in title.tracks}),
|
||||
server_vault=None,
|
||||
)
|
||||
|
||||
|
||||
@@ -106,7 +107,8 @@ def batch_title(*batches: dict[UUID, str], kids: list[UUID] | None = None) -> Si
|
||||
"""A title with one track per batch, whose DRM names ``kids`` (every KID of its batch by default)."""
|
||||
return SimpleNamespace(
|
||||
tracks=[
|
||||
SimpleNamespace(drm=[BatchDRM(kids=kids or list(keys), content_keys={}, batch=keys)]) for keys in batches
|
||||
SimpleNamespace(id=str(i), drm=[BatchDRM(kids=kids or list(keys), content_keys={}, batch=keys)])
|
||||
for i, keys in enumerate(batches)
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user