Example #1
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)

        common.log_utils.log_debug('HugeFiles: get_link: %s' % (web_url))
        html = self.net.http_GET(web_url).content

        r = re.findall('File Not Found', html)
        if r:
            raise ResolverError('File Not Found or removed')

        # Grab data values
        data = helpers.get_hidden(html)
        data.update(captcha_lib.do_captcha(html))
        common.log_utils.log_debug('HugeFiles - Requesting POST URL: %s with data: %s' % (web_url, data))
        html = self.net.http_POST(web_url, data).content

        # Re-grab data values
        data = helpers.get_hidden(html)
        data['referer'] = web_url
        headers = {'User-Agent': common.IE_USER_AGENT}
        common.log_utils.log_debug('HugeFiles - Requesting POST URL: %s with data: %s' % (web_url, data))
        request = urllib2.Request(web_url, data=urllib.urlencode(data), headers=headers)

        try: stream_url = urllib2.urlopen(request).geturl()
        except: return

        common.log_utils.log_debug('Hugefiles stream Found: %s' % stream_url)
        return stream_url
Example #2
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)

        common.log_utils.log_debug('HugeFiles: get_link: %s' % (web_url))
        html = self.net.http_GET(web_url).content

        r = re.findall('File Not Found', html)
        if r:
            raise ResolverError('File Not Found or removed')

        # Grab data values
        data = helpers.get_hidden(html)
        data.update(captcha_lib.do_captcha(html))
        common.log_utils.log_debug('HugeFiles - Requesting POST URL: %s with data: %s' % (web_url, data))
        html = self.net.http_POST(web_url, data).content

        # Re-grab data values
        data = helpers.get_hidden(html)
        data['referer'] = web_url
        headers = {'User-Agent': common.IE_USER_AGENT}
        common.log_utils.log_debug('HugeFiles - Requesting POST URL: %s with data: %s' % (web_url, data))
        request = urllib2.Request(web_url, data=urllib.urlencode(data), headers=headers)

        try: stream_url = urllib2.urlopen(request).geturl()
        except: return

        common.log_utils.log_debug('Hugefiles stream Found: %s' % stream_url)
        return stream_url
Example #3
0
    def get_media_url(self, host, media_id):

        try:
            web_url = self.get_url(host, media_id)
            self.headers['Referer'] = web_url

            html = self.net.http_GET(web_url, headers=self.headers).content
            if isinstance(html, unicode):
                html = html.encode('utf-8', 'ignore')

            if 'Uptobox.com is not available in your country' in html:
                raise Exception()

            r = re.search('(You have to wait (?:[0-9]+ minute[s]*, )*[0-9]+ second[s]*)', html)
            if r:
                raise Exception()

            data = helpers.get_hidden(html)
            for i in range(0, 3):
                try:
                    html = self.net.http_POST(web_url, data, headers=self.headers).content
                    if isinstance(html, unicode):
                        html = html.encode('utf-8', 'ignore')

                    stream_url = re.search('<a\shref\s*=[\'"](.+?)[\'"]\s*>\s*<span\sclass\s*=\s*[\'"]button_upload green[\'"]\s*>', html).group(1)
                    return stream_url
                except:
                    xbmc.sleep(1000)
        except:
            pass

        try:
            web_url = self.get_stream_url(host, media_id)
            self.headers['Referer'] = web_url

            html = self.net.http_GET(web_url, headers=self.headers).content
            if isinstance(html, unicode):
                html = html.encode('utf-8', 'ignore')

            if 'Uptobox.com is not available in your country' in html:
                raise Exception()
            '''
            r = re.search('(You have reached the limit of *[0-9]+ minute[s]*)', html)
            if r:
                raise Exception()
            '''

            sources = re.compile('<source.+?src\s*=\s*[\'"](.+?)[\'"].+?data-res\s*=\s*[\'"](.+?)[\'"].*?/>').findall(html)
            sources = [(i[0], int(re.sub('[^0-9]', '', i[1]))) for i in sources]
            sources = sorted(sources, key=lambda k: k[1])

            stream_url = sources[-1][0]
            if stream_url.startswith('//'):
                stream_url = 'http:' + stream_url

            return stream_url
        except:
            pass

        raise ResolverError('File not found')
Example #4
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        html = self.net.http_GET(web_url).content
        stream_url = None
        form_values = helpers.get_hidden(html)
        html = self.net.http_POST(web_url, form_data=form_values).content
        r = re.search('<IFRAME SRC="(.*?)" .*?></IFRAME>', html, re.DOTALL)
        if r:
            html = self.net.http_GET(r.group(1)).content
        r = re.search("<div id=\"player_code\">.*?<script type='text/javascript'>(.*?)</script>", html, re.DOTALL)
        if not r:
            raise ResolverError('Unable to resolve Mightyupload link. Player config not found.')
        r_temp = re.search("file: '([^']+)'", r.group(1))
        if r_temp:
            stream_url = r_temp.group(1)
        else:
            js = jsunpack.unpack(r.group(1))
            r = re.search("'file','([^']+)'", js.replace('\\', ''))
            if not r:
                r = re.search('"src"value="([^"]+)', js.replace('\\', ''))

            if not r:
                raise ResolverError('Unable to resolve Mightyupload link. Filelink not found.')

            stream_url = r.group(1)

        if stream_url:
            return stream_url + '|' + urllib.urlencode({'User-Agent': common.IE_USER_AGENT})
        else:
            raise ResolverError('Unable to resolve link')
    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
        if 'File Not Found' in html:
            raise ResolverError('File got deleted?')
        cookies = self.__get_cookies(html)

        pattern = '"([^"]+(?:\d+|)\.\w{1,3}\?cd=[^"]+)".*?'  # cgi
        pattern += 'action=[\'"]([^\'"]+).*?'  # post-url
        pattern += '<span id="\w+(?:\d+|)">(\d+)<'  # countdown
        match = re.search(pattern, html, re.DOTALL)

        if not match:
            raise ResolverError('Site structure changed!')

        self.net.http_GET('http://www.flashx.tv/flashx.php?fxabi=1',
                          headers=headers)
        self.net.http_GET(match.group(1), headers=headers)
        data = helpers.get_hidden(html)
        data['imhuman'] = 'Proceed to this video'
        common.kodi.sleep(int(match.group(3)) * 1000 + 500)
        headers.update({'Referer': web_url, 'Cookie': '; '.join(cookies)})

        html = self.net.http_POST(match.group(2), data,
                                  headers=headers).content
        sources = []
        for match in re.finditer('(eval\(function.*?)</script>', html,
                                 re.DOTALL):
            packed_data = jsunpack.unpack(match.group(1))
            sources += self.__parse_sources_list(packed_data)
        source = helpers.pick_source(sources,
                                     self.get_setting('auto_pick') == 'true')
        return source
