]> jfr.im git - yt-dlp.git/blame - yt_dlp/extractor/cinemax.py
[cleanup] Misc
[yt-dlp.git] / yt_dlp / extractor / cinemax.py
CommitLineData
4e4db743
RA
1# coding: utf-8
2from __future__ import unicode_literals
3
4e4db743
RA
4
5from .hbo import HBOBaseIE
6
7
8class CinemaxIE(HBOBaseIE):
9 _VALID_URL = r'https?://(?:www\.)?cinemax\.com/(?P<path>[^/]+/video/[0-9a-z-]+-(?P<id>\d+))'
10 _TESTS = [{
11 'url': 'https://www.cinemax.com/warrior/video/s1-ep-1-recap-20126903',
12 'md5': '82e0734bba8aa7ef526c9dd00cf35a05',
13 'info_dict': {
14 'id': '20126903',
15 'ext': 'mp4',
16 'title': 'S1 Ep 1: Recap',
17 },
18 'expected_warnings': ['Unknown MIME type application/mp4 in DASH manifest'],
19 }, {
20 'url': 'https://www.cinemax.com/warrior/video/s1-ep-1-recap-20126903.embed',
21 'only_matching': True,
22 }]
23
24 def _real_extract(self, url):
5ad28e7f 25 path, video_id = self._match_valid_url(url).groups()
4e4db743
RA
26 info = self._extract_info('https://www.cinemax.com/%s.xml' % path, video_id)
27 info['id'] = video_id
28 return info