]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/malemotion.py
   1 from __future__ 
import unicode_literals
 
   5 from .common 
import InfoExtractor
 
  11 class MalemotionIE(InfoExtractor
): 
  12     _VALID_URL 
= r
'^(?:https?://)?malemotion\.com/video/(.+?)\.(?P<id>.+?)(#|$)' 
  14         'url': 'http://malemotion.com/video/bien-dur.10ew', 
  16         'md5': 'b3cc49f953b107e4a363cdff07d100ce', 
  21         'skip': 'This video has been deleted.' 
  24     def _real_extract(self
, url
): 
  25         mobj 
= re
.match(self
._VALID
_URL
, url
) 
  26         video_id 
= mobj
.group("id") 
  28         webpage 
= self
._download
_webpage
(url
, video_id
) 
  30         self
.report_extraction(video_id
) 
  33         video_url 
= compat_urllib_parse
.unquote( 
  34             self
._search
_regex
(r
'<source type="video/mp4" src="(.+?)"', webpage
, 'video URL')) 
  37         video_title 
= self
._html
_search
_regex
( 
  38             r
'<title>(.*?)</title', webpage
, 'title') 
  40         # Extract video thumbnail 
  41         video_thumbnail 
= self
._search
_regex
( 
  42             r
'<video .+?poster="(.+?)"', webpage
, 'thumbnail', fatal
=False) 
  57             'thumbnail': video_thumbnail
,