def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'Referer': web_url}
        headers.update(self.headers)
        html = self.net.http_GET(web_url, headers=headers).content
        sources = helpers.parse_sources_list(html)
        if sources:
            if len(sources) > 1:
                try:
                    sources.sort(key=lambda x: int(re.sub("\D", '', x[0])),
                                 reverse=True)
                except:
                    common.logger.log_debug(
                        'Scrape sources sort failed |int(re.sub(r"""\D""", '
                        ', x[0])|')

            result = self.__auth_ip(media_id)
            if 'vt' in result:
                vt = result['vt']
                del result['vt']
                return helpers.pick_source(sources) + '?' + urllib.urlencode(
                    {'vt': vt}) + helpers.append_headers(self.headers)
            else:
                raise ResolverError('Video Token Missing')

        else:
            raise ResolverError('File not found')
Example #2
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'Referer': web_url, 'User-Agent': common.CHROME_USER_AGENT}
        html = self.net.http_GET(web_url, headers=headers).content
        sources = helpers.parse_sources_list(html)
        if sources:
            try:
                token = re.search('''var thief\s*=\s*["']([^"']+)''', html)
                if token:
                    vt_url = 'http://vidup.tv/jwv/%s' % token.group(1)
                    vt_html = self.net.http_GET(vt_url,
                                                headers=headers).content
                    vt = re.search('''\|([-\w]{50,})''', vt_html)
                    if vt:
                        sources = helpers.sort_sources_list(sources)
                        params = {
                            'direct': 'false',
                            'ua': 1,
                            'vt': vt.group(1)
                        }
                        return helpers.pick_source(
                            sources) + '?' + urllib.urlencode(
                                params) + helpers.append_headers(headers)
                    else:
                        raise ResolverError('Video VT Missing')
                else:
                    raise ResolverError('Video Token Missing')
            except urllib2.HTTPError:
                raise ResolverError('Unable to read page data')

        raise ResolverError('Unable to locate video')
Example #3
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'Referer': web_url}
     headers.update(self.headers)
     html = self.net.http_GET(web_url, headers=headers).content
     sources = helpers.parse_sources_list(html)
     if sources:
         if len(sources) > 1:
             try:
                 sources.sort(key=lambda x: int(re.sub("\D", '', x[0])),
                              reverse=True)
             except:
                 common.logger.log_debug(
                     'Scrape sources sort failed |int(re.sub(r"""\D""", '
                     ', x[0])|')
         try:
             vt = self.__auth_ip(media_id)
             if vt:
                 params = {'direct': 'false', 'ua': 1, 'vt': vt}
                 return helpers.pick_source(
                     sources) + '?' + urllib.urlencode(
                         params) + helpers.append_headers(self.headers)
         except urllib2.HTTPError:
             source = helpers.pick_source(sources)
             return source
     else:
         raise ResolverError('Video Token Missing')
Example #4
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:
            sources = helpers.parse_sources_list(html)
            if sources:
                return helpers.pick_source(sources) + helpers.append_headers(headers)

        raise ResolverError('File Not Found')
def get_media_url(url):
    try:
        hostname = urlparse.urlparse(url).hostname
        media_id = re.search('embed.php\?c=(.*)', url).group(1)
        headers = {'User-Agent': common.IE_USER_AGENT}
        html = net.http_GET(url, headers=headers).content
        adblock_check(html, headers)
        headers.update({'Referer': url})
        for js_url in get_js_url(html):
            js = get_js(js_url, headers, hostname)
            js = unwise.unwise_process(js)
            adblock_check(js, headers)
            xhr_check(js, headers)

        html = cleanse_html(html)
        for match in re.finditer('''href=['"]([^'"]+)''', html):
            playvid_url = match.group(1)
            if '-%s.' % (media_id) in playvid_url:
                headers.update({'Referer': url})
                html = net.http_GET(playvid_url, headers=headers).content
                common.log_utils.log(html)
                html = cleanse_html(html)
                headers['Referer'] = playvid_url

        sources = []
        spans = get_span_ids(html, media_id)
        for match in re.finditer('<script[^>]*>\s*(eval\(function.*?)</script>', html, re.DOTALL):
            js_data = jsunpack.unpack(match.group(1))
            if not spans or any(span_id in js_data for span_id in spans):
                js_sources = helpers.parse_sources_list(js_data)
                sources += js_sources

        d = {}
        for source in sources: d[source[1]] = d.setdefault(source[1], 0) + 1
        common.log_utils.log(sources)
        sources = [source for source in sources if d[source[1]] == 1]
        common.log_utils.log(sources)
        sources = [source for source in sources if
                   not any([x in source[1].lower() for x in ('/movie.mp4', '/trailer.mp4', '://cdn.flashx.tv')])]
        common.log_utils.log(sources)
        sources = [source for source in sources if check_headers(source, headers)]
        common.log_utils.log(sources)
        try:
            sources.sort(key=lambda x: SORT_KEY.get(x[0], 0), reverse=True)
        except:
            pass
        source = helpers.pick_source(sources)
        return source + helpers.append_headers(headers)

    except Exception as e:
        common.log_utils.log_debug('Exception during flashx resolve parse: %s' % e)
        raise

    raise ResolverError('Unable to resolve flashx link. Filelink not found.')
