mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-06 16:05:06 +00:00
fix(api): let a core failure name its own API error code
This commit is contained in:
@@ -84,6 +84,7 @@ from unshackle.core.remote_protocol import (
|
||||
TrackKeys,
|
||||
TracksReply,
|
||||
TracksRequest,
|
||||
coded,
|
||||
)
|
||||
from unshackle.core.search_result import SearchResult
|
||||
from unshackle.core.session import MAX_BACKOFF
|
||||
@@ -1680,7 +1681,9 @@ class RemoteService:
|
||||
why = "The server CDM refused this track"
|
||||
cdm = self.local_cdm
|
||||
if cdm is None:
|
||||
raise click.ClickException(f"{why}, and {track} needs a local CDM to license it")
|
||||
raise coded(
|
||||
click.ClickException(f"{why}, and {track} needs a local CDM to license it"), APIErrorCode.DRM_ERROR
|
||||
)
|
||||
drm_class = "PlayReady" if is_playready_cdm(cdm) else "Widevine"
|
||||
height = getattr(track, "height", None)
|
||||
systems = {d.__class__.__name__ for d in track.drm or ()}
|
||||
|
||||
Reference in New Issue
Block a user