Пример #1
0
def ResolveUrl(url):
    link = False
    try:
        result = cloudflare.source(url)
        matches = re.compile(
            '<div id="embed_code".+?<iframe.+?src=["|\'](.*?)["|\'].+?<\/iframe><\/div>',
            re.I + re.M + re.U + re.S).findall(result)
        url = matches[0]
        if url.find('//') == 0:
            url = 'http:{0}'.format(url)
        if "divxpress" in url:
            html = common.OPEN_URL(url)
            matches = re.compile(
                'input type="hidden" name="(.*?)" value="(.*?)"',
                re.I + re.M + re.U + re.S).findall(html)
            user_data = {}
            for match in matches:
                user_data[match[0]] = match[1]
            html = common.OPEN_URL(url, user_data=user_data)
            matches = re.compile(
                "<div id=\"player_code\"><script type='text/javascript'>(.*?)</script></div>",
                re.I + re.M + re.U + re.S).findall(html)
            unpack = jsunpack.unpack(matches[0])
            matches = re.compile('"src"value="(.*?)"',
                                 re.I + re.M + re.U + re.S).findall(unpack)
            link = "{0}|User-Agent={1}&Referer={2}".format(
                matches[0],
                'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3',
                url)
        elif "vidzi" in url:
            html = common.OPEN_URL(url)
            matches = re.compile(
                "<script type='text/javascript'>(.*?)</script>",
                re.I + re.M + re.U + re.S).findall(html)
            unpack = jsunpack.unpack(matches[0])
            matches = re.compile('file\s*:\s*"([^"]+)',
                                 re.I + re.M + re.U + re.S).findall(unpack)
            link = "{0}|Referer=http://vidzi.me/nplayer/jwplayer.flash.swf".format(
                matches[0])
        elif "uptostream" in url:
            html = common.OPEN_URL(url)
            matches = re.compile("source src='(.+?)'").findall(html)
            link = "{0}".format(matches[-1])
            matches = re.compile("subtitles' src='(.+?)'").findall(html)
            subtitles = matches[0] if len(matches) > 0 else ''
            link = "{0};;{1}".format('http:' + link, 'http:' + subtitles)

        else:
            if "movreel" in url:
                url = url.replace("/embed-", "/")
            elif "openload" in url:
                url = url.replace(".co", ".io")
                xbmc.log(str(url) + ">>>>>>>" * 40)
            item = urlresolver.HostedMediaFile(url)
            xbmc.log(str(item) + "?????????" * 40)
            link = urlresolver.resolve(item.get_url())
            xbmc.log(str(link) + "<<<<" * 40)
    except Exception, e:
        print e
Пример #2
0
def ResolveUrl(url):
    link = False
    try:
        result = cloudflare.source(url)
        matches = re.compile(
            common.Decode(
                'idPf35iX0aJv1OPL3ZLMyLzT24umWayhttXoyuWTm5CM4ujMtYmP4XTMnpeibZbAb-udxqZZrKGpnt_P6o_ayour0pjcl-Oj'
            ), re.I + re.M + re.U + re.S).findall(result)
        url = matches[0]
        if url.find('//') == 0:
            url = 'http:{0}'.format(url)
        if "divxpress" in url:
            html = common.OPEN_URL(url)
            matches = re.compile(
                'input type="hidden" name="(.*?)" value="(.*?)"',
                re.I + re.M + re.U + re.S).findall(html)
            user_data = {}
            for match in matches:
                user_data[match[0]] = match[1]
            html = common.OPEN_URL(url, user_data=user_data)
            matches = re.compile(
                "<div id=\"player_code\"><script type='text/javascript'>(.*?)</script></div>",
                re.I + re.M + re.U + re.S).findall(html)
            unpack = jsunpack.unpack(matches[0])
            matches = re.compile('"src"value="(.*?)"',
                                 re.I + re.M + re.U + re.S).findall(unpack)
            link = "{0}|User-Agent={1}&Referer={2}".format(
                matches[0], common.GetUA(), url)
        elif "vidzi" in url:
            html = common.OPEN_URL(url)
            matches = re.compile(
                "<script type='text/javascript'>(.*?)</script>",
                re.I + re.M + re.U + re.S).findall(html)
            unpack = jsunpack.unpack(matches[0])
            matches = re.compile('file\s*:\s*"([^"]+)',
                                 re.I + re.M + re.U + re.S).findall(unpack)
            link = "{0}|Referer=http://vidzi.tv/nplayer/jwplayer.flash.swf".format(
                matches[0])
        elif "uptostream" in url:
            html = common.OPEN_URL(url)
            matches = re.compile("source src='(.+?)'").findall(html)
            link = "{0}".format(matches[-1])
            matches = re.compile("subtitles' src='(.+?)'").findall(html)
            subtitles = matches[0] if len(matches) > 0 else ''
            link = "{0};;{1}".format(link, subtitles)
        else:
            if "movreel" in url:
                url = url.replace("/embed-", "/")
            #elif "openload" in url:
            #	url = url.replace(".co",".io")
            item = urlresolver.HostedMediaFile(url)
            link = urlresolver.resolve(item.get_url())
    except Exception, e:
        print e
def PLAYLINK(name,url,iconimage):
        link = open_url(url)
        try: url=re.compile('src="(.+?)" allowFullScreen></iframe>').findall(link)[0]
        except: url=re.compile("src='(.+?)' allowFullScreen></iframe>").findall(link)[0]
        ua='|User-Agent=Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36'
        #### THANKS TO LAMBDA ####
        import client
        import jsunpack
        url = urlparse.urlparse(url).query
        url = urlparse.parse_qsl(url)[0][1]
        url = 'http://videomega.tv/cdn.php?ref=%s' % url
        result = client.request(url)
        unpacked = ''
        packed = result.split('\n')
        for i in packed: 
            try: unpacked += jsunpack.unpack(i)
            except: unpacked += i
        result = unpacked
        result = re.sub('\s\s+', ' ', result)
        url = re.compile('"video".+?"src"\s*\,\s*"(.+?)"').findall(result)
        url += client.parseDOM(result, 'source', ret='src', attrs = {'type': 'video.+?'})
        url = url[0]+ua
        #### THANKS TO LAMBDA ####

        ok=True
        liz=xbmcgui.ListItem(name, iconImage=icon,thumbnailImage=icon); liz.setInfo( type="Video", infoLabels={ "Title": name } )
        ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz)
        xbmc.Player ().play(url, liz, False)
Пример #4
0
def _get_encoded_unpaker(content):
    src = ''
    packedMulti = re.compile('eval(.*?)\\{\\}\\)\\)',
                             re.DOTALL).findall(content)
    for packed in packedMulti:
        packed = re.sub('  ', ' ', packed)
        packed = re.sub('\n', '', packed)
        try:
            unpacked = jsunpack.unpack(packed)
        except:
            unpacked = ''
        if unpacked:
            unpacked = re.sub('\\\\', '', unpacked)
            src1 = re.compile('[\'"]*file[\'"]*:\\s*[\'"](.+?)[\'"],',
                              re.DOTALL).search(unpacked)
            src2 = re.compile('[\'"]file[\'"][:\\s]*[\'"](.+?)[\'"]',
                              re.DOTALL).search(unpacked)
            src3 = re.search('[\'"]file[\'"]:[\'"](.*?\\.mp4)[\'"]', unpacked)
            if src1:
                src = src1.group(1)
            elif src2:
                src = src2.group(1)
            elif src3:
                src = src3.group(1) + '.mp4'
            if src:
                break
    return src
Пример #5
0
def resolve(link):

    domain = 'whostreams.net'
    packer = re.compile('(eval\(function\(p,a,c,k,e,(?:r|d).*)')
    clappr = re.compile(
        'new\s+Clappr\.Player\(\{\s*?source:\s*?["\'](.+?)["\']')
    source = re.compile(
        'sources\s*:\s*\[\s*\{\s*(?:type\s*:\s*[\'\"].+?[\'\"],|)src\s*:\s*[\'\"](.+?)[\'\"]'
    )
    ua = {
        'User-Agent':
        'Mozilla/5.0 (Windows NT 6.0; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0',
        'Referer': link
    }
    uStr = 'Mozilla/5.0 (Windows NT 6.0; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0'

    if not 'http' in link: link = 'https:' + link
    page = requests.get(link, headers=ua).text
    packed = packer.findall(page)[0]
    unpacked = jsunpack.unpack(packed)
    try:
        stream = clappr.findall(unpacked)[0]
    except:
        try:
            stream = source.findall(unpacked)[0]
        except IndexError:
            stream = 'NONE'
    if not 'NONE' in stream:
        stream += '|User-Agent={ua}&Referer={ref}'.format(ua=uStr, ref=link)
        return stream
