Example #1
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:
         try:
             pattern = r"""{\s*vid:\s*'([^']+)',\s*hash\s*:\s*["\']([\da-f]{32})"""
             id, hash = re.findall(pattern, html)[0]
             hash_code = ''.join((self.encode_base_n(int(hash[lb:lb + 8], 16), 36) for lb in range(0, 32, 8)))
             load_url = 'https://www.eporner.com/xhr/video/%s?hash=%s&device=generic&domain=www.eporner.com&fallback=false&embed=false&supportedFormats=mp4' % (id, hash_code)
             headers.update({'Referer': web_url})
             r = self.net.http_GET(load_url, headers=headers).content
             r = r.replace("\/", "/")
             r = json.loads(r).get("sources", {}).get('mp4', {})
             sources = [(i, r[i].get("src")) for i in r]
             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)
             
         except: 
             raise ResolverError('File not found')
     
     raise ResolverError('File not found')
Example #2
0
    def get_media_url(self, host, media_id):
        print ":::mid2", media_id
        
        try:
            headers = {'User-Agent': common.RAND_UA}
            if not media_id.isdigit():
                web_url = self.get_url(host, media_id)
                html = self.net.http_GET(web_url, headers=headers).content
                
                if html:
                    web_url = re.search("""<iframe\s*width=['"]\d+['"]\s*height=['"]\d+['"]\s*src=['"](https:\/\/www\.watchmygf\.me\/embed\/(\d+))""", html).groups()[0]           
                else: raise ResolverError('File not found')
                      
            else: web_url = self.get_url(host, media_id)

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

            if html2:
                try:
                    file = re.search('''video_url:\s*['"]([^"']+)''', html2, re.DOTALL).groups()[0]
                    
                    return file + helpers.append_headers(headers)
                    
                except:
                    raise ResolverError('File not found')
            raise ResolverError('File not found')
        except:
            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
     sources = helpers.scrape_sources(html)
     if sources:
         headers.update({'verifypeer': 'false'})
         return helpers.pick_source(sources) + helpers.append_headers(
             headers)
     raise ResolverError('Video cannot be located.')
Example #4
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.%s/nuevo/player/embed.php?key=%s' % (host, media_id)}
        html = self.net.http_GET(web_url, headers=headers).content

        if html:
            source = re.search('''<file>\s*([^<\s*]+)''', html)
            if source: return source.group(1) + 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,
                'Referer': 'https://{0}/'.format(host)}
     r = self.net.http_GET(web_url, headers=headers)
     src = re.search(r"videolink'.+?innerHTML']='([^']+)", r.content)
     if src:
         src_url = 'https:' + src.group(1) if src.group(1).startswith('//') else src.group(1)
         src_url += '&stream=1'
         return helpers.get_redirect_url(src_url, headers) + 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.FF_USER_AGENT}
        html = self.net.http_GET(web_url, headers=headers).content
        html = unwise.unwise_process(html)
        r = re.search(r"Clappr.+?source:\s*'([^']+)", html)
        if r:
            headers.update({'Referer': web_url})
            return r.group(1) + helpers.append_headers(headers)

        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)
     headers = {'User-Agent': common.RAND_UA}
     html = self.net.http_GET(web_url, headers=headers).content
     server = re.search(r'var\s*arrFileHost\s*=\s*\["([^"]+)', html)
     if server:
         headers.update({'Referer': 'https://{}/'.format(host)})
         return 'https://{}/down.php?i={}{}'.format(
             server.group(1), media_id, helpers.append_headers(headers)
         )
     raise ResolverError('File Not Found or Removed')
Example #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}
        response = self.net.http_GET(web_url, headers=headers)
        html = response.content
        if 'video has been removed' not in html:
            source = re.findall('hls:"([^"]+)', html)[0]
            return source + helpers.append_headers(
                {'User-Agent': common.FF_USER_AGENT})

        raise ResolverError('File Not Found or removed')
