1 from urllib
.parse
import unquote
3 from .common
import InfoExtractor
10 class WakanimIE(InfoExtractor
):
11 _VALID_URL
= r
'https://(?:www\.)?wakanim\.tv/[^/]+/v2/catalogue/episode/(?P<id>\d+)'
13 'url': 'https://www.wakanim.tv/de/v2/catalogue/episode/2997/the-asterisk-war-omu-staffel-1-episode-02-omu',
17 'title': 'Episode 02',
18 'description': 'md5:2927701ea2f7e901de8bfa8d39b2852d',
19 'series': 'The Asterisk War (OmU.)',
21 'episode': 'Episode 02',
25 'skip_download': True,
29 'url': 'https://www.wakanim.tv/de/v2/catalogue/episode/7843/sword-art-online-alicization-omu-arc-2-folge-15-omu',
30 'only_matching': True,
34 def _real_extract(self
, url
):
35 video_id
= self
._match
_id
(url
)
37 webpage
= self
._download
_webpage
(url
, video_id
)
39 if 'Geoblocking' in webpage
:
41 self
.raise_geo_restricted(countries
=['DE', 'AT', 'CH'])
43 self
.raise_geo_restricted(countries
=['RU'])
45 manifest_url
= urljoin(url
, self
._search
_regex
(
46 r
'file\s*:\s*(["\'])(?P
<url
>(?
:(?
!\
1).)+)\
1', webpage, 'manifest url
',
48 if not self.get_param('allow_unplayable_formats
'):
49 # https://docs.microsoft.com/en-us/azure/media-services/previous/media-services-content-protection-overview#streaming-urls
50 encryption = self._search_regex(
51 r'encryption
%3D(c(?
:enc|
bc(?
:s
-aapl
)?
))',
52 manifest_url, 'encryption
', default=None)
53 if encryption in ('cenc
', 'cbcs
-aapl
'):
54 self.report_drm(video_id)
56 if 'format
=mpd
-time
-cmaf
' in unquote(manifest_url):
57 formats = self._extract_mpd_formats(
58 manifest_url, video_id, mpd_id='dash
')
60 formats = self._extract_m3u8_formats(
61 manifest_url, video_id, 'mp4
', entry_protocol='m3u8_native
',
64 info = self._search_json_ld(webpage, video_id, default={})
66 title = self._search_regex(
67 (r'<h1
[^
>]+\bclass
=["\']episode_h1[^>]+\btitle=(["\'])(?P
<title
>(?
:(?
!\
1).)+)\
1',
68 r'<span
[^
>]+\bclass
=["\']episode_title["\'][^
>]*>(?P
<title
>[^
<]+)'),
69 webpage, 'title
', default=None, group='title
')
71 return merge_dicts(info, {