Example #1
0
    def extractScriptLevel3(scriptUrl,referer=''):
        html4 = Cineestrenostv.getContentFromUrl(scriptUrl, "", Cineestrenostv.cookie, referer)
        finalIframeUrl = Decoder.extractWithRegex('http://', '%3D"', html4)
        finalIframeUrl = finalIframeUrl[0:len(finalIframeUrl) - 1]

        logger.debug("proccessing level 4, cookie: " + Cineestrenostv.cookie)

        finalHtml = Cineestrenostv.getContentFromUrl(finalIframeUrl, "", Cineestrenostv.cookie, referer)
        # print "final level5 html: "+finalHtml
        logger.debug("proccessing level 5, cookie: " + Cineestrenostv.cookie)
        playerUrl = Decoder.decodeBussinessApp(finalHtml, finalIframeUrl)
        return playerUrl
Example #2
0
 def extractChannel(html,page="http://www.vipgoal.net/"):
     element = {}
     if html.find('<script type="text/javascript" src="http://www.playerapp1.pw/channel.php?file=')>-1: #old part
         scriptUrl = Decoder.extractWithRegex('http://www.playerapp1.pw/channel.php?file=','"',html)
         html2 = Vigoal.getContentFromUrl(scriptUrl)
         lastUrl = Decoder.extractWithRegex('http://','" ',html2)
         lastUrl = lastUrl.replace('"',"")
         logger.debug("last url: "+lastUrl+", cookie="+Vigoal.cookie)
         html3 = Vigoal.getContentFromUrl(lastUrl,"",Vigoal.cookie,lastUrl)
         playerUrl = Decoder.decodeBussinessApp(html3,lastUrl)
         logger.debug("player url is: "+playerUrl)
         element["title"] = "Watch streaming"
         element["permalink"] = True
         element["link"] = playerUrl
     else: #unified with cinestrenostv, they are the same people, at least the same code works and the changes are at the same time xD
         logger.debug('Extracting channel from: '+page)
         element = Cineestrenostv.extractIframeChannel(html,page)
     return element
