]>
Commit | Line | Data |
---|---|---|
b78531a3 | 1 | # coding: utf-8 |
2 | from __future__ import unicode_literals | |
3 | ||
4 | from .common import InfoExtractor | |
5 | ||
6 | ||
7 | class Formula1IE(InfoExtractor): | |
c3fa77bd S |
8 | _VALID_URL = r'https?://(?:www\.)?formula1\.com/(?:content/fom-website/)?en/video/\d{4}/\d{1,2}/(?P<id>.+?)\.html' |
9 | _TESTS = [{ | |
b78531a3 | 10 | 'url': 'http://www.formula1.com/content/fom-website/en/video/2016/5/Race_highlights_-_Spain_2016.html', |
11 | 'md5': '8c79e54be72078b26b89e0e111c0502b', | |
12 | 'info_dict': { | |
13 | 'id': 'JvYXJpMzE6pArfHWm5ARp5AiUmD-gibV', | |
2342733f | 14 | 'ext': 'mp4', |
b78531a3 | 15 | 'title': 'Race highlights - Spain 2016', |
277c7465 | 16 | }, |
2342733f RA |
17 | 'params': { |
18 | # m3u8 download | |
19 | 'skip_download': True, | |
20 | }, | |
277c7465 | 21 | 'add_ie': ['Ooyala'], |
c3fa77bd S |
22 | }, { |
23 | 'url': 'http://www.formula1.com/en/video/2016/5/Race_highlights_-_Spain_2016.html', | |
24 | 'only_matching': True, | |
25 | }] | |
b78531a3 | 26 | |
27 | def _real_extract(self, url): | |
28 | display_id = self._match_id(url) | |
29 | webpage = self._download_webpage(url, display_id) | |
30 | ooyala_embed_code = self._search_regex( | |
31 | r'data-videoid="([^"]+)"', webpage, 'ooyala embed code') | |
32 | return self.url_result( | |
33 | 'ooyala:%s' % ooyala_embed_code, 'Ooyala', ooyala_embed_code) |