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