Example #6
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)

        html = self.net.http_GET(web_url).content

        data = helpers.get_hidden(html)
        data['method_free'] = 'Kostenloser stream / Kostenloser Download'
        html = self.net.http_POST(web_url, data).content

        js_data = re.findall('(eval\(function.*?)</script>',
                             html.replace('\n', ''))

        for i in js_data:
            try:
                html += jsunpack.unpack(i)
            except:
                pass

        html = html.replace('\\\'', '\'')
        html = html.replace('\\\'', '\'')

        stream_url = re.findall('<param\s+name="src"\s*value="([^"]+)', html)
        stream_url += re.findall("'file'\s*,\s*'(.+?)'", html)
        stream_url = [i for i in stream_url if not i.endswith('.srt')]

        if stream_url:
            return stream_url[0]

        raise ResolverError('File Not Found or removed')
Example #7
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        html = self.net.http_GET(web_url).content

        tries = 0
        while tries < MAX_TRIES:
            data = helpers.get_hidden(html)
            data["method_free"] = "Free Download"
            data.update(captcha_lib.do_captcha(html))

            html = self.net.http_POST(web_url, form_data=data).content
            # try to find source in packed data
            if jsunpack.detect(html):
                js_data = jsunpack.unpack(html)
                match = re.search('name="src"\s*value="([^"]+)', js_data)
                if match:
                    return match.group(1)

            # try to find source in html
            match = re.search('<span[^>]*>\s*<a\s+href="([^"]+)', html, re.DOTALL)
            if match:
                return match.group(1)

            tries += 1

        raise ResolverError("Unable to resolve kingfiles link. Filelink not found.")
Example #8
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        html = self.net.http_GET(web_url).content

        tries = 0
        while tries < MAX_TRIES:
            data = helpers.get_hidden(html)
            data.update(captcha_lib.do_captcha(html))

            html = self.net.http_POST(web_url, form_data=data).content
            html += helpers.get_packed_data(html)
            match = re.search('name="src"\s*value="([^"]+)', html)
            if match:
                return match.group(1)

            # try to find source in html
            match = re.search('<span[^>]*>\s*<a\s+href="([^"]+)', html,
                              re.DOTALL)
            if match:
                return match.group(1)

            tries += 1

        raise ResolverError(
            'Unable to resolve kingfiles link. Filelink not found.')
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)

        html = self.net.http_GET(web_url).content

        data = helpers.get_hidden(html)
        data['method_free'] = 'Kostenloser stream / Kostenloser Download'
        html = self.net.http_POST(web_url, data).content

        js_data = re.findall('(eval\(function.*?)</script>', html.replace('\n', ''))

        for i in js_data:
            try: html += jsunpack.unpack(i)
            except: pass

        html = html.replace('\\\'', '\'')
        html = html.replace('\\\'', '\'')

        stream_url = re.findall('<param\s+name="src"\s*value="([^"]+)', html)
        stream_url += re.findall("'file'\s*,\s*'(.+?)'", html)
        stream_url = [i for i in stream_url if not i.endswith('.srt')]

        if stream_url:
            return stream_url[0]

        raise ResolverError('File Not Found or removed')
Example #10
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
        if 'File Not Found' in html:
            raise ResolverError('File got deleted?')
        cookies = self.__get_cookies(html)

        #match = re.search('"([^"]+counter(?:\d+|)\.cgi[^"]+)".*?<span id="cxc(?:\d+|)">(\d+)<', html, re.DOTALL)
        match2 = re.search('action=[\'"]([^\'"]+)', html, re.IGNORECASE)
        print match2.group(0)
        if not match2:
            raise ResolverError('Site structure changed!')

        self.net.http_GET(match2.group(1), headers=headers)
        data = helpers.get_hidden(html)
        data['imhuman'] = 'Proceed to this video'
        #print data
        #print match2.group(1)
        common.kodi.sleep(int(10000)*1000+500)
        headers.update({'Referer': web_url, 'Cookie': '; '.join(cookies)})

        html = self.net.http_POST(match2.group(1), data, headers=headers).content
        print html
        sources = []
        for match in re.finditer('(eval\(function.*?)</script>', html, re.DOTALL):
            #print match.group(0)
            packed_data = jsunpack.unpack(match.group(1))
            #print "a",packed_data
            sources += self.__parse_sources_list(packed_data)
        source = helpers.pick_source(sources, self.get_setting('auto_pick') == 'true')
        return source
Example #11
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
        if 'File Not Found' in html:
            raise ResolverError('File got deleted?')
        cookies = self.__get_cookies(html)

        #match = re.search('"([^"]+counter(?:\d+|)\.cgi[^"]+)".*?<span id="cxc(?:\d+|)">(\d+)<', html, re.DOTALL)
        match2 = re.search('action=[\'"]([^\'"]+)', html, re.IGNORECASE)
        print match2.group(0)
        if not match2:
            raise ResolverError('Site structure changed!')

        self.net.http_GET(match2.group(1), headers=headers)
        data = helpers.get_hidden(html)
        data['imhuman'] = 'Proceed to this video'
        #print data
        #print match2.group(1)
        common.kodi.sleep(int(10000) * 1000 + 500)
        headers.update({'Referer': web_url, 'Cookie': '; '.join(cookies)})

        html = self.net.http_POST(match2.group(1), data,
                                  headers=headers).content
        print html
        sources = []
        for match in re.finditer('(eval\(function.*?)</script>', html,
                                 re.DOTALL):
            #print match.group(0)
            packed_data = jsunpack.unpack(match.group(1))
            #print "a",packed_data
            sources += self.__parse_sources_list(packed_data)
        source = helpers.pick_source(sources,
                                     self.get_setting('auto_pick') == 'true')
        return source
