Example #1
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'Referer': web_url, 'User-Agent': common.FF_USER_AGENT}
        html = self.net.http_GET(web_url, headers=headers).content
        #print html
        try: html = html.encode('utf-8')
        except: pass
        #if "This video doesn't exist." in html:
        #    raise ResolverError('The requested video was not found.')
        
        #match = re.search('<a data-quality="(.*?)" href="(.*?)".*?>(.*?)</a>', html, re.DOTALL)
        match = re.compile('<a data-quality="(.*?)" href="(.*?)".*?>(.*?)</a>', re.DOTALL).findall(html)
        print match

        if match:
            mylinks =sorted(match, key=lambda x: x[2])
            print mylinks[-1][1]
            html = self.net.http_GET(mylinks[-1][1], headers=headers).content
            html = jsunpack.unpack(re.search("eval(.*?)\{\}\)\)", html, re.DOTALL).group(1))
            match7 = re.search('src="(.*?).mp4"',html)
            if match7:
                return match7.group(1)+'.mp4|Cookie=PHPSESSID=1&Referer=http://static.cda.pl/flowplayer/flash/flowplayer.commercial-3.2.18.swf'            #aa_text = aa_decoder.AADecoder(match.group(1)).decode()
        else:
            html = jsunpack.unpack(re.search("eval(.*?)\{\}\)\)", html, re.DOTALL).group(1))
            match7 = re.search('src="(.*?).mp4"',html)
            if match7:
                return match7.group(1)+'.mp4|Cookie=PHPSESSID=1&Referer=http://static.cda.pl/flowplayer/flash/flowplayer.commercial-3.2.18.swf'            #aa_text = aa_decoder.AADecoder(match.group(1)).decode()
        raise ResolverError('Video Link Not Found')
Example #2
0
    def get_media_url(self, host, media_id):
        print "ALA CDA"
        web_url = self.get_url(host, media_id)
        headers = {"Referer": web_url, "User-Agent": common.FF_USER_AGENT}
        html = self.net.http_GET(web_url, headers=headers).content
        # print html
        try:
            html = html.encode("utf-8")
        except:
            pass
        # if "This video doesn't exist." in html:
        #    raise ResolverError('The requested video was not found.')

        # match = re.search('<a data-quality="(.*?)" href="(.*?)".*?>(.*?)</a>', html, re.DOTALL)
        match = re.compile('<a data-quality="(.*?)" href="(.*?)".*?>(.*?)</a>', re.DOTALL).findall(html)
        match20 = re.search("['\"]file['\"]:['\"](.*?\.mp4)['\"]", html)

        print match

        if match:
            mylinks = sorted(match, key=lambda x: x[2])
            print mylinks[-1][1]
            html = self.net.http_GET(mylinks[-1][1], headers=headers).content
            # print html
            match20 = re.search("['\"]file['\"]:['\"](.*?\.mp4)['\"]", html)
            if match20:
                mylink = match20.group(1).replace("\\", "")
                print "CDA.PL - STEP 3 %s " % mylink
                return (
                    mylink
                    + "|Cookie=PHPSESSID=1&Referer=http://static.cda.pl/flowplayer/flash/flowplayer.commercial-3.2.18.swf"
                )

            html = jsunpack.unpack(re.search("eval(.*?)\{\}\)\)", html, re.DOTALL).group(1))
            match7 = re.search('src="(.*?).mp4"', html)
            if match7:
                return (
                    match7.group(1)
                    + ".mp4|Cookie=PHPSESSID=1&Referer=http://static.cda.pl/flowplayer/flash/flowplayer.commercial-3.2.18.swf"
                )  # aa_text = aa_decoder.AADecoder(match.group(1)).decode()
        else:
            match20 = re.search("['\"]file['\"]:['\"](.*?\.mp4)['\"]", html)
            if match20:
                mylink = match20.group(1).replace("\\", "")
                print "CDA.PL - STEP 3 %s " % mylink
                return (
                    mylink
                    + "|Cookie=PHPSESSID=1&Referer=http://static.cda.pl/flowplayer/flash/flowplayer.commercial-3.2.18.swf"
                )
            html1 = jsunpack.unpack(re.search("eval(.*?)\{\}\)\)", html, re.DOTALL).group(1))
            match7 = re.search('src="(.*?).mp4"', html1)

            if match7:
                return (
                    match7.group(1)
                    + ".mp4|Cookie=PHPSESSID=1&Referer=http://static.cda.pl/flowplayer/flash/flowplayer.commercial-3.2.18.swf"
                )  # aa_text = aa_decoder.AADecoder(match.group(1)).decode()
        raise ResolverError("Video Link Not Found")
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)

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

            r =  'name="op" value="(.+?)">.+?'
            r += 'name="usr_login" value="(.+?)?">.+?'
            r += 'name="id" value="(.+?)".+?'
            r += 'name="fname" value="(.+?)".+?'
    
            r = re.search(r,html,re.DOTALL)
            op,usr_login,id,fname = r.groups()
            data =  {'op':op}
            data['usr_login'] = usr_login
            data['id'] = id
            data['fname'] = fname
            data['referer'] = web_url
            data['method_free'] = 'Continue to Stream'

            html = self.net.http_POST(web_url, data).content

            # get url from packed javascript
            sPattern =  '<div id="player_code"><script type=(?:"|\')text/javascript(?:"|\')>'
            sPattern += '(eval\(function\(p,a,c,k,e,d\)\{while.+?DivXBrowserPlugin.+?)</script>'
            
            r = re.search(sPattern, html, re.DOTALL + re.IGNORECASE)
            
            if r:
                sJavascript = r.group(1) + ")))"
                sUnpacked = jsunpack.unpack(sJavascript)
                sPattern = 'type="video/divx"src="(.+?)"custommode='
                r = re.search(sPattern, sUnpacked)
                if r:
                    return r.group(1)
            else:
                sPattern =  '<script type=(?:"|\')text/javascript(?:"|\')>'
                sPattern += '(eval\(function\(p,a,c,k,e,d\)\{while.*SWFObject.*)'
                
                r2 = re.search(sPattern, html, re.IGNORECASE)
                
                if r2:
                    sJavascript = r2.group(1) + ")))"
                    sUnpacked = jsunpack.unpack(sJavascript)
                    sPattern = "'file','([^']*)'";
                    r = re.search(sPattern, sUnpacked)
                    if r:
                        return r.group(1)
            raise Exception ('failed to parse link')

        except urllib2.URLError, e:
            common.addon.log_error('Movdivx: got http error %d fetching %s' %
                                  (e.code, web_url))
            common.addon.show_small_popup('Error','Http error: '+str(e), 5000, error_logo)
            return self.unresolvable(code=3, msg=e)
    def get_media_url(self, host, media_id):
        url = self.get_url(host, media_id)
        html = self.net.http_GET(url).content
        if 'File Not Found' in html:
            raise UrlResolver.ResolverError('File Not Found')

        headers = {
            'Referer': url
        }

        data = {}
        r = re.findall(r'type="hidden" name="(.+?)"\s* value="(.+?)"', html)
        for name, value in r:
            data[name] = value
        data.update({'method_free': 'Free Download'})

        html = self.net.http_POST(url, data, headers=headers).content

        r = re.search('(eval\(function\(p,a,c,k,e,[dr].*)', html)
        if r:
            js = jsunpack.unpack(r.group(1))
            r = re.search('playlist=([^&]+)', js)
            if r:
                html = self.net.http_GET(r.group(1)).content
                r = re.search('<file>\s*(.*)\s*</file>', html)
                if r:
                    return r.group(1)
                else:
                    raise UrlResolver.ResolverError('Unable to locate video file')
            else:
                raise UrlResolver.ResolverError('Unable to locate playlist')
        else:
            raise UrlResolver.ResolverError('Unable to locate packed data')
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {
            'User-Agent': common.IOS_USER_AGENT,
            'Referer': web_url
        }

        html = self.net.http_GET(web_url, headers=headers).content
        if jsunpack.detect(html):
            js_data = jsunpack.unpack(html)
            match = re.search('"src"\s*,\s*"([^"]+)', js_data)

        try:
            stream_url = match.group(1)

            r = urllib2.Request(stream_url, headers=headers)
            r = int(urllib2.urlopen(r, timeout=15).headers['Content-Length'])

            if r > 1048576:
                stream_url += '|' + urllib.urlencode(headers)
                return stream_url
        except:
            ResolverError("File Not Playable")

        raise ResolverError('No playable video found.')
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)

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

            # removed check.
            # get url from packed javascript
            sPattern = "src='http://xvidstage.com/player/swfobject.js'></script>.+?<script type='text/javascript'>eval.*?return p}\((.*?)</script>"# Modded
            r = re.search(sPattern, html, re.DOTALL + re.IGNORECASE)
            if r:
                sJavascript = r.group(1)
                sUnpacked = jsunpack.unpack(sJavascript)
                sPattern = "'file','(.+?)'"#modded
                r = re.search(sPattern, sUnpacked)
                if r:
                    return r.group(1)
                raise Exception ('File Not Found or removed')

            raise Exception ('File Not Found or removed')

        except urllib2.URLError, e:
            common.addon.log_error(self.name + ': got http error %d fetching %s' %
                                   (e.code, web_url))
            common.addon.show_small_popup('Error','Http error: '+str(e), 8000, error_logo)
            return self.unresolvable(code=3, msg=e)
