]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/vice.py
   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
'http://www\.vice\.com/.*?/(?P<name>.+)' 
  13         'url': 'http://www.vice.com/Fringes/cowboy-capitalists-part-1', 
  15             'id': '43cW1mYzpia9IlestBjVpd23Yu3afAfp', 
  17             'title': 'VICE_COWBOYCAPITALISTS_PART01_v1_VICE_WM_1080p.mov', 
  20             # Requires ffmpeg (m3u8 manifest) 
  21             'skip_download': True, 
  25     def _real_extract(self
, url
): 
  26         mobj 
= re
.match(self
._VALID
_URL
, url
) 
  27         name 
= mobj
.group('name') 
  28         webpage 
= self
._download
_webpage
(url
, name
) 
  30             embed_code 
= self
._search
_regex
( 
  31                 r
'embedCode=([^&\'"]+)', webpage, 
  33             ooyala_url = OoyalaIE._url_for_embed_code(embed_code) 
  34         except ExtractorError: 
  35             raise ExtractorError('The page doesn\'t contain a video', expected=True) 
  36         return self.url_result(ooyala_url, ie='Ooyala')