]> jfr.im git - yt-dlp.git/blame - youtube_dl/extractor/fusion.py
[6play] use geo verfication headers
[yt-dlp.git] / youtube_dl / extractor / fusion.py
CommitLineData
bb08101e
T
1from __future__ import unicode_literals
2
3from .common import InfoExtractor
4from .ooyala import OoyalaIE
5
6
7class FusionIE(InfoExtractor):
38662dfe 8 _VALID_URL = r'https?://(?:www\.)?fusion\.(?:net|tv)/video/(?P<id>\d+)'
14ff6baa 9 _TESTS = [{
38662dfe 10 'url': 'http://fusion.tv/video/201781/u-s-and-panamanian-forces-work-together-to-stop-a-vessel-smuggling-drugs/',
bb08101e
T
11 'info_dict': {
12 'id': 'ZpcWNoMTE6x6uVIIWYpHh0qQDjxBuq5P',
13 'ext': 'mp4',
14 'title': 'U.S. and Panamanian forces work together to stop a vessel smuggling drugs',
15 'description': 'md5:0cc84a9943c064c0f46b128b41b1b0d7',
16 'duration': 140.0,
17 },
14ff6baa
S
18 'params': {
19 'skip_download': True,
20 },
bb08101e 21 'add_ie': ['Ooyala'],
14ff6baa 22 }, {
38662dfe 23 'url': 'http://fusion.tv/video/201781',
14ff6baa
S
24 'only_matching': True,
25 }]
bb08101e
T
26
27 def _real_extract(self, url):
28 display_id = self._match_id(url)
29 webpage = self._download_webpage(url, display_id)
30
14ff6baa 31 ooyala_code = self._search_regex(
3ed81714 32 r'data-ooyala-id=(["\'])(?P<code>(?:(?!\1).)+)\1',
14ff6baa 33 webpage, 'ooyala code', group='code')
bb08101e
T
34
35 return OoyalaIE._build_url_result(ooyala_code)