]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/xbef.py
   1 from __future__ 
import unicode_literals
 
   3 from .common 
import InfoExtractor
 
   9 class XBefIE(InfoExtractor
): 
  10     _VALID_URL 
= r
'http://(?:www\.)?xbef\.com/video/(?P<id>[0-9]+)' 
  12         'url': 'http://xbef.com/video/5119-glamourous-lesbians-smoking-drinking-and-fucking', 
  13         'md5': 'a478b565baff61634a98f5e5338be995', 
  17             'title': 'md5:7358a9faef8b7b57acda7c04816f170e', 
  19             'thumbnail': 're:^http://.*\.jpg', 
  23     def _real_extract(self
, url
): 
  24         video_id 
= self
._match
_id
(url
) 
  25         webpage 
= self
._download
_webpage
(url
, video_id
) 
  27         title 
= self
._html
_search
_regex
( 
  28             r
'<h1[^>]*>(.*?)</h1>', webpage
, 'title') 
  30         config_url_enc 
= self
._download
_webpage
( 
  31             'http://xbef.com/Main/GetVideoURLEncoded/%s' % video_id
, video_id
, 
  32             note
='Retrieving config URL') 
  33         config_url 
= compat_urllib_parse
.unquote(config_url_enc
) 
  34         config 
= self
._download
_xml
( 
  35             config_url
, video_id
, note
='Retrieving config') 
  37         video_url 
= config
.find('./file').text
 
  38         thumbnail 
= config
.find('./image').text
 
  44             'thumbnail': thumbnail
,