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.

26 lines
977 B

  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/content/fom-website/en/video/\d{4}/\d{1,2}/(?P<id>.+?)\.html'
  6. _TEST = {
  7. 'url': 'http://www.formula1.com/content/fom-website/en/video/2016/5/Race_highlights_-_Spain_2016.html',
  8. 'md5': '8c79e54be72078b26b89e0e111c0502b',
  9. 'info_dict': {
  10. 'id': 'JvYXJpMzE6pArfHWm5ARp5AiUmD-gibV',
  11. 'ext': 'flv',
  12. 'title': 'Race highlights - Spain 2016',
  13. },
  14. 'add_ie': ['Ooyala'],
  15. }
  16. def _real_extract(self, url):
  17. display_id = self._match_id(url)
  18. webpage = self._download_webpage(url, display_id)
  19. ooyala_embed_code = self._search_regex(
  20. r'data-videoid="([^"]+)"', webpage, 'ooyala embed code')
  21. return self.url_result(
  22. 'ooyala:%s' % ooyala_embed_code, 'Ooyala', ooyala_embed_code)