]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/cloudy.py
   2 from __future__ 
import unicode_literals
 
   4 from .common 
import InfoExtractor
 
  11 class CloudyIE(InfoExtractor
): 
  12     _IE_DESC 
= 'cloudy.ec' 
  13     _VALID_URL 
= r
'https?://(?:www\.)?cloudy\.ec/(?:v/|embed\.php\?.*?\bid=)(?P<id>[A-Za-z0-9]+)' 
  15         'url': 'https://www.cloudy.ec/v/af511e2527aac', 
  16         'md5': '29832b05028ead1b58be86bf319397ca', 
  18             'id': 'af511e2527aac', 
  20             'title': 'Funny Cats and Animals Compilation june 2013', 
  21             'upload_date': '20130913', 
  25         'url': 'http://www.cloudy.ec/embed.php?autoplay=1&id=af511e2527aac', 
  26         'only_matching': True, 
  29     def _real_extract(self
, url
): 
  30         video_id 
= self
._match
_id
(url
) 
  32         webpage 
= self
._download
_webpage
( 
  33             'https://www.cloudy.ec/embed.php', video_id
, query
={ 
  39         info 
= self
._parse
_html
5_media
_entries
(url
, webpage
, video_id
)[0] 
  41         webpage 
= self
._download
_webpage
( 
  42             'https://www.cloudy.ec/v/%s' % video_id
, video_id
, fatal
=False) 
  46                 'title': self
._search
_regex
( 
  47                     r
'<h\d[^>]*>([^<]+)<', webpage
, 'title'), 
  48                 'upload_date': unified_strdate(self
._search
_regex
( 
  49                     r
'>Published at (\d{4}-\d{1,2}-\d{1,2})', webpage
, 
  50                     'upload date', fatal
=False)), 
  51                 'view_count': str_to_int(self
._search
_regex
( 
  52                     r
'([\d,.]+) views<', webpage
, 'view count', fatal
=False)), 
  55         if not info
.get('title'): 
  56             info
['title'] = video_id