Example #6
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.RAND_UA, 'Referer': 'https://www.mehlizmovieshd.com/'}
     html = self.net.http_GET(web_url, headers=headers).content
     
     if html:
         sources = helpers.parse_sources_list(html)
         if sources:
             sources = helpers.sort_sources_list(sources)
             return helpers.pick_source(sources) + helpers.append_headers(headers)
         
     raise ResolverError('Video not found')
Example #7
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.RAND_UA, 'Referer': 'https://www.mehlizmovieshd.com/'}
     html = self.net.http_GET(web_url, headers=headers).content
     
     if html:
         sources = helpers.parse_sources_list(html)
         if sources:
             sources = helpers.sort_sources_list(sources)
             return helpers.pick_source(sources) + helpers.append_headers(headers)
         
     raise ResolverError('Video not found')
Example #8
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:
         packed = helpers.get_packed_data(html)
         headers.update({'Referer': web_url})
         sources = helpers.parse_sources_list(packed)
         
         if sources: return helpers.pick_source(sources) + helpers.append_headers(headers)
         
     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
     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}
     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 #11
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.RAND_UA, 'Referer': 'https://www.mehlizmovieshd.com/'}
     html = self.net.http_GET(web_url, headers=headers).content
     
     if html:
         sources = helpers.parse_sources_list(html)
         if sources:
             if len(sources) > 1:
                 try: sources.sort(key=lambda x: int(re.sub("\D", "", x[0])), reverse=True)
                 except: common.logger.log_debug('Scrape sources sort failed |int(re.sub("\D", "", x[0])|')
                 
             return helpers.pick_source(sources) + helpers.append_headers(headers)
         
     raise ResolverError('Video not found')
Example #12
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'Referer': web_url}
     headers.update(self.headers)
     html = self.net.http_GET(web_url, headers=headers).content
     sources = helpers.parse_sources_list(html)
     if sources:
         vt = self.__auth_ip(media_id)
         if vt:
             source = helpers.pick_source(sources)
             return '%s?direct=false&ua=1&vt=%s' % (
                 source, vt) + helpers.append_headers(
                     {'User-Agent': common.SMU_USER_AGENT})
     else:
         raise ResolverError('Unable to locate links')
Example #13
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {
         'Referer': web_url
     }
     headers.update(self.headers)
     html = self.net.http_GET(web_url, headers=headers).content
     sources = helpers.parse_sources_list(html)
     if sources:
         vt = self.__auth_ip(media_id)
         if vt:
             source = helpers.pick_source(sources)
             return '%s?direct=false&ua=1&vt=%s' % (source, vt) + helpers.append_headers({'User-Agent': common.SMU_USER_AGENT})
     else:
         raise ResolverError('Unable to locate links')
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.RAND_UA, 'Referer': 'https://www.mehlizmovies.is/'}
     html = self.net.http_GET(web_url, headers=headers).content
     
     if html:
         sources = helpers.parse_sources_list(html)
         if sources:
             if len(sources) > 1:
                 try: sources.sort(key=lambda x: int(re.sub("\D", "", x[0])), reverse=True)
                 except: common.logger.log_debug('Scrape sources sort failed |int(re.sub("\D", "", x[0])|')
                 
             return helpers.pick_source(sources) + helpers.append_headers(headers)
         
     raise ResolverError('Video not found')
