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.

38 lines
1.5 KiB

  1. from __future__ import unicode_literals
  2. from .cbs import CBSBaseIE
  3. class CBSSportsIE(CBSBaseIE):
  4. _VALID_URL = r'https?://(?:www\.)?cbssports\.com/[^/]+/(?:video|news)/(?P<id>[^/?#&]+)'
  5. _TESTS = [{
  6. 'url': 'https://www.cbssports.com/nba/video/donovan-mitchell-flashes-star-potential-in-game-2-victory-over-thunder/',
  7. 'info_dict': {
  8. 'id': '1214315075735',
  9. 'ext': 'mp4',
  10. 'title': 'Donovan Mitchell flashes star potential in Game 2 victory over Thunder',
  11. 'description': 'md5:df6f48622612c2d6bd2e295ddef58def',
  12. 'timestamp': 1524111457,
  13. 'upload_date': '20180419',
  14. 'uploader': 'CBSI-NEW',
  15. },
  16. 'params': {
  17. # m3u8 download
  18. 'skip_download': True,
  19. }
  20. }, {
  21. 'url': 'https://www.cbssports.com/nba/news/nba-playoffs-2018-watch-76ers-vs-heat-game-3-series-schedule-tv-channel-online-stream/',
  22. 'only_matching': True,
  23. }]
  24. def _extract_video_info(self, filter_query, video_id):
  25. return self._extract_feed_info('dJ5BDC', 'VxxJg8Ymh8sE', filter_query, video_id)
  26. def _real_extract(self, url):
  27. display_id = self._match_id(url)
  28. webpage = self._download_webpage(url, display_id)
  29. video_id = self._search_regex(
  30. [r'(?:=|%26)pcid%3D(\d+)', r'embedVideo(?:Container)?_(\d+)'],
  31. webpage, 'video id')
  32. return self._extract_video_info('byId=%s' % video_id, video_id)