Watching a DRM show I pay for
The problem
My kids simply wanted to watch a show that steams on Citytv, a service for which we have a valid subscription. There's at least two apps for it but neither would stream properly on an AndroidTV box. Next I figured I'd just download the episodes with yt-dlp
, but of course DRM makes that a pain. Normally this would be a good time to just start sailing the high seas, but the show wasn't popular enough.
Solution
Time to figure out a way around the DRM so we can watch the content we pay money for. Here are the steps I used.
Get the Manifest
First open a new tab in the browser and opened developer tools (ctrl+shift+i
). Switch to the Network
tab in the developer tools.
Browse to the show and start it playing. Now in the Network
tab search for manifest.mpd
. There should be one of type DASH
. Save the manifest by right-clicking it and using Save Response As
. Also keep the URL for later (Copy Value->Copy URL
).
Extract the pssh
and License URL
Open the manifest.mpd
in your favourite editor. Look for the section that looks like:
<ContentProtection schemeIdUri="urn:uuid:aaaaaaaa-bbbb-4ccc-dddd-eeeeeeeeeeee" xmlns:cenc="urn:mpeg:cenc:2013" bc:licenseAcquisitionUrl="https://manifest.prod.boltdns.net/license/v1/cenc/widevine/1234567890123/11111111-2222-4333-9444-555555555555/11111111-2222-4333-9444-555555555555?fastly_token=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" xmlns:bc="urn:brightcove:2015">
<cenc:pssh>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</cenc:pssh>
</ContentProtection>
There's probably multiple similar sections. The one that contains the urn:brightcove:2015
is the the one I needed.
Take the value inside the <cenc:pssh>
tag, and the bc:licenseAcquisitionURL
.
Get the keyid and key
There's multiple ways to do this, but I simply pasted the two values in to the site https://cdrm-project.com/. Paste in the pssh
and license URl. After pressing Submit
you should get back a key value that needs to be saved for later. It should look like:
1234567890abcdef1234567890abcdef:1234567890abcdef1234567890abcdef
Download with dash-mpd-cli
Finally using all the values we've found we can start the download. I used the dash-mpd-cli. The format of the command is:
dash-mpd-cli --cookies-from-browser chromium --key <KEY> <MANIFEST URL>
If you're using Chrome instead of Chromium you may need to switch that option. If you're using Firefox (as I am) you'll probably have to sign in with Chromium.
Further help
If you look for download steps around they can be hard to find. If you run in to issues the best place I found for discussions on the topic is the forums on VideoHelp.