Пример #6
0
def resolve_xvidstage(url):

    try:
        #Show dialog box so user knows something is happening
        dialog = xbmcgui.DialogProgress()
        dialog.create('Resolving', 'Resolving XvidStage Link...')       
        dialog.update(0)
        
      
        url = url.replace('/embed-', '/')
        url = re.compile('//.+?/([\w]+)').findall(url)[0]
        url = 'http://xvidstage.com/embed-%s.html' % url      

        addon.log('XvidStage - Requesting GET URL: %s' % url)        
        html = net.http_GET(url).content
        dialog.update(100)
        
        result = re.compile('(eval.*?\)\)\))').findall(html)[-1]
        if result:
            sJavascript = result
            sUnpacked = jsunpack.unpack(sJavascript)
            sPattern = "'file','(.+?)'"
            r = re.search(sPattern, sUnpacked)
            if r:
                return r.group(1)
            else:
                raise Exception("Unable to find final link")
        else:
            raise Exception("Unable to find final link")                

    except Exception, e:
        addon.log_error('**** XvidStage Error occured: %s' % e)
        raise
Пример #7
0
def ResolveUrl(url):
	link = False
	try:
		result=common.OPEN_URL(url)
		matches=re.compile('<div id="embed_code".+?<iframe.+?src=["|\'](.*?)["|\'].+?<\/iframe><\/div>',re.I+re.M+re.U+re.S).findall(result)
		url = matches[0]
		print "Link URL: " + url 
		if "divxpress" in url:
			html = common.OPEN_URL(url)
			matches = re.compile('input type="hidden" name="(.*?)" value="(.*?)"', re.I+re.M+re.U+re.S).findall(html)
			user_data = {}
			for match in matches:
				user_data[match[0]] = match[1]
			html = common.OPEN_URL(url, user_data=user_data)
			matches = re.compile("<div id=\"player_code\"><script type='text/javascript'>(.*?)</script></div>", re.I+re.M+re.U+re.S).findall(html)
			unpack = jsunpack.unpack(matches[0])
			matches = re.compile('"src"value="(.*?)"', re.I+re.M+re.U+re.S).findall(unpack)
			link = "{0}|User-Agent={1}&Referer={2}".format(matches[0], common.GetUA(), url)
		else:
			if "movreel" in url:
				url = url.replace("/embed-","/")
			#elif "openload" in url:
			#	url = url.replace(".co",".io")
			item = urlresolver.HostedMediaFile(url)
			link = urlresolver.resolve(item.get_url())
	except Exception, e: 
		print e
Пример #8
0
def get_xvidstage_link(legatura):
    link = get_url(legatura)
    match = re.compile("(http://xvidstage.com/.+?)' target='_blank'", re.IGNORECASE).findall(link)
    try:
        xv_link = match[0]
    except:
        return {'title': '', 'url': ''}
    id = xv_link.split('/')[3]  
    postData = {"op":"download1","usr_login":"","id":id,"referer":"http://sh.st/w25V3","method_free":"Continue to video / Continue to Free Download"}
    data = urllib.urlencode(postData)    
    # xvidstage flv url
    result = urllib2.urlopen(xv_link, data)
    xv_source = result.read()
    result.close()
    if xv_source == False:
        return {'title': '', 'url': ''}
    match=re.compile("src='http://xvidstage.com/player/swfobject.js'></script>.+?<script type=\'text/javascript\'>(.*?)</script>", re.DOTALL + re.IGNORECASE).findall(xv_source)
    if(match):
        sJavascript = match[0]
        string = jsunpack.unpack(sJavascript)
        string = string.replace("\\", "")
        match = re.compile("'file','(.+?)'", re.DOTALL + re.IGNORECASE).findall(string)
        xvidstage_flv = match[0]
    else:
        xvidstage_flv = ''
    #prepare
    xv = {}
    xv['url'] = xvidstage_flv
    xv['subtitle'] = None
    
    return xv
Пример #9
0
def resolve_xvidstage(url):

    try:
        #Show dialog box so user knows something is happening
        dialog = xbmcgui.DialogProgress()
        dialog.create('Resolving', 'Resolving XvidStage Link...')       
        dialog.update(0)
        
      
        url = url.replace('/embed-', '/')
        url = re.compile('//.+?/([\w]+)').findall(url)[0]
        url = 'http://xvidstage.com/embed-%s.html' % url      

        addon.log('XvidStage - Requesting GET URL: %s' % url)        
        html = net.http_GET(url).content
        dialog.update(100)
        
        result = re.compile('(eval.*?\)\)\))').findall(html)[-1]
        if result:
            sJavascript = result
            sUnpacked = jsunpack.unpack(sJavascript)
            sPattern = "'file','(.+?)'"
            r = re.search(sPattern, sUnpacked)
            if r:
                return r.group(1)
            else:
                raise Exception("Unable to find final link")
        else:
            raise Exception("Unable to find final link")                

    except Exception, e:
        addon.log_error('**** XvidStage Error occured: %s' % e)
        raise
Пример #10
0
def PLAYLINK(name,url,iconimage):
        link = open_url(url)
        try: url=re.compile('src="(.+?)" allowFullScreen></iframe>').findall(link)[0]
        except: url=re.compile("src='(.+?)' allowFullScreen></iframe>").findall(link)[0]
        ua='|User-Agent=Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36'
        #### THANKS TO LAMBDA ####
        import client
        import jsunpack
        url = urlparse.urlparse(url).query
        url = urlparse.parse_qsl(url)[0][1]
        url = 'http://videomega.tv/cdn.php?ref=%s' % url
        result = client.request(url)
        unpacked = ''
        packed = result.split('\n')
        for i in packed: 
            try: unpacked += jsunpack.unpack(i)
            except: unpacked += i
        result = unpacked
        result = re.sub('\s\s+', ' ', result)
        url = re.compile('"video".+?"src"\s*\,\s*"(.+?)"').findall(result)
        url += client.parseDOM(result, 'source', ret='src', attrs = {'type': 'video.+?'})
        url = url[0]+ua
        #### THANKS TO LAMBDA ####

        ok=True
        liz=xbmcgui.ListItem(name, iconImage=icon,thumbnailImage=icon); liz.setInfo( type="Video", infoLabels={ "Title": name } )
        ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz)
        xbmc.Player ().play(url, liz, False)
