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.

42 lines
1.3 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/video?vid=432609859715',
  11. 'md5': 'b49050e955bebe32c301972e4012ac17',
  12. 'info_dict': {
  13. 'id': 'i0qKWsk3qJaM',
  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._search_regex(
  28. r"data-player-config='([^']+)'", webpage, 'data player config'),
  29. video_id)
  30. return self.url_result(smuggle_url(update_url_query(
  31. config['releaseURL'], {
  32. 'mbr': 'true',
  33. 'switch': 'http',
  34. }), {'force_smil_url': True}))