3 from .common
import InfoExtractor
4 from ..utils
import int_or_none
7 class XanimuIE(InfoExtractor
):
8 _VALID_URL
= r
'https?://(?:www\.)?xanimu\.com/(?P<id>[^/]+)/?'
10 'url': 'https://xanimu.com/51944-the-princess-the-frog-hentai/',
11 'md5': '899b88091d753d92dad4cb63bbf357a7',
13 'id': '51944-the-princess-the-frog-hentai',
15 'title': 'The Princess + The Frog Hentai',
16 'thumbnail': 'https://xanimu.com/storage/2020/09/the-princess-and-the-frog-hentai.jpg',
17 'description': r
're:^Enjoy The Princess \+ The Frog Hentai',
22 'url': 'https://xanimu.com/huge-expansion/',
23 'only_matching': True,
26 def _real_extract(self
, url
):
27 video_id
= self
._match
_id
(url
)
28 webpage
= self
._download
_webpage
(url
, video_id
)
31 for format_id
in ['videoHigh', 'videoLow']:
32 format_url
= self
._search
_json
(
33 rf
'var\s+{re.escape(format_id)}\s*=', webpage
, format_id
,
34 video_id
, default
=None, contains_pattern
=r
'[\'"]([^\'"]+)[\'"]')
38 'format_id': format_id,
39 'quality': -2 if format_id.endswith('Low') else None,
45 'title': self._search_regex(r'[\'"]headline
[\'"]:\s*[\'"]([^
"]+)[\'"]', webpage,
46 'title
', default=None) or self._html_extract_title(webpage),
47 'thumbnail
': self._html_search_meta('thumbnailUrl
', webpage, default=None),
48 'description
': self._html_search_meta('description
', webpage, default=None),
49 'duration
': int_or_none(self._search_regex(r'duration
:\s
*[\'"]([^\'"]+?
)[\'"]',
50 webpage, 'duration', fatal=False)),