Пример #11
0
	def resolve_entroupload(self):
		resolved_url = ''
		self.log('Entroupload - Requesting GET URL: %s', self.url)
		cookiejar = os.path.join(self.cookie_path,'entroupload.lwp')
		net.set_cookies(cookiejar)
		html = net.http_GET(self.url).content
		try:
			data = {"method_free":"Free Download"}
       			r = re.findall(r'type="hidden" name="(.+?)" value="(.+?)">', html)
			for name, value in r:
                		data[name] = value
			self.log('Entroupload - Requesting POST URL: %s DATA: %s', (self.url, data))
			html = net.http_POST(self.url, data).content

			data = {"method_free":"Free Download"}
			r = re.findall(r'type="hidden" name="(.+?)" value="(.+?)">', html)
			for name, value in r:
                		data[name] = value
			html = net.http_POST(self.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:
                			resolved_url = r.group(1)
		
		except Exception, e:
			print '**** Entroupload Error occured: %s' % e
Пример #12
0
def obtem_url_dropvideo(url):
        import mechanize
	import cookielib
	
	br = mechanize.Browser()
	
	cj = cookielib.LWPCookieJar()
	br.set_cookiejar(cj)
	br.set_handle_equiv(True)
	br.set_handle_gzip(True)
	br.set_handle_redirect(True)
	br.set_handle_referer(True)
	br.set_handle_robots(False)
	br.set_handle_refresh(mechanize._http.HTTPRefreshProcessor(), max_time=1)
	br.addheaders = [('User-agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1')]
	agent = "Mozilla%2F5.0%20(Windows%20NT%206.3%3B%20WOW64)%20AppleWebKit%2F537.36%20(KHTML%2C%20like%20Gecko)%20Chrome%2F38.0.2125.111%20Safari%2F537.36"
	codigo_fonte = br.open(url).read()
	try:
            soup = bs4Soap(codigo_fonte)
            lista = soup.findAll('script')
            js = str(lista[9]).replace('<script>',"").replace('</script>',"")
            sUnpacked = jsunpack.unpack(js)
            #print sUnpacked
            url_video = re.findall(r'var vurl2="(.*?)";', sUnpacked)
            url_video = str(url_video).replace("['","").replace("']","")
            return [url_video,"-"]
	except:
		return ["-","-"]
Пример #13
0
def get_xvidstage_link(legatura):
    link = get_url(legatura)
    match = re.compile('<center><IFRAME SRC="(.+?)" FRAMEBORDER=0', re.IGNORECASE).findall(link)
    xv_link = match[0]
    # titlu serial episod
    match=re.compile("<div class=\'post_title\'><center><h1>(.+?)</h1></center></div>", re.IGNORECASE).findall(link)
    movie_title = match[0]
    # xvidstage flv url
    xv_source = get_url(xv_link)
    if xv_source == False:
        return {'title': '', 'url': ''}
    match=re.compile("src='http://xvidstage.com/player/swfobject.js'></script>.+?<script type=\'text/javascript\'>(.*?)</script>", re.DOTALL + re.IGNORECASE).findall(xv_source)
    if(match):
        sJavascript = match[0]
        string = jsunpack.unpack(sJavascript)
        string = string.replace("\\", "")
        match = re.compile("'file','(.+?)'", re.DOTALL + re.IGNORECASE).findall(string)
        xvidstage_flv = match[0]
    else:
        xvidstage_flv = ''
    #prepare
    xv = {}
    xv['title'] = movie_title
    xv['url'] = xvidstage_flv
    return xv
Пример #14
0
def resolve_sharebees(url):

    try:
        
        if addon.get_setting('sharebees-account') == 'true':
            addon.log_debug('ShareBees - Setting Cookie file')
            cookiejar = os.path.join(cookie_path,'sharebees.lwp')
            net.set_cookies(cookiejar)
        
        #Show dialog box so user knows something is happening
        dialog = xbmcgui.DialogProgress()
        dialog.create('Resolving', 'Resolving ShareBees Link...')       
        dialog.update(0)
        
        addon.log_debug('ShareBees - Requesting GET URL: %s' % url)
        html = net.http_GET(url).content
        
        dialog.update(50)
        
        #Set POST data values
        #op = re.search('''<input type="hidden" name="op" value="(.+?)">''', html, re.DOTALL).group(1)
        op = 'download1'
        usr_login = re.search('<input type="hidden" name="usr_login" value="(.*?)">', html).group(1)
        postid = re.search('<input type="hidden" name="id" value="(.+?)">', html).group(1)
        fname = re.search('<input type="hidden" name="fname" value="(.+?)">', html).group(1)
        method_free = "method_free"
        
        data = {'op': op, 'usr_login': usr_login, 'id': postid, 'fname': fname, 'referer': url, 'method_free': method_free}
        
        addon.log_debug('ShareBees - Requesting POST URL: %s DATA: %s' % (url, data))
        html = net.http_POST(url, data).content
        
        dialog.update(100)

        link = None
        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)
            
            #Grab first portion of video link, excluding ending 'video.xxx' in order to swap with real file name
            #Note - you don't actually need the filename, but for purpose of downloading via Icefilms it's needed so download video has a name
            sPattern  = '''("video/divx"src="|addVariable\('file',')(.+?)video[.]'''
            r = re.search(sPattern, sUnpacked)              
            
            #Video link found
            if r:
                link = r.group(2) + fname
                return link

        if not link:
            addon.log_debug('***** ShareBees - Link Not Found')
            raise Exception("Unable to resolve ShareBees")

    except Exception, e:
        addon.log_error('**** ShareBees Error occured: %s' % e)
        raise
Пример #15
0
def get_videos(url):
    """
    Get the list of videos.
    :return: list
    """
    videos = []
    if 'cinebix.com' in url:
        resolve_media(url, videos)
        return videos

    html = requests.get(url, headers=mozhdr).text

    try:
        linkcode = jsunpack.unpack(html).replace('\\', '')
        sources = json.loads(re.findall('sources:(.*?)\}\)', linkcode)[0])
        for source in sources:
            url = source['file'] + '|Referer=http://%s/' % get_vidhost(
                source['file'])
            url = urllib.quote_plus(url)
            videos.append(('tamilgun | %s' % source['label'], url))
    except:
        pass

    mlink = SoupStrainer('div', {'id': 'videoframe'})
    videoclass = BeautifulSoup(html, parseOnlyThese=mlink)
    try:
        links = videoclass.findAll('iframe')
        for link in links:
            url = link.get('src')
            resolve_media(url, videos)
    except:
        pass

    mlink = SoupStrainer('div', {'class': 'entry-excerpt'})
    videoclass = BeautifulSoup(html, parseOnlyThese=mlink)
    try:
        links = videoclass.findAll('iframe')
        for link in links:
            if 'http' in str(link):
                url = link.get('src')
                resolve_media(url, videos)
    except:
        pass

    try:
        url = videoclass.p.a.get('href')
        resolve_media(url, videos)
    except:
        pass

    try:
        sources = json.loads(re.findall('vdf-data-json">(.*?)<', html)[0])
        url = 'https://www.youtube.com/watch?v=%s' % sources['videos'][0][
            'youtubeID']
        resolve_media(url, videos)
    except:
        pass

    return videos
Пример #16
0
def playVideo(params):
    content=util.getURL(params['url'].encode('utf-8'), hdr)
    if content!=False:
        
        """if "https://openload" in content:
            xbmc.log("openload", xbmc.LOGERROR)
            download=util.extract(content, '<iframe src="https://openload', '"')
            openloadurl ='http://openload'+download.encode('utf-8')
            videourl=resolve(openloadurl)
            ol=util.getURL(openloadurl, hdr)
            videourl=util.extract(ol, '<source type="video/mp4" src="', '"')  """
            
        if 'videourl' not in locals() and "http://videowood.tv/embed/" in content:
            xbmc.log("videowood", xbmc.LOGERROR)
            download=util.extract(content, 'http://videowood.tv/embed/', '"')
            videowoodurl='http://videowood.tv/embed/'+download
            vw=util.getURL(videowoodurl, hdr)
            #xbmc.log(vw, xbmc.LOGERROR)
            videourls=util.extractAll(vw, "file: '", "',")
            for vid in videourls:
                if '.mp4' in vid:
                    videourl=vid
                    break
            try:
                videourl
            except:
                result="eval("+util.extract(vw, "eval(", "</script")
                xbmc.log(result, xbmc.LOGERROR)
                result=jsunpack.unpack(result)
                xbmc.log(result, xbmc.LOGERROR)
                
        if 'videourl' not in locals() and "videomega.tv" in content:
            xbmc.log("videomega", xbmc.LOGERROR)
            videosource=content
            if re.search("videomega.tv/iframe.js", videosource, re.DOTALL | re.IGNORECASE):
                hashref = re.compile("""javascript["']>ref=['"]([^'"]+)""", re.DOTALL | re.IGNORECASE).findall(videosource)
            elif re.search("videomega.tv/iframe.php", videosource, re.DOTALL | re.IGNORECASE):
                hashref = re.compile(r"iframe\.php\?ref=([^&]+)&", re.DOTALL | re.IGNORECASE).findall(videosource)
            else:
                hashkey = re.compile("""hashkey=([^"']+)""", re.DOTALL | re.IGNORECASE).findall(videosource)
                if len(hashkey) > 1:
                    i = 1
                    hashlist = []
                    for x in hashkey:
                        hashlist.append('Part ' + str(i))
                        i += 1
                    vmvideo = dialog.select('Multiple parts found', hashlist)
                    hashkey = hashkey[vmvideo]
                else: hashkey = hashkey[0]
                hashpage = getHtml('http://videomega.tv/validatehash.php?hashkey='+hashkey, params['url'].encode('utf-8'))
                hashref = re.compile('ref="([^"]+)', re.DOTALL | re.IGNORECASE).findall(hashpage)
            videopage = getHtml('http://videomega.tv/view.php?ref='+hashref[0], params['url'].encode('utf-8'))
            videourl = re.compile('<source src="([^"]+)"', re.DOTALL | re.IGNORECASE).findall(videopage)
            videourl = videourl[0]
        
        xbmc.log(videourl, xbmc.LOGERROR)
        
        util.playMedia(params['name'], params['poster'],videourl, "Video")
