Repository: yt-dlp
Issue: Add Support for AES-128-CBC Encrypted DASH Manifests
Labels: enhancement,core:post-processor,core:downloader

### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm requesting a site-specific feature
- [X] I've verified that I'm running yt-dlp version **2023.03.04** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [ ] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### Region

Norway

### Example URLs

URL: https://zavideoplatform.streaming.mediaservices.windows.net///7ea4f3d7-2776-43a5-86e1-c05862349e8e/Introduction.ism/manifest(format=mpd-time-csf,encryption=cbc)

Content:
``` 
<?xml version="1.0" encoding="utf-8"?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" xmlns:sea="urn:mpeg:dash:schema:sea:2012" mediaPresentationDuration="PT3M32.949S" minBufferTime="PT3S"><Period><AdaptationSet id="1" group="5" profiles="ccff" bitstreamSwitching="false" segmentAlignment="true" contentType="audio" mimeType="audio/mp4" codecs="mp4a.40.2" lang="en"><ContentProtection schemeIdUri="urn:mpeg:dash:sea:2012"><sea:SegmentEncryption schemeIdUri="urn:mpeg:dash:sea:aes128-cbc:2013"/><sea:KeySystem keySystemUri="urn:mpeg:dash:sea:keysys:http:2013"/><sea:CryptoPeriod keyUriTemplate="https://zavideoplatform.keydelivery.eastus.media.azure.net/?kid=9280864f-064e-48c0-97e0-f2bcb1d8d012" IV="0x7BD31E102B0CE9CCD39691782533656C"/></ContentProtection><Label>aac_eng_2_127999_2_1</Label><SegmentTemplate timescale="10000000" media="QualityLevels($Bandwidth$)/Fragments(aac_eng_2_127999_2_1=$Time$,format=mpd-time-csf)" initialization="QualityLevels($Bandwidth$)/Fragments(aac_eng_2_127999_2_1=i,format=mpd-time-csf)"><SegmentTimeline><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333" r="1"/><S d="20053334"/><S d="20053333"/><S d="3840000"/></SegmentTimeline></SegmentTemplate><Representation id="5_A_aac_eng_2_127999_2_1_1" bandwidth="127999" audioSamplingRate="48000"/></AdaptationSet><AdaptationSet id="2" group="1" profiles="ccff" bitstreamSwitching="false" segmentAlignment="true" contentType="video" mimeType="video/mp4" codecs="avc1.640028" maxWidth="1920" maxHeight="1080" startWithSAP="1"><ContentProtection schemeIdUri="urn:mpeg:dash:sea:2012"><sea:SegmentEncryption schemeIdUri="urn:mpeg:dash:sea:aes128-cbc:2013"/><sea:KeySystem keySystemUri="urn:mpeg:dash:sea:keysys:http:2013"/><sea:CryptoPeriod keyUriTemplate="https://zavideoplatform.keydelivery.eastus.media.azure.net/?kid=9280864f-064e-48c0-97e0-f2bcb1d8d012" IV="0x7BD31E102B0CE9CCD39691782533656C"/></ContentProtection><SegmentTemplate timescale="10000000" media="QualityLevels($Bandwidth$)/Fragments(video=$Time$,format=mpd-time-csf)" initialization="QualityLevels($Bandwidth$)/Fragments(video=i,format=mpd-time-csf)"><SegmentTimeline><S d="20000000" r="105"/><S d="8666666"/></SegmentTimeline></SegmentTemplate><Representation id="1_V_video_1" bandwidth="628102" width="1920" height="1080"/><Representation id="1_V_video_2" bandwidth="422519" codecs="avc1.64001F" width="1280" height="720"/><Representation id="1_V_video_3" bandwidth="258591" codecs="avc1.64001F" width="960" height="540"/></AdaptationSet></Period></MPD>
``` 

### Provide a description that is worded well enough to be understood