Example #7
0
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
    logger.info("(page_url='%s')" % page_url)
    data = httptools.downloadpage(page_url, headers=headers).data

    packer = scrapertools.find_single_match(data,
                                            "<script type='text/javascript'>(eval.function.p,a,c,k,e,d..*?)</script>")
    if packer != "":
        unpacker = jsunpack.unpack(data)
    else:
        unpacker = ""
    if unpacker != "": data = unpacker

    data = re.sub(r'\n|\t|\s+', '', data)

    host = scrapertools.find_single_match(data, '\[\{image:"(http://[^/]+/)')
    mediaurl = scrapertools.find_single_match(data, ',\{file:"([^"]+)"')
    if not mediaurl.startswith(host):
        mediaurl = host + mediaurl
   
    rtmp_url = scrapertools.find_single_match(data, 'file:"(rtmp[^"]+)"')
    playpath = scrapertools.find_single_match(rtmp_url, 'vod\?h=[\w]+/(.*$)')
    rtmp_url = rtmp_url.split(playpath)[
                   0] + " playpath=" + playpath + " swfUrl=http://gamovideo.com/player61/jwplayer.flash.swf"

    video_urls = []
    video_urls.append(["RTMP [gamovideo]", rtmp_url])
    video_urls.append([scrapertools.get_filename_from_url(mediaurl)[-4:] + " [gamovideo]", mediaurl])

    for video_url in video_urls:
        logger.info("%s - %s" % (video_url[0], video_url[1]))

    return video_urls
Example #8
0
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
    logger.info("(page_url='%s')" % page_url)

    data = scrapertools.cache_page(page_url)

    # Submit
    post = {}
    r = re.findall(r'type="hidden" name="(.+?)"\s* value="?(.+?)">', data)
    for name, value in r:
        post[name] = value
        post.update({'method_free': 'Free Download'})
    data = scrapertools.cache_page(page_url, post=urllib.urlencode(post))

    # Get link
    sPattern = '''<div id="player_code">.*?<script type='text/javascript'>(eval.+?)</script>'''
    r = re.findall(sPattern, data, re.DOTALL | re.I)
    mediaurl = ""
    if r:
        sUnpacked = jsunpack.unpack(r[0])
        sUnpacked = sUnpacked.replace("\\'", "")
        r = re.findall('file,(.+?)\)\;s1', sUnpacked)
        if not r:
            r = re.findall('"src"value="(.+?)"/><embed', sUnpacked)

        mediaurl = r[0]

    video_urls = []
    video_urls.append([scrapertools.get_filename_from_url(mediaurl)[-4:] + " [hugefiles]", mediaurl])

    for video_url in video_urls:
        logger.info("%s - %s" % (video_url[0], video_url[1]))

    return video_urls
    def __get_link(self, web_url, media_id, headers):
        html = self.net.http_GET(web_url, headers=headers).content
        data = {}
        r = re.findall(r'type="hidden"\s*name="([^"]+)"\s*value="([^"]+)',
                       html)
        for name, value in r:
            data[name] = value
        data['imhuman'] = 'Proceed+to+video'
        url = 'http://www.flashx.tv/dl?%s' % (media_id)
        xbmc.sleep(6000)
        html = self.net.http_POST(url, form_data=data, headers=headers).content

        best = 0
        best_link = ''
        for packed in re.findall("<script[^>]*>(eval\(function.*?)</script>",
                                 html, re.DOTALL):
            unpacked = jsunpack.unpack(packed)
            for stream in re.findall(
                    'file\s*:\s*"(http.*?)"\s*,\s*label\s*:\s*"(\d+)',
                    unpacked, re.DOTALL):
                if int(stream[1]) > best:
                    best = int(stream[1])
                    best_link = stream[0]

        if best_link:
            return best_link
        else:
            raise UrlResolver.ResolverError(
                'Unable to resolve Flashx link. Filelink not found.')
Example #10
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 #11
0
    def get_media_url(self, host, media_id):
        try:
            web_url = self.get_url(host, media_id)
            link = self.net.http_GET(web_url).content

            if link.find('File Not Found') >= 0:
                err_title = 'Content not available.'
                err_message = 'The requested video was not found.'
                common.addon.log_error(self.name + ' - fetching %s - %s - %s ' % (web_url,err_title,err_message))
                xbmc.executebuiltin('XBMC.Notification([B][COLOR white]'+__name__+'[/COLOR][/B] - '+err_title+',[COLOR red]'+err_message+'[/COLOR],8000,'+logo+')')
                return self.unresolvable(1, err_message)

            videoUrl = re.compile("\'file\'\s?:\s?\'([\w\/\.\:\-\=\?]+)\'").findall(link)

            if len(videoUrl) > 0:
                return videoUrl[0]
            else:
                # search for packed function
                sPattern="<script type='text/javascript'>(eval\(function\(p,a,c,k,e,d\)\{while.+?(hostingbulk|np_vid|player_ads).+?)</script>"
                r = re.search(sPattern, link, re.DOTALL)
                if r:
                    sUnpacked = jsunpack.unpack(r.group(1))
                    r = re.search('file:"(.+?)",', sUnpacked)
                if r:
                    return r.group(1)
                else:
                    return self.unresolvable(0, 'No playable video found.')
        except urllib2.URLError, e:
            return self.unresolvable(3, str(e))
    def get_media_url(self, host, media_id):
        try:
            web_url = self.get_url(host, media_id)
            html = self.net.http_GET(web_url).content

            if html.find('404 Not Found') >= 0:
                raise Exception('File Removed')
            
            if html.find('Video is processing') >= 0:
                raise Exception('File still being processed')

            packed = re.search('(eval\(function.*?)\s*</script>', html, re.DOTALL)
            if packed:
                js = jsunpack.unpack(packed.group(1))
            else:
                js = html

            link = re.search('file\s*:\s*"([^"]+)', js)
            if link:
                common.addon.log_debug('letwatch.us Link Found: %s' % link.group(1))
                return link.group(1)

            raise Exception('Unable to find letwatch.us video')

        except urllib2.URLError, e:
            return self.unresolvable(3, str(e))