Example #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}
     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')
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, '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')
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,
                'Referer': 'https://{0}/'.format(host),
                'X-Requested-With': 'XMLHttpRequest'}
     js_data = json.loads(self.net.http_GET(web_url, headers=headers).content)
     sources = js_data.get('source', None)
     if sources:
         sources = [(source.get('label'), source.get('file')) for source in sources]
         headers.pop('X-Requested-With')
         return helpers.pick_source(helpers.sort_sources_list(sources)) + helpers.append_headers(headers)
     raise ResolverError('Video not found')
    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
        match = re.search('data="([^"]+)', html)
        if match:
            data = json.loads(match.group(1).replace('&quot;', '"'))
            src = data.get('streams').get('0').get('src')
            return self.easyload_decode(src, '15') + helpers.append_headers(headers)

        raise ResolverError('Video Link Not Found')
Example #13
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'User-Agent': common.RAND_UA}
        request = urllib_request.Request(web_url, headers=headers)
        response = urllib_request.urlopen(request, context=self.context)
        html = response.read()
        source = re.search(r'''file:\s*["']([^"']+)''', html)
        if source:
            headers.update({'Referer': web_url})
            return source.group(1) + helpers.append_headers(headers)

        raise ResolverError('File not found')
Example #14
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
        r = re.search(r'''data-video-link=["']([^"']+)''', html)
        if r:
            video_link = r.group(1)
            if video_link.startswith('//'):
                video_link = 'http:{0}'.format(video_link)
            return video_link + helpers.append_headers(headers)

        raise ResolverError('No playable video found.')
Example #15
0
    def get_media_url(self, host, media_id):  
        
        headers = {'User-Agent': common.RAND_UA}
        web_url = self.get_url(host, media_id)
        html = self.net.http_GET(web_url, headers=headers).content
        
        if html:
            source = re.search('''<source src="([^'"]+)"''', html, re.DOTALL)
            if source:
                return source.group(1) + helpers.append_headers(headers)

        raise ResolverError('File not found')
Example #16
0
    def get_media_url(self, host, media_id):
        try:
            result = self.__check_auth(media_id)
            if not result:
                result = self.__auth_ip(media_id)
        except ResolverError:
            raise

        if result:
            return result + helpers.append_headers(self.headers)

        raise ResolverError("Unable to retrieve video")
Example #17
0
 def get_media_url(self, host, media_id):
     headers = {'User-Agent': common.RAND_UA}
     html = self.net.http_POST(self.get_url(host, media_id), {
         'd': host
     },
                               headers=headers).content
     sources = [
         (label, url.replace('\\/', '/'))
         for (url,
              label) in re.findall(r'"([^"]+)","label":"([^"]+)"', html)
     ]
     return helpers.pick_source(sources) + helpers.append_headers(headers)
Example #18
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.')
Example #19
0
    def get_media_url(self, host, media_id):

        headers = {'User-Agent': common.RAND_UA}
        web_url = self.get_url(host, media_id)
        html = self.net.http_GET(web_url, headers=headers).content

        if html:
            source = re.search('''<source src="([^'"]+)"''', html, re.DOTALL)
            if source:
                return source.group(1) + helpers.append_headers(headers)

        raise ResolverError('File not found')
