]> Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/cinemax.py
New upstream version 2019.06.08
[youtubedl] / youtube_dl / extractor / cinemax.py
1 # coding: utf-8
2 from __future__ import unicode_literals
3
4 import re
5
6 from .hbo import HBOBaseIE
7
8
9 class CinemaxIE(HBOBaseIE):
10 _VALID_URL = r'https?://(?:www\.)?cinemax\.com/(?P<path>[^/]+/video/[0-9a-z-]+-(?P<id>\d+))'
11 _TESTS = [{
12 'url': 'https://www.cinemax.com/warrior/video/s1-ep-1-recap-20126903',
13 'md5': '82e0734bba8aa7ef526c9dd00cf35a05',
14 'info_dict': {
15 'id': '20126903',
16 'ext': 'mp4',
17 'title': 'S1 Ep 1: Recap',
18 },
19 'expected_warnings': ['Unknown MIME type application/mp4 in DASH manifest'],
20 }, {
21 'url': 'https://www.cinemax.com/warrior/video/s1-ep-1-recap-20126903.embed',
22 'only_matching': True,
23 }]
24
25 def _real_extract(self, url):
26 path, video_id = re.match(self._VALID_URL, url).groups()
27 info = self._extract_info('https://www.cinemax.com/%s.xml' % path, video_id)
28 info['id'] = video_id
29 return info