当前位置: 首页>>代码示例>>Python>>正文


Python CParsingHelper.rgetDataBeetwenMarkers方法代码示例

本文整理汇总了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 ""
开发者ID:a4tech,项目名称:iptvplayer-for-e2,代码行数:42,代码来源:urlparserhelper.py

示例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 ''
开发者ID:c0ns0le,项目名称:iptvplayer-for-e2-fork,代码行数:39,代码来源:urlparserhelper.py


注:本文中的Plugins.Extensions.IPTVPlayer.libs.pCommon.CParsingHelper.rgetDataBeetwenMarkers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。