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.

30 lines
1.1 KiB

  1. import re
  2. from .common import InfoExtractor
  3. class CBSIE(InfoExtractor):
  4. _VALID_URL = r'https?://(?:www\.)?cbs\.com/shows/[^/]+/video/(?P<id>[^/]+)/.*'
  5. _TEST = {
  6. u'url': u'http://www.cbs.com/shows/garth-brooks/video/_u7W953k6la293J7EPTd9oHkSPs6Xn6_/connect-chat-feat-garth-brooks/',
  7. u'file': u'4JUVEwq3wUT7.flv',
  8. u'info_dict': {
  9. u'title': u'Connect Chat feat. Garth Brooks',
  10. u'description': u'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!',
  11. u'duration': 1495,
  12. },
  13. u'params': {
  14. # rtmp download
  15. u'skip_download': True,
  16. },
  17. }
  18. def _real_extract(self, url):
  19. mobj = re.match(self._VALID_URL, url)
  20. video_id = mobj.group('id')
  21. webpage = self._download_webpage(url, video_id)
  22. real_id = self._search_regex(
  23. r"video\.settings\.pid\s*=\s*'([^']+)';",
  24. webpage, u'real video ID')
  25. return self.url_result(u'theplatform:%s' % real_id)