def get_media_url(url):
    try:
        hostname = urlparse.urlparse(url).hostname
        headers = {'User-Agent': common.FF_USER_AGENT}
        html = net.http_GET(url, headers=headers).content
        headers.update({'Referer': url})
        for match in re.finditer('''<script[^>]*src=["']([^'"]+)''', html):
            _html = get_js(match.group(1), headers, hostname)

        match = re.search('''href=['"]([^'"]+)''', html)
        if match:
            playvid_url = match.group(1)
            html = net.http_GET(playvid_url, headers=headers).content
            headers.update({'Referer': playvid_url})
            for match in re.finditer('''<script[^>]*src=["']([^'"]+)''', html):
                js = get_js(match.group(1), headers, hostname)
                match = re.search(
                    '''!=\s*null.*?get\(['"]([^'"]+).*?\{([^:]+)''', js,
                    re.DOTALL)
                if match:
                    fx_url, fx_param = match.groups()
                    fx_url = resolve_url(
                        urlparse.urljoin('http://www.flashx.tv', fx_url) +
                        '?' + urllib.urlencode({fx_param: 1}))
                    common.log_utils.log('fxurl: %s' % (fx_url))
                    _html = net.http_GET(fx_url, headers=headers).content

            headers.update({'Referer': url})
            html = net.http_GET(playvid_url, headers=headers).content
            html = helpers.add_packed_data(html)

        common.log_utils.log(html)
        sources = helpers.parse_sources_list(html)
        try:
            sources.sort(key=lambda x: SORT_KEY.get(x[0], 0), reverse=True)
        except:
            pass
        source = helpers.pick_source(sources)
        return source + helpers.append_headers(headers)

    except Exception as e:
        common.log_utils.log_debug(
            'Exception during flashx resolve parse: %s' % e)
        raise

    raise ResolverError('Unable to resolve flashx link. Filelink not found.')
Example #16
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {
         'Referer': web_url
     }
     headers.update(self.headers)
     html = self.net.http_GET(web_url, headers=headers).content
     sources = helpers.parse_sources_list(html)
     if sources:
         try:
             vt = self.__auth_ip(media_id)
             if vt:
                 params = {'direct': 'false', 'ua': 1, 'vt': vt}
                 return helpers.pick_source(sources) + '?' + urllib.urlencode(params) + helpers.append_headers(self.headers)
         except urllib2.HTTPError:
             source = helpers.pick_source(sources)
             return source
     else:
         raise ResolverError('Video Token Missing')
Example #17
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {
         'Referer': web_url
     }
     headers.update(self.headers)
     html = self.net.http_GET(web_url, headers=headers).content
     sources = helpers.parse_sources_list(html)
     if sources:
         try:
             vt = self.__auth_ip(media_id)
             if vt:
                 params = {'direct': 'false', 'ua': 1, 'vt': vt}
                 return helpers.pick_source(sources) + '?' + urllib.urlencode(params) + helpers.append_headers(self.headers)
         except urllib2.HTTPError:
             source = helpers.pick_source(sources)
             return source
     else:
         raise ResolverError('Video Token Missing')
Example #18
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
        }
        headers.update(self.headers)
        response = self.net.http_GET(web_url, headers=headers)
        headers['Cookie'] = response.get_headers(as_dict=True).get('Set-Cookie', '')
        print "Headers",headers
        sources1 = []

        html = response.content
        sources = helpers.parse_sources_list(html)
        match = re.search(r"""try_again\s*=\s*['"]([^'^"]+?)['"]""", html, re.DOTALL)
        if match:
            print "UR",match.group(1)
            print "AAA"
            response1 = self.net.http_GET('http://thevideo.me/jwv/%s' %  match.group(1), headers=headers).content
            js = jsunpack.unpack(response1)
            #print "R",js
            ret_headers = {
                'User-Agent': common.FF_USER_AGENT,
                 'Referer': 'http://thevideo.me/player/jw/7/jwplayer.flash.swf'
                }
            vt = re.findall("""b=['"]([^"]+)['"],c=['"]([^"]+)['"]""", js)

        for i, j in enumerate(sources):
            #print "i1 -->",sources[i][1]
            sources1.append([
                sources[i][0],
                sources[i][1] + '?direct=false&%s&%s' % (vt[0][0], vt[0][1])
                    ])
        return helpers.pick_source(sources1) + helpers.append_headers(ret_headers)


        if sources:
            vt = self.__auth_ip(media_id)
            if vt:
                source = helpers.pick_source(sources)
                return '%s?direct=false&ua=1&vt=%s' % (source, vt) + helpers.append_headers({'User-Agent': common.SMU_USER_AGENT})
        else:
            raise ResolverError('Unable to locate links')
    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)
        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)

        if sources:
            try: sources.sort(key=lambda x: int(re.sub('[^\d]+', '', x[0])), reverse=True)
            except: pass
            return helpers.pick_source(sources)

        raise ResolverError('File Not Found or removed')
