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