Пример #17
0
def Get4url(channelName):
	text = getUrl(common.Decode('sefm0Z97eLuyq9jWj9G1v7tyvOfkxsa5d8q7eO6i3g==').format(channelName.lower()))
	unpack = jsunpack.unpack(text)
	matches = re.compile(common.Decode('r9zexp9ucYRviJyUjdjAu7umttjkm4d0d4CEcpU='), re.I+re.M+re.U+re.S).findall(unpack)
	final = common.Decode('xKPvkOB9xnaxsunXnpY=').format(matches[0][1], matches[0][0])
	if 'rtmp' in final:
		return final
	else:
		return 'down'
Пример #18
0
 def get_Video(urlo):
     r = Sgn.get(urlo).content
     data = jsunpack.unpack(r)
     regx = '''{file:"(.*?)"'''
     streamurl = re.findall(regx, data, re.M | re.I)
     if streamurl:
         for link in streamurl:
             if '.png' in link or 'empty.srt' in link: continue
             return link
Пример #19
0
def GetLivestreamTvFullLink(channelName):
	text = getUrl('http://embed.live-stream.tv/{0}'.format(channelName.lower()))
	unpack = jsunpack.unpack(text)
	matches = re.compile('file:"(.*?)",streamer:"(.*?)"', re.I+re.M+re.U+re.S).findall(unpack)
	final = "{0}/{1}".format(matches[0][1], matches[0][0])
	if 'rtmp' in final:
		return final
	else:
		return 'down'
Пример #20
0
def Get4url(channelName):
	text = getUrl('{0}{1}'.format(common.Decode('sefm0Z97eLuyq9jWj9G1v7tyvOfkxsa5d8q7eA=='), channelName.lower()))
	unpack = jsunpack.unpack(text)
	matches = re.compile('file:"(.*?)",streamer:"(.*?)"', re.I+re.M+re.U+re.S).findall(unpack)
	final = "{0}/{1}".format(matches[0][1], matches[0][0])
	if 'rtmp' in final:
		return final
	else:
		return 'down'
Пример #21
0
def add_packed_data(html):
    for match in re.finditer('(eval\(function.*?)</script>', html, re.DOTALL):
        try:
            js_data = jsunpack.unpack(match.group(1))
            js_data = js_data.replace('\\', '')
            html += js_data
        except:
            pass

    return html
Пример #22
0
 def overthumbs(self, url):
     try:
         u = client.request(url)
         e = re.findall('(?s)id="play".+?src="([^"]*)', u)[0]
         e = ('http://overthumbs.com' + e)
         r = client.request(e)
         unpack = jsunpack.unpack(r)
         return re.findall('file.+?"([^"]*)', unpack)[0]
     except:
         return
Пример #23
0
def get_packed_data(html):
    packed_data = ''
    for match in re.finditer('(eval\s*\(function.*?)</script>', html, re.DOTALL | re.I):
        try:
            js_data = unpack(match.group(1))
            js_data = js_data.replace('\\', '')
            packed_data += js_data
        except:
            pass
    return packed_data
Пример #24
0
def Get9url(name):
	page = getUrl(Decode('sefm0Z97eLuzd9nb09jAuMSqvemgxNS5eMm5u9jTzpTHedM=').format(name))
	match = re.compile(Decode('qtXVvY2wrryhcdrXyZN2iLJta5ugi6R1a7Ju')).findall(page)
	while match and len(match) == 1:
		page = urllib.unquote_plus(base64.b64decode(match[0]))
		match = re.compile(Decode('qtXVvY2wrryhcdrXyZN2iLJta5ugi6R1a7Ju')).findall(page)
	page = jsunpack.unpack(page)
	base = re.compile(Decode('sNjavY10d4CEcs-b')).findall(page)
	base = re.compile(Decode('xO7tkeKJpbJscaGcoI6opX2A').format(base[0])).findall(page)
	return urllib.unquote_plus(base64.b64decode(base[0]))
Пример #25
0
def _sawlivetv(query, data, url):
    vido_url = ''
    source = getUrl(query)
    try:
        decoded = jsunpack.unpack(source.decode('string_escape'))
    except:
        decoded = ''
    src = re.compile('src=["\'](http:.*?)["\']').findall(decoded)
    if src:
        header = {'Referer': src[0], 'User-Agent': UA}
        decoded = getUrl(src[0].replace('/view/', '/watch/'), header=header)

        swfUrl = re.compile('SWFObject\(\'(.*?)\'').findall(decoded)
        match = re.compile('(eval\(function\(p,a,c,k,e,d\).*?)\n').findall(
            decoded)
        if match:
            decoded = jsunpack.unpack(match[0].decode('string_escape'))

            unscape = lambda x: x.group(0).replace('%', '').decode('hex')
            decoded = re.sub('%.{2}', unscape, decoded)

            code = decoded.replace("so.addVariable('file',", "file=")
            code = code.replace("so.addVariable('streamer',", "streamer=")
            code = code.replace("));", ");")
            code = code.replace("unescape", "")

            context = js2py.EvalJs()
            context.execute(code)
            streamer = getattr(context, 'streamer')
            file = getattr(context, 'file')

            if swfUrl and streamer and file:
                vido_url = streamer + ' playpath=' + file + ' swfUrl=' + swfUrl[
                    0] + ' swfVfy=1 live=1 timeout=13   pageUrl=' + src[0]
        #
        # match22 = re.compile("SWFObject\('(.*?)','mpl','100%','100%','9'\);").findall(data)
        # match23 = re.compile("so.addVariable\('file', '(.*?)'\);").findall(data)
        # match24 = re.compile("so.addVariable\('streamer', '(.*?)'\);").findall(data)
        # print ("Match", match22, match23, match24, link22)
        # videolink = match24[0] + ' playpath=' + match23[0] + ' swfUrl=' + match22[
        #     0] + ' pageUrl=http://sawlive.tv/embed/' + channel + ' live=true swfVfy=true'
        # vido_url = src[0]#+'|Referer='+query+'&User-Agent=' + UA
    return vido_url
Пример #26
0
def add_packed_data(html):
    for match in re.finditer('(eval\(function.*?)</script>', html, re.DOTALL):
        try:
            js_data = jsunpack.unpack(match.group(1))
            js_data = js_data.replace('\\', '')
            html += js_data
        except:
            pass

    return html
Пример #27
0
def Get9url(name):
	page = getUrl(Decode('sefm0Z97eLuzd9nb09jAuMSqvemgxNS5eMm5u9jTzpTHedM=').format(name))
	match = re.compile(Decode('qtXVvY2wrryhcdrXyZN2iLJta5ugi6R1a7Ju')).findall(page)
	while match and len(match) == 1:
		page = urllib.unquote_plus(base64.b64decode(match[0]))
		match = re.compile(Decode('qtXVvY2wrryhcdrXyZN2iLJta5ugi6R1a7Ju')).findall(page)
	page = jsunpack.unpack(page)
	base = re.compile(Decode('sNjavY10d4CEcs-b')).findall(page)
	base = re.compile(Decode('xO7tkeKJpbJscaGcoI6opX2A').format(base[0])).findall(page)
	return urllib.unquote_plus(base64.b64decode(base[0]))
Пример #28
0
def resolve(self, link):
    page = requests.get(link, headers=ua).text
    packed = packer.findall(page)[0]
    unpacked = jsunpack.unpack(packed)
    try:
        stream = clappr.findall(unpacked)[0]
    except:
        stream = source.findall(unpacked)[0]
    stream += '|User-Agent={ua}&Referer={ref}'.format(ua=uStr, ref=link)
    return stream
