]>
Commit | Line | Data |
---|---|---|
e42a692f PH |
1 | from __future__ import unicode_literals |
2 | ||
fa3ae234 PH |
3 | from .common import InfoExtractor |
4 | ||
5 | ||
6 | class CBSIE(InfoExtractor): | |
9d581f3d | 7 | _VALID_URL = r'https?://(?:www\.)?(?:cbs\.com/shows/[^/]+/(?:video|artist)|colbertlateshow\.com/(?:video|podcasts))/[^/]+/(?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', | |
9d581f3d | 13 | 'display_id': 'connect-chat-feat-garth-brooks', |
e42a692f PH |
14 | 'ext': 'flv', |
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!', | |
17 | 'duration': 1495, | |
fa3ae234 | 18 | }, |
e42a692f | 19 | 'params': { |
fa3ae234 | 20 | # rtmp download |
e42a692f | 21 | 'skip_download': True, |
fa3ae234 | 22 | }, |
e42a692f | 23 | '_skip': 'Blocked outside the US', |
2871d489 | 24 | }, { |
e42a692f PH |
25 | 'url': 'http://www.cbs.com/shows/liveonletterman/artist/221752/st-vincent/', |
26 | 'info_dict': { | |
10437550 | 27 | 'id': 'WWF_5KqY3PK1', |
9d581f3d | 28 | 'display_id': 'st-vincent', |
e42a692f PH |
29 | 'ext': 'flv', |
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.', | |
32 | 'duration': 3221, | |
2871d489 | 33 | }, |
e42a692f | 34 | 'params': { |
2871d489 | 35 | # rtmp download |
e42a692f | 36 | 'skip_download': True, |
2871d489 | 37 | }, |
e42a692f | 38 | '_skip': 'Blocked outside the US', |
9bf99891 S |
39 | }, { |
40 | 'url': 'http://colbertlateshow.com/video/8GmB0oY0McANFvp2aEffk9jZZZ2YyXxy/the-colbeard/', | |
41 | 'only_matching': True, | |
42 | }, { | |
9d581f3d | 43 | 'url': 'http://www.colbertlateshow.com/podcasts/dYSwjqPs_X1tvbV_P2FcPWRa_qT6akTC/in-the-bad-room-with-stephen/', |
9bf99891 | 44 | 'only_matching': True, |
2871d489 | 45 | }] |
fa3ae234 PH |
46 | |
47 | def _real_extract(self, url): | |
9d581f3d S |
48 | display_id = self._match_id(url) |
49 | webpage = self._download_webpage(url, display_id) | |
fa3ae234 | 50 | real_id = self._search_regex( |
9bf99891 | 51 | [r"video\.settings\.pid\s*=\s*'([^']+)';", r"cbsplayer\.pid\s*=\s*'([^']+)';"], |
e42a692f | 52 | webpage, 'real video ID') |
9d581f3d S |
53 | return { |
54 | '_type': 'url_transparent', | |
55 | 'ie_key': 'ThePlatform', | |
56 | 'url': 'theplatform:%s' % real_id, | |
57 | 'display_id': display_id, | |
58 | } |