- mobj = re.match(self._VALID_URL, url)
- video_id = mobj.group('id')
-
- url = 'http://videomega.tv/iframe.php?ref={0:}'.format(video_id)
- webpage = self._download_webpage(url, video_id)
-
- escaped_data = self._search_regex(
- r'unescape\("([^"]+)"\)', webpage, 'escaped data')
- playlist = compat_urllib_parse.unquote(escaped_data)
-
+ video_id = self._match_id(url)
+
+ iframe_url = 'http://videomega.tv/cdn.php?ref=%s' % video_id
+ req = compat_urllib_request.Request(iframe_url)
+ req.add_header('Referer', url)
+ req.add_header('Cookie', 'noadvtday=0')
+ webpage = self._download_webpage(req, video_id)
+
+ title = self._html_search_regex(
+ r'<title>(.+?)</title>', webpage, 'title')
+ title = re.sub(
+ r'(?:^[Vv]ideo[Mm]ega\.tv\s-\s*|\s*-\svideomega\.tv$)', '', title)