]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/wakanim.py
2 from __future__
import unicode_literals
4 from urllib
.parse
import unquote
6 from .common
import InfoExtractor
13 class WakanimIE(InfoExtractor
):
14 _VALID_URL
= r
'https://(?:www\.)?wakanim\.tv/[^/]+/v2/catalogue/episode/(?P<id>\d+)'
16 'url': 'https://www.wakanim.tv/de/v2/catalogue/episode/2997/the-asterisk-war-omu-staffel-1-episode-02-omu',
20 'title': 'Episode 02',
21 'description': 'md5:2927701ea2f7e901de8bfa8d39b2852d',
22 'series': 'The Asterisk War (OmU.)',
24 'episode': 'Episode 02',
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,
37 def _real_extract(self
, url
):
38 video_id
= self
._match
_id
(url
)
40 webpage
= self
._download
_webpage
(url
, video_id
)
42 if 'Geoblocking' in webpage
:
44 self
.raise_geo_restricted(countries
=['DE', 'AT', 'CH'])
46 self
.raise_geo_restricted(countries
=['RU'])
48 manifest_url
= urljoin(url
, self
._search
_regex
(
49 r
'file\s*:\s*(["\'])(?P
<url
>(?
:(?
!\
1).)+)\
1', webpage, 'manifest url
',
51 if not self.get_param('allow_unplayable_formats
'):
52 # https://docs.microsoft.com/en-us/azure/media-services/previous/media-services-content-protection-overview#streaming-urls
53 encryption = self._search_regex(
54 r'encryption
%3D(c(?
:enc|
bc(?
:s
-aapl
)?
))',
55 manifest_url, 'encryption
', default=None)
56 if encryption in ('cenc
', 'cbcs
-aapl
'):
57 self.report_drm(video_id)
59 if 'format
=mpd
-time
-cmaf
' in unquote(manifest_url):
60 formats = self._extract_mpd_formats(
61 manifest_url, video_id, mpd_id='dash
')
63 formats = self._extract_m3u8_formats(
64 manifest_url, video_id, 'mp4
', entry_protocol='m3u8_native
',
67 info = self._search_json_ld(webpage, video_id, default={})
69 title = self._search_regex(
70 (r'<h1
[^
>]+\bclass
=["\']episode_h1[^>]+\btitle=(["\'])(?P
<title
>(?
:(?
!\
1).)+)\
1',
71 r'<span
[^
>]+\bclass
=["\']episode_title["\'][^
>]*>(?P
<title
>[^
<]+)'),
72 webpage, 'title
', default=None, group='title
')
74 return merge_dicts(info, {