本文整理汇总了Python中core.decoder.Decoder.decodeLetonTv方法的典型用法代码示例。如果您正苦于以下问题:Python Decoder.decodeLetonTv方法的具体用法?Python Decoder.decodeLetonTv怎么用?Python Decoder.decodeLetonTv使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core.decoder.Decoder
的用法示例。
在下文中一共展示了Decoder.decodeLetonTv方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mainLogicExtractIframeChannel
# 需要导入模块: from core.decoder import Decoder [as 别名]
# 或者: from core.decoder.Decoder import decodeLetonTv [as 别名]
#.........这里部分代码省略.........
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