]> jfr.im git - yt-dlp.git/blame - youtube_dl/extractor/cbs.py
Merge remote-tracking branch 'duncankl/airmozilla'
[yt-dlp.git] / youtube_dl / extractor / cbs.py
CommitLineData
e42a692f
PH
1from __future__ import unicode_literals
2
fa3ae234
PH
3from .common import InfoExtractor
4
5
6class CBSIE(InfoExtractor):
e42a692f 7 _VALID_URL = r'https?://(?:www\.)?cbs\.com/shows/[^/]+/(?:video|artist)/(?P<id>[^/]+)/.*'
fa3ae234 8
2871d489 9 _TESTS = [{
e42a692f
PH
10 'url': 'http://www.cbs.com/shows/garth-brooks/video/_u7W953k6la293J7EPTd9oHkSPs6Xn6_/connect-chat-feat-garth-brooks/',
11 'info_dict': {
12 'id': '4JUVEwq3wUT7',
13 'ext': 'flv',
14 'title': 'Connect Chat feat. Garth Brooks',
15 'description': 'Connect with country music singer Garth Brooks, as he chats with fans on Wednesday November 27, 2013. Be sure to tune in to Garth Brooks: Live from Las Vegas, Friday November 29, at 9/8c on CBS!',
16 'duration': 1495,
fa3ae234 17 },
e42a692f 18 'params': {
fa3ae234 19 # rtmp download
e42a692f 20 'skip_download': True,
fa3ae234 21 },
e42a692f 22 '_skip': 'Blocked outside the US',
2871d489 23 }, {
e42a692f
PH
24 'url': 'http://www.cbs.com/shows/liveonletterman/artist/221752/st-vincent/',
25 'info_dict': {
10437550 26 'id': 'WWF_5KqY3PK1',
e42a692f
PH
27 'ext': 'flv',
28 'title': 'Live on Letterman - St. Vincent',
29 'description': 'Live On Letterman: St. Vincent in concert from New York\'s Ed Sullivan Theater on Tuesday, July 16, 2014.',
30 'duration': 3221,
2871d489 31 },
e42a692f 32 'params': {
2871d489 33 # rtmp download
e42a692f 34 'skip_download': True,
2871d489 35 },
e42a692f 36 '_skip': 'Blocked outside the US',
2871d489 37 }]
fa3ae234
PH
38
39 def _real_extract(self, url):
1c2528c8 40 video_id = self._match_id(url)
fa3ae234
PH
41 webpage = self._download_webpage(url, video_id)
42 real_id = self._search_regex(
43 r"video\.settings\.pid\s*=\s*'([^']+)';",
e42a692f 44 webpage, 'real video ID')
8865bdeb 45 return self.url_result('theplatform:%s' % real_id)