]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/vice.py
3db6286e48c1402ff210d8f4cc666dac1a918a86
1 from __future__
import unicode_literals
3 from .common
import InfoExtractor
4 from .ooyala
import OoyalaIE
5 from ..utils
import ExtractorError
8 class ViceIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:.+?\.)?vice\.com/(?:[^/]+/)+(?P<id>.+)'
13 'url': 'http://www.vice.com/Fringes/cowboy-capitalists-part-1',
15 'id': '43cW1mYzpia9IlestBjVpd23Yu3afAfp',
17 '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 video_id
= self
._match
_id
(url
)
32 webpage
= self
._download
_webpage
(url
, video_id
)
34 embed_code
= self
._search
_regex
(
35 r
'embedCode=([^&\'"]+)', webpage,
37 ooyala_url = OoyalaIE._url_for_embed_code(embed_code)
38 except ExtractorError:
39 raise ExtractorError('The page doesn\'t contain a video', expected=True)
40 return self.url_result(ooyala_url, ie='Ooyala')