Example #20
0
    def get_media_url(self, host, media_id):
        video = None
        web_url = self.get_url(host, media_id)
        if xbmc.getCondVisibility('System.HasAddon(plugin.video.gdrive)'
                                  ) and self.get_setting('use_gdrive'):
            doc_id = re.search(r'[-\w]{25,}', web_url)
            if doc_id:
                common.kodi.notify(header=None,
                                   msg='Resolving with GDRIVE',
                                   duration=3000)
                video = 'plugin://plugin.video.gdrive/?mode=video&amp;instance=gdrive1&amp;filename=%s&amp;content_type=video' % doc_id.group(
                    1)

        if not video:
            response, video_urls = self._parse_google(web_url)
            if video_urls:
                video_urls.sort(key=self.__key, reverse=True)
                video = helpers.pick_source(video_urls)

            if response is not None:
                res_headers = response.get_headers(as_dict=True)
                if 'Set-Cookie' in res_headers:
                    self.headers['Cookie'] = res_headers['Set-Cookie']

        if not video:
            if any(url_match in web_url for url_match in self.url_matches):
                video = self._parse_redirect(web_url, hdrs=self.headers)
            elif 'googlevideo.' in web_url:
                video = web_url + helpers.append_headers(self.headers)
        elif 'plugin://' not in video:
            if any(url_match in video for url_match in self.url_matches):
                video = self._parse_redirect(video, hdrs=self.headers)

        if video:
            if 'plugin://' in video:  # google plus embedded videos may result in this
                return video
            else:
                return video + helpers.append_headers(self.headers)

        raise ResolverError('File not found')
    def get_media_url(self, host, media_id):
        embeds = [
            'http://bestarticles.me/', 'http://tellygossips.net/',
            'http://tvarticles.org/'
        ]
        web_url = self.get_url(host, media_id)
        headers = {
            'User-Agent': common.FF_USER_AGENT,
            'Referer': random.choice(embeds)
        }

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

        if 'Not Found' in html:
            raise ResolverError('File Removed')

        if 'Video is processing' in html:
            raise ResolverError('File still being processed')

        html += helpers.get_packed_data(html)
        packed = re.search(r"JuicyCodes\.Run\((.+?)\)", html, re.I)
        if packed:
            from base64 import b64decode
            packed = packed.group(1).replace('"', '').replace('+', '')
            packed = b64decode(packed.encode('ascii'))
            html += '%s</script>' % packed.decode('latin-1').strip()

        source = helpers.scrape_sources(
            html,
            patterns=[r'''"file":\s*"(?P<url>[^"]+\.(?:m3u8|mp4|txt))"'''])
        if source:
            headers.update({'Referer': web_url, 'Accept': '*/*'})
            vsrv = re.search(r'//(\d+)/', source[0][1])
            if vsrv:
                source = re.sub(r"//\d+/", "//{0}/".format(host),
                                source[0][1]) + '?s={0}&d='.format(
                                    vsrv.group(1))
                disk = re.findall(r'videoDisk":\s*"([^"]+)', html)
                if disk:
                    disk = base64.b64encode(
                        disk[0].encode('utf-8')).decode('utf-8')
                    source += disk
            else:
                source = source[0][1]
            html = self.net.http_GET(source, headers=headers).content
            sources = re.findall(r'RESOLUTION=\d+x(\d+)\n([^\n]+)', html)
            src = helpers.pick_source(helpers.sort_sources_list(sources))
            if not src.startswith('http'):
                src = re.sub(source.split('/')[-1], src, source)
            return src + helpers.append_headers(headers)

        raise ResolverError('Video not found')
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
     if 'FILE NOT FOUND' not in html:
         r = re.search(r"btn-default'\s*href='([^']+)", html)
         if r:
             headers.update({'Referer': web_url})
             common.kodi.sleep(7000)
             strurl = helpers.get_redirect_url(r.group(1), headers=headers)
             if strurl:
                 return strurl + helpers.append_headers(headers)
     raise ResolverError('File cannot be located 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,
                'Referer': 'https://mail.ru/'}
     html = self.net.http_GET(web_url, headers=headers).content
     r = re.search(r'"weblink_get".+?url":\s*"([^"]+)', html, re.DOTALL)
     if r:
         strurl = '{0}/{1}'.format(r.group(1), media_id)
         tok = re.search(r'"tokens"[^}]+"download"\s*:\s*"([^"]+)', html, re.DOTALL)
         if tok:
             strurl += '?key={0}'.format(tok.group(1))
         return strurl + helpers.append_headers(headers)
     raise ResolverError('No playable video found.')
Example #24
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')
Example #25
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {
         'User-Agent': common.FF_USER_AGENT,
         'X-Requested-With': 'XMLHttpRequest'
     }
     html = self.net.http_GET(web_url, headers=headers).content
     source = re.search('"file":"([^"]+)"', html)
     if source:
         headers.update({'verifypeer': 'false', 'Referer': host})
         return source.group(1).replace(
             '\\/', '/') + helpers.append_headers(headers)
     raise ResolverError('Video cannot be located.')
