selsta/hlsdl

Support for FairPlay DRM - Streaming Key Delivery

nekno opened this issue · 1 comments

nekno commented

When an HLS server uses FairPlay DRM (SAMPLE-AES with Streaming Key Delivery), the key URI uses the protocol scheme skd://.

Today, hlsdl appears to interpret this skd:// scheme as a relative path, and attempts to append it to the root path of the M3U8 playlist.

So, if my playlist is located at:

  • https://streamingserver.domain/path/to/playlist/stream.m3u8

which returns the key URI:

  • skd://keyserver.domain/path/to/key, e.g.,
#EXTM3U
#EXT-X-VERSION:6
#EXT-X-TARGETDURATION:7
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-KEY:METHOD=SAMPLE-AES,URI="skd://keyserver.domain/path/to/key",KEYFORMATVERSIONS="1",KEYFORMAT="com.apple.streamingkeydelivery"

then hlsdl is sending HTTP GET requests for the key to:

  • https://streamingserver.domain/path/to/playlist/skd://keyserver.domain/path/to/key

Instead, the SKD requests should be an HTTP POST (with some body contents I don't understand) to:

  • https://keyserver.domain/path/to/key

Is SKD support possible? I assume it would entail an additional command-line arg to accept a server certificate, which is used to generate the body of the POST for the key?

skd:// is DRM which is unsupported. AFAIK there is no public method to remove Apple Fairplay DRM.