You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.7 KiB

9 years ago
  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. class CBSIE(InfoExtractor):
  4. _VALID_URL = r'https?://(?:www\.)?cbs\.com/shows/[^/]+/(?:video|artist)/(?P<id>[^/]+)/.*'
  5. _TESTS = [{
  6. 'url': 'http://www.cbs.com/shows/garth-brooks/video/_u7W953k6la293J7EPTd9oHkSPs6Xn6_/connect-chat-feat-garth-brooks/',
  7. 'info_dict': {
  8. 'id': '4JUVEwq3wUT7',
  9. 'ext': 'flv',
  10. 'title': 'Connect Chat feat. Garth Brooks',
  11. '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!',
  12. 'duration': 1495,
  13. },
  14. 'params': {
  15. # rtmp download
  16. 'skip_download': True,
  17. },
  18. '_skip': 'Blocked outside the US',
  19. }, {
  20. 'url': 'http://www.cbs.com/shows/liveonletterman/artist/221752/st-vincent/',
  21. 'info_dict': {
  22. 'id': 'WWF_5KqY3PK1',
  23. 'ext': 'flv',
  24. 'title': 'Live on Letterman - St. Vincent',
  25. 'description': 'Live On Letterman: St. Vincent in concert from New York\'s Ed Sullivan Theater on Tuesday, July 16, 2014.',
  26. 'duration': 3221,
  27. },
  28. 'params': {
  29. # rtmp download
  30. 'skip_download': True,
  31. },
  32. '_skip': 'Blocked outside the US',
  33. }]
  34. def _real_extract(self, url):
  35. video_id = self._match_id(url)
  36. webpage = self._download_webpage(url, video_id)
  37. real_id = self._search_regex(
  38. r"video\.settings\.pid\s*=\s*'([^']+)';",
  39. webpage, 'real video ID')
  40. return self.url_result('theplatform:%s' % real_id)