Example #26
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).content
        r = re.search(r'file\s*:\s*(?:\'|\")(.+?)(?:\'|\")', html)

        if r:
            url = urllib_parse.urljoin(web_url, r.group(1))
            url = self.net.http_HEAD(url, headers=headers).get_url()
            url = url + helpers.append_headers(headers)
            return url

        raise ResolverError('No video found')
Example #27
0
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {
         'Cookie': 'ref_url=http%3A%2F%2Fwww.movieswatch.com.pk%2F',
         'User-Agent': common.RAND_UA
     }
     html = self.net.http_GET(web_url, headers=headers).content
     sources = helpers.scrape_sources(html)
     if sources:
         headers.pop('Cookie')
         return helpers.pick_source(sources) + helpers.append_headers(
             headers)
     raise ResolverError('File not found')
Example #28
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

        _srcs = re.search(r'sources\s*:\s*\[(.+?)\]', html)
        if _srcs:
            srcs = helpers.scrape_sources(_srcs.group(1), patterns=['''["'](?P<url>http[^"']+)'''])
            if srcs:
                headers.update({'Referer': web_url})
                return helpers.pick_source(srcs) + helpers.append_headers(headers)

        raise ResolverError('Unable to locate link')
    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
        r = re.search(r'uttf0\((\[[^)]+)', html)
        if r:
            r = eval(r.group(1))
            r = base64.b64decode(
                ''.join(r)[::-1].encode('utf8')).decode('utf8')
            return r + helpers.append_headers(headers)

        sources = helpers.scrape_sources(
            html,
            patterns=[
                r'''hls":\s*"(?P<url>[^"]+)",\s*"video_height":\s*(?P<label>[^,]+)'''
            ],
            generic_patterns=False)
        if sources:
            return helpers.pick_source(sources) + helpers.append_headers(
                headers)

        raise ResolverError('No video found')
Example #30
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'''InitializeStream.+?source:\s*['"]([^'"]+)''', html,
                      re.DOTALL)

        if r:
            return _rot47(urllib_parse.unquote(
                r.group(1))) + helpers.append_headers(headers)

        raise ResolverError('Video cannot be located.')
Example #31
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).content
        r = re.search(r"atob\('([^']+)", html)

        if r:
            html = base64.b64decode(r.group(1).encode('ascii'))
            r2 = re.search(r"source\s*src='([^']+)", html.decode('latin-1'))
            if r2:
                return r2.group(1) + helpers.append_headers(headers)

        raise ResolverError('no file 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
        sources = helpers.scrape_sources(
            html,
            patterns=[r'''file:"(?P<url>[^"]+)",label:"(?P<label>[^"]+)'''],
            generic_patterns=False)
        if sources:
            return helpers.pick_source(sources) + helpers.append_headers(
                headers)

        raise ResolverError('Video cannot be located.')
Example #33
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://video.sibnet.ru/'
        }
        html = self.net.http_GET(web_url, headers=headers).content
        source = re.search(r'src:\s*"([^"]+)', html)
        if source:
            return 'https://video.sibnet.ru' + source.group(
                1) + helpers.append_headers(headers)

        raise ResolverError('Video not found')
    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
        flashvars = re.search(r'''var flashvars\s*=\s*({.+?});''', html)
        if flashvars:
            r = json.loads(flashvars.group(1)).get("mediaDefinition", {})
            sources = [(i.get("quality"), i.get("videoUrl")) for i in r]
            if sources:
                headers.update({'Referer': web_url})
                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
     r = re.search(r"href='([^']+)'>download\s*now", html)
     if r:
         common.kodi.sleep(3000)
         headers.update({'Referer': web_url})
         html = self.net.http_GET(r.group(1), headers=headers).content
         f = re.search(r'href="([^"]+)', html)
         if f:
             return f.group(1) + helpers.append_headers(headers)
     raise ResolverError('Video cannot be located.')
