本文整理汇总了Python中core.decoder.Decoder.extractSawlive方法的典型用法代码示例。如果您正苦于以下问题:Python Decoder.extractSawlive方法的具体用法?Python Decoder.extractSawlive怎么用?Python Decoder.extractSawlive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core.decoder.Decoder
的用法示例。
在下文中一共展示了Decoder.extractSawlive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getChannels
# 需要导入模块: from core.decoder import Decoder [as 别名]
# 或者: from core.decoder.Decoder import extractSawlive [as 别名]
def getChannels(page):
x = []
if str(page) == "0":
page = Live9net.MAIN_URL
html = Live9net.getContentFromUrl(page, "", Live9net.cookie, "")
# print html
if html.find("ESPN</") > -1: # it's a list, needs decode
table = Decoder.extract("ESPN</", "<div>", html)
x = Live9net.extractElements(table)
logger.debug("live9 channels logic done!")
else:
iframeUrl = Decoder.extract('src="', '"></iframe>', html)
html2 = Live9net.getContentFromUrl(iframeUrl, "", Live9net.cookie, page)
# print html2
if html2.find('src="http://sawlive.tv/') > -1 or html2.find('src="http://www3.sawlive') > -1:
if html2.find('src="http://sawlive.tv/') > -1:
scriptSrc = Decoder.extractWithRegex("http://sawlive", '"></script>', html2).replace(
'"></script>', ""
)
else:
scriptSrc = Decoder.extractWithRegex("http://www3.sawlive", '"></script>', html2).replace(
'"></script>', ""
)
finalRtmpUrl = Decoder.extractSawlive(scriptSrc, iframeUrl)
element = {}
element["link"] = finalRtmpUrl
element["title"] = "Watch channel"
element["permalink"] = True
logger.debug("finished append element!")
x.append(element)
return x
示例2: extractIframeValue
# 需要导入模块: from core.decoder import Decoder [as 别名]
# 或者: from core.decoder.Decoder import extractSawlive [as 别名]
def extractIframeValue(iframe,html,referer):
file = ""
if iframe.find("http:")!=0:
iframe = Decoder.extract("<iframe src='","' ",html).replace("'","") #take into account .lower() characters, so is not ' SRC=
if iframe.find("http:")!=0:
iframe = Decoder.extract(' src="','"',html).replace('"',"")
logger.debug("using iframeUrl: "+iframe)
if iframe.find("filmon.")>-1: # i prefer this fix to change all logic, really, I boried about this provider and is a 'silly' provider
logger.debug("Detected exceptional filmon.com|tv provider: "+iframe)
file = Filmoncom.launchScriptLogic(iframe,referer)[0]["url"]
else:
html2 = Cricfreetv.getContentFromUrl(iframe,"",Cricfreetv.cookie,referer)
#print html2
if html2.find("http://www3.sawlive.tv/embed/")>-1:
iframe2 = Decoder.extractWithRegex("http://www3.sawlive.tv/embed/",'"',html2).replace('"',"")
logger.debug("detected a sawlive: "+iframe2+", from: "+iframe)
#file = Live9net.getChannels(iframe2) #Live9net has the sawlive decoder, so it decodes target link
file = Decoder.extractSawlive(iframe2,Cricfreetv.cookie,iframe)
else:
file = Cricfreetv.seekIframeScript(html2,referer,iframe)
return file