feat(remote): cap server CDM licensing by height per API key and service

A session above the cap licenses with the client's own device, and a track above it in an uncapped -q run is handed back to the client. Also names the fallback in the ccextractor crash warning.
This commit is contained in:
imSp4rky
2026-09-24 16:50:26 -06:00
parent 91db1fa0b1
commit 7d31153c7f
21 changed files with 1087 additions and 47 deletions
@@ -83,19 +83,22 @@ def test_to_dict_full_details_redacts_error_fields_and_parameters():
class _PastGate(Exception):
"""Raised by the stubbed Services.load to prove a request got past the gate into the try block."""
"""Raised by the stubbed download manager to prove a request got past the gate."""
@pytest.fixture
def stub_handler(monkeypatch):
"""Make the service valid and make the first call after the gate (Services.load) explode, so a
forbidden request raises APIError *before* the try block and an allowed one is caught inside it."""
"""Make the service valid and make the first call after the gate (get_download_manager) explode, so a
forbidden request raises APIError and the handler returns an allowed one as an error response."""
from unshackle.core.api import download_manager
monkeypatch.setattr(handlers, "validate_service", lambda tag, request=None: tag)
monkeypatch.setattr(handlers.Services, "load", lambda tag: object())
def boom(*_args, **_kwargs):
raise _PastGate()
monkeypatch.setattr(handlers.Services, "load", boom)
monkeypatch.setattr(download_manager, "get_download_manager", boom)
return monkeypatch