Example #36
0
    def get_media_url(self, host, media_id):
        headers = {'User-Agent': common.RAND_UA}
        web_url = self.get_url(host, media_id)
        html = self.net.http_GET(web_url, headers=headers).content

        if html:
            try:
                headers.update({'Referer': web_url})
                file = re.search('''<source\s*src=['"]([^"']+)''', html, re.DOTALL).groups()[0]
                return urlparse.urljoin('https://www.vrsmash.com', file) + helpers.append_headers(headers)
            except:
                raise ResolverError('File not found')

        raise ResolverError('File not found')
Example #37
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}
     response = self.net.http_GET(web_url, headers=headers)
     html = response.content
     sources = []
     for r in re.finditer('''href=["']?(?P<url>[^"']+)["']?>DOWNLOAD <span>(?P<label>[^<]+)''', html, re.DOTALL):
         match = r.groupdict()
         stream_url = match['url'].replace('&amp;', '&')
         label = match.get('label', '0')
         sources.append([label, stream_url])
     if len(sources) > 1:
         sources.sort(key=lambda x: int(re.sub("\D", "", x[0])), reverse=True)
     return helpers.pick_source(sources) + helpers.append_headers(headers)
Example #38
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:
            try:
                headers.update({'Referer': web_url})
                file = re.search('''video_url:\s*['"]([^"']+)''', html, re.DOTALL).groups()[0]
                
                return file + helpers.append_headers(headers)
                
            except:
                raise ResolverError('File not found')

        raise ResolverError('File not found')
Example #39
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:
         try:
             headers.update({'Referer': web_url})
             flashvars = re.search('''var flashvars\s*=\s*({.+?});''', html).groups()[0]
             r = json.loads(flashvars.replace("\/", "/")).get("mediaDefinition", {})
             sources = [(i.get("quality"), i.get("videoUrl")) for i in r]
             
             if sources: return helpers.pick_source(sources) + helpers.append_headers(headers)
             
         except:
             raise ResolverError('File not found')
     
     raise ResolverError('File not found')
Example #40
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')
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     headers = {'User-Agent': common.RAND_UA}
     request = urllib2.Request(web_url, headers=headers) 
     response = urllib2.urlopen(request, context=self.context)
     html = response.read()
     
     if html:
         try:
             headers.update({'Referer': web_url})
             source = re.search('''file:\s*["']([^"']+)''', html).groups()[0]
             
             return source + helpers.append_headers(headers)
             
         except:
             raise ResolverError('File not found')
             
     raise ResolverError('File not found')
Example #42
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:
            if 'sucuri_cloudproxy_js' in html:
                cookie = self.sucuri(html)
                headers.update({'Referer': web_url, 'Cookie': cookie})
                html = self.net.http_GET(web_url, headers=headers).content
                    
            sources = re.findall('''<source\s*.+?label=['"](\w+)['"]\s*src=['"]([^'"]+)''', html)
            sources = [(i[0], i[1]) for i in sources if not i[1] == "dead_link"]
            if sources:
                try: sources.sort(key=lambda x: int(re.sub("\D", "", x[0])), reverse=True)
                except: pass
                return helpers.pick_source(sources) + helpers.append_headers(headers)

        raise ResolverError('File not found')
Example #43
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:
         try:
             pattern = r"""ajax\(url,opts\);}}\)\(([\d]+),[\d]+,\[([\d,]+)\]\);"""
             url_id, quals = re.findall(pattern, html)[0]
             quals = quals.replace(',','+')
             headers.update({'Referer': web_url,  'Origin': host})
             post_url = 'https://tkn.kodicdn.com/0000000%s/desktop/%s' % (url_id, quals)
             html = self.net.http_POST(post_url, headers=headers, form_data='').content
             if html:
                 sources = helpers.scrape_sources(html, patterns=["""['"](?P<label>\d+)['"]:{[\w":,]+token['"]:['"](?P<url>[^'"]+)"""])
                 if sources: return helpers.pick_source(sources) + helpers.append_headers(headers)
         except: 
             raise ResolverError('File not found')
     
     raise ResolverError('File not found')
