feat(drm): bridge a FairPlay-only HLS track only for a service with get_fairplay_bridge_license

This commit is contained in:
imSp4rky
2026-12-01 21:07:26 -07:00
parent e36236d5cc
commit 2097d31a0a
38 changed files with 607 additions and 77 deletions
+13
View File
@@ -65,6 +65,7 @@ class EXAMPLE(Service):
get_widevine_* service certificate + license (per-segment PSSH through `track`)
get_playready_license PlayReady challenge POST
get_clearkey_license DASH org.w3.clearkey JWK Set POST (Laurl fallback)
get_fairplay_bridge_license commented out: FairPlay-only HLS tracks, opt-in only
"""
# ALIASES: extra CLI tags that resolve to this service (e.g. `dl EX ...`).
@@ -523,6 +524,18 @@ class EXAMPLE(Service):
response.raise_for_status()
return response.content
# unshackle has no FairPlay CDM and never sends a FairPlay challenge. For a FairPlay-only track it can send a
# PlayReady or Widevine challenge for the KIDs of the init segments to the licence server of the platform, which
# works only when that server issues the same content key to PlayReady or Widevine. Defining this method opts the
# service in; a server that does not issue the content key refuses the challenge and can flag the device, so
# enable it only after a licence-only run (`--cdm-only --skip-dl`) proves the route.
#
# def get_fairplay_bridge_license(
# self, *, challenge: bytes, title: Title_T, track: AnyTrack, drm_system: str
# ) -> bytes | str | None:
# licence = self.get_playready_license if drm_system == "playready" else self.get_widevine_license
# return licence(challenge=challenge, title=title, track=track)
def get_clearkey_license(self, *, challenge: bytes, title: Title_T, track: AnyTrack) -> bytes | str | dict | None:
# DASH org.w3.clearkey: `challenge` is the W3C JSON license request; return the
# JWK Set response. Omit this method entirely when the manifest carries a Laurl: