def get_packed_data(html): packed_data = '' for match in re.finditer(r'(eval\s*\(function.*?)</script>', html, re.DOTALL | re.I): if jsunpack.detect(match.group(1)): packed_data += jsunpack.unpack(match.group(1)) return packed_data
def __method5(self, response): ''' http://videobug.se/vid/pVobcNozEWmTkarNnwX06w ''' html = response.content streams = [] if jsunpack.detect(html): streams = self._extract_streams(jsunpack.unpack(html)) return streams
def get_media_url(self, host, media_id): web_url = self.get_url(host, media_id) headers = {'User-Agent': common.FF_USER_AGENT, 'Referer': web_url} html = self.net.http_GET(web_url, headers=headers).content js = re.compile('<script[^>]+>(eval.*?)</sc', re.DOTALL | re.IGNORECASE).search(html).group(1) if jsunpack.detect(js): html += jsunpack.unpack(js) if html: source = re.search(',"(http.*?mp4)"', html, re.I) if source: return source.group(1) + helpers.append_headers(headers) raise ResolverError('Video not found')