Example #12
0
 def __box_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     self.headers['Referer'] = web_url
     
     html = self.net.http_GET(web_url, headers=self.headers).content
     if isinstance(html, unicode): html = html.encode('utf-8', 'ignore')
     
     if 'not available in your country' in html:
         msg = 'Unavailable in your country'
         common.kodi.notify(header=None, msg=msg, duration=3000)
         raise ResolverError(msg)
     elif re.search('''You need to be a <a.+?>premium member''', html):
         msg = 'Premium membership required'
         common.kodi.notify(header=None, msg=msg, duration=3000)
         raise ResolverError(msg)
     
     r = re.search('or you can wait ((?:\d hour,\s*)?(?:\d+ minutes?,\s*)?\d+ seconds?)', html, re.I)
     if r:
         msg = 'Cooldown in effect, %s remaining' % r.group(1)
         common.kodi.notify(header=None, msg=msg, duration=3000)
         raise ResolverError(msg)
     
     data = helpers.get_hidden(html)
     for _ in range(0, 3):
         html = self.net.http_POST(web_url, data, headers=self.headers).content
         if isinstance(html, unicode): html = html.encode('utf-8', 'ignore')
         match = re.search('''href\s*=\s*['"]([^'"]+)[^>]+>\s*<span[^>]+class\s*=\s*['"]button_upload green['"]''', html)
         if match:
             stream_url = match.group(1)
             return stream_url.replace(' ', '%20') + helpers.append_headers(self.headers)
         else:
             common.kodi.sleep(1000)
Example #13
0
    def get_media_url(self, host, media_id):

        try:
            web_url = self.get_url(host, media_id)
            self.headers['Referer'] = web_url

            html = self.net.http_GET(web_url, headers=self.headers).content
            if isinstance(html, unicode):
                html = html.encode('utf-8', 'ignore')

            if 'Uptobox.com is not available in your country' in html:
                raise Exception()

            r = re.search('(You have to wait (?:[0-9]+ minute[s]*, )*[0-9]+ second[s]*)', html)
            if r:
                raise Exception()

            data = helpers.get_hidden(html)
            for i in range(0, 3):
                try:
                    html = self.net.http_POST(web_url, data, headers=self.headers).content
                    if isinstance(html, unicode):
                        html = html.encode('utf-8', 'ignore')

                    stream_url = re.search('<a\shref\s*=[\'"](.+?)[\'"]\s*>\s*<span\sclass\s*=\s*[\'"]button_upload green[\'"]\s*>', html).group(1)
                    return stream_url
                except:
                    xbmc.sleep(1000)
        except:
            pass

        try:
            web_url = self.get_stream_url(host, media_id)
            self.headers['Referer'] = web_url

            html = self.net.http_GET(web_url, headers=self.headers).content
            if isinstance(html, unicode):
                html = html.encode('utf-8', 'ignore')

            if 'Uptobox.com is not available in your country' in html:
                raise Exception()
            '''
            r = re.search('(You have reached the limit of *[0-9]+ minute[s]*)', html)
            if r:
                raise Exception()
            '''

            sources = re.compile('<source.+?src\s*=\s*[\'"](.+?)[\'"].+?data-res\s*=\s*[\'"](.+?)[\'"].*?/>').findall(html)
            sources = [(i[0], int(re.sub('[^0-9]', '', i[1]))) for i in sources]
            sources = sorted(sources, key=lambda k: k[1])

            stream_url = sources[-1][0]
            if stream_url.startswith('//'):
                stream_url = 'http:' + stream_url

            return stream_url
        except:
            pass

        raise ResolverError('File not found')
    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('''val\(\)\s*\+\s*['"]([^"']+)''', html)
        suffix = match.group(1) if match else ''
        common.log_utils.log(html)
        data = helpers.get_hidden(html)
        for name in data:
            data[name] = data[name] + suffix

        common.log_utils.log(data)
        headers['Referer'] = web_url
        html = self.net.http_POST(web_url, form_data=data,
                                  headers=headers).content
        html = re.compile(
            r'clip\s*:\s*\{.*?(?:url|src)\s*:\s*[\"\'](.+?)[\"\']',
            re.DOTALL).search(html)
        if not html:
            raise ResolverError('File Not Found or removed')
        stream_url = html.group(1)
        req = urllib2.Request(stream_url)
        for key in headers:
            req.add_header(key, headers[key])
        stream_url = urllib2.urlopen(req).geturl()
        return stream_url + helpers.append_headers(headers)
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)

        headers = {"Upgrade-Insecure-Requests": "1", "User-Agent": common.FF_USER_AGENT}

        html = self.net.http_GET(web_url, headers=headers).content

        if "404 Not Found" in html or "Has Been Removed" in html:
            raise ResolverError("The requested video was not found.")

        data = helpers.get_hidden(html)
        data["method_free"] = "Proceed+to+video"
        headers["Referer"] = web_url
        html = self.net.http_POST(web_url, data, headers=headers).content

        match = re.search('file\s*:\s*"([^"]+)', html)

        if match:
            return match.group(1)
        else:
            for match in re.finditer("(eval\(function.*?)</script>", html, re.DOTALL):
                js_data = jsunpack.unpack(match.group(1))
                match = re.search("""file\s*:\s*['"]([^"']+)""", js_data)
                if match:
                    return match.group(1)

        raise ResolverError("No playable video found.")
