[cnbc] Add new extractor(closes #8012)
[youtube-dl] / youtube_dl / extractor / cnbc.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 CNBCIE(InfoExtractor):
9     _VALID_URL = r'https?://video\.cnbc\.com/gallery/\?video=(?P<id>[0-9]+)'
10     _TEST = {
11         'url': 'http://video.cnbc.com/gallery/?video=3000503714',
12         'md5': '',
13         'info_dict': {
14             'id': '3000503714',
15             'ext': 'mp4',
16             'title': 'Video title goes here',
17         }
18     }
19
20     def _real_extract(self, url):
21         video_id = self._match_id(url)
22         return {
23             '_type': 'url_transparent',
24             'ie_key': 'ThePlatform',
25             'url': smuggle_url(
26                 'http://link.theplatform.com/s/gZWlPC/media/guid/2408950221/%s?mbr=true&manifest=m3u' % video_id,
27                 {'force_smil_url': True}),
28             'id': video_id,
29         }