mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-29 20:45:11 +00:00
fix(drm): read the init segment tenc KID when FFprobe is not installed
This commit is contained in:
@@ -15,9 +15,11 @@ from pywidevine.pssh import PSSH
|
||||
|
||||
from tests.core.test_hls_kid_from_init import KEY_LINE, key_of, no_kid_pssh
|
||||
from tests.core.test_kid_windows import box, encv
|
||||
from unshackle.core import binaries
|
||||
from unshackle.core.drm import PlayReady, Widevine, cenc
|
||||
from unshackle.core.drm.verify import PIFF_TENC
|
||||
from unshackle.core.tracks import Video
|
||||
from unshackle.core.utils import subprocess as subprocess_utils
|
||||
|
||||
TRACK_KID = UUID(int=0xA)
|
||||
OTHER_KID = UUID(int=0xB)
|
||||
@@ -59,6 +61,12 @@ def test_init_kid_prefers_the_ffprobe_kid(monkeypatch: pytest.MonkeyPatch) -> No
|
||||
assert cenc.init_kid(init(encv(TRACK_KID))) == OTHER_KID
|
||||
|
||||
|
||||
def test_init_kid_reads_the_tenc_without_ffprobe(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setattr(cenc, "ffprobe", subprocess_utils.ffprobe)
|
||||
monkeypatch.setattr(binaries, "FFProbe", None)
|
||||
assert cenc.init_kid(init(encv(TRACK_KID))) == TRACK_KID
|
||||
|
||||
|
||||
def test_init_kid_skips_a_clear_piff_tenc() -> None:
|
||||
clear = box(b"uuid", PIFF_TENC, bytes(8) + TRACK_KID.bytes)
|
||||
assert cenc.init_kid(init(clear, encv(OTHER_KID, piff=True))) == OTHER_KID
|
||||
|
||||
Reference in New Issue
Block a user