[cnbc] fix test
[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         'info_dict': {
13             'id': '3000503714',
14             'ext': 'mp4',
15             'title': 'Fighting zombies is big business',
16             'description': 'md5:0c100d8e1a7947bd2feec9a5550e519e',
17         },
18         'params': {
19             # m3u8 download
20             'skip_download': True,
21         },
22     }
23
24     def _real_extract(self, url):
25         video_id = self._match_id(url)
26         return {
27             '_type': 'url_transparent',
28             'ie_key': 'ThePlatform',
29             'url': smuggle_url(
30                 'http://link.theplatform.com/s/gZWlPC/media/guid/2408950221/%s?mbr=true&manifest=m3u' % video_id,
31                 {'force_smil_url': True}),
32             'id': video_id,
33         }