diff options
| author | remitamine <remitamine@gmail.com> | 2016-05-18 22:24:46 +0100 | 
|---|---|---|
| committer | remitamine <remitamine@gmail.com> | 2016-05-18 22:24:46 +0100 | 
| commit | b78531a36abd765aa9c9df1dba1cf82dc23f8fec (patch) | |
| tree | 819635c9da4089e01e797f9fa2fe017582a2d5db | |
| parent | 11e6a0b64130f9b4aea1a6115a3ebaad73f2f5e0 (diff) | |
[formula1] Add new extractor(closes #3617)
| -rw-r--r-- | youtube_dl/extractor/extractors.py | 1 | ||||
| -rw-r--r-- | youtube_dl/extractor/formula1.py | 25 | 
2 files changed, 26 insertions, 0 deletions
diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 861701f4c..efbe970fe 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -242,6 +242,7 @@ from .fktv import FKTVIE  from .flickr import FlickrIE  from .folketinget import FolketingetIE  from .footyroom import FootyRoomIE +from .formula1 import Formula1IE  from .fourtube import FourTubeIE  from .fox import FOXIE  from .foxgay import FoxgayIE diff --git a/youtube_dl/extractor/formula1.py b/youtube_dl/extractor/formula1.py new file mode 100644 index 000000000..726393fcc --- /dev/null +++ b/youtube_dl/extractor/formula1.py @@ -0,0 +1,25 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor + + +class Formula1IE(InfoExtractor): +    _VALID_URL = r'https?://(?:www\.)?formula1\.com/content/fom-website/en/video/\d{4}/\d{1,2}/(?P<id>.+?)\.html' +    _TEST = { +        'url': 'http://www.formula1.com/content/fom-website/en/video/2016/5/Race_highlights_-_Spain_2016.html', +        'md5': '8c79e54be72078b26b89e0e111c0502b', +        'info_dict': { +            'id': 'JvYXJpMzE6pArfHWm5ARp5AiUmD-gibV', +            'ext': 'flv', +            'title': 'Race highlights - Spain 2016', +        } +    } + +    def _real_extract(self, url): +        display_id = self._match_id(url) +        webpage = self._download_webpage(url, display_id) +        ooyala_embed_code = self._search_regex( +            r'data-videoid="([^"]+)"', webpage, 'ooyala embed code') +        return self.url_result( +            'ooyala:%s' % ooyala_embed_code, 'Ooyala', ooyala_embed_code)  | 
