2016-06-30 20:57:42 +08:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from .common import InfoExtractor
|
|
|
|
from .ooyala import OoyalaIE
|
|
|
|
|
|
|
|
|
|
|
|
class FusionIE(InfoExtractor):
|
2018-02-17 21:54:52 +08:00
|
|
|
_VALID_URL = r'https?://(?:www\.)?fusion\.(?:net|tv)/video/(?P<id>\d+)'
|
2016-07-02 03:44:37 +08:00
|
|
|
_TESTS = [{
|
2018-02-17 21:54:52 +08:00
|
|
|
'url': 'http://fusion.tv/video/201781/u-s-and-panamanian-forces-work-together-to-stop-a-vessel-smuggling-drugs/',
|
2016-06-30 20:57:42 +08:00
|
|
|
'info_dict': {
|
|
|
|
'id': 'ZpcWNoMTE6x6uVIIWYpHh0qQDjxBuq5P',
|
|
|
|
'ext': 'mp4',
|
|
|
|
'title': 'U.S. and Panamanian forces work together to stop a vessel smuggling drugs',
|
|
|
|
'description': 'md5:0cc84a9943c064c0f46b128b41b1b0d7',
|
|
|
|
'duration': 140.0,
|
|
|
|
},
|
2016-07-02 03:44:37 +08:00
|
|
|
'params': {
|
|
|
|
'skip_download': True,
|
|
|
|
},
|
2016-06-30 20:57:42 +08:00
|
|
|
'add_ie': ['Ooyala'],
|
2016-07-02 03:44:37 +08:00
|
|
|
}, {
|
2018-02-17 21:54:52 +08:00
|
|
|
'url': 'http://fusion.tv/video/201781',
|
2016-07-02 03:44:37 +08:00
|
|
|
'only_matching': True,
|
|
|
|
}]
|
2016-06-30 20:57:42 +08:00
|
|
|
|
|
|
|
def _real_extract(self, url):
|
|
|
|
display_id = self._match_id(url)
|
|
|
|
webpage = self._download_webpage(url, display_id)
|
|
|
|
|
2016-07-02 03:44:37 +08:00
|
|
|
ooyala_code = self._search_regex(
|
2016-12-05 07:53:49 +08:00
|
|
|
r'data-ooyala-id=(["\'])(?P<code>(?:(?!\1).)+)\1',
|
2016-07-02 03:44:37 +08:00
|
|
|
webpage, 'ooyala code', group='code')
|
2016-06-30 20:57:42 +08:00
|
|
|
|
|
|
|
return OoyalaIE._build_url_result(ooyala_code)
|