]>
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 'http://www.cloudy.ec/embed.php?id=%s' % video_id
, video_id
)
35 info
= self
._parse
_html
5_media
_entries
(url
, webpage
, video_id
)[0]
37 webpage
= self
._download
_webpage
(
38 'https://www.cloudy.ec/v/%s' % video_id
, video_id
, fatal
=False)
42 'title': self
._search
_regex
(
43 r
'<h\d[^>]*>([^<]+)<', webpage
, 'title'),
44 'upload_date': unified_strdate(self
._search
_regex
(
45 r
'>Published at (\d{4}-\d{1,2}-\d{1,2})', webpage
,
46 'upload date', fatal
=False)),
47 'view_count': str_to_int(self
._search
_regex
(
48 r
'([\d,.]+) views<', webpage
, 'view count', fatal
=False)),
51 if not info
.get('title'):
52 info
['title'] = video_id