cinemax.py 877 B

12345678910111213141516171819202122232425
  1. from .hbo import HBOBaseIE
  2. class CinemaxIE(HBOBaseIE):
  3. _VALID_URL = r'https?://(?:www\.)?cinemax\.com/(?P<path>[^/]+/video/[0-9a-z-]+-(?P<id>\d+))'
  4. _TESTS = [{
  5. 'url': 'https://www.cinemax.com/warrior/video/s1-ep-1-recap-20126903',
  6. 'md5': '82e0734bba8aa7ef526c9dd00cf35a05',
  7. 'info_dict': {
  8. 'id': '20126903',
  9. 'ext': 'mp4',
  10. 'title': 'S1 Ep 1: Recap',
  11. },
  12. 'expected_warnings': ['Unknown MIME type application/mp4 in DASH manifest'],
  13. }, {
  14. 'url': 'https://www.cinemax.com/warrior/video/s1-ep-1-recap-20126903.embed',
  15. 'only_matching': True,
  16. }]
  17. def _real_extract(self, url):
  18. path, video_id = self._match_valid_url(url).groups()
  19. info = self._extract_info('https://www.cinemax.com/%s.xml' % path, video_id)
  20. info['id'] = video_id
  21. return info