Example #3
0
    def mainLogicExtractIframeChannel(html3,iframeUrl2):
        element = {}
        if html3.find('<script type="text/javascript" src="http://tv.verdirectotv.org/channel.php?file=')>-1:
            element = Cineestrenostv.extractScriptVerdirectotv(html3,iframeUrl2)
        elif html3.find('<script type="text/javascript" src="http://www.sunhd.info/channelsa.php?file=')>-1:
            element = Cineestrenostv.extractScriptSunhdinfo(html3,iframeUrl2)
        elif html3.find('<script type="text/javascript" src="http://www.ponlatv.com/channel.php?file=')>-1:
            element = Cineestrenostv.extractScriptPonlatv(html3,iframeUrl2)
        elif html3.find("http://vercanalestv.com/tv/")>-1: #vercanalestv
            iframeUrl = Decoder.extractWithRegex("http://vercanalestv.com/tv/",'"',html3)
            logger.debug("obtained iframeUrl: "+iframeUrl)
            html2 = Cineestrenostv.getContentFromUrl(iframeUrl[0:len(iframeUrl)-1],"",Cineestrenostv.cookie,"")
            if html2.find('<iframe scrolling="no" marginwidth="0" marginheight="0" frameborder="0" width="650" height="400" src="')>-1:
                element = Cineestrenostv.extractIframeChannel(html2,iframeUrl)
            else:
                logger.error("Something unexpected happened with url: "+iframeUrl)
                #print "ERROR: "+html2
        elif html3.find("http://www.dinostream.pw/channel.php?file=")>-1: #dinostream.pw has an iframe inside, so get iframe content and proccess it
            logger.debug("processing dinostream channel...")
            element  = Cineestrenostv.extractScriptDinostream(html3,iframeUrl2)
        elif html3.find("<script type='text/javascript' src='http://www.embeducaster.com/static/scripts/ucaster.js'></script>")>-1: #ucaster cases
            if html3.find("<script type='text/javascript'> width=650, height=400, channel='")>-1:
                channel = Decoder.extract("<script type='text/javascript'> width=650, height=400, channel='","'",html3)
            else:
                channel = Decoder.extract("<script type='text/javascript'> width=","',",html3)
                channel = channel[channel.find("channel='")+len("channel='"):]
            logger.debug("ucaster channel: "+channel)
            if html3.find('<script type="text/javascript" src="http://tv.verdirectotv.org/channel.php?file=')>-1:
                element = Cineestrenostv.extractScriptVerdirectotv(html3,iframeUrl2)
            else:
                ucasterUrl = 'http://www.embeducaster.com/embedplayer/'+channel+'/1/620/430'
                html4 = Cineestrenostv.getContentFromUrl(ucasterUrl,"",Cineestrenostv.cookie,iframeUrl2)
                playerUrl = Decoder.decodeUcaster(html4,iframeUrl2)
                logger.debug("lifeflash - player url is: "+playerUrl)
                element["title"] = "Watch streaming"
                element["permalink"] = True
                element["link"] = playerUrl
            logger.debug(channel+", "+element["link"])
        elif html3.find('http://www.mipsplayer.com/content/scripts/mipsEmbed.js')>-1: #before verdirectotv.com, if not is always called
            channel = Decoder.extract("channel='","'",html3)
            mipsUrl = 'http://www.mipsplayer.com/embedplayer/'+channel+'/1/650/400'
            logger.debug("mips url is: "+mipsUrl)
            html4 = Cineestrenostv.getContentFromUrl(mipsUrl,"",Cineestrenostv.cookie,iframeUrl2)
            playerUrl = Decoder.decodeMipsplayer(html4,iframeUrl2)
            logger.debug("mipsplayer - player url is: "+playerUrl)
            element["title"] = "Watch streaming"
            element["permalink"] = True
            element["link"] = playerUrl
        elif 'http://09stream.com/canal' in html3:
            logger.debug("using 09stream logic...")
            scriptUrl = Decoder.extractWithRegex("http://09stream.com/canal", '"', html3).replace('"',"")
            html4 = Cineestrenostv.getContentFromUrl(url=scriptUrl, cookie=Cineestrenostv.cookie, referer=iframeUrl2)
            element = Cineestrenostv.extractIframeChannel(html4, scriptUrl)
        elif html3.find("http://verdirectotv.com/tv")>-1:
            logger.debug("proccessing level 3, cookie: "+Cineestrenostv.cookie)
            scriptUrl = Decoder.extractWithRegex("http://verdirectotv.com/tv",'"',html3)
            scriptUrl = scriptUrl[0:len(scriptUrl)-1]

            html4 = Cineestrenostv.getContentFromUrl(scriptUrl,"",Cineestrenostv.cookie,iframeUrl2)
            #logger.debug("verdirectotv html: "+html4)
            if html4.find("http://www.dinostream.pw/channel.php?file=")>-1:
                scriptUrl2 = Decoder.extractWithRegex("http://www.dinostream.pw/channel.php?file=",'&autostart=true"',html4)
                scriptUrl2 = scriptUrl2[0:len(scriptUrl2)-1]
                element = Decoder.extractDinostreamPart(scriptUrl2,scriptUrl)
            elif html4.find("<script type='text/javascript' src='http://www.embeducaster.com/static/scripts/ucaster.js'></script>")>-1: #ucaster cases
                channel = Decoder.extract("<script type='text/javascript'> width=650, height=400, channel='","'",html4)
                if html4.find('<script type="text/javascript" src="http://tv.verdirectotv.org/channel.php?file=')>-1:
                    element = Cineestrenostv.extractScriptVerdirectotv(html4,scriptUrl)
                else:
                    ucasterUrl = 'http://www.embeducaster.com/embedplayer/'+channel+'/1/620/430'
                    html4 = Cineestrenostv.getContentFromUrl(ucasterUrl,"",Cineestrenostv.cookie,scriptUrl)
                    playerUrl = Decoder.decodeUcaster(html4,iframeUrl2)
                    logger.debug("lifeflash - player url is: "+playerUrl)
                    element["title"] = "Watch streaming"
                    element["permalink"] = True
                    element["link"] = playerUrl
                logger.debug(channel+", "+element["link"])
            elif html4.find('<iframe scrolling="no" marginwidth="0" marginheight="0" frameborder="0" width="650" height="400" src="')>-1: #retry the same logic
                element = Cineestrenostv.extractIframeChannel(html4,iframeUrl2)
            elif html4.find('<script type="text/javascript" src="http://tv.verdirectotv.org/channel.php?file=')>-1:
                element = Cineestrenostv.extractScriptVerdirectotv(html4,scriptUrl)
            elif html4.find("<script type='text/javascript' src='http://www.liveflashplayer.net/resources/scripts/")>-1:
                channel = Decoder.extract("channel='","'",html4)
                mipsUrl = 'http://www.liveflashplayer.net/embedplayer/'+channel+'/1/620/430'
                html4 = Cineestrenostv.getContentFromUrl(mipsUrl,"",Cineestrenostv.cookie,scriptUrl)
                playerUrl = Decoder.decodeLiveFlash(html4,iframeUrl2)
                logger.debug("lifeflash - player url is: "+playerUrl)
                element["title"] = "Watch streaming"
                element["permalink"] = True
                element["link"] = playerUrl
            elif html4.find('http://www.mipsplayer.com/content/scripts/mipsEmbed.js')>-1:
                channel = Decoder.extract("channel='","'",html4)
                mipsUrl = 'http://www.mipsplayer.com/embedplayer/'+channel+'/1/650/400'
                html4 = Cineestrenostv.getContentFromUrl(mipsUrl,"",Cineestrenostv.cookie,scriptUrl)
                playerUrl = Decoder.decodeMipsplayer(html4,iframeUrl2)
                logger.debug("mipsplayer - player url is: "+playerUrl)
                element["title"] = "Watch streaming"
                element["permalink"] = True
                element["link"] = playerUrl
            elif scriptUrl!=iframeUrl2:
                logger.debug("trying new loop with: "+scriptUrl+", "+iframeUrl2)
                element = Cineestrenostv.mainLogicExtractIframeChannel(html4,scriptUrl)
            else:
                logger.debug("big data: "+html4)

        elif html3.find('<iframe scrolling="no" marginwidth="0" marginheight="0" frameborder="0" width="653" height="403" src="')>-1:
             logger.debug("extracting iframe channel with referer: "+iframeUrl2)
             element = Cineestrenostv.extractIframeChannel(html3,iframeUrl2)
        elif html3.find('file: "')>-1 and html3.find('.m3u8')>-1: #direct link, not needed any logic
            link = Decoder.extract('file: "','",',html3)
            link = link+"|Referer="+iframeUrl2
            logger.debug("detected direct link: "+link)
            element["title"] = "Watching direct link"
            element["permalink"] = True
            element["link"] = link
        elif html3.find("http://telefivegb.com/")>-1 or html3.find("http://verlatelegratis.net")>-1:
            element = Cineestrenostv.extractNewIframeChannel(html3,iframeUrl2)
        elif html3.find("http://tvpor-internet.com/")>-1 or html3.find("http://www.malosolandia.com/")>-1:
            logger.debug("inside here!..")
            newUrl = "dummy url" #dummy
            if html3.find("http://tvpor-internet.com/")>-1:
                logger.debug("inside here1!..")
                newUrl = Decoder.extractWithRegex('http://tvpor-internet.com/','"',html3).replace('"',"")
            elif html3.find("http://www.malosolandia.com/")>-1:
                logger.debug("inside here2!..")
                logger.debug("using malosolandia")
                newUrl = Decoder.extractWithRegex('http://www.malosolandia.com/','.html',html3)
            else:
                logger.debug("nothing done!")
            if newUrl!="dummy url":
                logger.debug("html is: "+html3)
                logger.debug("using new url: "+newUrl)
                html4 = Cineestrenostv.getContentFromUrl(newUrl,"",Cineestrenostv.cookie,iframeUrl2)
                logger.debug("redirecting using: "+newUrl+", html: "+html4)
                element = Cineestrenostv.mainLogicExtractIframeChannel(html4,newUrl)
            else:
                logger.debug(html3)
        elif html3.find("http://www.rtve.es/directo/la-2/")>-1:
            element["title"] = "La 2"
            element["permalink"] = True
            element["link"] = "http://hlslive.rtve.es/LA2_LV3_IPH/LA2_LV3_IPH.m3u8"
        elif html3.find("http://www.rtve.es/directo/canal-24h/")>-1:
            element["title"] = "24H"
            element["permalink"] = True
            element["link"] = "http://hlslive.rtve.es/24H_LV3_IPH/24H_LV3_IPH.m3u8"
        elif html3.find("http://leton.tv/player.php")>-1:
            logger.debug("detected leton link...")
            letonUrl = Decoder.extractWithRegex('http://leton.tv/player.php','"',html3).replace('"',"")
            letonHtml = Cineestrenostv.getContentFromUrl(letonUrl,"",Cineestrenostv.cookie,iframeUrl2)
            #print letonHtml
            playerUrl = Decoder.decodeLetonTv(letonHtml,letonUrl)
            element["title"] = "Watch streaming"
            element["permalink"] = True
            element["link"] = playerUrl
        elif html3.find('<iframe scrolling="no" marginwidth="0" marginheight="0" frameborder="0" width="650" height="400" src="')>-1:
            logger.debug("detected iframe with embed page, doing a new loop again...")
            iframeUrl3 = Decoder.extract('<iframe scrolling="no" marginwidth="0" marginheight="0" frameborder="0" width="650" height="400" src="','"></iframe>',html3) #normal cases, standar width and height
            if iframeUrl3!=iframeUrl2:
                html4 = Cineestrenostv.getContentFromUrl(iframeUrl3,"","",iframeUrl2)
                return Cineestrenostv.mainLogicExtractIframeChannel(html4,iframeUrl3)
            else:
                logger.debug("infinite loop detected, stopped!")
        elif '<iframe scrolling="no" marginwidth="0" marginheight="0" frameborder="0" allowfullscreen width="650" height="400" src="http://cinestrenos' in html3:
            logger.debug("other loop inside...")
            iframeUrl3 = Decoder.extract('<iframe scrolling="no" marginwidth="0" marginheight="0" frameborder="0" allowfullscreen width="650" height="400" src="','"',html3)
            html4 = Cineestrenostv.getContentFromUrl(url=iframeUrl3,referer=iframeUrl2)
            logger.debug("using new iframe url: "+iframeUrl3)
            element = Cineestrenostv.extractIframeChannel(html4, iframeUrl3)
        else: #tries to decode the bussinesslink, TODO, review this part
            #print html3
            playerUrl = Decoder.decodeBussinessApp(html3,iframeUrl2)
            logger.debug("bussinessapp - player url is: "+playerUrl)
            element["title"] = "Watch streaming"
            element["permalink"] = True
            element["link"] = playerUrl
        return element
