Hi there
I need help understanding how to decrypt a video. (all URLs at the end)
My original question was here, but larley (thanks) suggested in his answer that this was a (I quote) "rare occurence of AES-128 encryption using a DASH manifest file", and I should start a new thread.
I updated the steps and details below according to some additional things I tried out after his answer. But I still can't figure out how to finalise this.
What I've done so far :
- found the MPD url and downloaded the manifest XML.
- Also downloaded the desired (encrypted) audio and video streams using yt-dlp (also tried dash-mpd-cli, both worked).
These are already sitting on my disk now and need to be decrypted.
Or maybe they need to be decrypted as chunks while being downloaded, I don't know (and wouldn't know how to do that).
- didn't find any PSSH nor explicit licence url, so I just tried out some random things :
I went to cdrm-project.com and entered the url found at "keyUriTemplate" in the manifest XML (first one for audio, along with its kid param.) and some headers that I could make out, leaving the PSSH field blank.
Upon "Send" it returned :
First I tried to use this as a decryption id:key pair with mp4decrypt it didn't work (didn't get any error, but a 0 byte output file).Code:Cached PSSH PSSH: Time:Wed Jan 3 17:08:02 2024 b8d35746ec9e9f5c3ebfc5ec945ebf42:78531faef00ddfcf9dfe029812c9f40f
Then, since larley pointed out that it could be AES-128, I searched the forum a bit and found a thread explaining how to find the key in browser's dev tools (it was about a HLS stream but I just followed the key part).
So I looked for requests to the "key delivery" URL and their responses.
This is what I found (sorry french UI) :
[Attachment 78373 - Click to enlarge]
Converted to HEX :
I then tried different id:key combinations with mp4decrypt, to no avail. (again, either "wrong id (or key)" error, or no error but 0 byte output file)Code:Base64: 9CrjgG+fUx2fsUlmCQ7gTQ== HEX: f42ae3806f9f531d9fb14966090ee04d
If someone could just give the last hint(s) I'm missing that would be greatly appreciated.
Video URL (public access) :
https://community.claris.com/en/s/engage/claris-engage-recordings?vtui__catalogId=a5NV...y0000000EB3MAM
MPD URL :
https://appiniummediacentralusa-usct.streaming.media.azure.net/02f4acb1-7193-422d-8d0f...ncryption=cbc)
Headers I used on cdrm-project :
Code:accept: "*/*" Accept-Language: "fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3" Accept-Encoding: "gzip, deflate, br" Origin: "https://community.claris.com" Connection: keep-alive Referer: "https://community.claris.com" Sec-Fetch-Dest: empty Sec-Fetch-Mode: cors Sec-Fetch-Site: cross-site
+ Reply to Thread
Results 1 to 15 of 15
-
Last edited by StanP; 15th Apr 2024 at 02:47.
-
This has nothing to do with DRM. It's just plain old AES-128 only disguised as a mpd manifest. It surprised me that N_m3u8 fails at this just because it's not m3u8. Here's your video, subtitles included:
https://www.transfernow.net/dl/20240414SWWWir6A--[----->+<]>.++++++++++++.---.--------.
[*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*] -
OK thousand thanks for that but could you please explain what you did, exactly ?
I realise I stated in my original post that "I was a complete newb to this" but didn't repeat it here.
I have no idea how to grab "plain old AES-128 only disguised as a mpd manifest" as you put it.
If you could just direct me to where I could find the info here, that would be great.
Firslty because there's a few other videos I want to grab from that source, and I'd rather do it by myself and second because I'm very much interested in understanding the process. -
Well, as I told you: "N_m3u8 fails at this just because it's not m3u8". So why not build your own local m3u8? Keep in mind, I dunno if there is some hidden m3u8 provided by them already. I tried editing some variables in that mpd path of yours with no luck.
First, download the encrypted content using their manifest. You do not want to decrypt them using N_m3u8 or merge them. Make sure you grab your wanted quality for both audio/video since we'll be working with that.
Code:N_m3u8DL-RE.exe https://appiniummediacentralusa-usct.streaming.media.azure.net/02f4acb1-7193-422d-8d0f-a8b2f5cd36d2/9f891697-3e16-4a91-8e3a-73392daf.ism/manifest(format=mpd-time-csf,encryption=cbc) --skip-merge
Before we move on we're gonna need 2 important things to decrypt hls aes 128: the key and the iv. The key you already found and we'll be using the hex value:
For the iv, download the mpd and save it as xml. Use VS Code or any other formatting tool to make it look neat. Then in it, you'll find:
Code:<sea:CryptoPeriod keyUriTemplate="https://appiniummediacentralusa.keydelivery.centralus.media.azure.net/?kid=f7f79bd5-91a2-4747-a61d-cee302b17c1b" IV="0x40E9F39B386D74F22185F092C7836FDE"/>
Code:import os def generate_m3u8(directory, iv_value): fragments = sorted([f for f in os.listdir(directory)]) with open(f"{directory}.m3u8", "w") as f: f.write("#EXTM3U\n") f.write("#EXT-X-VERSION:3\n") f.write("#EXT-X-MEDIA-SEQUENCE:1\n") f.write(f'#EXT-X-KEY:METHOD=AES-128,URI="random_irrelevant_path",IV={iv_value}\n') for fragment in fragments: f.write(f"#EXTINF:0,\n") f.write(f"{directory}/{fragment}\n") f.write("#EXT-X-ENDLIST") def generate_master_m3u8(video_dir, audio_dir): with open("master.m3u8", "w") as f: f.write(f"#EXTM3U\n") f.write(f"#EXT-X-STREAM-INF:BANDWIDTH=2\n{video_dir}.m3u8\n") f.write(f"#EXT-X-STREAM-INF:BANDWIDTH=1\n{audio_dir}.m3u8\n") v_dir = "video" a_dir = "audio" iv_val = "0x40E9F39B386D74F22185F092C7836FDE" generate_master_m3u8(v_dir, a_dir) generate_m3u8(v_dir, iv_val) generate_m3u8(a_dir, iv_val)
Code:N_m3u8DL-RE.exe master.m3u8 --custom-hls-key f42ae3806f9f531d9fb14966090ee04d -M format=mkv
Last edited by 2nHxWW6GkN1l916N3ayz8HQoi; 14th Apr 2024 at 08:29.
--[----->+<]>.++++++++++++.---.--------.
[*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*] -
https://github.com/Tontonnow/N_m3u8DL-RE/actions/runs/8680287173
download this
key must set
Code:N_m3u8DL-RE.exe https://appiniummediacentralusa-usct.streaming.media.azure.net/02f4acb1-7193-422d-8d0f-a8b2f5cd36d2/9f891697-3e16-4a91-8e3a-73392daf.ism/manifest(format=mpd-time-csf,encryption=cbc) --custom-hls-key 9CrjgG+fUx2fsUlmCQ7gTQ== -M format=mkv
[Attachment 78378 - Click to enlarge]
[Attachment 78377 - Click to enlarge]Last edited by Novia; 14th Apr 2024 at 10:42.
-
Great write-up, as usual.
Following command worked perfectly, well done.
Code:N_m3u8DL-RE.exe https://appiniummediacentralusa-usct.streaming.media.azure.net/02f4acb1-7193-422d-8d0f-a8b2f5cd36d2/9f891697-3e16-4a91-8e3a-73392daf.ism/manifest(format=mpd-time-csf,encryption=cbc) -M format=mkv --custom-hls-key f42ae3806f9f531d9fb14966090ee04d --custom-range 0-10
-
-
Check in this Repo
1. https://github.com/nilaoda/N_m3u8DL-RE
2. https://github.com/Tontonnow/N_m3u8DL-RE/
Or Direct File
N_m3u8DL-RE.zip -
LittleSoldier
Thank you for the tip
Everything was found, I just didn’t look carefully
2nHxWW6GkN1l916N3ayz8HQoi
Му gratitude to you for, as always, an informative theoretical guide.
Novia
many thanks for the fork which can recognize AES-128 in DASH manifest fileLast edited by mister_ nex; 14th Apr 2024 at 15:04.
-
Well, this doesn't work on my side, and actually I already tried it before. (not sure what you mean by "key must set" though)
[Attachment 78380 - Click to enlarge]
I'll try the method that doesn't merge the fragments asap and let you know.
Thanks to you all in the meantime. -
Use only this version of the program
Code:https://github.com/Tontonnow/N_m3u8DL-RE/actions/runs/8680287173
Code:INFO : Extracted, there are 5 streams, with 4 basic streams, 1 audio streams, 0 subtitle streams INFO : Vid *CENC 1920x1080 | 3947 Kbps | 1_V_video_1 | avc1.640028 | 1898 Segments | ~01h03m14s INFO : Vid *CENC 1280x720 | 3092 Kbps | 1_V_video_2 | avc1.64001F | 1898 Segments | ~01h03m14s INFO : Vid *CENC 960x540 | 1392 Kbps | 1_V_video_3 | avc1.64001F | 1898 Segments | ~01h03m14s INFO : Vid *CENC 640x360 | 937 Kbps | 1_V_video_4 | avc1.64001E | 1898 Segments | ~01h03m14s
Code:INFO : Extracted, there are 5 streams, with 4 basic streams, 1 audio streams, 0 subtitle streams INFO : Vid *AES_128 1920x1080 | 3947 Kbps | 1_V_video_1 | avc1.640028 | 1898 Segments | ~01h03m14s INFO : Vid *AES_128 1280x720 | 3092 Kbps | 1_V_video_2 | avc1.64001F | 1898 Segments | ~01h03m14s INFO : Vid *AES_128 960x540 | 1392 Kbps | 1_V_video_3 | avc1.64001F | 1898 Segments | ~01h03m14s INFO : Vid *AES_128 640x360 | 937 Kbps | 1_V_video_4 | avc1.64001E | 1898 Segments | ~01h03m14s
Last edited by mister_ nex; 14th Apr 2024 at 15:58.
-
Sorry if I'm being stupid here, but your link doesn't show any downloadable resource.
So I went for the latest release for that repo, that is N_m3u8DL-RE_Beta_win-x64_20240319.zip (found here )
If that's not the same version you're using, then I don't know where to find it.
I also tried with the 3 links provided by LittleSoldier.
No matter which version I try, the console showsCode:INFO : Vid *CENC 1920x1080 | 3947 Kbps...
-
never mind, I got the right exe, I wasn't logged in to github and the "artifacts" section at the bottom wasn't showing links...
I didn't know this behaviour !
Now with the right exe, AES-128 is correctly detected and the decryption / muxing works !
Thanks again to you all for your help, I was very close since the beginning, but was going in circles because not using the right versions of the tools... -
-
Can anyone help me, how to play mpd dash to ott player.. Any format to playlist. Please
Similar Threads
-
Help downloading .mpd dash stream with no manifest
By JustPassing in forum Video Streaming DownloadingReplies: 9Last Post: 19th Nov 2021, 05:51 -
how to download video files with "mpd" (mpeg dash manifest)?
By nzhd in forum Video Streaming DownloadingReplies: 59Last Post: 17th Apr 2021, 05:26 -
help to download videos DRM or with "mpd" (mpeg dash manifest)?
By Marven in forum ProgrammingReplies: 4Last Post: 17th Apr 2021, 05:24 -
Help Downloading m3u8 File encrypted with aes encryption
By thegeek in forum Video Streaming DownloadingReplies: 3Last Post: 15th Apr 2021, 06:07 -
Downloading AES-128 encrypted m3u8 file
By achy635 in forum Video Streaming DownloadingReplies: 6Last Post: 28th Aug 2019, 23:51