forked from kenzuya/unshackle
fix(export): strip session headers from exports and normalise merged keys
This commit is contained in:
@@ -123,7 +123,7 @@ def test_encrypted_ism_rung_gets_the_exported_keys(tmp_path: Path, monkeypatch:
|
||||
|
||||
export = export_tracks(tmp_path, parsed, ISM_URL)
|
||||
doc = json.loads(export.read_text(encoding="utf8"))
|
||||
doc["titles"][0]["keys"] = {"0" * 32: "ab" * 16}
|
||||
doc["titles"][0]["keys"] = {"1" * 32: "ab" * 16}
|
||||
doc["titles"][0]["drm"] = [{"system": "playready"}]
|
||||
export.write_text(json.dumps(doc), encoding="utf8")
|
||||
|
||||
|
||||
@@ -3983,12 +3983,12 @@ class dl:
|
||||
for kid, key in content_keys.items():
|
||||
# a KID that already holds a different key must not be overwritten:
|
||||
# the reader rejects a file that disagrees with itself
|
||||
if pool.setdefault(kid.hex, key) != key:
|
||||
if pool.setdefault(kid.hex, key.lower()) != key.lower():
|
||||
self.log.warning(
|
||||
f"KID {kid.hex} already has a different key in {export}, keeping the existing one"
|
||||
)
|
||||
else:
|
||||
entry.keys[kid.hex] = key
|
||||
entry.add_key(kid.hex, key)
|
||||
|
||||
mediaexport.write(export, doc)
|
||||
|
||||
|
||||
@@ -1077,7 +1077,7 @@ wheels = [
|
||||
[[package]]
|
||||
name = "mediaexport"
|
||||
version = "0.1.0"
|
||||
source = { git = "https://github.com/unshackle-dl/mediaexport?branch=main#07893237199fc865bd5c63b6848235e4f6ef81c8" }
|
||||
source = { git = "https://github.com/unshackle-dl/mediaexport?branch=main#144edd7bcaa943ad0a5116c998734d9f24c41aae" }
|
||||
|
||||
[[package]]
|
||||
name = "more-itertools"
|
||||
|
||||
Reference in New Issue
Block a user