formula1.py 938 B

123456789101112131415161718192021222324
  1. from .common import InfoExtractor
  2. class Formula1IE(InfoExtractor):
  3. _VALID_URL = r'https?://(?:www\.)?formula1\.com/en/latest/video\.[^.]+\.(?P<id>\d+)\.html'
  4. _TEST = {
  5. 'url': 'https://www.formula1.com/en/latest/video.race-highlights-spain-2016.6060988138001.html',
  6. 'md5': 'be7d3a8c2f804eb2ab2aa5d941c359f8',
  7. 'info_dict': {
  8. 'id': '6060988138001',
  9. 'ext': 'mp4',
  10. 'title': 'Race highlights - Spain 2016',
  11. 'timestamp': 1463332814,
  12. 'upload_date': '20160515',
  13. 'uploader_id': '6057949432001',
  14. },
  15. 'add_ie': ['BrightcoveNew'],
  16. }
  17. BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/6057949432001/S1WMrhjlh_default/index.html?videoId=%s'
  18. def _real_extract(self, url):
  19. bc_id = self._match_id(url)
  20. return self.url_result(
  21. self.BRIGHTCOVE_URL_TEMPLATE % bc_id, 'BrightcoveNew', bc_id)