Example #13
0
 def __get_link(self, web_url, headers):
     html = self.net.http_GET(web_url, headers=headers).content
     for match in re.finditer('(eval\(function\(p,a,c,k,e,d\).*?)</script>', html, re.DOTALL):
         js = jsunpack.unpack(match.group(1))
         match2 = re.search('file\s*:\s*"([^"]+(?:video|mobile)[^"]+)', js)
         if match2:
             return match2.group(1)
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        response = self.net.http_GET(web_url)
        html = response.content

        if html:
            packed = re.search('(eval\(function.*?)\s*</script>', html, re.DOTALL)
            if packed:
                js = jsunpack.unpack(packed.group(1))
            else:
                js = html

            video_url = None

            link = re.search('([^"]*.m3u8)', js)
            if link:
                video_url = link.group(1)
                common.log_utils.log_debug('vidbom.com Link Found: %s' % video_url)

            if not video_url:
                link = re.search('([^"]*.mp4)', js)
                if link:
                    video_url = link.group(1)
                    common.log_utils.log_debug('vidbom.com Link Found: %s' % video_url)

            if video_url:
                return video_url

        raise ResolverError('No playable video found.')
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)

        try:
            html = self.net.http_GET(web_url).content           
            form_values = {}
            for i in re.finditer('<input type="hidden" name="(.*?)" value="(.*?)"', html):
                form_values[i.group(1)] = i.group(2)   
            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 Exception ('Unable to resolve Mightyupload link. Player config not found.')
            r_temp = re.search("file: '([^']+)'",r.group(1))
            if r_temp:
                return r_temp.group(1)
            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 Exception ('Unable to resolve Mightyupload link. Filelink not found.')
            return r.group(1)
        
        except urllib2.URLError, e:
            common.addon.log_error(self.name + ': got http error %d fetching %s' %
                                    (e.code, web_url))
            return self.unresolvable(code=3, msg='Exception: %s' % e) 
Example #16
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
 def get_media_url(self, host, media_id):
     web_url = self.get_url(host, media_id)
     try:
         html = self.net.http_GET(web_url).content
         form_values = {}
         for i in re.finditer('<input type="hidden" name="(.*?)" value="(.*?)"', html):
             form_values[i.group(1)] = i.group(2)
         html = self.net.http_POST(web_url, form_data=form_values).content
         
         r = re.search("file: '([^']+)'",html)
         if r:
             return r.group(1)
         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:
                 return match2.group(1)
             else:
                 match2 = re.search('<embed.*?type="video.*?src="([^"]+)', js_data)
                 if match2:
                     return match2.group(1)
             
         raise Exception('Unable to resolve cloudyvideos link. Filelink not found.')
     except urllib2.URLError, e:
         common.addon.log_error(self.name + ': got http error %d fetching %s' %
                                 (e.code, web_url))
         return self.unresolvable(code=3, msg='Exception: %s' % e)