Example #16
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        html = self.net.http_GET(web_url).content
        stream_url = None
        form_values = helpers.get_hidden(html)
        html = self.net.http_POST(web_url, form_data=form_values).content
        r = re.search('<IFRAME SRC="(.*?)" .*?></IFRAME>', html, re.DOTALL)
        if r:
            html = self.net.http_GET(r.group(1)).content
        r = re.search("<div id=\"player_code\">.*?<script type='text/javascript'>(.*?)</script>", html, re.DOTALL)
        if not r:
            raise ResolverError('Unable to resolve Mightyupload link. Player config not found.')
        r_temp = re.search("file: '([^']+)'", r.group(1))
        if r_temp:
            stream_url = r_temp.group(1)
        else:
            js = jsunpack.unpack(r.group(1))
            r = re.search("'file','([^']+)'", js.replace('\\', ''))
            if not r:
                r = re.search('"src"value="([^"]+)', js.replace('\\', ''))

            if not r:
                raise ResolverError('Unable to resolve Mightyupload link. Filelink not found.')

            stream_url = r.group(1)

        if stream_url:
            return stream_url + '|' + urllib.urlencode({'User-Agent': common.IE_USER_AGENT})
        else:
            raise ResolverError('Unable to resolve link')
Example #17
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)

        headers = {
            'Upgrade-Insecure-Requests': '1',
            'User-Agent': common.FF_USER_AGENT
        }

        html = self.net.http_GET(web_url, headers=headers).content

        if '404 Not Found' in html or 'Has Been Removed' in html:
            raise ResolverError('The requested video was not found.')

        data = helpers.get_hidden(html)
        data['method_free'] = 'Proceed+to+video'
        headers['Referer'] = web_url
        html = self.net.http_POST(web_url, data, headers=headers).content

        match = re.search('file\s*:\s*"([^"]+)', html)

        if match:
            return match.group(1)
        else:
            for match in re.finditer('(eval\(function.*?)</script>', html,
                                     re.DOTALL):
                js_data = jsunpack.unpack(match.group(1))
                match = re.search('''file\s*:\s*['"]([^"']+)''', js_data)
                if match:
                    return match.group(1)

        raise ResolverError('No playable video found.')
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT}
        response = self.net.http_GET(web_url, headers=headers)
        html = response.content
        data = helpers.get_hidden(html)
        headers['Cookie'] = response.get_headers(as_dict=True).get(
            'Set-Cookie', '')
        html = self.net.http_POST(web_url, headers=headers,
                                  form_data=data).content

        packed = re.findall('(eval\(function.*?)\s*</script>', html, re.DOTALL)
        if packed:

            js = ''
            for pack in packed:
                js += jsunpack.unpack(pack)

            sources = helpers.scrape_sources(
                js,
                patterns=['''(?P<url>[^"']+\.(?:m3u8|mp4))'''],
                result_blacklist='tmp')

            if sources:
                return helpers.pick_source(sources) + helpers.append_headers(
                    headers)

        raise ResolverError('Unable to locate video')
Example #19
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

        data = helpers.get_hidden(html)
        data['confirm.y'] = random.randint(0, 120)
        data['confirm.x'] = random.randint(0, 120)

        headers['Referer'] = web_url

        post_url = web_url + '#'

        html = self.net.http_POST(post_url, form_data=data, headers=headers).content.encode('utf-8')

        match = re.findall('''["']?sources['"]?\s*:\s*\[(.*?)\]''', html)

        if match:
            stream_url = re.findall('''['"]?file['"]?\s*:\s*['"]?([^'"]+)''', match[0])
            if stream_url:
                stream_url = stream_url[0].replace('\/', '/')
                stream_url += '|' + urllib.urlencode({'User-Agent': common.FF_USER_AGENT, 'Referer': web_url})
                return stream_url

        raise ResolverError('File Not Found or removed')
Example #20
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT}
        response = self.net.http_GET(web_url, headers=headers)
        html = response.content
        data = helpers.get_hidden(html)
        headers['Cookie'] = response.get_headers(as_dict=True).get(
            'Set-Cookie', '')
        sleep_time = 10  # in seconds
        wait_ms = sleep_time * 1000
        common.kodi.notify(header=None,
                           msg='XvidStage requires %s second wait' %
                           sleep_time,
                           duration=wait_ms)
        common.kodi.sleep(wait_ms)
        html = self.net.http_POST(web_url, headers=headers,
                                  form_data=data).content

        if html:
            packed = helpers.get_packed_data(html)

            sources = helpers.scrape_sources(packed, result_blacklist=['tmp'])
            if sources:
                return helpers.pick_source(sources) + helpers.append_headers(
                    headers)

        raise ResolverError('Unable to locate video')
Example #21
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        html = self.net.http_GET(web_url).content
        r = re.findall('The file you were looking for could not be found',
                       html)
        if r:
            raise ResolverError('File Not Found or removed')
        tries = 0
        while tries < MAX_TRIES:
            data = helpers.get_hidden(html)
            data['method_free'] = 'Free+Download+>>'
            data.update(captcha_lib.do_captcha(html))
            headers = {'Referer': web_url}
            common.log_utils.log_debug(data)
            html = self.net.http_POST(web_url, data, headers=headers).content
            if tries > 0:
                xbmc.sleep(6000)

            if 'File Download Link Generated' in html:
                r = re.search('href="([^"]+)[^>]>Download<', html, re.I)
                if r:
                    return r.group(1) + '|' + urllib.urlencode(
                        {'User-Agent': common.IE_USER_AGENT})

            tries = tries + 1

        raise ResolverError('Unable to locate link')
Example #22
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
        data = helpers.get_hidden(html)
        data['confirm.y'] = random.randint(0, 120)
        data['confirm.x'] = random.randint(0, 120)
        headers['Referer'] = web_url
        post_url = web_url + '#'
        html = self.net.http_POST(post_url, form_data=data,
                                  headers=headers).content.encode('utf-8')
        match = re.search('hide\(\);(.*?;)\s*//', html, re.DOTALL)
        if match:
            dtext = AADecoder(match.group(1)).decode()
            match = re.search('"?sources"?\s*:\s*\[(.*?)\]', dtext, re.DOTALL)
            if match:
                for match in re.finditer(
                        '''['"]?file['"]?\s*:\s*['"]([^'"]+)['"][^}]*['"]?label['"]?\s*:\s*['"]([^'"]*)''',
                        match.group(1), re.DOTALL):
                    stream_url, _label = match.groups()
                    stream_url = stream_url.replace('\/', '/')
                    stream_url += '|User-Agent=%s&Referer=%s' % (
                        common.FF_USER_AGENT, web_url)
                    return stream_url

        raise ResolverError('File Not Found or removed')
