1 from __future__ import unicode_literals
3 from .common import InfoExtractor
6 class CBSIE(InfoExtractor):
7 _VALID_URL = r'https?://(?:www\.)?(?:cbs\.com/shows/[^/]+/(?:video|artist)|colbertlateshow\.com/(?:video|podcasts))/[^/]+/(?P<id>[^/]+)'
10 'url': 'http://www.cbs.com/shows/garth-brooks/video/_u7W953k6la293J7EPTd9oHkSPs6Xn6_/connect-chat-feat-garth-brooks/',
13 'display_id': 'connect-chat-feat-garth-brooks',
15 'title': 'Connect Chat feat. Garth Brooks',
16 '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!',
21 'skip_download': True,
23 '_skip': 'Blocked outside the US',
25 'url': 'http://www.cbs.com/shows/liveonletterman/artist/221752/st-vincent/',
28 'display_id': 'st-vincent',
30 'title': 'Live on Letterman - St. Vincent',
31 'description': 'Live On Letterman: St. Vincent in concert from New York\'s Ed Sullivan Theater on Tuesday, July 16, 2014.',
36 'skip_download': True,
38 '_skip': 'Blocked outside the US',
40 'url': 'http://colbertlateshow.com/video/8GmB0oY0McANFvp2aEffk9jZZZ2YyXxy/the-colbeard/',
41 'only_matching': True,
43 'url': 'http://www.colbertlateshow.com/podcasts/dYSwjqPs_X1tvbV_P2FcPWRa_qT6akTC/in-the-bad-room-with-stephen/',
44 'only_matching': True,
47 def _real_extract(self, url):
48 display_id = self._match_id(url)
49 webpage = self._download_webpage(url, display_id)
50 real_id = self._search_regex(
51 [r"video\.settings\.pid\s*=\s*'([^']+)';", r"cbsplayer\.pid\s*=\s*'([^']+)';"],
52 webpage, 'real video ID')
54 '_type': 'url_transparent',
55 'ie_key': 'ThePlatform',
56 'url': 'theplatform:%s' % real_id,
57 'display_id': display_id,