logo

youtube-dl

[mirror] Download/Watch videos from video hostersgit clone https://hacktivis.me/git/mirror/youtube-dl.git

formula1.py (995B)


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