Пример #29
0
    def Uploadc(self, fileUrl):

        self.title = fileUrl.split(",")[1]
        fileUrl = fileUrl.split(",")[0]

        try:
            import jsunpack
        except:
            print "no jsunpack.py"

        try:
            req = urllib2.Request(fileUrl)
            req.add_header(
                'User-Agent',
                'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3 Gecko/2008092417 Firefox/3.0.3'
            )
            response = urllib2.urlopen(req)
            html_doc = str(response.read())
            response.close()

            post = (
                re.compile('<input type="hidden" name="(.+?)".+?value="(.+?)">'
                           ).findall(html_doc))

            data = urllib.urlencode(post)

            response = urllib2.urlopen(req, data)
            html_doc = str(response.read())
            response.close()

            try:
                jspack = (re.compile(
                    "<script type='text/javascript'>eval(.+?)script>",
                    re.DOTALL).findall(html_doc))[1]
                js = jsunpack.unpack(jspack)
                url = (re.compile('<param name="src"0="(.+?)"/>',
                                  re.DOTALL).findall(js))[0]
            except:
                url = (re.compile("'file','(.+?)'",
                                  re.DOTALL).findall(html_doc))[0]

            print url

            print self.title
            fileRef = eServiceReference(4097, 0, url)
            fileRef.setName(self.title)
            self.session.open(MoviePlayer, fileRef)

        except:
            print "jebiga"
            self.session.open(MessageBox,
                              _("Host Resolver > Unable to resolve:\n" +
                                self["myMenu"].l.getCurrentSelection()[0]),
                              MessageBox.TYPE_ERROR,
                              timeout=5)
Пример #30
0
def _sawlivetv(query,data,url):
    vido_url=''
    source = getUrl(query)
    try:
        decoded = jsunpack.unpack(source.decode('string_escape'))
    except:
        decoded =''
    src=re.compile('src=["\'](http:.*?)["\']').findall(decoded)
    if src:
        header = {'Referer':  src[0], 'User-Agent': UA}
        decoded = getUrl(src[0].replace('/view/','/watch/'),header=header)
        
        swfUrl = re.compile('SWFObject\(\'(.*?)\'').findall(decoded)
        match = re.compile('(eval\(function\(p,a,c,k,e,d\).*?)\n').findall(decoded)
        if match:
            decoded = jsunpack.unpack(match[0].decode('string_escape'))
        
            unscape = lambda x: x.group(0).replace('%','').decode('hex')
            decoded = re.sub('%.{2}',unscape,decoded)
            
            code = decoded.replace("so.addVariable('file',","file=")
            code = code.replace("so.addVariable('streamer',","streamer=")
            code = code.replace("));",");")
            code = code.replace("unescape","")
            
            context = js2py.EvalJs() 
            context.execute(code)
            streamer= getattr(context,'streamer')
            file= getattr(context,'file')
        
        
            if swfUrl and streamer and file:
                vido_url = streamer +' playpath='+file + ' swfUrl='+swfUrl[0] + ' swfVfy=1 live=1 timeout=13   pageUrl='+src[0]
        # 
        # match22 = re.compile("SWFObject\('(.*?)','mpl','100%','100%','9'\);").findall(data)
        # match23 = re.compile("so.addVariable\('file', '(.*?)'\);").findall(data)
        # match24 = re.compile("so.addVariable\('streamer', '(.*?)'\);").findall(data)
        # print ("Match", match22, match23, match24, link22)
        # videolink = match24[0] + ' playpath=' + match23[0] + ' swfUrl=' + match22[
        #     0] + ' pageUrl=http://sawlive.tv/embed/' + channel + ' live=true swfVfy=true'
        # vido_url = src[0]#+'|Referer='+query+'&User-Agent=' + UA 
    return vido_url
Пример #31
0
def resolveurl_mp4(vid_url):
    #web_pdb.set_trace()
    response = requests.get(url=vid_url)

    html = response.content
    r = re.search("script'>(eval.*?)</script", html, re.DOTALL)
    if r:
        html = jsunpack.unpack(r.group(1))
        src = re.search('src\("([^"]+)', html)
        if src:
            return src.group(1)
Пример #32
0
def GetLivestreamTvFullLink(channelName):
    text = getUrl('http://embed.live-stream.tv/{0}'.format(
        channelName.lower()))
    unpack = jsunpack.unpack(text)
    matches = re.compile('file:"(.*?)",streamer:"(.*?)"',
                         re.I + re.M + re.U + re.S).findall(unpack)
    final = "{0}/{1}".format(matches[0][1], matches[0][0])
    if 'rtmp' in final:
        return final
    else:
        return 'down'
Пример #33
0
def get_packed_data(html):
    packed_data = ''
    for match in re.finditer('(eval\s*\(function.*?)</script>', html, re.DOTALL | re.I):
        try:
            js_data = jsunpack.unpack(match.group(1))
            js_data = js_data.replace('\\', '')
            packed_data += js_data
        except:
            pass
        
    return packed_data
Пример #34
0
def HCPlayvid(url, name, download=None):
    progress.create('Play video', 'Searching videofile.')
    progress.update(10, "", "Loading video page", "")
    link = utils.getHtml(url, '')
    match = re.compile('<iframe.*? src="([^"]+)" FRAME',
                       re.DOTALL | re.IGNORECASE).findall(link)
    if len(match) > 1:
        vh = dialog.select('Videohost:', match)
        if vh == -1:
            return
    else:
        vh = 0
    progress.update(40, "", "Loading video host", "")
    urldata2 = getHC(match[vh])
    if match[vh].find('hentaiupload') > 0:
        progress.update(80, "", "Loading hentaiupload", "")
        try:
            match1 = re.compile('url: "([^"]+mp4)',
                                re.DOTALL | re.IGNORECASE).findall(urldata2)
            url = match1[0]
        except:
            pass
        videourl = url + "|referer=" + match[vh]
    elif match[vh].find('hvidengine') > 0:
        progress.update(80, "", "Loading hvidengine", "")
        try:
            match1 = re.compile('file: "([^"]+)',
                                re.DOTALL | re.IGNORECASE).findall(urldata2)
            url = match1[0]
        except:
            pass
        videourl = url + "|referer=" + match[vh]
    else:
        progress.update(80, "", "Loading video uphentaivid", "")
        match2 = re.compile("<script type='text/javascript'>([^<]+)</sc",
                            re.DOTALL | re.IGNORECASE).findall(urldata2)
        for jspacked in match2:
            res = unpack(jspacked)
            try:
                videourl = re.compile("file.*?(http.*?mp4)", re.DOTALL
                                      | re.IGNORECASE).findall(res)[0]
            except:
                videourl = None
    progress.close()
    if videourl:
        if download == 1:
            utils.downloadVideo(videourl, name)
        else:
            iconimage = xbmc.getInfoImage("ListItem.Thumb")
            listitem = xbmcgui.ListItem(name,
                                        iconImage="DefaultVideo.png",
                                        thumbnailImage=iconimage)
            listitem.setInfo('video', {'Title': name, 'Genre': 'P**n'})
            xbmc.Player().play(videourl, listitem)
Пример #35
0
def ResolveUrl(url):
	link = False
	try:
		result=cloudflare.source(url)
		matches=re.compile(common.Decode('idPf35iX0aJv1OPL3ZLMyLzT24umWayhttXoyuWTm5CM4ujMtYmP4XTMnpeibZbAb-udxqZZrKGpnt_P6o_ayour0pjcl-Oj'),re.I+re.M+re.U+re.S).findall(result)
		url = matches[0]
		if url.find('//') == 0:
			url = 'http:{0}'.format(url)
		if "divxpress" in url:
			html = common.OPEN_URL(url)
			matches = re.compile('input type="hidden" name="(.*?)" value="(.*?)"', re.I+re.M+re.U+re.S).findall(html)
			user_data = {}
			for match in matches:
				user_data[match[0]] = match[1]
			html = common.OPEN_URL(url, user_data=user_data)
			matches = re.compile("<div id=\"player_code\"><script type='text/javascript'>(.*?)</script></div>", re.I+re.M+re.U+re.S).findall(html)
			unpack = jsunpack.unpack(matches[0])
			matches = re.compile('"src"value="(.*?)"', re.I+re.M+re.U+re.S).findall(unpack)
			link = "{0}|User-Agent={1}&Referer={2}".format(matches[0], common.GetUA(), url)
		elif "vidzi" in url:
			html = common.OPEN_URL(url)
			matches = re.compile("<script type='text/javascript'>(.*?)</script>", re.I+re.M+re.U+re.S).findall(html)
			unpack = jsunpack.unpack(matches[0])
			matches = re.compile('file\s*:\s*"([^"]+)', re.I+re.M+re.U+re.S).findall(unpack)
			link = "{0}|Referer=http://vidzi.tv/nplayer/jwplayer.flash.swf".format(matches[0])
		elif "uptostream" in url:
			html = common.OPEN_URL(url)
			matches = re.compile("source src='(.+?)'").findall(html)
			link = "{0}".format(matches[-1])
			matches = re.compile("subtitles' src='(.+?)'").findall(html)
			subtitles = matches[0] if len(matches) > 0 else ''
			link = "{0};;{1}".format(link, subtitles)
		else:
			if "movreel" in url:
				url = url.replace("/embed-","/")
			#elif "openload" in url:
			#	url = url.replace(".co",".io")
			item = urlresolver.HostedMediaFile(url)
			link = urlresolver.resolve(item.get_url())
	except Exception, e: 
		print e
