]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/wakanim.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
12 class WakanimIE(InfoExtractor
):
13 _VALID_URL
= r
'https://(?:www\.)?wakanim\.tv/[^/]+/v2/catalogue/episode/(?P<id>\d+)'
15 'url': 'https://www.wakanim.tv/de/v2/catalogue/episode/2997/the-asterisk-war-omu-staffel-1-episode-02-omu',
19 'title': 'Episode 02',
20 'description': 'md5:2927701ea2f7e901de8bfa8d39b2852d',
21 'series': 'The Asterisk War (OmU.)',
23 'episode': 'Episode 02',
27 'format': 'bestvideo',
28 'skip_download': True,
32 'url': 'https://www.wakanim.tv/de/v2/catalogue/episode/7843/sword-art-online-alicization-omu-arc-2-folge-15-omu',
33 'only_matching': True,
36 def _real_extract(self
, url
):
37 video_id
= self
._match
_id
(url
)
39 webpage
= self
._download
_webpage
(url
, video_id
)
41 m3u8_url
= urljoin(url
, self
._search
_regex
(
42 r
'file\s*:\s*(["\'])(?P
<url
>(?
:(?
!\
1).)+)\
1', webpage, 'm3u8 url
',
44 if not self.get_param('allow_unplayable_formats
'):
45 # https://docs.microsoft.com/en-us/azure/media-services/previous/media-services-content-protection-overview#streaming-urls
46 encryption = self._search_regex(
47 r'encryption
%3D(c(?
:enc|
bc(?
:s
-aapl
)?
))',
48 m3u8_url, 'encryption
', default=None)
49 if encryption in ('cenc
', 'cbcs
-aapl
'):
50 raise ExtractorError('This video
is DRM protected
.', expected=True)
52 formats = self._extract_m3u8_formats(
53 m3u8_url, video_id, 'mp4
', entry_protocol='m3u8_native
',
56 info = self._search_json_ld(webpage, video_id, default={})
58 title = self._search_regex(
59 (r'<h1
[^
>]+\bclass
=["\']episode_h1[^>]+\btitle=(["\'])(?P
<title
>(?
:(?
!\
1).)+)\
1',
60 r'<span
[^
>]+\bclass
=["\']episode_title["\'][^
>]*>(?P
<title
>[^
<]+)'),
61 webpage, 'title
', default=None, group='title
')
63 return merge_dicts(info, {