2 from __future__ import unicode_literals
6 from .common import InfoExtractor
15 class CloudyIE(InfoExtractor):
17 https?://(?:www\.)?cloudy\.ec/
18 (?:v/|embed\.php\?id=)
21 _API_URL = 'http://www.cloudy.ec/api/player.api.php?%s'
23 'url': 'https://www.cloudy.ec/v/af511e2527aac',
24 'md5': '5cb253ace826a42f35b4740539bedf07',
26 'id': 'af511e2527aac',
28 'title': 'Funny Cats and Animals Compilation june 2013',
32 def _real_extract(self, url):
33 mobj = re.match(self._VALID_URL, url)
34 video_id = mobj.group('id')
36 url = 'http://www.cloudy.ec/embed.php?id=%s' % video_id
37 webpage = self._download_webpage(url, video_id)
39 file_key = self._search_regex(
40 r'filekey\s*=\s*"([^"]+)"', webpage, 'file_key')
41 data_url = self._API_URL % compat_urllib_parse.urlencode({
45 player_data = self._download_webpage(
46 data_url, video_id, 'Downloading player data')
47 data = compat_parse_qs(player_data)
51 '%s error: %s' % (self.IE_NAME, ' '.join(data['error_msg'])),
54 title = data.get('title', [None])[0]
56 title = remove_end(title, '&asdasdas').strip()
59 video_url = data.get('url', [None])[0]