mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-12 20:15:10 +00:00
fix(import): add decrypts_samples to ImportService
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
"""ImportService and RemoteService stand in for a Service in dl, so they have every method dl calls on one."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from unshackle.commands import dl as dl_module
|
||||
from unshackle.core.import_service import ImportService
|
||||
from unshackle.core.remote_service import RemoteService
|
||||
|
||||
|
||||
@pytest.mark.parametrize("cls", [ImportService, RemoteService])
|
||||
def test_stand_in_service_has_every_method_dl_calls(cls: type) -> None:
|
||||
called = set(re.findall(r"\bservice\.(\w+)\(", Path(dl_module.__file__).read_text(encoding="utf-8")))
|
||||
assert called
|
||||
assert sorted(name for name in called if not hasattr(cls, name)) == []
|
||||
@@ -765,6 +765,12 @@ class ImportService:
|
||||
"license through a CDM: export the title again with the tracks you need selected."
|
||||
)
|
||||
|
||||
def decrypts_samples(self, track: AnyTrack) -> bool:
|
||||
return False
|
||||
|
||||
def get_sample_decrypter(self, track: AnyTrack, entry: int) -> bytes:
|
||||
raise NotImplementedError("An import does not decrypt samples")
|
||||
|
||||
def on_segment_downloaded(self, track: AnyTrack, segment: Any) -> None:
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user