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