本文整理汇总了Python中Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper.rgetDataBeetwenMarkers方法的典型用法代码示例。如果您正苦于以下问题:Python CParsingHelper.rgetDataBeetwenMarkers方法的具体用法?Python CParsingHelper.rgetDataBeetwenMarkers怎么用?Python CParsingHelper.rgetDataBeetwenMarkers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper
的用法示例。
在下文中一共展示了CParsingHelper.rgetDataBeetwenMarkers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: VIDEOWEED_unpackJSPlayerParams
# 需要导入模块: from Plugins.Extensions.IPTVPlayer.libs.pCommon import CParsingHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper import rgetDataBeetwenMarkers [as 别名]
def VIDEOWEED_unpackJSPlayerParams(code):
sts, code = CParsingHelper.rgetDataBeetwenMarkers(code, "eval(function", "</script>")
if not sts:
return ""
while True:
mark1 = "}("
mark2 = "));"
idx1 = code.rfind(mark1)
if -1 == idx1:
return ""
idx1 += len(mark1)
idx2 = code.rfind(mark2, idx1)
if -1 == idx2:
return ""
# idx2 += 1
paramsCode = "paramsTouple = (" + code[idx1:idx2] + ")"
paramsAlgoObj = compile(paramsCode, "", "exec")
try:
paramsAlgoObj = compile(paramsCode, "", "exec")
except:
printDBG("unpackJSPlayerParams compile algo code EXCEPTION")
return ""
vGlobals = {"__builtins__": None, "string": string}
vLocals = {"paramsTouple": None}
try:
exec(paramsAlgoObj, vGlobals, vLocals)
except:
printDBG("unpackJSPlayerParams exec code EXCEPTION")
return ""
# decrypt JS Player params
code = VIDEOWEED_decryptPlayerParams(*vLocals["paramsTouple"])
try:
code = VIDEOWEED_decryptPlayerParams(*vLocals["paramsTouple"])
if -1 == code.find("eval"):
return code
except:
printDBG("decryptPlayerParams EXCEPTION")
return ""
return ""
示例2: VIDEOWEED_unpackJSPlayerParams
# 需要导入模块: from Plugins.Extensions.IPTVPlayer.libs.pCommon import CParsingHelper [as 别名]
# 或者: from Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper import rgetDataBeetwenMarkers [as 别名]
def VIDEOWEED_unpackJSPlayerParams(code):
sts, code = CParsingHelper.rgetDataBeetwenMarkers(code, 'eval(function', '</script>')
if not sts: return ''
while True:
mark1 = "}("
mark2 = "));"
idx1 = code.rfind(mark1)
if -1 == idx1: return ''
idx1 += len(mark1)
idx2 = code.rfind(mark2, idx1)
if -1 == idx2: return ''
#idx2 += 1
paramsCode = 'paramsTouple = (' + code[idx1:idx2] + ')'
paramsAlgoObj = compile(paramsCode, '', 'exec')
try:
paramsAlgoObj = compile(paramsCode, '', 'exec')
except:
printDBG('unpackJSPlayerParams compile algo code EXCEPTION')
return ''
vGlobals = {"__builtins__": None, 'string': string}
vLocals = { 'paramsTouple': None }
try:
exec( paramsAlgoObj, vGlobals, vLocals )
except:
printDBG('unpackJSPlayerParams exec code EXCEPTION')
return ''
# decrypt JS Player params
code = VIDEOWEED_decryptPlayerParams(*vLocals['paramsTouple'])
try:
code = VIDEOWEED_decryptPlayerParams(*vLocals['paramsTouple'])
if -1 == code.find('eval'):
return code
except:
printDBG('decryptPlayerParams EXCEPTION')
return ''
return ''