Example #18
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 = {}
        for match in re.finditer('input type="hidden" name="([^"]+)" value="([^"]+)', html):
            key, value = match.groups()
            data[key] = value
        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 + '|' + urllib.urlencode({'User-Agent': common.IE_USER_AGENT, 'Referer': web_url})

        raise ResolverError('Unable to resolve grifthost 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
        form_values = {}
        stream_url = ''
        for i in re.finditer('<input type="hidden" name="([^"]+)" value="([^"]+)', html):
            form_values[i.group(1)] = i.group(2)

        xbmc.sleep(2000)
        html = self.net.http_POST(web_url, form_data=form_values).content
        
        r = re.search("file\s*:\s*'([^']+)'", html)
        if r:
            stream_url = r.group(1)

        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('<embed.*?type="video.*?src="([^"]+)', js_data)
                if match2:
                    stream_url = match2.group(1)
            
        if stream_url:
            return stream_url + '|User-Agent=%s&Referer=%s' % (common.IE_USER_AGENT, web_url)

        raise UrlResolver.ResolverError('Unable to resolve cloudyvideos link. Filelink not found.')
    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
        if "No such file or the file has been removed due to copyright infringement issues." in html:
            raise UrlResolver.ResolverError('File Not Found or removed')

        filename = re.compile('<input name="fname" type="hidden" value="(.+?)">').findall(html)[0]
        data = {'op': 'download1', 'method_free': '1', 'usr_login': '', 'id': media_id, 'fname': filename}
        data.update(captcha_lib.do_captcha(html))
        html = self.net.http_POST(resp.get_url(), data).content

        # find packed javascript embed code
        r = re.search('(eval.*?)\s*</script>', html, re.DOTALL)
        if r:
            packed_data = r.group(1)
        else:
            raise UrlResolver.ResolverError('packed javascript embed code not found')

        try: decrypted_data = jsunpack.unpack(packed_data)
        except: pass
        decrypted_data = decrypted_data.replace('\\', '')
        # First checks for a flv url, then the if statement is for the avi url
        r = re.search('[\'"]file[\'"]\s*,\s*[\'"]([^\'"]+)', decrypted_data)
        if not r:
            r = re.search('src="(.+?)"', decrypted_data)
        if r:
            stream_url = r.group(1)
        else:
            raise UrlResolver.ResolverError('stream url not found')

        return stream_url
Example #21
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'Referer': web_url, 'User-Agent': common.FF_USER_AGENT}

        player_headers = {'Cookie': 'PHPSESSID=1', 'Referer': 'http://static.cda.pl/flowplayer/flash/flowplayer.commercial-3.2.18.swf'}
        player_headers.update(headers)

        html = self.net.http_GET(web_url, headers=headers).content
        try: html = html.encode('utf-8')
        except: pass
        match = re.findall('data-quality="(.*?)" href="(.*?)".*?>(.*?)</a>', html, re.DOTALL)
        if match:
            mylinks = sorted(match, key=lambda x: x[2])
            html = self.net.http_GET(mylinks[-1][1], headers=headers).content
            
        from HTMLParser import HTMLParser
        match = re.search('''['"]file['"]:\s*['"](.+?)['"]''', HTMLParser().unescape(html))
        if match:
            mylink = match.group(1).replace("\\", "")
            return self.__check_vid(mylink) + helpers.append_headers(player_headers)

        html = jsunpack.unpack(re.search("eval(.*?)\{\}\)\)", html, re.DOTALL).group(1))
        match = re.search('src="(.*?\.mp4)"', html)
        if match:
            return self.__check_vid(match.group(1)) + helpers.append_headers(player_headers)

        raise ResolverError('Video Link 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
        
        tries = 0
        while tries < MAX_TRIES:
            data = {}
            for match in re.finditer('input type="hidden" name="([^"]+)" value="([^"]+)', html):
                key, value = match.groups()
                data[key] = value
            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 UrlResolver.ResolverError('Unable to resolve kingfiles link. Filelink not found.')
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
    logger.info("ay8ou8ohth get_video_url(page_url='%s')" % page_url)

    data = ''
    patron_new_url = '<iframe\s+src\s*=\s*"([^"]+)'

    while page_url != "":
        headers = [
            ['User-Agent', 'Mozilla/5.0 (Windows NT 6.1; rv:39.0) Gecko/20100101 Firefox/39.0'],
            ['Accept-Encoding', 'gzip, deflate'],
            ['Referer', page_url]
        ]
        data = scrapertools.cache_page(page_url, headers=headers)
        page_url = scrapertools.find_single_match(data, patron_new_url)
        page_url = re.sub("\n|\r|\t", "", page_url)

    media_url = scrapertools.find_single_match(data, 'file\s*:\s*"([^"]+)')
    if media_url == '':
        data = scrapertools.find_single_match(data, '(eval\(function.*?)</script>')
        data = jsunpack.unpack(data)
        media_url = scrapertools.find_single_match(data, 'file\s*:\s*"([^"]+)')
    video_urls = [[scrapertools.get_filename_from_url(media_url)[-4:] + " [ay8ou8ohth]", media_url + '|' + urllib.urlencode(dict(headers))]]

    for video_url in video_urls:
        logger.info("[ay8ou8ohth.py] %s - %s" % (video_url[0], video_url[1]))

    return video_urls
    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 = {}
            for match in re.finditer(r'type="hidden"\s+name="(.+?)"\s+value="(.*?)"', html):
                key, value = match.groups()
                data[key] = value
            data["method_free"] = "Free Download"

            html = self.net.http_POST(web_url, form_data=data).content

            for match in re.finditer("(eval\(function.*?)</script>", html, re.DOTALL):
                js_data = jsunpack.unpack(match.group(1))
                js_data = js_data.replace("\\'", "'")

                match2 = re.search("\"html5\".*?file\s*:\s*'([^']+)", js_data)
                if match2:
                    stream_url = match2.group(1)
                    return stream_url

            tries += 1

        raise UrlResolver.ResolverError("Unable to resolve 24uploading 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
        form_values = {}
        stream_url = None
        for i in re.finditer('<input type="hidden" name="(.*?)" value="(.*?)"', html):
            form_values[i.group(1)] = i.group(2)
        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 UrlResolver.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 UrlResolver.ResolverError('Unable to resolve Mightyupload link. Filelink not found.')

            stream_url = r.group(1)

        if stream_url:
            return stream_url + '|User-Agent=%s' % (common.IE_USER_AGENT)
        else:
            raise UrlResolver.ResolverError('Unable to resolve link')
    def get_media_url(self, host, media_id):
        try:
            url = self.get_url(host, media_id)
            html = self.net.http_GET(url).content
            dialog = xbmcgui.DialogProgress()
            dialog.create('Resolving', 'Resolving Hugefiles Link...')       
            dialog.update(0)
    
            data = {}
            r = re.findall(r'type="hidden" name="(.+?)"\s* value="?(.+?)">', html)
            for name, value in r:
                data[name] = value
                data.update({'method_free':'Free Download'})
            html = net.http_POST(url, data).content
    
            dialog.update(50)
    
            sPattern = '''<div id="player_code">.*?<script type='text/javascript'>(eval.+?)</script>'''
            r = re.search(sPattern, html, re.DOTALL + re.IGNORECASE)
    
            if r:
                sJavascript = r.group(1)
                sUnpacked = jsunpack.unpack(sJavascript)
                sPattern  = '<embed id="np_vid"type="video/divx"src="(.+?)'
                sPattern += '"custommode='
                r = re.search(sPattern, sUnpacked)
                if r:
                    dialog.update(100)
                    dialog.close()
                    return r.group(1)

        except Exception, e:
            common.addon.log('**** Hugefiles Error occured: %s' % e)
            common.addon.show_small_popup('Error', str(e), 5000, '')
            return False
 def get_media_url(self, host, media_id):
     url = self.get_url(host, media_id)
     html = self.net.http_GET(url).content
     r = re.findall('<center><h3>File Not Found</h3></center><br>', html, re.I)
     if r:
         raise UrlResolver.ResolverError('File Not Found or removed')
     if not r:
         data = {}
         r = re.findall(r'type="hidden" name="(.+?)"\s* value="?(.+?)">', html)
         for name, value in r:
             data[name] = value
             data['method_free'] = 'Wait for 0 seconds'
         
     html = self.net.http_POST(url, data).content
     
     sPattern = '<script type=(?:"|\')text/javascript(?:"|\')>(eval\('
     sPattern += 'function\(p,a,c,k,e,d\)(?!.+player_ads.+).+np_vid.+?)'
     sPattern += '\s+?</script>'
     r = re.search(sPattern, html, re.DOTALL + re.IGNORECASE)
     if r:
         sJavascript = r.group(1)
         sUnpacked = jsunpack.unpack(sJavascript)
         sPattern = '<embed id="np_vid"type="video/divx"src="(.+?)'
         sPattern += '"custommode='
         r = re.search(sPattern, sUnpacked)
         if r:
             return r.group(1)
     else:
         num = re.compile('cyberlocker\|(.+?)\|http').findall(html)
         pre = 'http://'+num[0]+'.cyberlocker.ch:182/d/'
         preb = re.compile('image\|(.+?)\|video\|(.+?)\|').findall(html)
         for ext, link in preb:
             r = pre+link+'/video.'+ext
             return r
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
    logger.info("[speedvid.py] url=" + page_url)
    video_urls = []

    data = scrapertools.cache_page(page_url, headers=headers)

    time.sleep(5)

    post_url = re.findall('Form method="POST" action=\'(.*)\'', data)[0]
    post_selected = re.findall('Form method="POST" action=(.*)</Form>', data, re.DOTALL)[0]

    post_data = 'op=%s&usr_login=%s&id=%s&fname=%s&referer=%s&hash=%s&imhuman=Proceed+to+video' % (
        re.findall('input type="hidden" name="op" value="(.*)"', post_selected)[0],
        re.findall('input type="hidden" name="usr_login" value="(.*)"', post_selected)[0],
        re.findall('input type="hidden" name="id" value="(.*)"', post_selected)[0],
        re.findall('input type="hidden" name="fname" value="(.*)"', post_selected)[0],
        re.findall('input type="hidden" name="referer" value="(.*)"', post_selected)[0],
        re.findall('input type="hidden" name="hash" value="(.*)"', post_selected)[0])

    headers.append(['Referer', page_url])
    data = scrapertools.cache_page(post_url, post=post_data, headers=headers)

    data = scrapertools.find_single_match(data, "(eval.function.p,a,c,k,e,.*?)\s*</script>")

    if data != "":
        from lib import jsunpack
        data = jsunpack.unpack(data)

        # URL del vídeo
        url = re.findall('file:\s*"([^"]+)"', data)[0]

        video_urls.append([scrapertools.get_filename_from_url(url)[-4:] + " [speedvid]", url])

    return video_urls
Example #29
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        response = self.net.http_GET(web_url)
        html = response.content

        if html:
            packed = re.search('(eval\(function.*?)\s*</script>', html, re.DOTALL)
            if packed:
                js = jsunpack.unpack(packed.group(1))
            else:
                js = html

            video_url = None

            link = re.search('([^"]*.m3u8)', js)
            if link:
                video_url = link.group(1)
                common.log_utils.log_debug('watchers.to Link Found: %s' % video_url)

            if video_url == None:
                link = re.search('([^"]*.mp4)', js)
                if link:
                    video_url = link.group(1)
                    common.log_utils.log_debug('watchers.to Link Found: %s' % video_url)

            if video_url != None:
                return video_url + '|Referer=http://watchers.to/player7/jwplayer.flash.swf'
            else:
                raise ResolverError('No playable video found.')
    def get_media_url(self, host, media_id):
        url = self.get_url(host, media_id)
        html = http_get(url)

        data = {}
        r = re.findall(r'type="(?:hidden|submit)?" name="((?!(?:.+premium)).+?)"\s* value="?(.+?)">', html)
        for name, value in r:
            data[name] = value

        html = http_post(url, data)

        sPattern = '<script type=(?:"|\')text/javascript(?:"|\')>(eval\('
        sPattern += 'function\(p,a,c,k,e,d\)(?!.+player_ads.+).+np_vid.+?)'
        sPattern += '\s+?</script>'
        r = re.search(sPattern, html, re.DOTALL + re.IGNORECASE)
        if r:
            sJavascript = r.group(1)
            sUnpacked = jsunpack.unpack(sJavascript)
            sPattern = '<embed id="np_vid"type="video/divx"src="(.+?)'
            sPattern += '"custommode='
            r = re.search(sPattern, sUnpacked)
            if r:
                return r.group(1)

        else:
            fold = re.compile('l\/([0-9])\/k').findall(html)
            pre = 'http://s6.entroupload.com/files/' + fold[0] + '/'
            preb = re.compile('image(?:\|)?\|(.+?)\|(.+?)\|files').findall(html)
            for ext, link in preb:
                r = pre + link + '/video.' + ext
                return r
Example #31
0
def get_video_url(page_url,
                  premium=False,
                  user="",
                  password="",
                  video_password=""):
    logger.info("(page_url='%s')" % page_url)
    data = httptools.downloadpage(page_url, headers=headers).data
    packer = scrapertools.find_single_match(
        data,
        "<script type='text/javascript'>(eval.function.p,a,c,k,e,d..*?)</script>"
    )
    if packer != "":
        data = jsunpack.unpack(packer)

    data = re.sub(r'\n|\t|\s+', '', data)
    host = scrapertools.find_single_match(data, '\[\{image:"(http://[^/]+/)')
    mediaurl = scrapertools.find_single_match(data, ',\{file:"([^"]+)"')
    if not mediaurl.startswith(host):
        mediaurl = host + mediaurl

    rtmp_url = scrapertools.find_single_match(data, 'file:"(rtmp[^"]+)"')
    playpath = scrapertools.find_single_match(rtmp_url, 'mp4:.*$')
    rtmp_url = rtmp_url.split(
        playpath
    )[0] + " playpath=" + playpath + " swfUrl=http://gamovideo.com/player61/jwplayer.flash.swf"

    video_urls = []
    video_urls.append(["RTMP [gamovideo]", rtmp_url])
    video_urls.append([
        scrapertools.get_filename_from_url(mediaurl)[-4:] + " [gamovideo]",
        mediaurl
    ])

    for video_url in video_urls:
        logger.info("%s - %s" % (video_url[0], video_url[1]))

    return video_urls
Example #32
0
def get_video_url(page_url,
                  premium=False,
                  user="",
                  password="",
                  video_password=""):
    # import web_pdb; web_pdb.set_trace()
    logger.info("[wstream.py] url=" + page_url)
    video_urls = []

    data = httptools.downloadpage(page_url, headers=headers).data.replace(
        'https', 'http')
    # logger.info("[wstream.py] data=" + data)
    vid = scrapertools.find_multiple_matches(
        data, 'download_video.*?>.*?<.*?<td>([^\,,\s]+)')

    headers.append(['Referer', page_url])
    post_data = scrapertools.find_single_match(
        data,
        "</div>\s*<script type='text/javascript'>(eval.function.p,a,c,k,e,.*?)\s*</script>"
    )
    if post_data != "":
        from lib import jsunpack
        data = jsunpack.unpack(post_data)

    media_url = scrapertools.find_multiple_matches(data, '(http.*?\.mp4)')
    _headers = urllib.urlencode(dict(headers))
    i = 0

    for media_url in media_url:
        video_urls.append(
            [vid[i] + " mp4 [wstream] ", media_url + '|' + _headers])
        i = i + 1

    for video_url in video_urls:
        logger.info("[wstream.py] %s - %s" % (video_url[0], video_url[1]))

    return video_urls
Example #33
0
def get_video_url(page_url, url_referer=''):
    logger.info("url=" + page_url)
    video_urls = []

    resp = httptools.downloadpage(page_url)

    if not resp.sucess or "Not Found" in resp.data or "File was deleted" in resp.data or "is no longer available" in resp.data:
        return 'El fichero no existe o ha sido borrado'

    unpacked = ""
    data = resp.data
    # ~ logger.debug(data)

    packed = scrapertools.find_single_match(data,
                                            "function\(p,a,c,k.*?</script>")
    if packed:
        unpacked = jsunpack.unpack(packed)
        # ~ logger.debug(unpacked)

    media_url = scrapertools.find_single_match(unpacked, 'src"value="([^"]+)')
    if not media_url:
        id_ = page_url.rsplit("/", 1)[1]
        rand = scrapertools.find_single_match(data,
                                              'name="rand" value="([^"]+)"')
        post = "op=download2&id=%s&rand=%s&referer=%s&method_free=&method_premium=" % (
            id_, rand, page_url)
        data = httptools.downloadpage(page_url, post).data
        # ~ logger.debug(data)
        media_url = scrapertools.find_single_match(
            data, '<div id="dl_link".*?<a href="([^"]+)"')

    if not media_url: return []

    ext = scrapertools.get_filename_from_url(media_url)[-4:]
    video_urls.append([ext, media_url])

    return video_urls
Example #34
0
class XvidstageResolver(Plugin, UrlResolver, PluginSettings):
    implements = [UrlResolver, PluginSettings]
    name = "xvidstage"

    def __init__(self):
        p = self.get_setting('priority') or 100
        self.priority = int(p)
        self.net = Net()
        self.pattern ='http://((?:www.)?xvidstage.com)/([0-9A-Za-z]+)'
        # http://xvidstage.com/59reflvbp02z

    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)

        try:
            html = self.net.http_GET(web_url).content
        except urllib2.URLError, e:
            common.addon.log_error(self.name + ': got http error %d fetching %s' %
                                    (e.code, web_url))
            return False
# removed check.
# get url from packed javascript
        sPattern = "src='http://xvidstage.com/player/swfobject.js'></script>.+?<script type='text/javascript'>eval.*?return p}\((.*?)</script>"# Modded
        r = re.search(sPattern, html, re.DOTALL + re.IGNORECASE)
        print r.groups()
        if r:
            sJavascript = r.group(1)
            sUnpacked = jsunpack.unpack(sJavascript)
            print sUnpacked
            sPattern = "'file','(.+?)'"#modded
            r = re.search(sPattern, sUnpacked)
            print r.groups()
            if r:
                return r.group(1)


        return False
Example #35
0
def get_video_url(page_url,
                  premium=False,
                  user="",
                  password="",
                  video_password=""):
    logger.info("url = " + page_url)
    headers = {"Referer": page_url}
    data = httptools.downloadpage(page_url, headers=headers).data
    flowplayer = re.search("url: [\"']([^\"']+)", data)
    if flowplayer:
        return [["FLV", flowplayer.group(1)]]
    video_urls = []
    try:
        jsUnpack = jsunpack.unpack(data)
        logger.debug(jsUnpack)
        fields = re.search("\[([^\]]+).*?parseInt\(value\)-(\d+)", jsUnpack)
        if fields:
            logger.debug("Values: " + fields.group(1))
            logger.debug("Substract: " + fields.group(2))
            substract = int(fields.group(2))
            arrayResult = [
                chr(int(value) - substract)
                for value in fields.group(1).split(",")
            ]
            strResult = "".join(arrayResult)
            logger.debug(strResult)
            videoSources = re.findall(
                "<source[\s]+src=[\"'](?P<url>[^\"']+)[^>]+label=[\"'](?P<label>[^\"']+)",
                strResult)
            for url, label in videoSources:
                url += "|Referer=%s" % page_url
                video_urls.append([label, url])
            video_urls.sort(key=lambda i: int(i[0].replace("p", "")))
    except:
        url = scrapertools.find_single_match(data, '<source src="([^"]+)')
        video_urls.append(["MP4", url])
    return video_urls
Example #36
0
def get_video_url(page_url,
                  premium=False,
                  user="",
                  password="",
                  video_password=""):
    logger.info("(page_url='%s')" % page_url)

    referer = page_url.replace('iframe', 'preview')
    data = httptools.downloadpage(page_url, headers={'Referer': referer}).data
    _0xd003 = scrapertools.find_single_match(data,
                                             'var _0x[0-f]+=(\[[^;]+\]);')
    # `forShift` and `forIndex` for Class S ----------------
    regex = ";\}\([^,]+,([^\)]+)\)\);"
    forShift = int(scrapertools.find_single_match(data, regex), 16)

    regex = "new _0x[^\(]+\(_0x[^\(]+(\(.*?\))\);"
    lineKey = scrapertools.find_single_match(data, regex)

    regex = "\(\s*'([^']+)'\s*,\s*'([^']+)'\s*\)\s*([\+,]*)"
    forIndex = scrapertools.find_multiple_matches(lineKey, regex)
    # ------------------------------------------------------
    packed = scrapertools.find_single_match(
        data, "<script type=[\"']text/javascript[\"']>(eval.*?)</script>")
    unpacked = jsunpack.unpack(packed)

    video_urls = []
    url = scrapertools.find_single_match(unpacked, '(http[^,]+\.mp4)')

    video_urls.append(
        [".mp4" + " [streamplay]",
         S(_0xd003, forShift, forIndex).decode(url)])

    video_urls.sort(key=lambda x: x[0], reverse=True)
    for video_url in video_urls:
        logger.info("%s - %s" % (video_url[0], video_url[1]))

    return video_urls
Example #37
0
    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        headers = {'Referer': web_url, 'User-Agent': common.FF_USER_AGENT}

        player_headers = {
            'Cookie':
            'PHPSESSID=1',
            'Referer':
            'http://static.cda.pl/flowplayer/flash/flowplayer.commercial-3.2.18.swf'
        }
        player_headers.update(headers)

        html = self.net.http_GET(web_url, headers=headers).content
        try:
            html = html.encode('utf-8')
        except:
            pass
        match = re.findall('data-quality="(.*?)" href="(.*?)".*?>(.*?)</a>',
                           html, re.DOTALL)
        if match:
            mylinks = sorted(match, key=lambda x: x[2])
            html = self.net.http_GET(mylinks[-1][1], headers=headers).content

        match = re.search('''['"]file['"]:['"](.*?\.mp4)['"]''', html)
        if match:
            mylink = match.group(1).replace("\\", "")
            return self.__check_vid(mylink) + helpers.append_headers(
                player_headers)

        html = jsunpack.unpack(
            re.search("eval(.*?)\{\}\)\)", html, re.DOTALL).group(1))
        match = re.search('src="(.*?\.mp4)"', html)
        if match:
            return self.__check_vid(
                match.group(1)) + helpers.append_headers(player_headers)

        raise ResolverError('Video Link Not Found')
Example #38
0
def swzz_get_url(item):
    headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:59.0) Gecko/20100101 Firefox/59.0'}

    if "/link/" in item.url:
        data = httptools.downloadpage(item.url, headers=headers).data
        if "link =" in data:
            data = scrapertoolsV2.find_single_match(data, 'link = "([^"]+)"')
            if 'http' not in data:
                data = 'https:' + data
        else:
            match = scrapertoolsV2.find_single_match(data, r'<meta name="og:url" content="([^"]+)"')
            match = scrapertoolsV2.find_single_match(data, r'URL=([^"]+)">') if not match else match

            if not match:
                from lib import jsunpack

                try:
                    data = scrapertoolsV2.find_single_match(data.replace('\n', ''), r"(eval\s?\(function\(p,a,c,k,e,d.*?)</script>")
                    data = jsunpack.unpack(data)

                    logger.debug("##### play /link/ unpack ##\n%s\n##" % data)
                except:
                    logger.debug("##### The content is yet unpacked ##\n%s\n##" % data)

                data = scrapertoolsV2.find_single_match(data, r'var link(?:\s)?=(?:\s)?"([^"]+)";')
                data, c = unshortenit.unwrap_30x_only(data)
            else:
                data = match
        if data.startswith('/'):
            data = urlparse.urljoin("http://swzz.xyz", data)
            if not "vcrypt" in data:
                data = httptools.downloadpage(data).data
        logger.debug("##### play /link/ data ##\n%s\n##" % data)
    else:
        data = item.url

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

        try:
            html = self.net.http_GET(web_url).content
            form_values = {}
            for i in re.finditer(
                    '<input type="hidden" name="(.*?)" value="(.*?)"', html):
                form_values[i.group(1)] = i.group(2)
            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 Exception(
                    'Unable to resolve Mightyupload link. Player config not found.'
                )
            r_temp = re.search("file: '([^']+)'", r.group(1))
            if r_temp:
                return r_temp.group(1)
            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 Exception(
                    'Unable to resolve Mightyupload link. Filelink not found.')
            return r.group(1)

        except urllib2.URLError, e:
            common.addon.log_error(self.name +
                                   ': got http error %d fetching %s' %
                                   (e.code, web_url))
            return self.unresolvable(code=3, msg='Exception: %s' % e)
