VideoHelp Forum
+ Reply to Thread
Results 1 to 20 of 20
Thread
  1. Good afternoon, it's been some days that I tried to decrypt a video that uses a MPD+AES 128 CBC key, I tried seeking the tutorial:
    https://forum.videohelp.com/threads/413718-My-journey-with-AES-128-encrypted-HLS
    https://forum.videohelp.com/threads/414202-%5BSOLVED%5D-AES-128-encryption-using-a-DAS...-manifest-file
    I checked also other topics, but I didn't find anything regarding MPD + AES 128 that resembles the problem I have.
    Sorry to the staff if it was asked before(it seems not)

    I checked the requests(all of them) but I didn't find any possible "key". What to do in such cases? I tried to access the link:
    keyUriTemplate
    But nothing, it fails asking for a parameter.
    I was able to find the IV and also the code that "decrypts" the frames in javascript, but it's a mess.
    Any suggestion to what to do in such cases?
    What makes me wonder is that there is no request to the "CryptoPeriod keyUriTemplate=" found in the mpd, still the webpage can decrypt the frames.

    Before I was able to use yt-dlp and it was enough to download it(simple MPD no encryption), but now it's impossible.

    For stream(by microsoft) they were using M3U8 + AES 128 CBC if I'm not wrong and I could get the keys by the requests, while on sharepoint I can't find it.
    If someone can point me to some guides/tutorials it would help me a lot.
    Last edited by raknitir; 4th Jul 2024 at 05:50.
    Quote Quote  
  2. Originally Posted by raknitir View Post
    Good afternoon, it's been some days that I tried to decrypt a video that uses a MPD+AES 128 CBC key, I tried seeking the tutorial:
    https://forum.videohelp.com/threads/413718-My-journey-with-AES-128-encrypted-HLS
    https://forum.videohelp.com/threads/414202-%5BSOLVED%5D-AES-128-encryption-using-a-DAS...-manifest-file
    I checked also other topics, but I didn't find anything regarding MPD + AES 128 that resembles the problem I have.
    Sorry to the staff if it was asked before(it seems not)

    I checked the requests(all of them) but I didn't find any possible "key". What to do in such cases? I tried to access the link:
    keyUriTemplate
    But nothing, it fails asking for a parameter.
    I was able to find the IV and also the code that "decrypts" the frames in javascript, but it's a mess.
    Any suggestion to what to do in such cases?
    What makes me wonder is that there is no request to the "CryptoPeriod keyUriTemplate=" found in the mpd, still the webpage can decrypt the frames.

    Before I was able to use yt-dlp and it was enough to download it(simple MPD no encryption), but now it's impossible.

    For stream(by microsoft) they were using M3U8 + AES 128 CBC if I'm not wrong and I could get the keys by the requests, while on sharepoint I can't find it.
    If someone can point me to some guides/tutorials it would help me a lot.
    share video url
    Quote Quote  
  3. Yes please i've been looking for a manifest like this
    Quote Quote  
  4. Sadly I can't it's a work account and a work video any idea of where to look? Is it possible that the key is inside the url(so without making a request?)
    I'm continuing searching a solution.
    Quote Quote  
  5. The key and IV are inside the manifest.
    Could you send me a PM regrading the manifest? I really need it to develop my downloader.
    Quote Quote  
  6. @larley

    have you tried the search filed on the forum? there are many posts about aes-128

    https://www.videohelp.com/search?siteurl=forum.videohelp.com&q=aes-128
    Quote Quote  
  7. Yes, for HLS, but not DASH. There's only one thread about this but the site metioned removed the Manifests and is now serving raw video files.
    Quote Quote  
  8. I may have found the key any idea of how to decrypt the file? I tried N_m3u8DL-RE but it doesn't decrypt it even if I provide the supposed key(the files downloaded are the same as the ones I downloaded before encrypted) and IV.
    Quote Quote  
  9. 1) I downloaded the key by using the URI in the KeyURITemplate found in the MPD manifest and I replaced the & with &.
    2) I downloaded all the segments using the youtube-dlp with the --keep-fragments argument
    3) I modified and used the script found thanks to the solution suggested by larley. That generated two m3u8s and the main one
    4) Then I used N_m3u8DL-RE with the main.m3u8 and the key I found previously if the key it's in the same folder it's enough the name of it for example "Key"
    I tried to download a video I already had downloaded and it seems that the bitrate is half the original for the mp4.
    While the audio gives that warning while merging:
    Non-monotonic DTS in output stream.... This may result in incorrect timestamps in the output file.

    I noticed also that the audio fragments are 2 times the video's ones(for example 1000 video fragments and 2000 audio fragments)
    How to make sure to download the best resolution with yt-dlp?(I can't use -F because is DRM) Just to make does it downloads the best?
    Thanks to larley for his help.

    I hope this really short "guide" can help someone.
    Last edited by raknitir; 5th Jul 2024 at 10:44.
    Quote Quote  
  10. Code:
    --allow-u
    with either
    Code:
    -f "bv,ba"
    or
    Code:
    -F
    and
    Code:
    -f <id>+<id>
    Quote Quote  
  11. Thanks a lot, do you know of any solution to Non-monotonic DTS in output stream.... This may result in incorrect timestamps in the output file. for the audio file?
    Quote Quote  
  12. Thanks I'll make some tests to understand why.
    Quote Quote  
  13. I downloaded the same video 3 times and it seems the last fragment of the video file is different in one download while in the other two downloads has the same hash. I used the following command, did I do something wrong?
    yt-dlp "" --allow-unplayable-formats -o "video" -R "infinite" --fragment-retries "infinite" --file-access-retries "infinite" --retry-sleep linear=1::2 --retry-sleep fragment:1 --cookies cookies.txt --limit-rate 40K --concurrent-fragments 4 --keep-fragments
    Are there other tools to download fragments without merging?
    I'm a noob sorry.
    Quote Quote  
  14. The downloader i mentioned here: https://forum.videohelp.com/threads/415144-AES-128-in-DASH-MPD-file#post2741789 with:
    Code:
    --skip-merge
    (not sure why you would want to skip merging if it already decrypts them for you)
    Quote Quote  
  15. Because N_m3u8DL-RE.exe doesn't decrypt it(MPD + AES 128) and I have to download the fragments using yt-dlp, generate the needed .m3u8 and then run N_m3u8DL-RE on the m3u8. Am I missing something? Thanks for the help.
    Quote Quote  
  16. Did you use the modified version that i referenced and provided the key?
    Code:
    --custom-hls-key <key>
    The modified downloader should error out with 'need the key' or something when needed but not specified.
    Quote Quote  
  17. Thanks, I didn't notice it(I read the post above it). I'll try it soon.
    Quote Quote  
  18. It doesn't detect it's AES 128 and doesn't decrypt it.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!