]> jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/fusion.py
[Fusion] Add new extractor
[yt-dlp.git] / youtube_dl / extractor / fusion.py
1 from __future__ import unicode_literals
2
3 from .common import InfoExtractor
4 from .ooyala import OoyalaIE
5
6
7 class FusionIE(InfoExtractor):
8 _VALID_URL = r'https?://(?:www\.)?fusion\.net/video/\d+/(?P<id>[\w-]+)'
9 _TEST = {
10 'url': 'http://fusion.net/video/201781/u-s-and-panamanian-forces-work-together-to-stop-a-vessel-smuggling-drugs/',
11 'md5': '55c3dd61d2b96dc17c4ab6711d02a39e',
12 'info_dict': {
13 'id': 'ZpcWNoMTE6x6uVIIWYpHh0qQDjxBuq5P',
14 'ext': 'mp4',
15 'title': 'U.S. and Panamanian forces work together to stop a vessel smuggling drugs',
16 'description': 'md5:0cc84a9943c064c0f46b128b41b1b0d7',
17 'duration': 140.0,
18 },
19 'add_ie': ['Ooyala'],
20 }
21
22 def _real_extract(self, url):
23 display_id = self._match_id(url)
24 webpage = self._download_webpage(url, display_id)
25
26 ooyala_code = self._search_regex(r'data-video-id="([^"]{32})"',
27 webpage, 'ooyala code')
28
29 return OoyalaIE._build_url_result(ooyala_code)