Example #40
0
    def get_media_url(self, host, media_id):
        try:
            url = self.get_url(host, media_id)
            html = self.net.http_GET(url).content
            dialog = xbmcgui.DialogProgress()
            dialog.create('Resolving', 'Resolving Sharerepo Link...')       
            dialog.update(0)

            data = {}
            r = re.findall(r'type="(?:hidden|submit)?" name="(.+?)"\s* value="?(.+?)">', html)
            for name, value in r:
                data[name] = value
                
            html = net.http_POST(url, data).content
    
            dialog.update(50)
    
            sPattern = '''<div id="player_code">.*?<script type='text/javascript'>(eval.+?)</script>'''
            r = re.search(sPattern, html, re.DOTALL + re.IGNORECASE)
            
            if r:
                sJavascript = r.group(1)
                sUnpacked = jsunpack.unpack(sJavascript)
                sPattern  = '''("video/divx"src="|addVariable\('file',')(.+?)video[.]'''
                r = re.search(sPattern, sUnpacked)              
                if r:
                    link = r.group(2) + fname
                    dialog.close()
                    return link
                raise Exception ('File Not Found or removed')
            raise Exception ('File Not Found or removed')

        except urllib2.URLError, e:
            common.addon.log_error(self.name + ': got http error %d fetching %s' %
                                   (e.code, web_url))
            common.addon.show_small_popup('Error','Http error: '+str(e), 8000, error_logo)
            return self.unresolvable(code=3, msg=e)
