diff options
author | nyuszika7h <nyuszika7h@gmail.com> | 2021-10-26 18:33:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-26 22:03:43 +0530 |
commit | dc88e9be03ea0974760725d1ad089b91a7fefe52 (patch) | |
tree | c7f49a9f6cbca3b29fb499e274479742219eefc3 | |
parent | 673944b001447adb0de88c12fa22577a770d771a (diff) | |
download | hypervideo-pre-dc88e9be03ea0974760725d1ad089b91a7fefe52.tar.lz hypervideo-pre-dc88e9be03ea0974760725d1ad089b91a7fefe52.tar.xz hypervideo-pre-dc88e9be03ea0974760725d1ad089b91a7fefe52.zip |
[wakanim] Add support for MPD manifests (#1428)
Closes #1426
Authored by: nyuszika7h
-rw-r--r-- | yt_dlp/extractor/wakanim.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/yt_dlp/extractor/wakanim.py b/yt_dlp/extractor/wakanim.py index c956d616e..22441c38f 100644 --- a/yt_dlp/extractor/wakanim.py +++ b/yt_dlp/extractor/wakanim.py @@ -1,6 +1,8 @@ # coding: utf-8 from __future__ import unicode_literals +from urllib.parse import unquote + from .common import InfoExtractor from ..utils import ( merge_dicts, @@ -37,20 +39,24 @@ class WakanimIE(InfoExtractor): webpage = self._download_webpage(url, video_id) - m3u8_url = urljoin(url, self._search_regex( - r'file\s*:\s*(["\'])(?P<url>(?:(?!\1).)+)\1', webpage, 'm3u8 url', + manifest_url = urljoin(url, self._search_regex( + r'file\s*:\s*(["\'])(?P<url>(?:(?!\1).)+)\1', webpage, 'manifest url', group='url')) if not self.get_param('allow_unplayable_formats'): # https://docs.microsoft.com/en-us/azure/media-services/previous/media-services-content-protection-overview#streaming-urls encryption = self._search_regex( r'encryption%3D(c(?:enc|bc(?:s-aapl)?))', - m3u8_url, 'encryption', default=None) + manifest_url, 'encryption', default=None) if encryption in ('cenc', 'cbcs-aapl'): self.report_drm(video_id) - formats = self._extract_m3u8_formats( - m3u8_url, video_id, 'mp4', entry_protocol='m3u8_native', - m3u8_id='hls') + if 'format=mpd-time-cmaf' in unquote(manifest_url): + formats = self._extract_mpd_formats( + manifest_url, video_id, mpd_id='dash') + else: + formats = self._extract_m3u8_formats( + manifest_url, video_id, 'mp4', entry_protocol='m3u8_native', + m3u8_id='hls') info = self._search_json_ld(webpage, video_id, default={}) |