2 from __future__ import unicode_literals
6 from .common import InfoExtractor
7 from ..utils import smuggle_url
10 class CNBCIE(InfoExtractor):
11 _VALID_URL = r'https?://video\.cnbc\.com/gallery/\?video=(?P<id>[0-9]+)'
13 'url': 'http://video.cnbc.com/gallery/?video=3000503714',
17 'title': 'Fighting zombies is big business',
18 'description': 'md5:0c100d8e1a7947bd2feec9a5550e519e',
19 'timestamp': 1459332000,
20 'upload_date': '20160330',
21 'uploader': 'NBCU-CNBC',
25 'skip_download': True,
29 def _real_extract(self, url):
30 video_id = self._match_id(url)
32 '_type': 'url_transparent',
33 'ie_key': 'ThePlatform',
35 'http://link.theplatform.com/s/gZWlPC/media/guid/2408950221/%s?mbr=true&manifest=m3u' % video_id,
36 {'force_smil_url': True}),
41 class CNBCVideoIE(InfoExtractor):
42 _VALID_URL = r'https?://(?:www\.)?cnbc\.com(?P<path>/video/(?:[^/]+/)+(?P<id>[^./?#&]+)\.html)'
44 'url': 'https://www.cnbc.com/video/2018/07/19/trump-i-dont-necessarily-agree-with-raising-rates.html',
48 'title': "Trump: I don't necessarily agree with raising rates",
49 'description': 'md5:878d8f0b4ebb5bb1dda3514b91b49de3',
50 'timestamp': 1531958400,
51 'upload_date': '20180719',
52 'uploader': 'NBCU-CNBC',
55 'skip_download': True,
59 def _real_extract(self, url):
60 path, display_id = re.match(self._VALID_URL, url).groups()
61 video_id = self._download_json(
62 'https://webql-redesign.cnbcfm.com/graphql', display_id, query={
68 })['data']['page']['vcpsId']
69 return self.url_result(
70 'http://video.cnbc.com/gallery/?video=%d' % video_id,