Example #41
0
def get_video_url(page_url,
                  premium=False,
                  user="",
                  password="",
                  video_password=""):
    logger.info("(page_url='%s')" % page_url)

    data = httptools.downloadpage(page_url).data
    if "p,a,c,k,e,d" in data:
        data = jsunpack.unpack(data).replace("\\", "")
    video_urls = []
    videos = scrapertools.find_multiple_matches(
        data, 'file":"([^"]+)","label":"(.*?)"')
    subtitulo = scrapertools.find_single_match(data,
                                               'tracks:\s*\[{"file":"(.*?)"')
    if "http" not in subtitulo and subtitulo != "":
        subtitulo = "https://rcdn.me" + subtitulo

    for video_url, video_calidad in videos:
        extension = scrapertools.get_filename_from_url(video_url)[-4:]

        video_url = video_url.replace("\\", "")

        if extension not in [".vtt", ".srt"]:
            video_urls.append([
                "%s %s [rcdnme]" % (extension, video_calidad), video_url, 0,
                subtitulo
            ])
    try:
        video_urls.sort(
            key=lambda it: int(it[0].split("p ", 1)[0].rsplit(" ")[1]))
    except:
        pass
    for video_url in video_urls:
        logger.info(" %s - %s" % (video_url[0], video_url[1]))

    return video_urls
Example #42
0
def get_video_url(page_url,
                  premium=False,
                  user="",
                  password="",
                  video_password=""):
    logger.info("(page_url='%s')" % page_url)

    packed = scrapertools.find_single_match(data,
                                            r"'text/javascript'>(eval.*?)\n")
    unpacked = jsunpack.unpack(packed)
    video_urls = []

    video_info = scrapertools.find_multiple_matches(unpacked, r'{(file:.*?)}')
    subtitulo = scrapertools.find_single_match(unpacked,
                                               r'tracks:\s*\[{file:"([^"]+)"')

    for info in video_info:

        video_url = scrapertools.find_single_match(info, r'file:"([^"]+)"')
        label = scrapertools.find_single_match(info, r'label:"([^"]+)"')

        if video_url == subtitulo:
            continue

        extension = scrapertools.get_filename_from_url(video_url)[-4:]
        if extension in (".png", ".jpg"):
            continue
        if extension == ".mpd":
            video_urls.append([
                "%s %s [StreamSB]" % (extension, label), video_url, 0, '',
                "mpd"
            ])
        else:
            video_urls.append(
                ["%s %s [StreamSB]" % (extension, label), video_url])

    return video_urls
Example #43
0
def get_video_url(page_url,
                  premium=False,
                  user="",
                  password="",
                  video_password=""):
    logger.info("url=" + page_url)
    video_urls = []
    data = httptools.downloadpage(page_url).data
    packed = scrapertools.find_single_match(
        data, "text/javascript'>(.*?)\s*</script>")
    unpacked = jsunpack.unpack(packed)
    media_urls = scrapertools.find_multiple_matches(unpacked, 'file:"([^"]+)"')
    for media_url in media_urls:
        media_url += "|Referer=%s" % page_url
        if ".png" in media_url:
            continue
        ext = "mp4"
        if "m3u8" in media_url:
            ext = "m3u8"
        video_urls.append(["%s [watchvideo]" % (ext), media_url])
    video_urls.reverse()
    for video_url in video_urls:
        logger.info("%s - %s" % (video_url[0], video_url[1]))
    return video_urls
