✅ Builtin MPEG-DASH Clearkey/DRM Support — Either append #clearkey=<clearkey> to the end of the URL or include a clearkeys json file or URL for DRM decryption
✅ High Performance — Uses streamlink API's to offload segment downloading before passing to ffmpeg for muxing
✅ Highly Flexible — Can support standard HLS, Mpeg-DASH as well as DASH-DRM, Youtube, Twitch and other livestreaming services as channels
✅ Proxy Support — Full support for passing proxy servers to bypass geo restrictions. Also support for bypassing proxy for specific URL's used in initial redirections
✅ Extended Stream Type Detection — Fallback option that checks MIME type of stream URL for streamlink plugin selection
✅ support headers=origin&referer — You can now add #headers at the end of URL
-i: Required input URL-ua: Required user agent string-proxy <proxy server>: Optional: Configure a proxy server. Supports http, https only.-proxybypass <comma-delimited hostnames>: Optional. To be used in conjunction with-proxydirective. Supply a comma-delimited list of hostnames to be bypassed from supplied proxy. Wildcards supported.-clearkeys <clearkey file or url>: Optional: Supply a json file or URL containing json URL to clearkey mappings-loglevel <loglevel>: Optional to change the default log level of "INFO". Supported options: "CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG", and "NOTSET".-subtitles: Optional to enable muxing of subtitles. Disabled by default. NOTE: Subtitle support in streamlink is limited at best. May not work as intended. Example:dispatchwrapparr.py -i {streamUrl} -ua {userAgent} [-proxy 'http://your.proxy.server:3128' -proxybypass '192.168.0.*,*.somesite.com' -clearkeys 'clearkeys.json' -loglevel 'INFO' -subtitles]#headers: Example`
#EXTM3U
#EXTINF:-1 group-title=" " channel-id="id.uk" tvg-id="id.uk" tvg-logo="", Channel Name
http://example.com/stream.m3u8#headers=origin:https://example.com&referer:https://example.com
dispatchwrapper.py -i "http://example.com/stream.m3u8#headers=origin:https://example.com&referer:https://example.com" -ua "MyUserAgent"---
- This command will install or update Dispatchwrapparr to the latest version into your Dispatcharr docker container.
docker exec -it dispatcharr bash -c
"mkdir -p /data/dispatchwrapparr && \
curl -sSL \
'https://raw.githubusercontent.com/jordandalley/dispatchwrapparr/refs/heads/main/dispatchwrapparr.py' \
-o '/data/dispatchwrapparr/dispatchwrapparr.py' && \
chmod +x '/data/dispatchwrapparr/dispatchwrapparr.py'"- Create a new profile in Dispatcharr under 'Settings' > 'Stream Profiles'
- In the 'Name' field, type in 'dispatchwrapparr'
- In the 'Command' field, type in the location of the script as it would be inside the docker container, eg.
/data/dispatchwrapparr/dispatchwrapparr.py - In the 'Parameters' field, type in
-i {streamUrl} -ua {userAgent} - Now select 'dispatchwrapparr' as your preferred profile on any particular streams!
If you wish to use a proxy server, create a separate profile:
- In the 'Name' field, type in 'dispatchwrapparr proxy'
- In the 'Command' field, type in the location of the script as it would be inside the docker container, eg.
/data/dispatchwrapparr/dispatchwrapparr.py - In the 'Parameters' field, type in
-i {streamUrl} -ua {userAgent} -proxy http://your.proxy.server:3128 - Now select 'dispatchwrapparr proxy' on any streams that you wish to use the proxy server for.
Easy! There are two methods, the first of which is the most simple for starting out.
Method 1: Append #clearkey= to the stream URL
You'll need the clearkeys in order to play DRM protected content. There are a number of ways to acquire the keys such as scripts and browser plugins. This script assumes that you have these keys already.
To play these streams, simply create a custom m3u8 file that places #clearkey= at the end of the stream URL. Below is an example that could be used for Channel 4 (UK):
#EXTM3U
#EXTINF:-1 group-title="United Kingdom" channel-id="Channel4London.uk" tvg-id="Channel4London.uk" tvg-logo="https://raw.githubusercontent.com/tv-logo/tv-logos/main/countries/united-kingdom/channel-4-uk.png", Channel 4
https://olsp.live.dash.c4assets.com/dash_iso_sp_tl/live/channel(c4)/manifest.mpd#clearkey=5ce85f1aa5771900b952f0ba58857d7aMore channels can be added to the same m3u8 file, and may also contain a mixture of DRM and non-DRM encrypted streams. Simply upload your m3u8 file into Dispatcharr and select dispatchwrapparr as the profile for any streams.
Method 2: Use -clearkeys directive to supply a json file or URL containing URL to Clearkey mappings
The -clearkeys directive can be supplied with a json formatted file or URL containing URL's which map to clearkeys, and performs this function in the following ways:
- Wildcards are supported. Eg. to match a clearkey to a specific URL, you can specify wildcards in the URL string. Eg.
https://olsp.live.dash.c4assets.com/*/live/channel(c4)/*.mpd - When a URL is supplied, it will ignore the
-proxydirective for fetching clearkeys. It assumes that a proxy is not required for this request. This allows you to create your own clearkeys API that runs locally. - When a file is supplied without an absolute path, it will assume that the file is in the same directory as the script. Eg.
-clearkeys clearkeys.jsonwould resolve to/data/dispatchwrapparr/clearkeys.json. - Supports KID:KEY combinations, and comma delimited lists of clearkeys where multiple keys are required.
- If no stream URL matches a clearkey, the script will continue processing the stream as normal.
Below is an example of a clearkeys.json file or an expected output from an API/URL containing clearkeys. Again, below is an example that could be used for Channel 4 (UK):
{
"https://olsp.live.dash.c4assets.com/dash_iso_sp_tl/live/channel(c4)/manifest.mpd": "5ce85f1aa5771900b952f0ba58857d7a",
}
This script was made possible thanks to many wonderful python libraries and open source projects.
- Dispatcharr development community for making such an awesome stream manager!
- Streamlink for their awesome API and stream handling capability
- titus-au who laid a lot of the groundwork for managing DASHDRM streams in streamlink!
This project is licensed under the MIT License.
