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.

32 lines
1015 B

  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. from ..utils import smuggle_url
  4. class FoxSportsIE(InfoExtractor):
  5. _VALID_URL = r'https?://(?:www\.)?foxsports\.com/video\?vid=(?P<id>\d+)'
  6. _TEST = {
  7. 'url': 'http://www.foxsports.com/video?vid=432609859715',
  8. 'info_dict': {
  9. 'id': 'gA0bHB3Ladz3',
  10. 'ext': 'flv',
  11. 'title': 'Courtney Lee on going up 2-0 in series vs. Blazers',
  12. 'description': 'Courtney Lee talks about Memphis being focused.',
  13. },
  14. 'add_ie': ['ThePlatform'],
  15. }
  16. def _real_extract(self, url):
  17. video_id = self._match_id(url)
  18. webpage = self._download_webpage(url, video_id)
  19. config = self._parse_json(
  20. self._search_regex(
  21. r"data-player-config='([^']+)'", webpage, 'data player config'),
  22. video_id)
  23. return self.url_result(smuggle_url(
  24. config['releaseURL'] + '&manifest=f4m', {'force_smil_url': True}))