本文整理匯總了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