Example #44
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:
         iframe_url = re.search("""<iframe.+?src=["'](http://sexix\.net/v\.php\?(u=.+?))['"]""", html)
         if iframe_url:
             playlist_url = 'http://sexix.net/qaqqew/playlist.php?%s' % iframe_url.group(2)
             headers.update({'Referer': iframe_url.group(1)})
             _html = self.net.http_GET(playlist_url, headers=headers).content
             if _html:
                 sources = re.findall("""source file=["']([^"']+).+?label=["']([^"']+)""", _html)
                 if sources:
                     sources = [(i[1], i[0]) for i in sources]
                     try: sources.sort(key=lambda x: int(re.sub("\D", "", x[0])), reverse=True)
                     except: pass
                     headers.update({'Referer': web_url})
                     return helpers.pick_source(sources) + helpers.append_headers(headers)
             
     raise ResolverError('File not found')
Example #45
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:
            try:
                params = "".join([x.replace("' + '", "") for x in self.between(html, "params += '", "';")])
                vkey = params.split('=')[-1]
                m = hashlib.md5()
                m.update(vkey + 'PT6l13umqV8K827')
                params += '&pkey=%s' % m.hexdigest()
                params = urllib.unquote(params)
                url = 'http://www.drtuber.com/player_config/?' + params
                sources_html = self.net.http_GET(url, headers=headers).content                     
                if sources_html:
                    sources = helpers.scrape_sources(sources_html, patterns=["""video_file>\<\!\[CDATA\[(?P<url>[^\]]+)"""])
                    if sources: return helpers.pick_source(sources) + helpers.append_headers(headers)
            except:   
                raise ResolverError('File not found')

        raise ResolverError('File not found')
Example #46
0
    def get_media_url(self, host, media_id):  
        
        try:
            headers = {'User-Agent': common.RAND_UA}
            web_url = self.get_url(host, media_id)
            html = self.net.http_GET(web_url, headers=headers).content
            
            if html:
                source = re.search('''video_url=['"]([^'"]+)['"]''', html, re.DOTALL)
                replaceparts = re.search('''video_url\+=['"]([^'"]+)['"]''', html, re.DOTALL)
                
                if source:
                    source = source.group(1)
                    replacemap = {'M':u'\u041C', 'A':u'\u0410', 'B':u'\u0412', 'C':u'\u0421', 'E':u'\u0415', '=':'~'}

                    for key in replacemap:
                        source = source.replace(replacemap[key], key)

                    videourl = base64.b64decode(source)
                    if replaceparts:
                        replaceparts = [x for x in replaceparts.group(1).split('||') if x]
                        videourl = re.sub('/get_file/\d+/[0-9a-z]{32}/', replaceparts[0], videourl)
                        videourl += '&' if '?' in videourl else '?'
                        videourl += 'lip=' + replaceparts[1] + '&lt=' + replaceparts[2]
                        
                        return self.net.http_GET(videourl, headers=headers).get_url() + helpers.append_headers(headers)

            raise ResolverError('File not found')
        except:
            raise ResolverError('File not found')
Example #47
0
 def get_media_url(self, host, media_id):
     headers = {'User-Agent': common.RAND_UA}
     web_url = self.get_url(host, media_id)
     html = self.net.http_GET(web_url, headers=headers).content
     
     if html:
         try:
             if media_id.startswith('embed/'):
                 web_url = re.search('''link:\s*["']([^"']+)''', html).groups()[0]
                 html = self.net.http_GET(web_url, headers=headers).content
                 
             sources = re.findall('''['"]?file['"]?:\s*['"]([^'"]+).+?['"]?type['"]?:\s*['"]([^'"]+)''', html)
             if sources:
                 sources = [(i[1], i[0]) for i in sources]
                 return self.net.http_GET(helpers.pick_source(sources), headers=headers).get_url() + helpers.append_headers(headers)
                 
         except Exception as e:
             raise ResolverError(e)
             
     raise ResolverError('File not found')
Example #48
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:
         try:
             headers.update({'Referer': web_url})
             html = html.replace('\\','')
             pattern = r"""<video src="([^"]+)"""
             link = re.search(pattern,html)
             return urlparse.urljoin('http://www.girlfriendvideos.com', link.groups()[0])  + helpers.append_headers(headers)
         except:
             raise ResolverError('File not found')
             
     raise ResolverError('File not found')