[ie/wistia] Support password-protected videos (#11100)
[yt-dlp3.git] / yt_dlp / extractor / thestar.py
blob38aa695a5cbd9adc1e900839cc7b17d9782d6dac
1 from .common import InfoExtractor
4 class TheStarIE(InfoExtractor):
5 _VALID_URL = r'https?://(?:www\.)?thestar\.com/(?:[^/]+/)*(?P<id>.+)\.html'
6 _TEST = {
7 'url': 'http://www.thestar.com/life/2016/02/01/mankind-why-this-woman-started-a-men-s-skincare-line.html',
8 'md5': '2c62dd4db2027e35579fefb97a8b6554',
9 'info_dict': {
10 'id': '4732393888001',
11 'ext': 'mp4',
12 'title': 'Mankind: Why this woman started a men\'s skin care line',
13 'description': 'Robert Cribb talks to Young Lee, the founder of Uncle Peter\'s MAN.',
14 'uploader_id': '794267642001',
15 'timestamp': 1454353482,
16 'upload_date': '20160201',
18 'params': {
19 # m3u8 download
20 'skip_download': True,
23 BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/794267642001/default_default/index.html?videoId=%s'
25 def _real_extract(self, url):
26 display_id = self._match_id(url)
27 webpage = self._download_webpage(url, display_id)
28 brightcove_id = self._search_regex(
29 r'mainartBrightcoveVideoId["\']?\s*:\s*["\']?(\d+)',
30 webpage, 'brightcove id')
31 return self.url_result(
32 self.BRIGHTCOVE_URL_TEMPLATE % brightcove_id,
33 'BrightcoveNew', brightcove_id)