2 from __future__ import unicode_literals
6 from .common import InfoExtractor
14 class CloudyIE(InfoExtractor):
16 https?://(?:www\.)?cloudy\.ec/
17 (?:v/|embed\.php\?id=)
20 _API_URL = 'http://www.cloudy.ec/api/player.api.php?%s'
22 'url': 'https://www.cloudy.ec/v/af511e2527aac',
23 'md5': '5cb253ace826a42f35b4740539bedf07',
25 'id': 'af511e2527aac',
27 'title': 'Funny Cats and Animals Compilation june 2013',
31 def _real_extract(self, url):
32 mobj = re.match(self._VALID_URL, url)
33 video_id = mobj.group('id')
35 url = 'http://www.cloudy.ec/embed.php?id=%s' % video_id
36 webpage = self._download_webpage(url, video_id)
38 file_key = self._search_regex(
39 r'filekey\s*=\s*"([^"]+)"', webpage, 'file_key')
40 data_url = self._API_URL % compat_urllib_parse.urlencode({
44 player_data = self._download_webpage(
45 data_url, video_id, 'Downloading player data')
46 data = compat_parse_qs(player_data)
50 '%s error: %s' % (self.IE_NAME, ' '.join(data['error_msg'])),
53 title = data.get('title', [None])[0]
55 title = title.replace('&asdasdas', '').strip()
60 'url': data.get('url', [None])[0],