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.

35 lines
1.4 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. import re
  4. from .turner import TurnerBaseIE
  5. class TruTVIE(TurnerBaseIE):
  6. _VALID_URL = r'https?://(?:www\.)?trutv\.com(?:(?P<path>/shows/[^/]+/videos/[^/?#]+?)\.html|/full-episodes/[^/]+/(?P<id>\d+))'
  7. _TEST = {
  8. 'url': 'http://www.trutv.com/shows/10-things/videos/you-wont-believe-these-sports-bets.html',
  9. 'md5': '2cdc844f317579fed1a7251b087ff417',
  10. 'info_dict': {
  11. 'id': '/shows/10-things/videos/you-wont-believe-these-sports-bets',
  12. 'ext': 'mp4',
  13. 'title': 'You Won\'t Believe These Sports Bets',
  14. 'description': 'Jamie Lee sits down with a bookie to discuss the bizarre world of illegal sports betting.',
  15. 'upload_date': '20130305',
  16. }
  17. }
  18. def _real_extract(self, url):
  19. path, video_id = re.match(self._VALID_URL, url).groups()
  20. if path:
  21. data_src = 'http://www.trutv.com/video/cvp/v2/xml/content.xml?id=%s.xml' % path
  22. else:
  23. data_src = 'http://www.trutv.com/tveverywhere/services/cvpXML.do?titleId=' + video_id
  24. return self._extract_cvp_info(
  25. data_src, path, {
  26. 'secure': {
  27. 'media_src': 'http://androidhls-secure.cdn.turner.com/trutv/big',
  28. 'tokenizer_src': 'http://www.trutv.com/tveverywhere/processors/services/token_ipadAdobe.do',
  29. },
  30. })