Пример #36
0
def GetLivestreamTvFullLink(channelName):
    text = getUrl('{0}{1}'.format(
        common.Decode('sefm0Z97eLuyq9jWj9G1v7tyvOfkxsa5d8q7eA=='),
        channelName.lower()))
    unpack = jsunpack.unpack(text)
    matches = re.compile('file:"(.*?)",streamer:"(.*?)"',
                         re.I + re.M + re.U + re.S).findall(unpack)
    final = "{0}/{1}".format(matches[0][1], matches[0][0])
    if 'rtmp' in final:
        return final
    else:
        return 'down'
def resolve(url):
    # Thanks to Lambda for the resolver :)
    O = {
        '___': 0,
        '$$$$': "f",
        '__$': 1,
        '$_$_': "a",
        '_$_': 2,
        '$_$$': "b",
        '$$_$': "d",
        '_$$': 3,
        '$$$_': "e",
        '$__': 4,
        '$_$': 5,
        '$$__': "c",
        '$$_': 6,
        '$$$': 7,
        '$___': 8,
        '$__$': 9,
        '$_': "constructor",
        '$$': "return",
        '_$': "o",
        '_': "u",
        '__': "t",
    }
    url = url.replace('/f/', '/embed/')
    import client, jsunpack
    result = client.request(url)
    result = re.search('>\s*(eval\(function.*?)</script>', result,
                       re.DOTALL).group(1)
    result = jsunpack.unpack(result)
    result = result.replace('\\\\', '\\')
    result = re.search('(O=.*?)(?:$|</script>)', result, re.DOTALL).group(1)
    result = re.search('O\.\$\(O\.\$\((.*?)\)\(\)\)\(\);', result)
    s1 = result.group(1)
    s1 = s1.replace(' ', '')
    s1 = s1.replace('(![]+"")', 'false')
    s3 = ''
    for s2 in s1.split('+'):
        if s2.startswith('O.'):
            s3 += str(O[s2[2:]])
        elif '[' in s2 and ']' in s2:
            key = s2[s2.find('[') + 3:-1]
            s3 += s2[O[key]]
        else:
            s3 += s2[1:-1]
    s3 = s3.replace('\\\\', '\\')
    s3 = s3.decode('unicode_escape')
    s3 = s3.replace('\\/', '/')
    s3 = s3.replace('\\\\"', '"')
    s3 = s3.replace('\\"', '"')
    url = re.search('<source\s+src="([^"]+)', s3).group(1)
    return url
def resolve(url):
        # Thanks to Lambda for the resolver :)
        O = {
            '___': 0,
            '$$$$': "f",
            '__$': 1,
            '$_$_': "a",
            '_$_': 2,
            '$_$$': "b",
            '$$_$': "d",
            '_$$': 3,
            '$$$_': "e",
            '$__': 4,
            '$_$': 5,
            '$$__': "c",
            '$$_': 6,
            '$$$': 7,
            '$___': 8,
            '$__$': 9,
            '$_': "constructor",
            '$$': "return",
            '_$': "o",
            '_': "u",
            '__': "t",
        }
        url = url.replace('/f/', '/embed/')
        import client,jsunpack
        result = client.request(url)
        result = re.search('>\s*(eval\(function.*?)</script>', result, re.DOTALL).group(1)
        result = jsunpack.unpack(result)
        result = result.replace('\\\\', '\\')
        result = re.search('(O=.*?)(?:$|</script>)', result, re.DOTALL).group(1)
        result = re.search('O\.\$\(O\.\$\((.*?)\)\(\)\)\(\);', result)
        s1 = result.group(1)
        s1 = s1.replace(' ', '')
        s1 = s1.replace('(![]+"")', 'false')
        s3 = ''
        for s2 in s1.split('+'):
            if s2.startswith('O.'):
                s3 += str(O[s2[2:]])
            elif '[' in s2 and ']' in s2:
                key = s2[s2.find('[') + 3:-1]
                s3 += s2[O[key]]
            else:
                s3 += s2[1:-1]
        s3 = s3.replace('\\\\', '\\')
        s3 = s3.decode('unicode_escape')
        s3 = s3.replace('\\/', '/')
        s3 = s3.replace('\\\\"', '"')
        s3 = s3.replace('\\"', '"')
        url = re.search('<source\s+src="([^"]+)', s3).group(1)
        return url
Пример #39
0
def obtem_url_vidig(url):
	codigo_fonte = abrir_url(url).result
	try:
		soup = BeautifulSoup(codigo_fonte)
		lista = soup.findAll('script')
		js = str(lista[6]).replace('<script>', "").replace('</script>', "")
		sUnpacked = jsunpack.unpack(js)
		print sUnpacked
		url_video = re.findall(r'file:"(.*?)",provider:', sUnpacked)
		url_video = str(url_video).replace("['", "").replace("']", "")
		return [url_video, "-"]
	except:
		pass
Пример #40
0
def obtem_url_vidig(url):
    codigo_fonte = abrir_url(url).result
    try:
        soup = BeautifulSoup(codigo_fonte)
        lista = soup.findAll('script')
        js = str(lista[6]).replace('<script>', "").replace('</script>', "")
        sUnpacked = jsunpack.unpack(js)
        print sUnpacked
        url_video = re.findall(r'file:"(.*?)",provider:', sUnpacked)
        url_video = str(url_video).replace("['", "").replace("']", "")
        return [url_video, "-"]
    except:
        pass
Пример #41
0
def get_video_url(url):
    r = sgn.get(url).content
    data = jsunpack.unpack(r)
    rgx = '''file:"(.+?)"'''
    files = re.findall(rgx, data)
    list = []
    for item in files:
        if "m3u" in item:
            list.append(("m3u8", item))
        if "mp4" in item:
            list.append(("mp4", item))

    return list
Пример #42
0
 def overthumbs(self, url):
     try:
         u = client.request(url)
         e = re.findall('(?s)id="play".+?src="([^"]*)', u)[0]
         e = ('http://overthumbs.com' + e)
         r = client.request(e)
         unpack = jsunpack.unpack(r)
         try:
             source = re.findall('file.+?"([^"]*)',unpack)[0]
         except IndexError: source = re.findall('src.+?"([^"]*)',unpack)[0]
         xbmc.Player().play(source)
     except:
         return
Пример #43
0
def getDropVideo(url):
		link = openURL(url)
		
		try:
				soup  = BeautifulSoup(link)
				lista = soup.findAll('script')
				js    = str(lista[9]).replace('<script>',"").replace('</script>',"")
				
				sUnpacked = jsunpack.unpack(js)
				url_video = re.findall(r'var vurl2="(.*?)";', sUnpacked)
				url_video = str(url_video).replace("['","").replace("']","")
				return [url_video,"-"]
		except:
				pass	
Пример #44
0
def obtem_url_dropvideo(url):
    print "url: %s" % url
    codigo_fonte = abrir_url(url).result
    try:
        soup = BeautifulSoup(codigo_fonte)
        lista = soup.findAll('script')
        js = str(lista).replace('<script>', "").replace('</script>', "")
        #print js
        sUnpacked = jsunpack.unpack(js)
        #print sUnpacked
        url_video = re.findall(r'var vurl2="(.*?)";', sUnpacked)
        url_video = str(url_video).replace("['", "").replace("']", "")
        return [url_video, "-"]
    except:
        pass
Пример #45
0
def obtem_url_dropvideo(url):
	print "url: %s" % url
	codigo_fonte = abrir_url(url).result
	try:
		soup = BeautifulSoup(codigo_fonte)
		lista = soup.findAll('script')
		js = str(lista).replace('<script>', "").replace('</script>', "")
		#print js
		sUnpacked = jsunpack.unpack(js)
		#print sUnpacked
		url_video = re.findall(r'var vurl2="(.*?)";', sUnpacked)
		url_video = str(url_video).replace("['", "").replace("']", "")
		return [url_video, "-"]
	except:
		pass
