2 from __future__ import unicode_literals
4 from .common import InfoExtractor
11 class WakanimIE(InfoExtractor):
12 _VALID_URL = r'https://(?:www\.)?wakanim\.tv/[^/]+/v2/catalogue/episode/(?P<id>\d+)'
14 'url': 'https://www.wakanim.tv/de/v2/catalogue/episode/2997/the-asterisk-war-omu-staffel-1-episode-02-omu',
18 'title': 'Episode 02',
19 'description': 'md5:2927701ea2f7e901de8bfa8d39b2852d',
20 'series': 'The Asterisk War (OmU.)',
22 'episode': 'Episode 02',
26 'format': 'bestvideo',
27 'skip_download': True,
31 def _real_extract(self, url):
32 video_id = self._match_id(url)
34 webpage = self._download_webpage(url, video_id)
36 m3u8_url = urljoin(url, self._search_regex(
37 r'file\s*:\s*(["\'])(?P<url>(?:(?!\1).)+)\1', webpage, 'm3u8 url',
40 formats = self._extract_m3u8_formats(
41 m3u8_url, video_id, 'mp4', entry_protocol='m3u8_native',
44 info = self._search_json_ld(webpage, video_id, default={})
46 title = self._search_regex(
47 (r'<h1[^>]+\bclass=["\']episode_h1[^>]+\btitle=(["\'])(?P<title>(?:(?!\1).)+)\1',
48 r'<span[^>]+\bclass=["\']episode_title["\'][^>]*>(?P<title>[^<]+)'),
49 webpage, 'title', default=None, group='title')
51 return merge_dicts(info, {