When creating a new extractor for the Zenva platform, I ran into an issue with handling the manifest file for video streaming. Zenva uses a DASH manifest with AES-128-CBC encryption to serve videos. While the key URI is freely accessible in the manifest, the current native DASH and fragment downloaders, as well as the common mpd parsing method, do not support this format. In fact, the _parse_mpd_formats method treats any manifest with a ContentProtection element as DRM, **which is not the case here**. Therefore, it is impossible to handle this format using the current methods available in the codebase (afaik).

This problem is probably not specific to Zenva. As HLS AES-128 encryption is already supported, it would make sense for similar encryption in DASH manifests to be supported as well. This is not DRM protection since the encryption key is freely available, unlike with DRM where the key would be protected.

The solution would probably involve modifying the common mpd parsing method and the native dash and fragment downloaders to handle AES-128-CBC encryption, as well as making a case that this isn't DRM. 

Any help or guidance on how we can handle this situation would be greatly appreciated. This would enable support for a larger range of websites and improve the extractor's flexibility when handling different streaming formats.

> For greater context and reference around discussions surrounding this problem, see [Discord thread](https://discord.com/channels/807245652072857610/807246463808700487/1109865322544123944)  (you may have to read around it)


### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [ ] If using API, add `'verbose': True` to `YoutubeDL` params instead
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
[debug] Command-line config: ['-vU', 'https://zavideoplatform.streaming.mediaservices.windows.net///7ea4f3d7-2776-43a5-86e1-c05862349e8e/Introduction.ism/manifest(format=mpd-time-csf,encryption=cbc)']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.03.04 [392389b7d] (source)
[debug] Lazy loading extractors is disabled
[debug] Git HEAD: 36ee625b8
[debug] Python 3.10.6 (CPython x86_64 64bit) - Linux-5.19.0-1021-lowlatency-x86_64-with-glibc2.35 (OpenSSL 3.0.2 15 Mar 2022, glibc 2.35)
[debug] exe versions: ffmpeg 4.4.2 (setts), ffprobe 4.4.2
[debug] Optional libraries: certifi-2020.06.20, pyxattr-0.7.2, secretstorage-3.3.1, sqlite3-2.6.0
[debug] Proxy map: {}
[debug] Loaded 1813 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.03.04, Current version: stable@2023.03.04
yt-dlp is up to date (stable@2023.03.04)
[generic] Extracting URL: https://zavideoplatform.streaming.mediaservices.windows.net///7ea4f3d7-2776-43a5-86e1-c05862349e8e/Introduction.ism/manifest(format=mpd-time-csf,encryption=cbc)
[generic] manifest(format=mpd-time-csf,encryption=cbc): Downloading webpage
WARNING: [generic] Falling back on generic information extractor
[generic] manifest(format=mpd-time-csf,encryption=cbc): Extracting information
[debug] Identified a DASH manifest
ERROR: [generic] manifest(format=mpd-time-csf,encryption=cbc): This video is DRM protected
Traceback (most recent call last):
  File "/home/ivanskodje/dev/yt-dlp/yt_dlp/YoutubeDL.py", line 1533, in wrapper
    return func(self, *args, **kwargs)
  File "/home/ivanskodje/dev/yt-dlp/yt_dlp/YoutubeDL.py", line 1630, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/home/ivanskodje/dev/yt-dlp/yt_dlp/YoutubeDL.py", line 1689, in process_ie_result
    ie_result = self.process_video_result(ie_result, download=download)
  File "/home/ivanskodje/dev/yt-dlp/yt_dlp/YoutubeDL.py", line 2630, in process_video_result
    self.raise_no_formats(info_dict)
  File "/home/ivanskodje/dev/yt-dlp/yt_dlp/YoutubeDL.py", line 1047, in raise_no_formats
    raise ExtractorError(msg, video_id=info['id'], ie=info['extractor'],
yt_dlp.utils.ExtractorError: [generic] manifest(format=mpd-time-csf,encryption=cbc): This video is DRM protected
```