2 from __future__ import unicode_literals
6 from .common import InfoExtractor
15 class CloudyIE(InfoExtractor):
16 _IE_DESC = 'cloudy.ec and videoraj.ch'
18 https?://(?:www\.)?(?P<host>cloudy\.ec|videoraj\.ch)/
19 (?:v/|embed\.php\?id=)
22 _EMBED_URL = 'http://www.%s/embed.php?id=%s'
23 _API_URL = 'http://www.%s/api/player.api.php?%s'
26 'url': 'https://www.cloudy.ec/v/af511e2527aac',
27 'md5': '5cb253ace826a42f35b4740539bedf07',
29 'id': 'af511e2527aac',
31 'title': 'Funny Cats and Animals Compilation june 2013',
35 'url': 'http://www.videoraj.ch/v/47f399fd8bb60',
36 'md5': '7d0f8799d91efd4eda26587421c3c3b0',
38 'id': '47f399fd8bb60',
40 'title': 'Burning a New iPhone 5 with Gasoline - Will it Survive?',
45 def _real_extract(self, url):
46 mobj = re.match(self._VALID_URL, url)
47 video_host = mobj.group('host')
48 video_id = mobj.group('id')
50 url = self._EMBED_URL % (video_host, video_id)
51 webpage = self._download_webpage(url, video_id)
53 file_key = self._search_regex(
54 r'filekey\s*=\s*"([^"]+)"', webpage, 'file_key')
55 data_url = self._API_URL % (video_host, compat_urllib_parse.urlencode({
59 player_data = self._download_webpage(
60 data_url, video_id, 'Downloading player data')
61 data = compat_parse_qs(player_data)
65 '%s error: %s' % (self.IE_NAME, ' '.join(data['error_msg'])),
68 title = data.get('title', [None])[0]
70 title = remove_end(title, '&asdasdas').strip()
73 video_url = data.get('url', [None])[0]