1 from __future__ import unicode_literals
4 from .common import InfoExtractor
5 from .ooyala import OoyalaIE
6 from ..utils import ExtractorError
9 class ViceIE(InfoExtractor):
10 _VALID_URL = r'https?://(?:.+?\.)?vice\.com/.*?/(?P<name>.+)'
14 'url': 'http://www.vice.com/Fringes/cowboy-capitalists-part-1',
16 'id': '43cW1mYzpia9IlestBjVpd23Yu3afAfp',
18 'title': 'VICE_COWBOYCAPITALISTS_PART01_v1_VICE_WM_1080p.mov',
21 # Requires ffmpeg (m3u8 manifest)
22 'skip_download': True,
25 'url': 'https://news.vice.com/video/experimenting-on-animals-inside-the-monkey-lab',
26 'only_matching': True,
30 def _real_extract(self, url):
31 mobj = re.match(self._VALID_URL, url)
32 name = mobj.group('name')
33 webpage = self._download_webpage(url, name)
35 embed_code = self._search_regex(
36 r'embedCode=([^&\'"]+)', webpage,
38 ooyala_url = OoyalaIE._url_for_embed_code(embed_code)
39 except ExtractorError:
40 raise ExtractorError('The page doesn\'t contain a video', expected=True)
41 return self.url_result(ooyala_url, ie='Ooyala')