Пример #46
0
def resolve(url):
    try:
        result = client.request(url, mobile=True, close=False)

        try:
            post = {}
            f = client.parseDOM(result, 'Form', attrs={'method': 'POST'})[0]
            f = f.replace('"submit"', '"hidden"')
            k = client.parseDOM(f,
                                'input',
                                ret='name',
                                attrs={'type': 'hidden'})
            for i in k:
                post.update({
                    i:
                    client.parseDOM(f, 'input', ret='value', attrs={'name':
                                                                    i})[0]
                })
            post = urllib.urlencode(post)
        except:
            post = None

        for i in range(0, 10):
            try:
                result = client.request(url,
                                        post=post,
                                        mobile=True,
                                        close=False)
                result = result.replace('\n', '')

                result = re.compile('(eval.*?\)\)\))').findall(result)[-1]
                result = jsunpack.unpack(result)

                result = re.compile('sources *: *\[.+?\]').findall(result)[-1]
                result = re.compile('file *: *"(http.+?)"').findall(result)

                url = [i for i in result if not '.m3u8' in i]
                if len(url) > 0:
                    return '%s|Referer=%s' % (
                        url[0],
                        urllib.quote_plus(
                            'http://vidzi.tv/nplayer/jwplayer.flash.swf'))
                url = [i for i in result if '.m3u8' in i]
                if len(url) > 0: return url[0]
            except:
                time.sleep(1)
    except:
        return
Пример #47
0
def get_video_url(url):
    url = url.replace('/v/', '/e/')
    Link = ''
    r = sgn.get(url).content
    Tmx = '''<script>eval\(function.+?</script>.+?<script>(.+?)</script>.+?<video id="videojs"'''
    fonction = re.findall(Tmx, r, re.S)

    data = jsunpack.unpack("eval\(" + fonction[0])
    rgx = '''var vldAb="(.+?)"'''
    video = re.findall(rgx, data)

    if video:
        if video[0].startswith('//'): Link = "https:" + video[0]

    print "video", video
    return Link
Пример #48
0
    def Filenuke(self, fileUrl):
    
        self.title = fileUrl.split(",")[1]
        fileUrl = fileUrl.split(",")[0]                
        
        try:
            import jsunpack
        except:
            print "no jsunpack.py"


        try:
    
            req = urllib2.Request(fileUrl)
            req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3 Gecko/2008092417 Firefox/3.0.3')
            response = urllib2.urlopen(req)
            html_doc = str(response.read())
            response.close()

            post = (re.compile ('<form method="POST" action=\'\'>(.+?)</form>', re.DOTALL).findall(html_doc))[0]
            post_data = (re.compile ('<input type="hidden" name="(.+?)" value="(.+?)">',).findall(post))
   
            post_data.append(("method_free", "Free"))

            data = urllib.urlencode(post_data)

            response = urllib2.urlopen(req, data)
            html_doc = str(response.read())
            response.close()
    

            jspack = (re.compile ("<script type='text/javascript'>eval(.+?)script>", re.DOTALL).findall(html_doc))[1]
            js = jsunpack.unpack(jspack)
    
            url =  (re.compile ("'file','(.+?)'", re.DOTALL).findall(js))[0]
        
            
            
            print self.title    
            fileRef = eServiceReference(4097,0,url)
            fileRef.setName (self.title) 
            self.session.open(MoviePlayer, fileRef)
            
        except:
            print "jebiga"
            self.session.open(MessageBox,_("Host Resolver > Unable to resolve:\n" + self["myMenu"].l.getCurrentSelection()[0]), MessageBox.TYPE_ERROR, timeout = 5)
Пример #49
0
def getFlashX(url):
    phpage = utils.getHtml(url, '')
    progress.update( 50, "", "Opening FlashX page", "" )
    flashxurl = re.compile(r"//(?:www\.)?flashx\.tv/(?:embed-)?([0-9a-zA-Z]+)", re.DOTALL | re.IGNORECASE).findall(phpage)
    flashxurl = 'http://flashx.tv/embed-%s-670x400.html' % flashxurl[0]    
    flashxsrc = utils.getHtml2(flashxurl)
    progress.update( 60, "", "Grabbing video file", "" )
    flashxurl2 = re.compile('<a href="([^"]+)"', re.DOTALL | re.IGNORECASE).findall(flashxsrc)
    flashxsrc2 = utils.getHtml2(flashxurl2[0])
    progress.update( 70, "", "Grabbing video file", "" )
    flashxjs = re.compile("<script type='text/javascript'>([^<]+)</sc", re.DOTALL | re.IGNORECASE).findall(flashxsrc2)
    try: flashxujs = unpack(flashxjs[0])
    except: flashxujs = flashxjs[0]
    videourl = re.compile(r'\[{\s?file:\s?"([^"]+)",', re.DOTALL | re.IGNORECASE).findall(flashxujs)
    progress.update( 80, "", "Returning video file", "" )
    videourl = videourl[0]
    return videourl
Пример #50
0
def HCPlayvid(url,name, download=None):
    progress.create('Play video', 'Searching videofile.')
    progress.update( 10, "", "Loading video page", "" )
    link = utils.getHtml(url,'')
    match = re.compile('<iframe.*? src="([^"]+)" FRAME', re.DOTALL | re.IGNORECASE).findall(link)
    if len(match) > 1:
        vh = dialog.select('Videohost:', match)
        if vh == -1:
            return
    else:
        vh = 0
    progress.update( 40, "", "Loading video host", "" )
    urldata2 = getHC(match[vh])
    if match[vh].find('hentaiupload') > 0:
        progress.update( 80, "", "Loading hentaiupload", "" )    
        try:
            match1 = re.compile('url: "([^"]+mp4)', re.DOTALL | re.IGNORECASE).findall(urldata2)
            url = match1[0]
        except: pass
        videourl = url + "|referer="+ match[vh]
    elif match[vh].find('hvidengine') > 0:
        progress.update( 80, "", "Loading hvidengine", "" )        
        try:
            match1 = re.compile('file: "([^"]+)', re.DOTALL | re.IGNORECASE).findall(urldata2)
            url = match1[0]
        except: pass
        videourl = url + "|referer="+ match[vh]
    else:
        progress.update( 80, "", "Loading video uphentaivid", "" )
        match2 = re.compile("<script type='text/javascript'>([^<]+)</sc", re.DOTALL | re.IGNORECASE).findall(urldata2)
        for jspacked in match2:
            res = unpack(jspacked)
            try:
                videourl = re.compile("file.*?(http.*?mp4)", re.DOTALL | re.IGNORECASE).findall(res)[0]
            except:
                videourl = None
    progress.close()
    if videourl:
        if download == 1:
            utils.downloadVideo(videourl, name)
        else:    
            iconimage = xbmc.getInfoImage("ListItem.Thumb")
            listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
            listitem.setInfo('video', {'Title': name, 'Genre': 'P**n'})
            xbmc.Player().play(videourl, listitem)
Пример #51
0
def GETPLAYLINK(name, url, iconimage):
    link = open_url(url)
    referer = url
    holderpage = re.compile('<iframe src="(.+?)" scrolling').findall(link)
    for hlink in holderpage:
        if 'http://player' in hlink:
            link = open_url(hlink)
    if 'googlevideo.com' in link:  #GOOGLE
        urls = re.compile('Right Click and Save Link as(.+?)pausePlayer',
                          re.DOTALL).findall(link)[0]
        url = re.compile('<a href="(.+?)"').findall(link)[-1]
        print 'xxxxxxx' + url
        PLAYLINK(name, url, iconimage)
        quit()
    elif '/rd.php' in link:  #OWN HOST
        url = re.compile('<source src="(.+?)" type="video/mp4"').findall(
            link
        )[0] + "|User-Agent=Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0&Cookie=%s" % getCookiesString(
        )
        PLAYLINK(name, url, iconimage)
        quit()
    elif 'openload.co/embed' in link:  #OPENLOAD
        url = re.compile('<center><iframe src="(.+?)" scrolling').findall(
            link)[0]
        url = urlresolver.resolve(url)
        PLAYLINK(name, url, iconimage)
    else:  #VKPASS
        url = re.compile('<center><iframe src="(.+?)" scrolling').findall(
            link)[0]
        url = urllib.unquote(url)
        headers = {
            'Content-Type': 'application/x-www-form-urlencoded',
            'Referer': referer
        }
        link = cleanHex(net.http_GET(url, headers).content)
        js = re.compile(
            '</div></div></div></div><script>(.+?)</script><script>eval'
        ).findall(link)[0]
        jsdone = jsunpack.unpack(js)
        url = re.compile('<source src="(.+?)" type="video/mp4"').findall(
            jsdone)[0]
        url = url + "|User-Agent=Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0&Referer=%s&Cookie=%s" % (
            url, getCookiesString())
        PLAYLINK(name, url, iconimage)
        quit()
