]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/alphaporno.py
   1 from __future__ 
import unicode_literals
 
   3 from .common 
import InfoExtractor
 
  12 class AlphaPornoIE(InfoExtractor
): 
  13     _VALID_URL 
= r
'https?://(?:www\.)?alphaporno\.com/videos/(?P<id>[^/]+)' 
  15         'url': 'http://www.alphaporno.com/videos/sensual-striptease-porn-with-samantha-alexandra/', 
  16         'md5': 'feb6d3bba8848cd54467a87ad34bd38e', 
  19             'display_id': 'sensual-striptease-porn-with-samantha-alexandra', 
  21             'title': 'Sensual striptease porn with Samantha Alexandra', 
  22             'thumbnail': 're:https?://.*\.jpg$', 
  23             'timestamp': 1418694611, 
  24             'upload_date': '20141216', 
  26             'filesize_approx': 54120000, 
  33     def _real_extract(self
, url
): 
  34         display_id 
= self
._match
_id
(url
) 
  36         webpage 
= self
._download
_webpage
(url
, display_id
) 
  38         video_id 
= self
._search
_regex
( 
  39             r
"video_id\s*:\s*'([^']+)'", webpage
, 'video id', default
=None) 
  41         video_url 
= self
._search
_regex
( 
  42             r
"video_url\s*:\s*'([^']+)'", webpage
, 'video url') 
  43         ext 
= self
._html
_search
_meta
( 
  44             'encodingFormat', webpage
, 'ext', default
='.mp4')[1:] 
  46         title 
= self
._search
_regex
( 
  47             [r
'<meta content="([^"]+)" itemprop="description">', 
  48              r
'class="title" itemprop="name">([^<]+)<'], 
  50         thumbnail 
= self
._html
_search
_meta
('thumbnail', webpage
, 'thumbnail') 
  51         timestamp 
= parse_iso8601(self
._html
_search
_meta
( 
  52             'uploadDate', webpage
, 'upload date')) 
  53         duration 
= parse_duration(self
._html
_search
_meta
( 
  54             'duration', webpage
, 'duration')) 
  55         filesize_approx 
= parse_filesize(self
._html
_search
_meta
( 
  56             'contentSize', webpage
, 'file size')) 
  57         bitrate 
= int_or_none(self
._html
_search
_meta
( 
  58             'bitrate', webpage
, 'bitrate')) 
  59         categories 
= self
._html
_search
_meta
( 
  60             'keywords', webpage
, 'categories', default
='').split(',') 
  62         age_limit 
= self
._rta
_search
(webpage
) 
  66             'display_id': display_id
, 
  70             'thumbnail': thumbnail
, 
  71             'timestamp': timestamp
, 
  73             'filesize_approx': filesize_approx
, 
  75             'categories': categories
, 
  76             'age_limit': age_limit
,