Example #23
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = self.headers
        response = self.net.http_GET(web_url, headers=headers)
        response_headers = response.get_headers(as_dict=True)
        cookies = response_headers.get('Set-Cookie')

        cookie = ''
        for ck in cookies.split('Only, '):
            cookie += ck.split(';')[0] + '; '
        headers.update({
            'Cookie': cookie[:-2],
            'Referer': 'https://{}/'.format(host)
        })

        html = response.content
        data = helpers.get_hidden(html, index=1)
        _html = self.net.http_POST(web_url, headers=headers,
                                   form_data=data).content
        url = re.search('"link_button"\s*href="([^"]+)', _html)
        if url:
            response = self.net.http_GET(url.group(1), headers=headers)
            strurl = re.search('"link_button"\s*href="([^"]+)',
                               response.content)
            if strurl:
                return strurl.group(1) + helpers.append_headers(headers)

        raise ResolverError('File not found')
Example #24
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        html = self.net.http_GET(web_url).content

        data = helpers.get_hidden(html)
        data['method_free'] = 'Proceed to Video'
        html = self.net.http_POST(web_url, form_data=data).content
        stream_url = ''
        for match in re.finditer('(eval\(function.*?)</script>', html,
                                 re.DOTALL):
            js_data = jsunpack.unpack(match.group(1))
            match2 = re.search('<param\s+name="src"\s*value="([^"]+)', js_data)
            if match2:
                stream_url = match2.group(1)
            else:
                match2 = re.search('file\s*:\s*"([^"]+)', js_data)
                if match2:
                    stream_url = match2.group(1)

        if stream_url:
            return stream_url + helpers.append_headers({
                'User-Agent': common.IE_USER_AGENT,
                'Referer': web_url
            })

        raise ResolverError(
            'Unable to resolve grifthost link. Filelink not found.')
Example #25
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)

        # get landing page
        html = self.net.http_GET(web_url, headers={'Referer': web_url}).content

        # read POST variables into data
        data = helpers.get_hidden(html)
        html = self.net.http_POST(web_url,
                                  data,
                                  headers=({
                                      'Referer': web_url,
                                      'X-Requested-With': 'XMLHttpRequest'
                                  })).content

        # search for content tag
        r = re.search(r'class="stream-content" data-url', html)
        if not r: raise ResolverError('page structure changed')

        # read the data-url
        r = re.findall(r'data-url="?(.+?)"', html)
        if not r: raise ResolverError('video not found')

        # return media URL
        return r[0]
Example #26
0
    def __box_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        self.headers['Referer'] = web_url

        html = self.net.http_GET(web_url, headers=self.headers).content
        if isinstance(html, unicode): html = html.encode('utf-8', 'ignore')

        if 'not available in your country' in html:
            raise ResolverError('Unavailable in your country')

        r = re.search('You have to wait (\d+ minutes?,\s*)?\d+ seconds?', html,
                      re.I)
        if r:
            raise ResolverError('Cooldown in effect')

        data = helpers.get_hidden(html)
        for _ in range(0, 3):
            html = self.net.http_POST(web_url, data,
                                      headers=self.headers).content
            if isinstance(html, unicode): html = html.encode('utf-8', 'ignore')
            match = re.search(
                '''href\s*=\s*['"]([^'"]+)[^>]+>\s*<span[^>]+class\s*=\s*['"]button_upload green['"]''',
                html)
            if match:
                stream_url = match.group(1)
                return stream_url.replace(' ', '%20') + helpers.append_headers(
                    self.headers)
            else:
                common.kodi.sleep(1000)
    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
        if "File Not Found" in html:
            raise ResolverError("File got deleted?")
        cookies = self.__get_cookies(html)

        match = re.compile("'([^']+counter\.cgi[^']+)'", re.DOTALL).findall(html)

        if not match:
            raise ResolverError("Site structure changed!")

        self.net.http_GET(match[0], headers=headers)
        data = helpers.get_hidden(html)
        data["imhuman"] = "Proceed to this video"
        common.kodi.sleep(5500)
        headers.update({"Referer": web_url, "Cookie": "; ".join(cookies)})

        html = self.net.http_POST("http://www.flashx.tv/dl", data, headers=headers).content
        sources = []
        for match in re.finditer("(eval\(function.*?)</script>", html, re.DOTALL):
            packed_data = jsunpack.unpack(match.group(1))
            sources += self.__parse_sources_list(packed_data)
        source = helpers.pick_source(sources, self.get_setting("auto_pick") == "true")
        return source
Example #28
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

        if html:
            data = helpers.get_hidden(html)
            headers.update({'Referer': web_url})
            common.kodi.sleep(2000)
            _html = self.net.http_POST(web_url,
                                       headers=headers,
                                       form_data=data).content
            if _html:
                sources = helpers.scrape_sources(
                    _html,
                    patterns=[
                        '''(?:file:|xpro\()\s*["'](?P<url>[^"']+)["']\)?,\s*label\s*:\s*["'](?P<label>[^"',]{3,4})["']'''
                    ],
                    generic_patterns=False)
                if sources:
                    sources = [(source[0], source[1].decode("rot-13")) if
                               (source[1].startswith("uggc")) else
                               (source[0], source[1]) for source in sources]

                    return helpers.pick_source(
                        sources) + helpers.append_headers(headers)

        raise ResolverError('Unable to locate video')
