Skip to content

A plugin that extends the standard streamlink dash plugin to support DRM based MPDs, as well as multi audio and multi period support. Multiple audio and multiple periods support are enabled by default.

License

Notifications You must be signed in to change notification settings

titus-au/streamlink-plugin-dashdrm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 

Repository files navigation

streamlink-plugin-dashdrm

A streamlink plugin that extends the standard streamlink dash plugin to support DRM based MPDs, as well as multi audio and multi period support.

This is a reimplementation of streamlink-drm as a plugin, so the latest streamlink base code can be used. In addition to DRM support, the plugin also reimplement the multiple audio fork done by Shea Smith.

In addition, the plugin also implements multi period support. Note that the caveats around periods still applies, such as differing video specifications likely causing video players to not play properly, or when switching to a new period too quickly thus cutting off the previous period, so YMMV. Lastly, the plugin currently contains code to also include subtitle streams, however ffmpeg has no support for TTML decoding at this stage, so any TTML/STPP based subtitles will not be recognised by the player even if it is included.

Install and Use

To use this plugin, you need to utilise streamlink's plugin sideload capability. Download the plugin source by cloning the repository, or just downloading the plugin file (dashdrm.py) and either place it in your streamlink plugins sideload directory, or put in a new directory and specify the path when executing streamlink with --plugin-dir <path_of_dashdrm.py>.

Install using git by typing:

git clone https://github.com/titus-au/streamlink-plugin-dashdrm.git

To update the plugin using git, change into the directory where you had cloned the plugin, then type:

git pull

To make use of the plugin, add dashdrm:// in front of the url.

streamlink --plugin-dir /path/to/dashdrm/plugin --default-stream best --url dashdrm://http://abc.def/xyz.mpd

Multi period support is enabled automatically, however if you wish to jump straight to the current last period when streamlink starts, you can do:

streamlink --plugin-dir /path/to/dashdrm/plugin --default-stream best --url "dashdrm://http://abc.def/xyz.mpd period=-1"

Parameters

The plugin accepts a number of optional parameters:

Option Description
--dashdrm-decryption-key <key in hex or base64> This is a comma seperated list of decryption keys to be passed to ffmpeg. If only one key is given, then all streams will use this key. If 2 keys are given, then the video stream will use the first key, and all remaining streams (eg audio streams) will use the second key. If more than 2 keys are given, then the video stream will use the first key, and the second stream will use the second key, the third stream will use the third key etc. If more streams than keys are given, keys will be looped starting with the second key. The keys need to be in hex or base64, either just the key by itself, or in the format of kid:key (although the kid is not used)
--dashdrm-presentation-delay <delay in seconds> Override the presentation delay defaults, similar to hls-live-edge
--dashdrm-use-subtitles Mux in subtitle tracks that are found, however ffmpeg currently does not support TTML/STPP
--dashdrm-ignore-location Workaround to ignore Location tag for in rare occasions where the Location tag lead to incorrect segment URLs
--dashdrm-ignore-availability Workaround to ignore segment availability times for in rare occasions where the server is setting segment availability in the future even though the segments are available now, resulting in stream timeouts. Use this with caution as it'll completely ignore availability values thus will try and load segments that are in theory unavailable
--dashdrm-availability-grace <grace in seconds> Workaround to wait extra grace time on top of the segment available time, in cases where server is returning 403/404 errors when segments are being fetched as they are not yet available even though they are supposed to be. A negative grace value can also be given, which can cover cases where the availability times are in the future

Disclaimer

  • Use of this code to decrypt DRM is purely for academic purposes. You should not use this code for any illegal purposes and I take no responsibility for your actions
  • This code has not been widely tested, so consider it alpha software
  • About

    A plugin that extends the standard streamlink dash plugin to support DRM based MPDs, as well as multi audio and multi period support. Multiple audio and multiple periods support are enabled by default.

    Topics

    Resources

    License

    Stars

    Watchers

    Forks

    Languages