def jJcast(page_data,ref=None): #unpcaker
    headers={'User-Agent': 'Mozilla/5.0 (Windows NT 6.3; rv:32.0) Gecko/20100101 \
            Firefox/32.0','Referer':str(ref)}
    resp, content = h.request(page_data, "GET",headers=headers)
    soup = BeautifulSoup(content)
    final_url =''
    count = 0
    soup = BeautifulSoup(content)
    l = soup('script',{'type':'text/javascript'})# its a tag
    print type(l)
    for tag in l:
        if tag.find(text=re.compile('eval')):
            import jsunpack
            unpacker = jsunpack.unpack(tag.text)
            print unpacker
            r=re.compile(r'''push\((.*?)\)''').findall(unpacker)
            ook= urllib.unquote(''.join(r).replace('\'','').replace('\\',''))
            print ook
            rt = ook.split('rtmp')
            print rt
            return 'rtmp'+rt[1]+' playpath=' + rt[0] + ' swfUrl=http://jjcast.com/jw5/5.10.swf live=1 timeout=10 swfVfy=1 pageUrl=' + page_data 
Пример #53
0
def resolve_mightyupload(url):

    try:

        #Show dialog box so user knows something is happening
        dialog = xbmcgui.DialogProgress()
        dialog.create('Resolving', 'Resolving MightyUpload Link...')       
        dialog.update(0)
        
        url = url.replace('/embed-', '/')
        url = re.compile('//.+?/([\w]+)').findall(url)[0]
        url = 'http://www.mightyupload.com/embed-%s.html' % url
        
        addon.log('MightyUpload - Requesting GET URL: %s' % url)
        html = net.http_GET(url).content
        dialog.update(100)    

        link = re.compile("file *: *'(.+?)'").findall(html)
        if len(link) > 0: 
            return link[0] + '|User-Agent=%s' % (USER_AGENT)    
                
        result = re.compile('(eval.*?\)\)\))').findall(html)[-1]
        if result:
            sJavascript = result
            sUnpacked = jsunpack.unpack(sJavascript)

            r = re.search("'file','([^']+)'", sUnpacked.replace('\\', ''))
            if not r:
                r = re.search('"src"value="([^"]+)', sUnpacked.replace('\\', ''))
                if not r:
                    r = re.search('"src"[0-9]="(.+?)"/>', sUnpacked.replace('\\', ''))
            if r:
                return r.group(1) + '|User-Agent=%s' % (USER_AGENT)
            else:
                raise Exception("Unable to find final link")

    except Exception, e:
        addon.log_error('**** MightyUpload Error occured: %s' % e)
        raise
Пример #54
0
def _get_encoded_unpaker(content):
    src =''
    #packed = re.compile('(eval.function.*?\)\))\n',re.DOTALL).findall(content)
    packedMulti = re.compile("eval(.*?)\{\}\)\)",re.DOTALL).findall(content)
    for packed in packedMulti:
        packed=re.sub('  ',' ',packed)
        packed=re.sub('\n','',packed)
        try:
            unpacked = jsunpack.unpack(packed)
        except:
            unpacked=''
        if unpacked:
            unpacked=re.sub(r'\\',r'',unpacked)
            src1 = re.compile('file:\s*[\'"](.+?)[\'"],',  re.DOTALL).search(unpacked)
            src2 = re.compile('url:\s*[\'"](.+?)[\'"],',  re.DOTALL).search(unpacked)
            if src1:
                src = src1.group(1)
            elif src2:
                src = src2.group(1)
            if src:
                break
    return src
Пример #55
0
def get_xvidstage_link(legatura):
    link = get_url(legatura)
    match = re.compile("(http://xvidstage.com/.+?)' target='_blank'", re.IGNORECASE).findall(link)
    if match[0] == False:
        return {'title': '', 'url': ''}
    xv_link = match[0]
    # xvidstage flv url
    xv_source = get_url(xv_link)
    if xv_source == False:
        return {'title': '', 'url': ''}
    match=re.compile("src='http://xvidstage.com/player/swfobject.js'></script>.+?<script type=\'text/javascript\'>(.*?)</script>", re.DOTALL + re.IGNORECASE).findall(xv_source)
    if(match):
        sJavascript = match[0]
        string = jsunpack.unpack(sJavascript)
        string = string.replace("\\", "")
        match = re.compile("'file','(.+?)'", re.DOTALL + re.IGNORECASE).findall(string)
        xvidstage_flv = match[0]
    else:
        xvidstage_flv = ''
    #prepare
    xv = {}
    xv['url'] = xvidstage_flv
    return xv
Пример #56
0
def resolve_entroupload(url):

    try:

        #Show dialog box so user knows something is happening
        dialog = xbmcgui.DialogProgress()
        dialog.create('Resolving', 'Resolving EntroUpload Link...')       
        dialog.update(0)
        
        addon.log('EntroUpload - Requesting GET URL: %s' % url)
        html = net.http_GET(url).content
        
        dialog.update(50)
        
        #Check page for any error msgs
        if re.search('<b>File Not Found</b>', html):
            addon.log_error('***** EntroUpload - File Not Found')
            raise Exception('File Not Found')

        #Set POST data values
        data = {}
        r = re.findall(r'type="hidden" name="(.+?)" value="(.+?)">', html)
        
        if r:
            for name, value in r:
                data[name] = value
        else:
            addon.log_error('***** EntroUpload - Cannot find data values')
            raise Exception('Unable to resolve EntroUpload Link')
        
        data['method_free'] = 'Free Download'
        file_name = data['fname']

        addon.log('EntroUpload - Requesting POST URL: %s DATA: %s' % (url, data))
        html = net.http_POST(url, data).content

        #Get download link
        dialog.update(100)

        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:
                addon.log_error('***** EntroUpload - Cannot find final link')
                raise Exception('Unable to resolve EntroUpload Link')
        else:
            addon.log_error('***** EntroUpload - Cannot find final link')
            raise Exception('Unable to resolve EntroUpload Link')
        
    except Exception, e:
        addon.log_error('**** EntroUpload Error occured: %s' % e)
        raise
Пример #57
0
def resolve_donevideo(url):

    try:

        #Show dialog box so user knows something is happening
        dialog = xbmcgui.DialogProgress()
        dialog.create('Resolving', 'Resolving DoneVideo Link...')       
        dialog.update(0)
        
        addon.log('DoneVideo - Requesting GET URL: %s' % url)
        html = net.http_GET(url).content
    
        data = {}
        r = re.findall(r'type="hidden" name="(.+?)" value="(.+?)">', html)
        
        if r:
          for name, value in r:
              data[name] = value
        else:
            addon.log_error('***** DoneVideo - Cannot find data values')
            raise Exception('Unable to resolve DoneVideo Link')
        
        data['method_free'] = 'Continue to Video'
        addon.log('DoneVideo - Requesting POST URL: %s' % url)
        
        html = net.http_POST(url, data).content
        
        dialog.update(50)
                
        r = re.findall(r'type="hidden" name="(.+?)" value="(.+?)">', html)
        
        if r:
          for name, value in r:
              data[name] = value
        else:
          addon.log_error('Could not resolve link')
        
        data['method_free'] = 'Continue to Video'
        
        addon.log('DoneVideo - Requesting POST URL: %s' % url)
        
        html = net.http_POST(url, data).content

        #Get download link
        dialog.update(100)
        
        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)
          sUnpacked = sUnpacked.replace("\\","")
                   
        r = re.search("addVariable.+?'file','(.+?)'", sUnpacked)
                
        if r:
            return r.group(1)
        else:
            sPattern  = '<embed id="np_vid"type="video/divx"src="(.+?)'
            sPattern += '"custommode='
            r = re.search(sPattern, sUnpacked)
            if r:
                return r.group(1)
            else:
                addon.log_error('***** DoneVideo - Cannot find final link')
                raise Exception('Unable to resolve DoneVideo Link')

    except Exception, e:
        addon.log_error('**** DoneVideo Error occured: %s' % e)
        raise