You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
949 B

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