def getHosterUrlandPlay():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue("siteUrl")
    sTitle = oInputParameterHandler.getValue("sTitle")

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    sUrl = oRequestHandler.getRealUrl()

    # take care of recaptcha-forms
    while recaptcha.checkForReCaptcha(sHtmlContent):
        aCaptchaParams = recaptcha.getCaptcha(sHtmlContent)
        oSolver = cInputWindow(captcha=aCaptchaParams[0])
        userresponse = oSolver.get()
        if not userresponse:
            break
        params = recaptcha.buildResponse(userresponse, aCaptchaParams[1])
        oRequestHandler = cRequestHandler(sUrl)
        oRequestHandler.setRequestType(cRequestHandler.REQUEST_TYPE_POST)
        for param in params.split("&"):
            param = param.split("=")
            oRequestHandler.addParameters(param[0], param[1])
        oRequestHandler.addParameters("submit", "true")
        sHtmlContent = oRequestHandler.request()

    # if the videolink is in an iframe
    sPattern = '<iframe id="iframe" src="([^"]+)"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if aResult[0]:
        sStreamUrl = aResult[1][0]
        oHoster = cHosterHandler().getHoster(sStreamUrl)
        cHosterGui().showHosterMenuDirect(oGui, oHoster, sStreamUrl, sFileName=sTitle)
        oGui.setEndOfDirectory()
        return

    # if its in a flash-container
    sPattern = '<param name="movie" value="([^"]+)"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if aResult[0]:
        sStreamUrl = aResult[1][0]
        oHoster = cHosterHandler().getHoster(sStreamUrl)
        cHosterGui().showHosterMenuDirect(oGui, oHoster, sStreamUrl, sFileName=sTitle)
        oGui.setEndOfDirectory()
        return

    # if its done by simple redirects
    else:
        sStreamUrl = oRequestHandler.getRealUrl()
        oHoster = cHosterHandler().getHoster(sStreamUrl)
        cHosterGui().showHosterMenuDirect(oGui, oHoster, sStreamUrl, sFileName=sTitle)
        oGui.setEndOfDirectory()
Пример #2
0
def getHosterUrlandPlay():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sHoster = oInputParameterHandler.getValue('hosterName')
    sTitle = oInputParameterHandler.getValue('sTitle')
   
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request();
    sUrl = oRequestHandler.getRealUrl()
    #--> Recaptchabehandlung
    while(recaptcha.checkForReCaptcha(sHtmlContent)):
        aCaptchaParams = recaptcha.getCaptcha(sHtmlContent)
        oSolver = cInputWindow(captcha = aCaptchaParams[0])
        userresponse = oSolver.get()
        if not userresponse:
         break
        params = recaptcha.buildResponse(userresponse, aCaptchaParams[1])
        oRequestHandler = cRequestHandler(sUrl)
        oRequestHandler.setRequestType(cRequestHandler.REQUEST_TYPE_POST)
        for param in params.split('&'):
            param = param.split('=')
            oRequestHandler.addParameters(param[0], param[1])
        oRequestHandler.addParameters('submit', 'true')
        sHtmlContent = oRequestHandler.request()
    #<-- Recaptchabehandlung
    #Videolink in einem Iframe?
    sPattern = '<iframe id="iframe" src="([^"]+)"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        sStreamUrl = aResult[1][0]
        oHoster = cHosterHandler().getHoster2(sHoster)  
        cHosterGui().showHosterMenuDirect(oGui, oHoster, sStreamUrl, sFileName = sTitle)
        oGui.setEndOfDirectory()
        return 
    sPattern = '<param name="movie" value="([^"]+)"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        sStreamUrl = aResult[1][0]
        oHoster = cHosterHandler().getHoster2(sHoster)
        cHosterGui().showHosterMenuDirect(oGui, oHoster, sStreamUrl, sFileName = sTitle)
        oGui.setEndOfDirectory()
        return
    #Link fuehrt ueber redirects direkt zum Hoster
    else:
        sStreamUrl = oRequestHandler.getRealUrl()
        oHoster = cHosterHandler().getHoster2(sHoster)
        cHosterGui().showHosterMenuDirect(oGui, oHoster, sStreamUrl, sFileName = sTitle)
        oGui.setEndOfDirectory()
    #oGui.setEndOfDirectory()
def getHosterUrlandPlay():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sTitle = oInputParameterHandler.getValue('sTitle')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    sUrl = oRequestHandler.getRealUrl()

    # take care of recaptcha-forms
    while (recaptcha.checkForReCaptcha(sHtmlContent)):
        aCaptchaParams = recaptcha.getCaptcha(sHtmlContent)
        oSolver = cInputWindow(captcha=aCaptchaParams[0])
        userresponse = oSolver.get()
        if not userresponse:
            break
        params = recaptcha.buildResponse(userresponse, aCaptchaParams[1])
        oRequestHandler = cRequestHandler(sUrl)
        oRequestHandler.setRequestType(cRequestHandler.REQUEST_TYPE_POST)
        for param in params.split('&'):
            param = param.split('=')
            oRequestHandler.addParameters(param[0], param[1])
        oRequestHandler.addParameters('submit', 'true')
        sHtmlContent = oRequestHandler.request()

    # if the videolink is in an iframe
    sPattern = '<iframe id="iframe" src="([^"]+)"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if aResult[0]:
        sStreamUrl = aResult[1][0]
        oHoster = cHosterHandler().getHoster(sStreamUrl)
        cHosterGui().showHosterMenuDirect(oGui,
                                          oHoster,
                                          sStreamUrl,
                                          sFileName=sTitle)
        oGui.setEndOfDirectory()
        return

    # if its in a flash-container
    sPattern = '<param name="movie" value="([^"]+)"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if aResult[0]:
        sStreamUrl = aResult[1][0]
        oHoster = cHosterHandler().getHoster(sStreamUrl)
        cHosterGui().showHosterMenuDirect(oGui,
                                          oHoster,
                                          sStreamUrl,
                                          sFileName=sTitle)
        oGui.setEndOfDirectory()
        return

    # if its done by simple redirects
    else:
        sStreamUrl = oRequestHandler.getRealUrl()
        oHoster = cHosterHandler().getHoster(sStreamUrl)
        cHosterGui().showHosterMenuDirect(oGui,
                                          oHoster,
                                          sStreamUrl,
                                          sFileName=sTitle)
        oGui.setEndOfDirectory()