Example #29
0
    def get_media_url(self, host, media_id):

        try:
            web_url = self.get_url(host, media_id)
            self.headers['Referer'] = web_url

            html = self.net.http_GET(web_url, headers=self.headers).content
            if isinstance(html, unicode): html = html.encode('utf-8', 'ignore')

            if 'Uptobox.com is not available in your country' in html:
                raise ResolverError('Unavailable in your country')

            r = re.search('(You have to wait (?:[0-9]+ minute[s]*, )*[0-9]+ second[s]*)', html)
            if r:
                raise ResolverError('Cooldown in effect')

            data = helpers.get_hidden(html)
            for _ in range(0, 3):
                try:
                    html = self.net.http_POST(web_url, data, headers=self.headers).content
                    if isinstance(html, unicode):
                        html = html.encode('utf-8', 'ignore')

                    stream_url = re.search('<a\shref\s*=[\'"](.+?)[\'"]\s*>\s*<span\sclass\s*=\s*[\'"]button_upload green[\'"]\s*>', html).group(1)
                    return stream_url
                except:
                    xbmc.sleep(1000)
        except:
            pass

        try:
            web_url = self.get_stream_url(host, media_id)
            self.headers['Referer'] = web_url

            html = self.net.http_GET(web_url, headers=self.headers).content
            if isinstance(html, unicode): html = html.encode('utf-8', 'ignore')

            if 'Uptobox.com is not available in your country' in html:
                raise ResolverError('Unavailable in your country')
            '''
            r = re.search('(You have reached the limit of *[0-9]+ minute[s]*)', html)
            if r:
                raise Exception()
            '''

            sources = helpers.parse_html5_source_list(html)
            try: sources.sort(key=lambda x: x[0], reverse=True)
            except: pass
            source = helpers.pick_source(sources)
            if source.startswith('//'):
                source = 'http:' + source

            return source
        except:
            pass

        raise ResolverError('File not found')
Example #30
0
    def get_media_url(self, host, media_id):

        try:
            web_url = self.get_url(host, media_id)
            self.headers['Referer'] = web_url

            html = self.net.http_GET(web_url, headers=self.headers).content
            if isinstance(html, unicode): html = html.encode('utf-8', 'ignore')

            if 'Uptobox.com is not available in your country' in html:
                raise ResolverError('Unavailable in your country')

            r = re.search('(You have to wait (?:[0-9]+ minute[s]*, )*[0-9]+ second[s]*)', html)
            if r:
                raise ResolverError('Cooldown in effect')

            data = helpers.get_hidden(html)
            for _ in range(0, 3):
                try:
                    html = self.net.http_POST(web_url, data, headers=self.headers).content
                    if isinstance(html, unicode):
                        html = html.encode('utf-8', 'ignore')

                    stream_url = re.search('<a\shref\s*=[\'"](.+?)[\'"]\s*>\s*<span\sclass\s*=\s*[\'"]button_upload green[\'"]\s*>', html).group(1)
                    return stream_url
                except:
                    xbmc.sleep(1000)
        except:
            pass

        try:
            web_url = self.get_stream_url(host, media_id)
            self.headers['Referer'] = web_url

            html = self.net.http_GET(web_url, headers=self.headers).content
            if isinstance(html, unicode): html = html.encode('utf-8', 'ignore')

            if 'Uptobox.com is not available in your country' in html:
                raise ResolverError('Unavailable in your country')
            '''
            r = re.search('(You have reached the limit of *[0-9]+ minute[s]*)', html)
            if r:
                raise Exception()
            '''

            sources = helpers.parse_html5_source_list(html)
            try: sources.sort(key=lambda x: x[0], reverse=True)
            except: pass
            source = helpers.pick_source(sources)
            if source.startswith('//'):
                source = 'http:' + source

            return source
        except:
            pass

        raise ResolverError('File not found')
Example #31
0
 def get_media_url(self, host, media_id): # need fix
     web_url = self.get_url(host, media_id)
     html = self.net.http_GET(web_url).content
     data = helpers.get_hidden(html)
     furl = 'http://happystreams.net/dl'
     headers = {'User-Agent': common.FF_USER_AGENT, 'Referer': web_url, 'Cookie': self.__get_cookies(host, html)}
     html = self.net.http_POST(url=furl, form_data=data, headers=headers).content
     html = helpers.add_packed_data(html)
     source = re.search(r'file:\"(.*?)\"', html).groups()[0]
     return source
Example #32
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.FF_USER_AGENT}
     response = self.net.http_GET(web_url, headers=headers)
     html = response.content
     data = helpers.get_hidden(html)
     headers['Cookie'] = response.get_headers(as_dict=True).get('Set-Cookie', '')
     html = self.net.http_POST(response.get_url(), headers=headers, form_data=data).content
     sources = helpers.scrape_sources(html)
     return helpers.pick_source(sources) + helpers.append_headers(headers)
Example #33
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.FF_USER_AGENT}
     response = self.net.http_GET(web_url, headers=headers)
     html = response.content
     data = helpers.get_hidden(html)
     headers['Cookie'] = response.get_headers(as_dict=True).get('Set-Cookie', '')
     html = self.net.http_POST(response.get_url(), headers=headers, form_data=data).content
     sources = helpers.scrape_sources(html)
     return helpers.pick_source(sources) + helpers.append_headers(headers)
Example #34
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.FF_USER_AGENT}
     response = self.net.http_GET(web_url, headers=headers)
     html = response.content.encode("utf-8")
     sources = helpers.scrape_sources(html, patterns=['''src\s*:\s*'(?P<url>[^']+)'''])
     if not sources:
         data = helpers.get_hidden(html)
         headers['Cookie'] = response.get_headers(as_dict=True).get('Set-Cookie', '')
         html = self.net.http_POST(response.get_url(), headers=headers, form_data=data).content
         sources = helpers.scrape_sources(html, patterns=['''src\s*:\s*'(?P<url>[^']+)'''])
     return helpers.pick_source(sources) + helpers.append_headers(headers)
Example #35
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        resp = self.net.http_GET(web_url)
        html = resp.content
        post_url = resp.get_url()

        form_values = helpers.get_hidden(html)
        html = self.net.http_POST(post_url, form_data=form_values).content
        r = re.search('file: "http(.+?)"', html)
        if r:
            return "http" + r.group(1)
        else:
            raise ResolverError('Unable to resolve Movpod Link')
Example #36
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        html = self.net.http_GET(web_url, headers={'Referer': web_url}).content

        data = helpers.get_hidden(html)
        html = self.net.http_POST(web_url, data, headers=({'Referer': web_url, 'X-Requested-With': 'XMLHttpRequest'})).content

        r = re.search(r'class="stream-content" data-url', html)
        if not r: raise ResolverError('page structure changed')
        r = re.findall(r'data-url="?(.+?)"', html)
        stream_url = r[0] + helpers.append_headers({'User-Agent': common.IE_USER_AGENT})

        return stream_url
