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',
27 'id': 'N2bzkydjraWDGwnt8jAttCF6Y0PDv4Zj',
29 'title': 'VICE News - Inside the Monkey Lab',
30 'description': 'md5:1f660d467d3515f29d11e5ef742a4b82',
33 # Requires ffmpeg (m3u8 manifest)
34 'skip_download': True,
39 def _real_extract(self, url):
40 mobj = re.match(self._VALID_URL, url)
41 name = mobj.group('name')
42 webpage = self._download_webpage(url, name)
44 embed_code = self._search_regex(
45 r'embedCode=([^&\'"]+)', webpage,
47 ooyala_url = OoyalaIE._url_for_embed_code(embed_code)
48 except ExtractorError:
49 raise ExtractorError('The page doesn\'t contain a video', expected=True)
50 return self.url_result(ooyala_url, ie='Ooyala')