Example #44
0
def get_video_url(page_url,
                  premium=False,
                  user="",
                  password="",
                  video_password=""):
    logger.info("url=" + page_url)

    data = scrapertools.cache_page(page_url)

    video_urls = []
    media_urls = scrapertools.find_multiple_matches(
        data, '\{file\:"([^"]+)",label\:"([^"]+)"\}')
    if len(media_urls) > 0:
        for media_url, label in media_urls:
            video_urls.append([
                scrapertools.get_filename_from_url(media_url)[-4:] + " (" +
                label + ") [letwatch]", media_url
            ])
    else:
        matches = scrapertools.find_single_match(
            data,
            "<script type='text/javascript'>(eval\(function\(p,a,c,k,e,d.*?)"
            "</script>")
        matchjs = jsunpack.unpack(matches).replace("\\", "")
        media_urls = scrapertools.find_multiple_matches(
            matchjs, '\{file\:"([^"]+)",label\:"([^"]+)"\}')
        for media_url, label in media_urls:
            video_urls.append([
                scrapertools.get_filename_from_url(media_url)[-4:] + " (" +
                label + ") [letwatch]", media_url
            ])

    for video_url in video_urls:
        logger.info("%s - %s" % (video_url[0], video_url[1]))

    return video_urls
Example #45
0
def get_video_url(page_url,
                  premium=False,
                  user="",
                  password="",
                  video_password=""):
    logger.debug("url=" + page_url)
    global data
    video_urls = []
    code = scrapertools.find_single_match(data, 'name="code" value="([^"]+)')
    hash = scrapertools.find_single_match(data, 'name="hash" value="([^"]+)')
    post = "op=download1&code=%s&hash=%s&imhuman=Proceed+to+video" % (code,
                                                                      hash)
    data = httptools.downloadpage("http://vidtome.co/playvideos/%s" % code,
                                  post=post).data
    packed = scrapertools.find_multiple_matches(
        data, r'(eval\s?\(function\(p,a,c,k,e,d\).*?\n)')
    for p in packed:
        data = jsunpack.unpack(p)
        media_url = scrapertools.find_single_match(data,
                                                   r"source:\\'([^\\']+)")
        if media_url:
            video_urls.append(
                [media_url.split('.')[-1] + ' [Vidto.me]', media_url])
    return video_urls
Example #46
0
def get_video_url(page_url,
                  premium=False,
                  user="",
                  password="",
                  video_password=""):
    logger.info("[megadrive.py] get_video_url(page_url='%s')" % page_url)
    video_urls = []

    data = scrapertools.cache_page(page_url)

    data_pack = scrapertools.find_single_match(
        data, "(eval.function.p,a,c,k,e,.*?)\s*</script>")
    if data_pack != "":
        from lib import jsunpack
        data_unpack = jsunpack.unpack(data_pack)
        data = data_unpack

    video_url = scrapertools.find_single_match(data, 'file"?\s*:\s*"([^"]+)",')
    video_urls.append(["[megadrive]", video_url])

    for video_url in video_urls:
        logger.info("[megadrive.py] %s - %s" % (video_url[0], video_url[1]))

    return video_urls
Example #47
0
def get_video_url(page_url,
                  premium=False,
                  user="",
                  password="",
                  video_password=""):
    logger.info()
    itemlist = []

    referer = re.sub(r"embed-|player-", "", page_url)[:-5]

    data = httptools.downloadpage(page_url, headers={'Referer': referer}).data

    if data == "File was deleted":
        return "El archivo no existe o ha sido borrado"

    packed = scrapertools.find_single_match(
        data, "<script type=[\"']text/javascript[\"']>(eval.*?)</script>")
    unpacked = jsunpack.unpack(packed)

    url = scrapertools.find_single_match(unpacked, '(http[^,]+\.mp4)')
    itemlist.append([".mp4" + " [streamplay]", decode_video_url(url)])
    itemlist.sort(key=lambda x: x[0], reverse=True)

    return itemlist
Example #48
0
def findvideos(item):
    logger.info()
    itemlist = []
    data = httptools.downloadpage(item.url).data
    data = re.sub(r'\n|\r|\t|&nbsp;|<br>||<br/>', "", data)
    data = scrapertools.find_single_match(data, 'var videos =(.*?)\}')
    patron = 'src="([^"]+)"'
    matches = re.compile(patron, re.DOTALL).findall(data)
    for url in matches:
        url = url.replace("cloud/index.php", "cloud/query.php")
        if "/player.php" in url:
            data = httptools.downloadpage(url).data
            phantom = scrapertools.find_single_match(
                data, 'Phantom.Start\("(.*?)"\)')
            phantom = phantom.replace('"+"', '')
            import base64
            packed = base64.b64decode(phantom).decode("utf8")
            unpacked = jsunpack.unpack(packed)
            url = scrapertools.find_single_match(unpacked, '"src","([^"]+)"')
            if not url.startswith("https"):
                url = "https:%s" % url
        itemlist.append(
            item.clone(title="%s",
                       url=url,
                       action='play',
                       language='VO',
                       contentTitle=item.contentTitle))
    itemlist = servertools.get_servers_itemlist(itemlist,
                                                lambda x: x.title % x.server)
    # Requerido para FilterTools
    itemlist = filtertools.get_links(itemlist, item, list_language,
                                     list_quality)
    # Requerido para AutoPlay
    autoplay.start(itemlist, item)

    return itemlist
Example #49
0
    def _unshorten_swzz(self, uri):
        try:
            r = httptools.downloadpage(uri)
            if r.url != uri:
                return r.url, r.code
            data = r.data
            if "link =" in data or 'linkId = ' in data:
                uri = scrapertools.find_single_match(data, 'link(?:Id)? = "([^"]+)"')
                if 'http' not in data:
                    uri = 'https:' + uri
            else:
                match = scrapertools.find_single_match(data, r'<meta name="og:url" content="([^"]+)"')
                match = scrapertools.find_single_match(data, r'URL=([^"]+)">') if not match else match

                if not match:
                    from lib import jsunpack

                    try:
                        data = scrapertools.find_single_match(data.replace('\n', ''),
                                                              r"(eval\s?\(function\(p,a,c,k,e,d.*?)</script>")
                        data = jsunpack.unpack(data)

                        logger.debug("##### play /link/ unpack ##\n%s\n##" % data)
                    except:
                        logger.debug("##### The content is yet unpacked ##\n%s\n##" % data)

                    uri = scrapertools.find_single_match(data, r'var link(?:\s)?=(?:\s)?"([^"]+)";')
                else:
                    uri = match
            if uri.startswith('/'):
                uri = "http://swzz.xyz" + uri
                if not "vcrypt" in data:
                    uri = httptools.downloadpage(data).data
            return uri, r.code
        except Exception as e:
            return uri, str(e)
Example #50
0
def get_video_url(page_url,
                  premium=False,
                  user="",
                  password="",
                  video_password=""):
    logger.info("(page_url='%s')" % page_url)
    data = httptools.downloadpage(page_url).data
    post = {}
    r = re.findall(r'type="hidden" name="(.+?)"\s* value="?(.+?)">', data)
    for name, value in r:
        post[name] = value
        post.update({'method_free': 'Free Download'})
    data = httptools.downloadpage(page_url, post=urllib.urlencode(post)).data
    # Get link
    sPattern = '''<div id="player_code">.*?<script type='text/javascript'>(eval.+?)</script>'''
    r = re.findall(sPattern, data, re.DOTALL | re.I)
    mediaurl = ""
    if r:
        sUnpacked = jsunpack.unpack(r[0])
        sUnpacked = sUnpacked.replace("\\'", "")
        r = re.findall('file,(.+?)\)\;s1', sUnpacked)
        if not r:
            r = re.findall('"src"value="(.+?)"/><embed', sUnpacked)

        mediaurl = r[0]

    video_urls = []
    video_urls.append([
        scrapertools.get_filename_from_url(mediaurl)[-4:] + " [hugefiles]",
        mediaurl
    ])

    for video_url in video_urls:
        logger.info("%s - %s" % (video_url[0], video_url[1]))

    return video_urls