Example #37
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        resp = self.net.http_GET(web_url)
        html = resp.content
        post_url = resp.get_url()

        form_values = helpers.get_hidden(html)
        html = self.net.http_POST(post_url, form_data=form_values).content
        r = re.search('file: "http(.+?)"', html)
        if r:
            return "http" + r.group(1)
        else:
            raise ResolverError('Unable to resolve Movpod Link')
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     html = self.net.http_GET(web_url).content
     data = helpers.get_hidden(html)
     data['imhuman'] = 'Proceed+to+video'
     furl = 'http://happystreams.net/dl'
     headers = {'User-Agent': common.FF_USER_AGENT, 'Referer': web_url, 'Cookie': self.__get_cookies(host, html)}
     
     html = self.net.http_POST(url=furl, form_data=data, headers=headers).content
     for match in re.finditer('(eval\(function.*?)</script>', html, re.DOTALL):
         packed_data = jsunpack.unpack(match.group(1))
         source = re.search(r'file:\"(.*?)\"', packed_data).groups()[0]
     
     return source
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.FF_USER_AGENT}
     response = self.net.http_GET(web_url, headers=headers)
     html = response.content
     if 'Not available' not in html:
         if 'sources: [' not in html:
             data = helpers.get_hidden(html)
             headers['Cookie'] = response.get_headers(as_dict=True).get('Set-Cookie', '')
             html = self.net.http_POST(response.get_url(), headers=headers, form_data=data).content
         sources = helpers.scrape_sources(html)
         return helpers.pick_source(sources) + helpers.append_headers({'User-Agent': common.FF_USER_AGENT})
     else:
         raise ResolverError('File Not Found or removed')
 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
     data = helpers.get_hidden(html)
     data['confirm.y'] = random.randint(0, 120)
     data['confirm.x'] = random.randint(0, 120)
     headers['Referer'] = web_url
     post_url = web_url + '#'
     html = self.net.http_POST(post_url, form_data=data, headers=headers).content.encode('utf-8')
     sources = helpers.parse_sources_list(html)
     try: sources.sort(key=lambda x: x[0], reverse=True)
     except: pass
     return helpers.pick_source(sources)
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT}
        response = self.net.http_GET(web_url, headers=headers)
        html = response.content
        if re.search('>(File Not Found)<', html):
            raise ResolverError('File Not Found or removed')

        data = helpers.get_hidden(html)
        headers.update({'Referer': web_url})
        common.kodi.sleep(10000)
        html = self.net.http_POST(response.get_url(), form_data=data, headers=headers).content
        sources = helpers.scrape_sources(html)
        return helpers.pick_source(sources) + helpers.append_headers(headers)
Example #42
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.FF_USER_AGENT}
     response = self.net.http_GET(web_url, headers=headers)
     html = response.content
     if 'Not available' not in html:
         if 'sources: [' not in html:
             data = helpers.get_hidden(html)
             headers['Cookie'] = response.get_headers(as_dict=True).get('Set-Cookie', '')
             html = self.net.http_POST(response.get_url(), headers=headers, form_data=data).content
         sources = helpers.scrape_sources(html)
         return helpers.pick_source(sources) + helpers.append_headers({'User-Agent': common.FF_USER_AGENT})
     else:
         raise ResolverError('File Not Found or removed')
 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
     data = helpers.get_hidden(html)
     headers.update({'Referer': web_url})
     html = self.net.http_POST(web_url, headers=headers, form_data=data).content
     
     if html:
         sources = helpers.scrape_sources(html, patterns=['''file:["'](?P<url>[^"']+)'''], result_blacklist=['dl', '.smil'])
     
         return helpers.pick_source(sources) + helpers.append_headers(headers)
         
     raise ResolverError('File not found')
Example #44
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        html = self.net.http_GET(web_url, headers={'Referer': web_url}).content

        data = helpers.get_hidden(html)
        print data
        html = self.net.http_POST(web_url, data, headers=({'Referer': web_url, 'X-Requested-With': 'XMLHttpRequest'})).content

        r = re.search(r'class="stream-content" data-url', html)
        if not r: raise ResolverError('page structure changed')
        r = re.findall(r'data-url="?(.+?)"', html)
        stream_url = r[0] + helpers.append_headers({'User-Agent': common.IE_USER_AGENT})

        return stream_url
 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
     data = helpers.get_hidden(html)
     data['confirm.y'] = random.randint(0, 120)
     data['confirm.x'] = random.randint(0, 120)
     headers['Referer'] = web_url
     post_url = web_url + '#'
     html = self.net.http_POST(post_url, form_data=data, headers=headers).content.encode('utf-8')
     sources = helpers.parse_sources_list(html)
     try: sources.sort(key=lambda x: x[0], reverse=True)
     except: pass
     return helpers.pick_source(sources)
Example #46
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     resp = self.net.http_GET(web_url)
     html = resp.content
     r = re.findall(r"<title>404 - Not Found</title>", html)
     if r:
         raise ResolverError('File Not Found or removed')
     post_url = resp.get_url()
     form_values = helpers.get_hidden(html)
     html = self.net.http_POST(post_url, form_data=form_values).content
     r = re.search('file: "(.+?)"', html)
     if r:
         return r.group(1)
     else:
         raise ResolverError('Unable to resolve Gorillavid link')
Example #47
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     resp = self.net.http_GET(web_url)
     html = resp.content
     r = re.findall(r"<title>404 - Not Found</title>", html)
     if r:
         raise ResolverError('File Not Found or removed')
     post_url = resp.get_url()
     form_values = helpers.get_hidden(html)
     html = self.net.http_POST(post_url, form_data=form_values).content
     r = re.search('file: "(.+?)"', html)
     if r:
         return r.group(1)
     else:
         raise ResolverError('Unable to resolve Gorillavid link')
    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
        
        data = helpers.get_hidden(html)
        data['imhuman'] = 'Proceed to this video'
        common.kodi.sleep(5000)
        cookies = self.__get_cookies(html, web_url)
        headers.update({'Cookie': "; ".join("=".join((str(k),str(v))) for k,v in cookies.items())})

        html = self.net.http_POST(web_url, data, headers=headers).content
        sources = self.__parse_sources_list(html)
        source = helpers.pick_source(sources, self.get_setting('auto_pick') == 'true')
        return source + helpers.append_headers(headers)
