]>
Commit | Line | Data |
---|---|---|
6a8422b9 S |
1 | from __future__ import unicode_literals |
2 | ||
3 | from .common import InfoExtractor | |
6cd64b68 RA |
4 | from ..utils import ( |
5 | smuggle_url, | |
6 | update_url_query, | |
7 | ) | |
6a8422b9 S |
8 | |
9 | ||
10 | class FoxSportsIE(InfoExtractor): | |
de765f6c | 11 | _VALID_URL = r'https?://(?:www\.)?foxsports\.com/(?:[^/]+/)*(?P<id>[^/]+)' |
6a8422b9 S |
12 | |
13 | _TEST = { | |
ab39a25c | 14 | 'url': 'http://www.foxsports.com/tennessee/video/432609859715', |
6cd64b68 | 15 | 'md5': 'b49050e955bebe32c301972e4012ac17', |
6a8422b9 | 16 | 'info_dict': { |
ab39a25c | 17 | 'id': 'bwduI3X_TgUB', |
6cd64b68 | 18 | 'ext': 'mp4', |
6a8422b9 S |
19 | 'title': 'Courtney Lee on going up 2-0 in series vs. Blazers', |
20 | 'description': 'Courtney Lee talks about Memphis being focused.', | |
6cd64b68 RA |
21 | 'upload_date': '20150423', |
22 | 'timestamp': 1429761109, | |
23 | 'uploader': 'NEWA-FNG-FOXSPORTS', | |
6a8422b9 S |
24 | }, |
25 | 'add_ie': ['ThePlatform'], | |
26 | } | |
27 | ||
28 | def _real_extract(self, url): | |
29 | video_id = self._match_id(url) | |
30 | ||
31 | webpage = self._download_webpage(url, video_id) | |
32 | ||
33 | config = self._parse_json( | |
ab39a25c RA |
34 | self._html_search_regex( |
35 | r"""class="[^"]*(?:fs-player|platformPlayer-wrapper)[^"]*".+?data-player-config='([^']+)'""", | |
36 | webpage, 'data player config'), | |
6a8422b9 S |
37 | video_id) |
38 | ||
6cd64b68 RA |
39 | return self.url_result(smuggle_url(update_url_query( |
40 | config['releaseURL'], { | |
41 | 'mbr': 'true', | |
42 | 'switch': 'http', | |
43 | }), {'force_smil_url': True})) |