Example #20
0
def get_media_url(url):
    try:
        hostname = urlparse.urlparse(url).hostname
        headers = {'User-Agent': common.FF_USER_AGENT}
        html = net.http_GET(url, headers=headers).content
        headers.update({'Referer': url})
        for match in re.finditer('''<script[^>]*src=["']([^'"]+)''', html):
            _html = get_js(match.group(1), headers, hostname)
                
        match = re.search('''href=['"]([^'"]+)''', html)
        if match:
            playvid_url = match.group(1)
            html = net.http_GET(playvid_url, headers=headers).content
            headers.update({'Referer': playvid_url})
            for match in re.finditer('''<script[^>]*src=["']([^'"]+)''', html):
                js = get_js(match.group(1), headers, hostname)
                match = re.search('''!=\s*null.*?get\(['"]([^'"]+).*?\{([^:]+)''', js, re.DOTALL)
                if match:
                    fx_url, fx_param = match.groups()
                    fx_url = resolve_url(urlparse.urljoin('http://www.flashx.tv', fx_url) + '?' + urllib.urlencode({fx_param: 1}))
                    common.log_utils.log('fxurl: %s' % (fx_url))
                    _html = net.http_GET(fx_url, headers=headers).content
                    
            headers.update({'Referer': url})
            html = net.http_GET(playvid_url, headers=headers).content
            html = helpers.add_packed_data(html)
        
        common.log_utils.log(html)
        sources = helpers.parse_sources_list(html)
        try: sources.sort(key=lambda x: SORT_KEY.get(x[0], 0), reverse=True)
        except: pass
        source = helpers.pick_source(sources)
        return source + helpers.append_headers(headers)
        
    except Exception as e:
        common.log_utils.log_debug('Exception during flashx resolve parse: %s' % e)
        raise
    
    raise ResolverError('Unable to resolve flashx link. Filelink not found.')
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {
         'Referer': web_url
     }
     headers.update(self.headers)
     html = self.net.http_GET(web_url, headers=headers).content
     sources = helpers.parse_sources_list(html)
     if sources:
         if len(sources) > 1:
             try: sources.sort(key=lambda x: int(re.sub("\D", '', x[0])), reverse=True)
             except: common.logger.log_debug('Scrape sources sort failed |int(re.sub(r"""\D""", '', x[0])|')
         try:
             vt = self.__auth_ip(media_id)
             if vt:
                 params = {'direct': 'false', 'ua': 1, 'vt': vt}
                 return helpers.pick_source(sources) + '?' + urllib.urlencode(params) + helpers.append_headers(self.headers)
         except urllib2.HTTPError:
             source = helpers.pick_source(sources)
             return source
     else:
         raise ResolverError('Video Token Missing')
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {
            'Referer': web_url
        }
        headers.update(self.headers)
        html = self.net.http_GET(web_url, headers=headers).content
        sources = helpers.parse_sources_list(html)
        if sources:
            if len(sources) > 1:
                try: sources.sort(key=lambda x: int(re.sub("\D", '', x[0])), reverse=True)
                except: common.logger.log_debug('Scrape sources sort failed |int(re.sub(r"""\D""", '', x[0])|')

            result = self.__auth_ip(media_id)
            if 'vt' in result:
                vt = result['vt']
                del result['vt']
                return helpers.pick_source(sources) + '?' + urllib.urlencode({'vt': vt}) + helpers.append_headers(self.headers)
            else:
                raise ResolverError('Video Token Missing')

        else:
            raise ResolverError('File not found')
Example #23
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

        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)

        if sources:
            try:
                sources.sort(key=lambda x: int(re.sub('[^\d]+', '', x[0])),
                             reverse=True)
            except:
                pass
            return helpers.pick_source(sources)

        raise ResolverError('File Not Found or removed')
Example #24
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'Referer': web_url, 'User-Agent': common.CHROME_USER_AGENT}
        html = self.net.http_GET(web_url, headers=headers).content
        sources = helpers.parse_sources_list(html)
        if sources:
            try:
                token = re.search('''var thief\s*=\s*["']([^"']+)''', html)
                if token:
                    vt_url = 'http://vidup.tv/jwv/%s' % token.group(1)
                    vt_html = self.net.http_GET(vt_url, headers=headers).content
                    vt = re.search('''\|([-\w]{50,})''', vt_html)
                    if vt:
                        sources = helpers.sort_sources_list(sources)
                        params = {'direct': 'false', 'ua': 1, 'vt': vt.group(1)}
                        return helpers.pick_source(sources) + '?' + urllib.urlencode(params) + helpers.append_headers(headers)
                    else:
                        raise ResolverError('Video VT Missing')
                else:
                    raise ResolverError('Video Token Missing')
            except urllib2.HTTPError:
                raise ResolverError('Unable to read page data')

        raise ResolverError('Unable to locate video')