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 get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.RAND_UA}
        html = self.net.http_GET(web_url, headers=headers).content

        if html:
            video_id = re.search("""playvideo\.php\?id=(\d+)""", html)
            if video_id:
                video_url = 'http://%s/jwplayer/playvideo.php?id=%s' % (
                    host, video_id.group(1))
                headers.update({'Referer': web_url})
                _html = self.net.http_GET(video_url, headers=headers).content
                if _html:
                    try:
                        _html = jsunpack.unpack(_html)
                    except Exception as e:
                        raise ResolverError(e)
                    sources = helpers.scrape_sources(
                        _html,
                        patterns=['''file:\s*["'](?P<url>http[^"']+)'''])
                    if sources:
                        return helpers.pick_source(
                            sources) + helpers.append_headers(headers)

        raise ResolverError('File not found')
示例#3
0
 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
示例#4
0
def get_packed_data(html):
    packed_data = ''
    for match in re.finditer(r'(eval\s*\(function.*?)</script>', html, re.DOTALL | re.I):
        try:
            js_data = jsunpack.unpack(match.group(1))
            js_data = js_data.replace('\\', '')
            packed_data += js_data
        except:
            pass

    return packed_data
示例#5
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.RAND_UA, 'Referer': web_url}
     html = self.net.http_GET(web_url, headers=headers).content
     r = re.search(r"text/javascript'>(eval.*?)\s*</script>", html,
                   re.DOTALL)
     if r:
         html = jsunpack.unpack(r.group(1))
         src = re.search(r'file:"([^"]+)"', html)
         if src:
             return src.group(1) + helpers.append_headers(headers)
     raise ResolverError('Video cannot be located.')
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.RAND_UA}
     html = self.net.http_GET(web_url, headers=headers).content
     try:
         packed = re.search('>(eval\(function\(p,a,c,k,e,d\).+)\s+', html)
         unpacked = jsunpack.unpack(packed.group(1))
         r = re.search('src:"([^"]+)"', unpacked)
         return r.group(1)
     except Exception as e:
         common.logger.log_debug(e)
         raise ResolverError("Video not found")
示例#7
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.FF_USER_AGENT}
     html = self.net.http_GET(web_url, headers=headers).content
     match = re.search(r'<script type=\'text/javascript\'>(.+?)</script>',
                       html, re.DOTALL)
     source = re.search(r'sources:\[{file:"([^"]+)"}]',
                        jsunpack.unpack(match.group(1)))
     if source:
         headers.update({'verifypeer': 'false'})
         return source.group(1) + helpers.append_headers(headers)
     raise ResolverError('Video Link Not Found')
示例#8
0
 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')
示例#9
0
 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')
示例#10
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.RAND_UA,
                   'Referer': web_url}
        html = self.net.http_GET(web_url, headers=headers).content

        r = re.search(r'JuicyCodes\.Run\("([^)]+)"\)', html)

        if r:
            jc = r.group(1).replace('"+"', '')
            jc = base64.b64decode(jc.encode('ascii'))
            jc = jsunpack.unpack(jc.decode('ascii'))
            sources = helpers.scrape_sources(jc)
            return helpers.pick_source(sources) + helpers.append_headers(headers)

        raise ResolverError('Video cannot be located.')
示例#11
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.RAND_UA}
     html = self.net.http_GET(web_url, headers=headers).content
     
     if html:
         video_id = re.search("""playvideo\.php\?id=(\d+)""", html)
         if video_id:
             video_url = 'http://%s/jwplayer/playvideo.php?id=%s' % (host, video_id.group(1))
             headers.update({'Referer': web_url})
             _html = self.net.http_GET(video_url, headers=headers).content
             if _html:
                 try: _html = jsunpack.unpack(_html)
                 except Exception as e: raise ResolverError(e)
                 sources = helpers.scrape_sources(_html, patterns=['''file:\s*["'](?P<url>http[^"']+)'''])
                 if sources: return helpers.pick_source(sources) + helpers.append_headers(headers)
     
     raise ResolverError('File not found')
示例#12
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.IOS_USER_AGENT, 'Referer': web_url}
        stream_url = ''
        new_host = urllib_parse.urlparse(web_url).netloc
        html = self.net.http_GET(web_url, headers=headers).content
        if 'videozoo' not in new_host:
            r = re.search(
                r'(?:playlist:|timer\s*=\s*null;).+?url\s*[:=]+\s*[\'"]+(.+?)[\'"]+',
                html, re.DOTALL)
        else:
            r = re.search(r'\*/\s+?(eval\(function\(p,a,c,k,e,d\).+)\s+?/\*',
                          html)
            if r:
                try:
                    r = jsunpack.unpack(r.group(1))
                    if r:
                        r = re.search(r'\[{"url":"(.+?)"', r.replace('\\', ''))
                except:
                    if r:
                        re_src = re.search(r'urlResolvers\|2F(.+?)\|',
                                           r.group(1))
                        re_url = re.search(r'php\|3D(.+?)\|', r.group(1))
                        if re_src and re_url:
                            stream_url = 'http://%s/%s.php?url=%s' % (
                                new_host, re_src.group(1), re_url.group(1))
                            stream_url = self._redirect_test(stream_url)
                        else:
                            raise ResolverError('File not found')
        if r:
            stream_url = urllib_parse.unquote_plus(r.group(1))
            if 'http' not in stream_url:
                stream_url = 'http://' + host + '/' + stream_url.replace(
                    '/gplus.php', 'gplus.php').replace('/picasa.php',
                                                       'picasa.php')
            stream_url = self._redirect_test(stream_url)

        if stream_url:
            if 'google' in stream_url:
                return HostedMediaFile(url=stream_url).resolve()
            else:
                return stream_url
        else:
            raise ResolverError('File not found')