Example #4
0
def open(url,page):
	if url.find("rtmp://")==-1 and url.find("|Referer=")==-1 and ( url.find("http://privatestream.tv/")>-1 or url.find("http://www.dinostream.pw/")>-1 or url.find("http://www.embeducaster.com/")>-1 or url.find("http://tv.verdirectotv.org/channel.php")>-1 or url.find("http://mamahd.com/")>-1):
		logger.info("brute url [referer] is: "+url)
		referer = ''
		if(url.find("referer: ")>-1):
			referer = url[url.find("referer: ")+len("referer: "):]
		url = url[0:url.find(",")]
		if url.find("http://privatestream.tv/")>-1:
			html = Downloader.getContentFromUrl(url,"","",referer)
			url = Decoder.decodePrivatestream(html,referer)
		elif url.find("http://www.dinostream.pw/")>-1:
			url = Decoder.extractDinostreamPart(url,referer)["link"]
		elif url.find("http://www.embeducaster.com/")>-1:
			#url = url.replace("/membedplayer/","/embedplayer/")
			url = Cineestrenostv.getContentFromUrl(url,"","",referer)
		elif url.find("http://tv.verdirectotv.org/channel.php")>-1:
			html4 = Cineestrenostv.getContentFromUrl(url,"",Cineestrenostv.cookie,referer)
			finalIframeUrl = Decoder.extractWithRegex('http://','%3D"',html4)
			if finalIframeUrl.find('"')>-1 or finalIframeUrl.find("'")>-1:
				finalIframeUrl = finalIframeUrl[0:len(finalIframeUrl)-1]
			finalHtml = Cineestrenostv.getContentFromUrl(finalIframeUrl,"",Cineestrenostv.cookie,referer)
			url = Decoder.decodeBussinessApp(finalHtml,finalIframeUrl)
		elif url.find("http://mamahd.com/")>-1:
			url = Mamahdcom.getChannels(url)[0]["link"]
		elif url.find("http://showsport-tv.com/")>-1:
			url = ShowsportTvCom.getChannels(url)[0]["link"]
	elif url.find("rtmp://")==-1:
		try:
			if url.find(", referer: ")>-1:
				page = url[url.find(", referer: ")+len(", referer: "):]
				url = url[:url.find(", referer: ")]
				logger.debug("changing page to referer: "+page)
			logger.debug("trying decoder part for url: "+url)
			url = Decoder.decodeLink(url,page)
		except:
			logger.info("decoder url launched an exception, probably could not be decoded")
			pass
	#launch redirects to his better addons
	if url.find("sop://")>-1 or url.find("acestream://")>-1 or url.find(".acelive")>-1: #required plexus or something similar installed, this dependency is external from this addon so needs to be installed
		logger.info("trying to send link to plexus: "+url)
		mode = "1"
		if url.find("sop://")>-1:
			mode = "2"
		url = "plugin://program.plexus/?mode="+mode+"&url="+url+"&name=RemoteLink"
	elif url.find(".torrent")>-1 or url.find("magnet:")>-1:
		logger.info("trying to send link to quasar: "+url)
		url = urllib.quote_plus(url)
		url = "plugin://plugin.video.quasar/play?uri="+url
	elif url.find("youtube.com/")>-1:
		id = ""
		if url.find("v=")>-1:
			id = url[url.find("v=")+len("v="):]
		elif url.find("/embed/")>-1:
			id = url[url.find("/embed/")+len("/embed/"):]
		url = "plugin://plugin.video.youtube/play/?video_id="+id+""
	elif url.find("vimeo.com/")>-1:
		url = "plugin://plugin.video.vimeo/play/?video_id="+urllib.quote_plus(url)
	else:
		logger.info("nothing done!")
	logger.debug("launching playable url: "+url)
	play(url,page)