Example #51
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

        if 'File was deleted' in html:
            raise ResolverError('File Removed')

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

        packed = re.search('(eval\(function.*?)\s*</script>', html, re.DOTALL)
        if packed:
            js = jsunpack.unpack(packed.group(1))
        else:
            js = html

        link = re.search('file:"(.*?m3u8)"', js)
        #link = re.search('(?:m3u8").*?"(.*?)"', js)
        if link:
            common.log_utils.log_debug('watchvideo.us Link Found: %s' %
                                       link.group(1))
            return link.group(1)

        raise ResolverError('Unable to find watchvideo.us video')
Example #52
0
def get_video_url(page_url,
                  premium=False,
                  user="",
                  password="",
                  video_password=""):
    logger.info("url=%s" % page_url)
    video_urls = []

    data = httptools.downloadpage(page_url).data
    packed = scrapertools.find_single_match(
        data, '(eval\(function\(p,a,c,k,e.*?)</script>').strip()
    unpack = jsunpack.unpack(packed)

    bloque = scrapertools.find_single_match(unpack, 'sources:\[(.*?)\}\]')
    matches = scrapertools.find_multiple_matches(
        bloque, 'file:"([^"]+)"(?:,label:"([^"]+)"|\})')
    for media_url, calidad in matches:
        ext = scrapertools.get_filename_from_url(media_url)[-4:]
        if calidad:
            ext += " " + calidad + "p"
        media_url += "|Referer=%s" % page_url
        video_urls.append([ext + ' [watchers]', media_url])

    return video_urls
Example #53
0
def get_video_url(page_url,
                  premium=False,
                  user="",
                  password="",
                  video_password=""):
    logger.info("(page_url='%s')" % page_url)
    data = re.sub(r"\n|\r|\t|\s{2}", "", httptools.downloadpage(page_url).data)
    match = scrapertools.find_single_match(
        data, "<script type='text/javascript'>(.*?)</script>")
    data = jsunpack.unpack(match)
    data = data.replace("\\'", "'")
    media_url = scrapertools.find_single_match(
        data, '{type:"video/mp4",src:"([^"]+)"}')
    if not media_url:
        media_url = scrapertools.find_single_match(data, '"file":"([^"]+)')
    logger.info("media_url=" + media_url)
    video_urls = list()
    video_urls.append([
        scrapertools.get_filename_from_url(media_url)[-4:] + " [mp4upload]",
        media_url
    ])
    for video_url in video_urls:
        logger.info("%s - %s" % (video_url[0], video_url[1]))
    return video_urls
Example #54
0
def get_video_url(page_url, url_referer=''):
    logger.info("(page_url='%s')" % page_url)
    video_urls = []

    page_url = page_url.replace('http://', 'https://').replace('://www.', '://')
    if 'embed-' not in page_url: page_url = page_url.replace('mp4upload.com/', 'www.mp4upload.com/embed-') + '.html'

    data = httptools.downloadpage(page_url).data
    # ~ logger.debug(data)

    url = scrapertools.find_single_match(data, 'player\.src\("([^"]+)')
    if not url:
        packed = scrapertools.find_single_match(data, "<script type=[\"']text/javascript[\"']>(eval.*?)</script>")
        if packed:
            unpacked = jsunpack.unpack(packed)
            # ~ logger.debug(unpacked)
            url = scrapertools.find_single_match(unpacked, 'player\.src\("([^"]+)')

    if url:
        # ~ video_urls.append(['mp4', url])
        # ~ ERROR: CCurlFile::Stat - Failed: Peer certificate cannot be authenticated with given CA certificates(60)
        video_urls.append(['mp4', url+'|verifypeer=false'])

    return video_urls
Example #55
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
     js = jsunpack.unpack(html).split(';')
     try:
         charcodes = [
             int(val)
             for val in js[1].split('=')[-1].replace('[', '').replace(
                 ']', '').split(',')
         ]
         sub = int(''.join(char for char in js[2].split('-')[1]
                           if char.isdigit()))
     except IndexError:
         raise ResolverError('Video not found')
     charcodes = [val - sub for val in charcodes]
     try:
         srcs = ''.join(map(unichr, charcodes))
     except ValueError:
         raise ResolverError('Video not found')
     source_list = helpers.scrape_sources(srcs)
     source = helpers.pick_source(source_list)
     print "source", source
     return source  #+ helpers.append_headers(headers)
Example #56
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 #57
0
def get_video_url(page_url, url_referer=''):
    logger.info("(page_url='%s')" % page_url)
    video_urls = []

    data = httptools.downloadpage(page_url).data
    # ~ logger.debug(data)

    if "File Not Found" in data or "File was deleted" in data:
        return 'El archivo ya no está presente en el servidor'

    packed = scrapertools.find_single_match(
        data, "text/javascript'>(.*?)\s*</script>")
    if packed:
        unpacked = jsunpack.unpack(packed)
        # ~ logger.debug(unpacked)
        videos = scrapertools.find_multiple_matches(
            unpacked, 'file:"([^"]+).*?label:"([^"]+)')
        for video, label in videos:
            if ".jpg" not in video:
                video_urls.append([label, video])

        video_urls.sort(key=lambda it: int(it[0].replace('p', '')))

    return video_urls
Example #58
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.search('href="([^"]+)', html)
        if r:
            web_url = r.group(1)
            html = self.net.http_GET(web_url).content

            try: html = jsunpack.unpack(re.search('(eval\(function.*?)</script>', html, re.DOTALL).group(1))
            except: pass

            best = 0
            best_link = ''

            for stream in re.findall('file\s*:\s*"(http.*?)"\s*,\s*label\s*:\s*"(\d+)', html, re.DOTALL):
                if int(stream[1]) > best:
                    best = int(stream[1])
                    best_link = stream[0]

        if best_link:
            return best_link
        else:
            raise ResolverError('Unable to resolve Flashx link. Filelink not found.')
Example #59
0
    def __get_link(self, web_url, media_id, headers):
        html = self.net.http_GET(web_url, headers=headers).content
        data = {}
        r = re.findall(r'type="hidden"\s*name="([^"]+)"\s*value="([^"]+)', html)
        for name, value in r:
            data[name] = value
        data['imhuman'] = 'Proceed+to+video'
        url = 'http://www.flashx.tv/dl?%s' % (media_id)
        xbmc.sleep(6000)
        html = self.net.http_POST(url, form_data=data, headers=headers).content
        
        best = 0
        best_link = ''
        for packed in re.findall("<script[^>]*>(eval\(function.*?)</script>", html, re.DOTALL):
            unpacked = jsunpack.unpack(packed)
            for stream in re.findall('file\s*:\s*"(http.*?)"\s*,\s*label\s*:\s*"(\d+)', unpacked, re.DOTALL):
                if int(stream[1]) > best:
                    best = int(stream[1])
                    best_link = stream[0]

        if best_link:
            return best_link
        else:
            raise UrlResolver.ResolverError('Unable to resolve Flashx link. Filelink not found.')
Example #60
0
def get_video_url(page_url,
                  premium=False,
                  user="",
                  password="",
                  video_password=""):
    logger.info("url=" + page_url)
    video_urls = []
    global data
    # data = httptools.downloadpage(page_url, use_requests=True, verify=False).data
    data = re.sub(r'"|\n|\r|\t|&nbsp;|<br>|\s{2,}', "", data)
    logger.info('GOUN DATA= ' + data)
    packed_data = scrapertools.find_single_match(
        data, "javascript'>(eval.*?)</script>")
    unpacked = jsunpack.unpack(packed_data)
    logger.info('GOUN DATA= ' + unpacked)
    patron = r"sources..([^\]]+)"
    matches = re.compile(patron, re.DOTALL).findall(unpacked)
    if not matches:
        patron = r'src:([^,]+),'
        matches = re.compile(patron, re.DOTALL).findall(unpacked)
    for url in matches:
        url += "|Referer=%s" % page_url
        video_urls.append(['mp4 [Go Unlimited]', url])
    return video_urls