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.

28 lines
1.2 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. from ..utils import smuggle_url
  5. class BravoTVIE(InfoExtractor):
  6. _VALID_URL = r'https?://(?:www\.)?bravotv\.com/(?:[^/]+/)+videos/(?P<id>[^/?]+)'
  7. _TEST = {
  8. 'url': 'http://www.bravotv.com/last-chance-kitchen/season-5/videos/lck-ep-12-fishy-finale',
  9. 'md5': 'd60cdf68904e854fac669bd26cccf801',
  10. 'info_dict': {
  11. 'id': 'LitrBdX64qLn',
  12. 'ext': 'mp4',
  13. 'title': 'Last Chance Kitchen Returns',
  14. 'description': 'S13: Last Chance Kitchen Returns for Top Chef Season 13',
  15. }
  16. }
  17. def _real_extract(self, url):
  18. video_id = self._match_id(url)
  19. webpage = self._download_webpage(url, video_id)
  20. account_pid = self._search_regex(r'"account_pid"\s*:\s*"([^"]+)"', webpage, 'account pid')
  21. release_pid = self._search_regex(r'"release_pid"\s*:\s*"([^"]+)"', webpage, 'release pid')
  22. return self.url_result(smuggle_url(
  23. 'http://link.theplatform.com/s/%s/%s?mbr=true&switch=progressive' % (account_pid, release_pid),
  24. {'force_smil_url': True}), 'ThePlatform', release_pid)