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.

43 lines
1.4 KiB

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