Example #49
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        html = self.net.http_GET(web_url).content

        tries = 0
        while tries < MAX_TRIES:
            data = helpers.get_hidden(html, index=0)
            data.update(captcha_lib.do_captcha(html))

            html = self.net.http_POST(web_url, form_data=data).content
            match = re.search('href="([^"]+)[^>]*>Download<', html, re.DOTALL)
            if match:
                return match.group(1)
            tries += 1

        raise ResolverError('Unable to resolve uploadz.co link. Filelink not found.')
Example #50
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     """ Human Verification """
     resp = self.net.http_GET(web_url)
     html = resp.content
     r = re.findall(r'<span class="t" id="head_title">404 - File Not Found</span>', html)
     if r:
         raise ResolverError('File Not Found or removed')
     post_url = resp.get_url()
     form_values = helpers.get_hidden(html)
     html = self.net.http_POST(post_url, form_data=form_values).content
     r = re.search('file: "http(.+?)"', html)
     if r:
         return "http" + r.group(1)
     else:
         raise ResolverError('Unable to resolve Daclips link')
Example #51
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     """ Human Verification """
     resp = self.net.http_GET(web_url)
     html = resp.content
     r = re.findall(r'<span class="t" id="head_title">404 - File Not Found</span>', html)
     if r:
         raise ResolverError('File Not Found or removed')
     post_url = resp.get_url()
     form_values = helpers.get_hidden(html)
     html = self.net.http_POST(post_url, form_data=form_values).content
     r = re.search('file: "http(.+?)"', html)
     if r:
         return "http" + r.group(1)
     else:
         raise ResolverError('Unable to resolve Daclips link')
Example #52
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     html = self.net.http_GET(web_url).content
     data = helpers.get_hidden(html)
     data['imhuman'] = 'Proceed+to+video'
     furl = 'http://www.flashx.tv/dl?%s' % (media_id)
     headers = {'User-Agent': common.FF_USER_AGENT, 'Referer': web_url, 'Cookie': self.__get_cookies(html)}
     
     common.kodi.sleep(5000)
     html = self.net.http_POST(url=furl, form_data=data, headers=headers).content
     sources = []
     for match in re.finditer('(eval\(function.*?)</script>', html, re.DOTALL):
         packed_data = jsunpack.unpack(match.group(1))
         sources += self.__parse_sources_list(packed_data)
     source = helpers.pick_source(sources, self.get_setting('auto_pick') == 'true')
     return source
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.FF_USER_AGENT}
        response = self.net.http_GET(web_url, headers=headers)
        html = response.content
        data = helpers.get_hidden(html)
        headers['Cookie'] = response.get_headers(as_dict=True).get('Set-Cookie', '')
        html = self.net.http_POST(web_url, headers=headers, form_data=data).content

        if html:
            packed = helpers.get_packed_data(html)

            sources = helpers.scrape_sources(packed, result_blacklist=['tmp'])
            if sources: return helpers.pick_source(sources) + helpers.append_headers(headers)

        raise ResolverError('Unable to locate video')
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        html = self.net.http_GET(web_url).content

        tries = 0
        while tries < MAX_TRIES:
            data = helpers.get_hidden(html)
            data['method_free'] = 'Free Download >>'
            data.update(captcha_lib.do_captcha(html))

            html = self.net.http_POST(web_url, form_data=data).content
            match = re.search('href="([^"]+)[^>]*>Download<', html, re.DOTALL)
            if match:
                return match.group(1)
            tries += 1

        raise ResolverError('Unable to resolve upload.af link. Filelink not found.')
Example #55
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        html = self.net.http_GET(web_url).content
        headers = {'User-Agent': common.RAND_UA, 'Referer': web_url}

        tries = 0
        while tries < MAX_TRIES:
            data = helpers.get_hidden(html, index=0)
            data.update(captcha_lib.do_captcha(html))

            html = self.net.http_POST(web_url, headers=headers, form_data=data).content
            match = re.search('href="([^"]+)[^>]*>Click here to download<', html, re.DOTALL | re.I)
            if match:
                return match.group(1) + helpers.append_headers(headers)
            tries += 1

        raise ResolverError('Unable to resolve uploadz.co link. Filelink not found.')
Example #56
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
        tries = 0
        while tries < MAX_TRIES:
            data = helpers.get_hidden(html, index=0)
            data.update(captcha_lib.do_captcha(html))
            headers.update({'Referer': web_url})
            html = self.net.http_POST(web_url, data, headers=headers).content

            r = re.search('href="([^"]+)[^>]+>Click here to download<', html, re.DOTALL | re.I)
            if r:
                return r.group(1) + helpers.append_headers(headers)

            tries = tries + 1

        raise ResolverError('Unable to locate link')
Example #57
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('''val\(['"]([^"']+)''', html)
        prefix = match.group(1) if match else ''
        data = helpers.get_hidden(html)
        for name in data:
            data[name] = prefix + data[name]

        headers['Referer'] = web_url
        html = self.net.http_POST(web_url, form_data=data, headers=headers).content
        match = re.search('''clip\s*:\s*\{.*?(?:url|src)\s*:\s*["'](?P<url>[^"']+)["']''', html, re.DOTALL)
        if not match:
            raise ResolverError('File Not Found or removed')

        source = self.net.http_GET(match.group('url'), headers=headers).get_url()
        return source + helpers.append_headers(headers)
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.FF_USER_AGENT}
     response = self.net.http_GET(web_url, headers=headers)
     cookie = response.get_headers(as_dict=True).get('Set-Cookie', '')
     if cookie:
         headers.update({'Cookie': cookie})
     html = response.content
     
     if html:
         data = helpers.get_hidden(html)
         if not "method_free" in data: data.update({'method_free': 'Submit Query'})
         _html = self.net.http_POST(web_url, headers=headers, form_data=data).content
         if _html:
             sources = helpers.scrape_sources(_html, patterns=['''file:\s*["'](?P<url>[^"']+)'''])
             if sources: return helpers.pick_source(sources) + helpers.append_headers(headers)
             
     raise ResolverError("Video not found")