コード例 #1
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();
    
    sPattern = '<iframe id="iframe" src="([^"]+)"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        sStreamUrl = aResult[1][0]
        oHoster = cHosterHandler().getHoster(sHoster)
        if (sTitle != False):
            oHoster.setFileName(sTitle)
        cHosterGui().showHosterMenuDirect(oGui, oHoster, sStreamUrl)
        oGui.setEndOfDirectory()
        return
    else:
        sPattern = '<param name="movie" value="([^"]+)"'
        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
            sStreamUrl = aResult[1][0]
            oHoster = cHosterHandler().getHoster(sHoster)
            if (sTitle != False):
                oHoster.setFileName(sTitle)
            cHosterGui().showHosterMenuDirect(oGui, oHoster, sStreamUrl)
            oGui.setEndOfDirectory()
            return

    oGui.setEndOfDirectory()
コード例 #2
0
ファイル: hoster.py プロジェクト: milkibreizh/zombi-addons
    def checkHoster(self, sHosterUrl):
    
        #securitee
        if (not sHosterUrl):
            return False
        
        #Petit nettoyage
        sHosterUrl = sHosterUrl.split('|')[0]
        
        #Recuperation du host
        sHostName = sHosterUrl.split('/')[2]
            
        #L'user a active l'url resolver ?
        if cConfig().getSetting('UserUrlResolver') == 'true':
            import urlresolver
            hmf = urlresolver.HostedMediaFile(url=sHosterUrl)
            if hmf.valid_url():
                tmp = cHosterHandler().getHoster('resolver')
                RH = sHosterUrl.split('/')[2]
                RH = RH.replace('www.','')
                tmp.setRealHost( RH[:3].upper() )
                return tmp

        #Gestion classique
    
        if (('youtube' in sHostName) or ('youtu.be' in sHostName)):
            return cHosterHandler().getHoster('youtube')
        if (('dailymotion' in sHostName) or (('dai.ly' in sHostName))):
            return cHosterHandler().getHoster('dailymotion') 
            
        #Si aucun hebergeur connu on teste les liens directs
        if (sHosterUrl[-4:] in '.mp4.avi.flv.m3u8'):
            return cHosterHandler().getHoster('lien_direct')
            
        return False
コード例 #3
0
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()
コード例 #4
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()
コード例 #5
0
def __checkHoster(sHosterName):
    sHosterName = sHosterName.lower()

    if (sHosterName.endswith('rutube.png')):
        return cHosterHandler().getHoster('rutube')

    if (sHosterName.endswith('megavideo.png')):
        return cHosterHandler().getHoster('megavideo')

    #if (sHosterName.endswith('play.png')):
    #    return cHosterHandler().getHoster('sevenload') oder 4shared

    return False
コード例 #6
0
def __checkHoster(sHosterName):
    sHosterName = sHosterName.lower()

    if (sHosterName.endswith('rutube.png')):
        return cHosterHandler().getHoster('rutube')

    if (sHosterName.endswith('megavideo.png')):
        return cHosterHandler().getHoster('megavideo')

    #if (sHosterName.endswith('play.png')):
    #    return cHosterHandler().getHoster('sevenload') oder 4shared

    return False
コード例 #7
0
def __checkHoster(sHosterName):
    sHosterName = str(sHosterName)
    if (sHosterName.startswith('ecostream')):
        return cHosterHandler().getHoster('ecostream')

    if (sHosterName.startswith('movshare')):
        return cHosterHandler().getHoster('movshare')

    if (sHosterName.startswith('novamov')):
        return cHosterHandler().getHoster('novamov')

    if (sHosterName.startswith('videoweed')):
        return cHosterHandler().getHoster('videoweed')

    return False
コード例 #8
0
def __checkHoster(sHosterName):
    sHosterName = str(sHosterName)
    if (sHosterName.startswith('ecostream')):
        return cHosterHandler().getHoster('ecostream')

    if (sHosterName.startswith('movshare')):
        return cHosterHandler().getHoster('movshare')

    if (sHosterName.startswith('novamov')):
        return cHosterHandler().getHoster('novamov')

    if (sHosterName.startswith('videoweed')):
        return cHosterHandler().getHoster('videoweed')

    return False
コード例 #9
0
def playAllMovieParts():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    if (oInputParameterHandler.exist('aParts')):
        sParts = oInputParameterHandler.getValue('aParts')
        aParts = eval(sParts)

        oPlayer = cPlayer()
        oPlayer.clearPlayList()
        for sPartUrl in aParts:
            oHoster = cHosterHandler().getHoster('southpark')
            oHoster.setUrl(sPartUrl)

            aLink = oHoster.getMediaLink()
            if (aLink[0] == True):
                oGuiElement = cGuiElement()
                oGuiElement.setSiteName(SITE_IDENTIFIER)
                oGuiElement.setMediaUrl(aLink[1])
                oPlayer.addItemToPlaylist(oGuiElement)

        oPlayer.startPlayer()
        return

    oGui.setEndOfDirectory()
コード例 #10
0
def getHosterUrlandPlay():
    oGui = cGui()

    oParams = ParameterHandler()
    sTitle = oParams.getValue('Title')
    sUrl = oParams.getValue('siteUrl')
    sHoster = oParams.getValue('Hoster')

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

    sPattern = '<div id="video_actions">.*?<a href="([^"]+)" target="_blank">'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        sStreamUrl = aResult[1][0]
        oHoster = cHosterHandler().getHoster(sHoster)
        cHosterGui().showHosterMenuDirect(oGui,
                                          oHoster,
                                          sStreamUrl,
                                          sFileName=sTitle)
        oGui.setEndOfDirectory()
        return
    oGui.setEndOfDirectory()
コード例 #11
0
def showHosters():
    oGui = cGui()
	
    oInputParameterHandler = cInputParameterHandler()
    sTitle = oInputParameterHandler.getValue('Title')	
    sUrl = oInputParameterHandler.getValue('siteUrl')
    
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request();    
    
    __createInfo(oGui, sHtmlContent, sTitle)
    
    sPattern = '<h3>Hoster dieser Episode(.*?)</ul>'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        sHtmlContent = aResult[1][0]

        sPattern = '<li><a href="([^"]+)">.*?class="icon ([^"]+)"></span> ([^<]+?)</a>'
        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
             for aEntry in aResult[1]:
                oHoster = cHosterHandler().getHoster2(str(aEntry[1]).lower())              
                if (oHoster != False):
                    __createMenuEntry(oGui, 'getHosterUrlandPlay', str(aEntry[2]),
                      [['siteUrl', URL_MAIN + '/' + str(aEntry[0])], ['Title', sTitle],
                      ['hosterName', oHoster]])
                    
    oGui.setEndOfDirectory()
コード例 #12
0
def getHosterUrlandPlay():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sHoster = oInputParameterHandler.getValue('hosterName')

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

    sTitle = __getMovieTitle(sHtmlContent)

    sPattern = '<div id="video_actions">.*?<a href="([^"]+)">'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        sStreamUrl = aResult[1][0]

        oHoster = cHosterHandler().getHoster(sHoster)
        if (sTitle != False):
            oHoster.setFileName(sTitle)

        cHosterGui().showHoster(oGui, oHoster, sStreamUrl)
        oGui.setEndOfDirectory()
        return

    oGui.setEndOfDirectory()
コード例 #13
0
def showHosters():
    oGui = cGui()
	
    oParams= ParameterHandler()
    sTitle = oParams.getValue('Title')	
    sUrl = oParams.getValue('siteUrl')
    
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    if not META:
        __createInfo(oGui, sHtmlContent, sTitle)
    
    sPattern = '<h3>Hoster dieser Episode(.*?)</ul>'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        sHtmlContent = aResult[1][0]

        sPattern = '<li><a href="([^"]+)">.*?class="icon ([^"]+)"></span> ([^<]+?)</a>'
        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
            for aEntry in aResult[1]:
                oHoster = cHosterHandler().getHoster2('//'+str(aEntry[1]).lower()+'/')              
                if (oHoster != False):
                    oGuiElement = cGuiElement(str(aEntry[2]),SITE_IDENTIFIER,'getHosterUrlandPlay')
                    oParams.setParam('siteUrl',URL_MAIN + '/' + str(aEntry[0]))
                    oParams.setParam('Hoster',oHoster)
                    oGui.addFolder(oGuiElement, oParams, bIsFolder = True)                    
    oGui.setEndOfDirectory()
コード例 #14
0
def playAllMovieParts():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    if (oInputParameterHandler.exist('aParts')):
        sParts = oInputParameterHandler.getValue('aParts')
        aParts = eval(sParts)

        oPlayer = cPlayer()
	oPlayer.clearPlayList()
        for sPartUrl in aParts:
            oHoster = cHosterHandler().getHoster('southpark')
            oHoster.setUrl(sPartUrl)
           
            aLink = oHoster.getMediaLink()            
            if (aLink[0] == True):
                oGuiElement = cGuiElement()
                oGuiElement.setSiteName(SITE_IDENTIFIER)
                oGuiElement.setMediaUrl(aLink[1])
                oPlayer.addItemToPlaylist(oGuiElement)
       
        oPlayer.startPlayer()
        return
        
    oGui.setEndOfDirectory()
コード例 #15
0
def multiPartMovie():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('sUrl')
    sTitle = oInputParameterHandler.getValue('sTitle')
    sSecurityValue = oInputParameterHandler.getValue('securityCookie')

    oRequest = cRequestHandler(sUrl)
    oRequest.addHeaderEntry('Cookie', sSecurityValue)
    oRequest.addHeaderEntry('Referer', 'http://kinox.to/')
    sHtmlContent = oRequest.request()

    #pattern for single part
    sPattern = '<a\shref=\\\\"(.*?)\\\\"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0]):
        aMovieParts = aResult[1]
        sPartUrl = aMovieParts[0].replace('\\/', '/')
        oHoster = cHosterHandler().getHoster2(sPartUrl)
    cHosterGui().showHosterMenuDirect(oGui,
                                      oHoster,
                                      sPartUrl,
                                      sFileName=sTitle)
    oGui.setEndOfDirectory()
コード例 #16
0
def getHosterUrlandPlay():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sHoster = oInputParameterHandler.getValue('hosterName')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')

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

    sPattern = '<div class="hostwrapper">.*?src=([^ ]+) '
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
        
    if (aResult[0] == True):
        sStreamUrl = aResult[1][0]
        sStreamUrl = str(sStreamUrl).replace('"', '').replace("'", '')
    
        oHoster = cHosterHandler().getHoster(sHoster)
	oHoster.setFileName(sMovieTitle)
        cHosterGui().showHoster(oGui, oHoster, sStreamUrl)
        oGui.setEndOfDirectory()
        return

    oGui.setEndOfDirectory()
コード例 #17
0
def showHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sTitle = oInputParameterHandler.getValue('sTitle')
    sHosters = oInputParameterHandler.getValue('sHosters')
    
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request();    
    
    # hosterName:hosterId
    sPattern = '"([^"]+)":"([^"]+)"'
    oParser = cParser()
    aResult = oParser.parse(sHosters, sPattern)
    if (aResult[0] == True):
        for aEntry in aResult[1]:
            sHoster = aEntry[0]
            sHosterId = aEntry[1]
            
            sUrl = 'http://crypt2.be/file/' + sHosterId
            sThumbnail = 'http://serienjunkies.org/media/img/stream/'+sHoster+'.png'
            
            oHoster = cHosterHandler().getHoster2(sHoster.lower())
            if (oHoster != False):
                __createMenuEntry(oGui, 'getHosterUrlandPlay', oHoster, [['siteUrl', sUrl],
                ['sTitle', sTitle],['hosterName', oHoster]], sThumb=sThumbnail)
              
    oGui.setEndOfDirectory()
コード例 #18
0
    def download(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sHosterIdentifier = oInputParameterHandler.getValue(
            'sHosterIdentifier')
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')

        if (bGetRedirectUrl == 'True'):
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        cConfig().log("Telechargement " + sMediaUrl)

        oHoster = cHosterHandler().getHoster(sHosterIdentifier)
        oHoster.setFileName(sFileName)

        #try:
        oHoster.setUrl(sMediaUrl)
        aLink = oHoster.getMediaLink()
        if (aLink[0] == True):
            oDownload = cDownload()
            oDownload.download(aLink[1], oHoster.getFileName())
            return

        #except:
        # cConfig().log("Telechargement " + sHosterFileName)

        oGui.setEndOfDirectory()
コード例 #19
0
def parseHosterDirect(sUrl='', sHoster='', sMovieTitle=''):
    if (sUrl == '' and sHoster == ''):
        oInputParameterHandler = cInputParameterHandler()
        if not (oInputParameterHandler.exist('sUrl')
                and oInputParameterHandler.exist('sHoster')):
            return False
        sUrl = oInputParameterHandler.getValue('sUrl')
        sHoster = oInputParameterHandler.getValue('sHoster')
        sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')

    oHoster = cHosterHandler().getHoster2(sHoster)
    if (oHoster == False):
        return False

    oParser = cParser()
    #Link oder Iframe suchen der den Hosternamen enthält
    sPattern = 'id="maincontent5".*?(?:href|src)="([^<]+' + sHoster.lower(
    ) + '\.[^<"]+)"'
    oRequest = cRequestHandler(sUrl)
    sHtmlContent = oRequest.request()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        sStreamUrl = aResult[1][0]
        oGui = cGui()
        cHosterGui().showHosterMenuDirect(oGui,
                                          oHoster,
                                          sStreamUrl,
                                          sFileName=sMovieTitle)
        oGui.setEndOfDirectory()

    return False
コード例 #20
0
    def download(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sHosterIdentifier = oInputParameterHandler.getValue('sHosterIdentifier')
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')

        if (bGetRedirectUrl == 'True'):
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        cConfig().log("Telechargement " + sMediaUrl)

        oHoster = cHosterHandler().getHoster(sHosterIdentifier)
        oHoster.setFileName(sFileName)

        #try:
        oHoster.setUrl(sMediaUrl)
        aLink = oHoster.getMediaLink()
        if (aLink[0] == True):
            oDownload = cDownload()
            oDownload.download(aLink[1], oHoster.getFileName())
            return

        #except:
        # cConfig().log("Telechargement " + sHosterFileName)

        oGui.setEndOfDirectory()
コード例 #21
0
def showHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')

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

    sPattern = "<h\d+ class='post-title entry-title'>(.*?)<div style='clear: both;'></div>"
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        sHtmlContent = aResult[1][0]
        sHtmlContent = str(sHtmlContent).lower()

        sPattern = "src=([^ ]+) "
        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
            for aEntry in aResult[1]:
                sHosterUrl = str(aEntry).replace("'", '').replace('"', '')               
                hosterPattern = '([^\.]+)\.(?:com|eu|net|de|ru)?/'
                aResult = cParser().parse(sHosterUrl, hosterPattern)
                
                if aResult[0] == True:
                    hosterId = aResult[1][0]
                    oHoster = cHosterHandler().getHoster2(hosterId)                              
                    if (oHoster != False):
                        oHoster.setFileName(sMovieTitle)
                        cHosterGui().showHoster(oGui, oHoster, sHosterUrl)

    oGui.setEndOfDirectory()
コード例 #22
0
def __callSearch(sSearchText, iStart):
    oGui = cGui()

    oRequest = cRequestHandler(URL_SEARCH)
    oRequest.addParameters('q', sSearchText)
    oRequest.addParameters('x', 0)
    oRequest.addParameters('y', 0)
    oRequest.addParameters('n', ENTRIES_PER_PAGE)
    oRequest.addParameters('s', iStart)
    sHtmlContent = oRequest.request()

    sPattern = '<div class="smallVideoTeaser"><a href="([^"]+)" title="([^"]+)"><img .+?><img src="([^"]+)".*?/>'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        for aEntry in aResult[1]:
            oHoster = cHosterHandler().getHoster('mtv')
            oHoster.setDisplayName(aEntry[1])

            sUrl = URL_MAIN + str(aEntry[0]).strip()
            cHosterGui().showHoster(oGui, oHoster, sUrl)            

        __createNextButtonForSearch(oGui, iStart, sSearchText, sHtmlContent)
            
    oGui.setEndOfDirectory()
コード例 #23
0
def showHosters():
    oInputParameterHandler = cInputParameterHandler()
    if (oInputParameterHandler.exist('sUrl') and oInputParameterHandler.exist('sMovieTitle')):
        sUrl = oInputParameterHandler.getValue('sUrl')
        sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
        
        sHtmlContent = cRequestHandler(sUrl).request() 
        sPattern = '<tr id="tablemoviesindex2">.*?<a href="([^"]+)">([^<]+)<.*?alt="(.*?) .*?width="16">.*?</a>.*?alt="([^"]+)"'
        aResult = cParser().parse(sHtmlContent.replace('\\',''), sPattern)
        if (aResult[0] == True):
            oGui = cGui()
            createInfo(oGui, sHtmlContent)
            for aEntry in aResult[1]:
                sHoster = aEntry[2].strip()
                if (cHosterHandler().getHoster2(sHoster.lower())!=False):
                    sUrl = URL_MAIN + aEntry[0]
                    sTitle = aEntry[1] + ' - ' + sHoster + ' - ' + aEntry[3]
                    
                    oGuiElement = cGuiElement()
                    oGuiElement.setSiteName(SITE_IDENTIFIER)
                    oGuiElement.setFunction('showHoster')               
                    oGuiElement.setTitle(sTitle)

                    oOutputParameterHandler = cOutputParameterHandler()
                    oOutputParameterHandler.addParameter('sUrl', sUrl)
                    oOutputParameterHandler.addParameter('sHoster', sHoster)
                    oOutputParameterHandler.addParameter('sMovieTitle', sMovieTitle)
                    
                    oGui.addFolder(oGuiElement, oOutputParameterHandler)

            oGui.setEndOfDirectory()   
コード例 #24
0
    def showHosterMenu(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sHosterIdentifier = oInputParameterHandler.getValue(
            'sHosterIdentifier')
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')

        oHoster = cHosterHandler().getHoster(sHosterIdentifier)
        oHoster.setFileName(sFileName)

        # play
        self.__showPlayMenu(oGui, sMediaUrl, oHoster, bGetRedirectUrl)

        # playlist
        self.__showPlaylistMenu(oGui, sMediaUrl, oHoster, bGetRedirectUrl)

        # download
        if (oHoster.isDownloadable() == True):
            self.__showDownloadMenu(oGui, sMediaUrl, oHoster, bGetRedirectUrl)

        # JD
        if (oHoster.isJDownloaderable() == True):
            self.__showJDMenu(oGui, sMediaUrl, oHoster, bGetRedirectUrl)

        oGui.setEndOfDirectory()
コード例 #25
0
def getMovieUrl():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sHosterIdentifier = oInputParameterHandler.getValue('hosterIdentifier')
    
    oHoster = cHosterHandler().getHoster2(sHosterIdentifier)            
    
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request();

    sPattern = 'src="http://wwwstatic.megavideo.com/.*?v=([^"]+)"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        sMovieUrl = 'http://megavideo.com/?v=' + aResult[1][0]            
        cHosterGui().showHosterMenuDirect(oGui, oHoster, sMovieUrl)
    else:
        sPattern = '<embed src="([^"]+)"'
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
            sMovieUrl = aResult[1][0].strip()             
            cHosterGui().showHosterMenuDirect(oGui, oHoster, sMovieUrl)


    oGui.setEndOfDirectory()
コード例 #26
0
def showHosters():
    oInputParameterHandler = cInputParameterHandler()
    if (oInputParameterHandler.exist('sUrl')
            and oInputParameterHandler.exist('sMovieTitle')):
        sUrl = oInputParameterHandler.getValue('sUrl')
        sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')

        sHtmlContent = cRequestHandler(sUrl).request()
        sPattern = '<tr id="tablemoviesindex2">.*?<a href="([^"]+)">([^<]+)<.*?alt="(.*?) .*?width="16">.*?</a>.*?alt="([^"]+)"'
        aResult = cParser().parse(sHtmlContent.replace('\\', ''), sPattern)
        if (aResult[0] == True):
            oGui = cGui()
            createInfo(oGui, sHtmlContent)
            for aEntry in aResult[1]:
                sHoster = aEntry[2].strip()
                if (cHosterHandler().getHoster2(sHoster.lower()) != False):
                    sUrl = URL_MAIN + aEntry[0]
                    sTitle = aEntry[1] + ' - ' + sHoster + ' - ' + aEntry[3]

                    oGuiElement = cGuiElement()
                    oGuiElement.setSiteName(SITE_IDENTIFIER)
                    oGuiElement.setFunction('showHoster')
                    oGuiElement.setTitle(sTitle)

                    oOutputParameterHandler = cOutputParameterHandler()
                    oOutputParameterHandler.addParameter('sUrl', sUrl)
                    oOutputParameterHandler.addParameter('sHoster', sHoster)
                    oOutputParameterHandler.addParameter(
                        'sMovieTitle', sMovieTitle)

                    oGui.addFolder(oGuiElement, oOutputParameterHandler)

            oGui.setEndOfDirectory()
コード例 #27
0
def parseHoster(sUrl = '', sHoster = '', sDisplayName = '', sMovieTitle = ''):
    if (sUrl == '' and sHoster == ''):
        return False
       
    oHoster = cHosterHandler().getHoster2(sHoster)
    if (oHoster == False):
        return False

    oHoster.setFileName(sMovieTitle)
    oHoster.setDisplayName(sDisplayName)

    oParser = cParser()
    sPattern = oHoster.getHosterLinkPattern()

    oRequest = cRequestHandler(sUrl)
    sHtmlContent = oRequest.request()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        sStreamUrl = aResult[1][0]        
        oGui = cGui()
        cHosterGui().showHoster(oGui, oHoster, sStreamUrl)
        return True

    return False
コード例 #28
0
def showHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request();    
    
    __createInfo(oGui, sHtmlContent)
    
    sPattern = '<h3>Hoster dieser Episode(.*?)</ul>'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        sHtmlContent = aResult[1][0]

        sPattern = '<a href="([^"]+)">.*?<span class=\"icon ([^"]+)"></span> ([^<]+?)</a>'
        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
             for aEntry in aResult[1]:
                oHoster = cHosterHandler().getHoster2(str(aEntry[1]).lower())
                if (oHoster != False):
                    oGuiElement = cGuiElement()
                    oGuiElement.setSiteName(SITE_IDENTIFIER)
                    oGuiElement.setFunction('getHosterUrlandPlay')
                    oGuiElement.setTitle(str(aEntry[2]))

                    oOutputParameterHandler = cOutputParameterHandler()
                    oOutputParameterHandler.addParameter('siteUrl', URL_MAIN + str(aEntry[0]))
                    oOutputParameterHandler.addParameter('hosterName', oHoster.getPluginIdentifier())
                    oGui.addFolder(oGuiElement, oOutputParameterHandler)

    oGui.setEndOfDirectory()
コード例 #29
0
def __parseHosterDefault(sUrl, sHosterName, sHosterFileName, sPattern, sSecurityValue, sMovieTitle):
    if (sPattern == False):
        #sPattern = 'div><a href=\\\\"([^"]+)\\\\'
        sPattern = 'href=\\\\"([^"]+)\\\\" alt=\\\\"Watch\\\\"'

    sUrl = sUrl.replace('&amp;', '&')
    logger.info(sUrl)

    oRequest = cRequestHandler(sUrl)
    oRequest.addHeaderEntry('Cookie', sSecurityValue)
    oRequest.addHeaderEntry('Referer', 'http://kino.to/')
    sHtmlContent = oRequest.request()

    oParser = cParser()
    aMovieParts = oParser.parse(sHtmlContent, sPattern)

    iCounter = 0
    oGui = cGui()
    if (aMovieParts[0] == True):

        for sPartUrl in aMovieParts[1]:
            sPartUrl = sPartUrl.replace('\\/', '/')
            iCounter = iCounter + 1

            oHoster = cHosterHandler().getHoster(sHosterFileName)
	    if (sMovieTitle != False):
		oHoster.setFileName(sMovieTitle)
            cHosterGui().showHoster(oGui, oHoster, sPartUrl)            

    oGui.setEndOfDirectory()
コード例 #30
0
def __parseContent(oGui, sHtmlContent, sValue, iStartIndex):
    sPattern = '<div class="stationcol".*?<a class="playbutton clickabletitle".*?title="([^"]+)" href="([^"]+)">.*?<div class="dirbitrate">([^<]+)</div>.*?<div class="dirtype">([^<]+)</div>'

    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        for aEntry in aResult[1]:
            oHoster = cHosterHandler().getHoster('shoutcast')
            sTitle = str(aEntry[3]) + ' - ' + str(aEntry[2]) + ' - ' + str(aEntry[0])
            oHoster.setDisplayName(sTitle)
	    oHoster.setFileName(sTitle)
            cHosterGui().showHoster(oGui, oHoster, str(aEntry[1]))

    if (__checkForNextPage(sHtmlContent)):
        iNextPage = int(iStartIndex) + COUNT_OF_ENTRIES

        oGuiElement = cGuiElement()
        oGuiElement.setSiteName(SITE_IDENTIFIER)
        oGuiElement.setFunction('showGenreContent')
        oGuiElement.setTitle('mehr ..')
        oOutputParameterHandler = cOutputParameterHandler()
        oOutputParameterHandler.addParameter('sGenre', sValue)
        oOutputParameterHandler.addParameter('iStartIndex', iNextPage)
        oGui.addFolder(oGuiElement, oOutputParameterHandler)
コード例 #31
0
def parseHosterDirect(sUrl = '', sHoster = '', sMovieTitle = ''):
    if (sUrl == '' and sHoster == ''):
        oInputParameterHandler = cInputParameterHandler()
        if not (oInputParameterHandler.exist('sUrl') and oInputParameterHandler.exist('sHoster')):
            return False
        sUrl = oInputParameterHandler.getValue('sUrl')
        sHoster = oInputParameterHandler.getValue('sHoster')
        sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
        
    oHoster = cHosterHandler().getHoster2(sHoster)
    if (oHoster == False):
        return False
    
    oParser = cParser()
    #Link oder Iframe suchen der den Hosternamen enthält
    sPattern = 'id="maincontent5".*?(?:href|src)="([^<]+'+sHoster.lower()+'\.[^<"]+)"'
    oRequest = cRequestHandler(sUrl)
    sHtmlContent = oRequest.request()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        sStreamUrl = aResult[1][0]    
        oGui = cGui()
        cHosterGui().showHosterMenuDirect(oGui, oHoster, sStreamUrl, sFileName=sMovieTitle) 
        oGui.setEndOfDirectory()
      
    return False
コード例 #32
0
def showTrailerDetails():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    if (oInputParameterHandler.exist('sUrl')):
        sUrl = oInputParameterHandler.getValue('sUrl')

        oRequest = cRequestHandler(sUrl)
        sHtmlContent = oRequest.request()

        sPattern = '<div class="srTrailerListItem .*?">.*?<a href="([^"]+)">.*?<img src="([^"]+)".+?/>.*?<a.+?>(.*?)<br class'

        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)
        
        if (aResult[0] == True):
            for aEntry in aResult[1]:
                sTitle = cUtil().removeHtmlTags(aEntry[2], '')
                sTitle = oParser.replace('[ ]{2,}', ' ', sTitle)
                
                oHoster = cHosterHandler().getHoster('kinode')
                oHoster.setDisplayName(sTitle)
		oHoster.setFileName(sTitle)

                sUrl = URL_MAIN + str(aEntry[0])               
                cHosterGui().showHoster(oGui, oHoster, sUrl)

    oGui.setEndOfDirectory()
コード例 #33
0
    def download(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sHosterIdentifier = oInputParameterHandler.getValue('sHosterIdentifier')
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')

        if (bGetRedirectUrl == 'True'):
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        logger.info('call download: ' + sMediaUrl)

        oHoster = cHosterHandler().getHoster(sHosterIdentifier)
        oHoster.setFileName(sFileName)

        selfAddon = xbmcaddon.Addon(id='plugin.video.xstream')
        sPath = str(selfAddon.getSetting('download-folder'))

        #try:
        oHoster.setUrl(sMediaUrl)
        aLink = oHoster.getMediaLink()
        if (aLink[0] == True):
            oDownload = cDownload()
            oDownload.download(aLink[1], oHoster.getFileName(), sPath)
            return

        #except:
        #    logger.fatal('could not load plugin: ' + sHosterFileName)

        oGui.setEndOfDirectory()
コード例 #34
0
def getHosterUrlandPlay():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sHoster = oInputParameterHandler.getValue('hosterName')
   
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request();
    
    sTitle = __getMovieTitle(sHtmlContent)

    sPattern = '<div id="video_actions">.*?<a href="([^"]+)">'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        sStreamUrl = aResult[1][0]

        oHoster = cHosterHandler().getHoster(sHoster)
	if (sTitle != False):
	    oHoster.setFileName(sTitle)

        cHosterGui().showHoster(oGui, oHoster, sStreamUrl)
        oGui.setEndOfDirectory()
        return

    oGui.setEndOfDirectory()
コード例 #35
0
def __parseContent(oGui, sHtmlContent, sValue, iStartIndex):
    sPattern = '<div class="stationcol".*?<a class="playbutton clickabletitle".*?title="([^"]+)" href="([^"]+)">.*?<div class="dirbitrate">([^<]+)</div>.*?<div class="dirtype">([^<]+)</div>'

    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        for aEntry in aResult[1]:
            oHoster = cHosterHandler().getHoster('shoutcast')
            sTitle = str(aEntry[3]) + ' - ' + str(aEntry[2]) + ' - ' + str(
                aEntry[0])
            oHoster.setDisplayName(sTitle)
            oHoster.setFileName(sTitle)
            cHosterGui().showHoster(oGui, oHoster, str(aEntry[1]))

    if (__checkForNextPage(sHtmlContent)):
        iNextPage = int(iStartIndex) + COUNT_OF_ENTRIES

        oGuiElement = cGuiElement()
        oGuiElement.setSiteName(SITE_IDENTIFIER)
        oGuiElement.setFunction('showGenreContent')
        oGuiElement.setTitle('mehr ..')
        oOutputParameterHandler = cOutputParameterHandler()
        oOutputParameterHandler.addParameter('sGenre', sValue)
        oOutputParameterHandler.addParameter('iStartIndex', iNextPage)
        oGui.addFolder(oGuiElement, oOutputParameterHandler)
コード例 #36
0
def getHosterUrlandPlay():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sHoster = oInputParameterHandler.getValue('hosterName')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')

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

    sPattern = '<div class="hostwrapper">.*?src=([^ ]+) '
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
        
    if (aResult[0] == True):
        sStreamUrl = aResult[1][0]
        sStreamUrl = str(sStreamUrl).replace('"', '').replace("'", '')
    
        oHoster = cHosterHandler().getHoster(sHoster)
	oHoster.setFileName(sMovieTitle)
        cHosterGui().showHoster(oGui, oHoster, sStreamUrl)
        oGui.setEndOfDirectory()
        return

    oGui.setEndOfDirectory()
コード例 #37
0
def showHosters():
    oGui = cGui()

    oParams = ParameterHandler()
    sTitle = oParams.getValue('Title')
    sUrl = oParams.getValue('siteUrl')

    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    if not META:
        __createInfo(oGui, sHtmlContent, sTitle)

    sPattern = '<h3>Hoster dieser Episode(.*?)</ul>'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0] == True):
        sHtmlContent = aResult[1][0]

        sPattern = '<li><a href="([^"]+)">.*?class="icon ([^"]+)"></span> ([^<]+?)</a>'
        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
            for aEntry in aResult[1]:
                oHoster = cHosterHandler().getHoster2('//' +
                                                      str(aEntry[1]).lower() +
                                                      '/')
                if (oHoster != False):
                    oGuiElement = cGuiElement(str(aEntry[2]), SITE_IDENTIFIER,
                                              'getHosterUrlandPlay')
                    oParams.setParam('siteUrl',
                                     URL_MAIN + '/' + str(aEntry[0]))
                    oParams.setParam('Hoster', oHoster)
                    oGui.addFolder(oGuiElement, oParams, bIsFolder=True)
    oGui.setEndOfDirectory()
コード例 #38
0
def __parseHosterDefault(sUrl, sHosterName, sHosterFileName, sPattern, sSecurityValue, sMovieTitle):
  if not sPattern:
    #sPattern = 'div><a href=\\\\"([^"]+)\\\\'
    sPattern = '<a\shref=\\\\"(.*?)\\\\"'

  sUrl = sUrl.replace('&amp;', '&')

  oRequest = cRequestHandler(sUrl)
  oRequest.addHeaderEntry('Cookie', sSecurityValue)
  oRequest.addHeaderEntry('Referer', 'http://kinox.to/')
  sHtmlContent = oRequest.request()

  oParser = cParser()
  aMovieParts = oParser.parse(sHtmlContent, sPattern)

  print("SHTMLCONTENT###########: %s" % sPattern)
  print("SHTMLCONTENT###########: %s" % sHtmlContent)
  print("SHTMLCONTENT###########: %s" % aMovieParts[1])

  iCounter = 0
  oGui = cGui()
  if (aMovieParts[0] == True):

    for sPartUrl in aMovieParts[1]:
      sPartUrl = sPartUrl.replace('\\/', '/')
      iCounter = iCounter + 1

      oHoster = cHosterHandler().getHoster(sHosterFileName)
      if (sMovieTitle != False):
        oHoster.setFileName(sMovieTitle)
      print("PARSEHOSTERDEFAULT: %s" % sHosterFileName)
      cHosterGui().showHoster(oGui, oHoster, sPartUrl)

  oGui.setEndOfDirectory()
コード例 #39
0
def showTrailerDetails():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    if (oInputParameterHandler.exist('sUrl')):
        sUrl = oInputParameterHandler.getValue('sUrl')

        oRequest = cRequestHandler(sUrl)
        sHtmlContent = oRequest.request()

        sPattern = '(http://fpc.e-media.de/kinode/clip/\d+.xml)'

        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)
        
        i = 1
        if (aResult[0] == True):
            for aEntry in aResult[1]:
                sTitle = 'Clip ' + str(i)
                sUrl = aEntry
                
                oHoster = cHosterHandler().getHoster('kinode')
                oHoster.setDisplayName(sTitle)
                oHoster.setFileName(sTitle)
                cHosterGui().showHosterMenuDirect(oGui, oHoster, sUrl)
                i = i+1

    oGui.setEndOfDirectory()
コード例 #40
0
    def download(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sHosterIdentifier = oInputParameterHandler.getValue(
            'sHosterIdentifier')
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')

        if (bGetRedirectUrl == 'True'):
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        logger.info('call download: ' + sMediaUrl)

        oHoster = cHosterHandler().getHoster(sHosterIdentifier)
        oHoster.setFileName(sFileName)

        #try:
        oHoster.setUrl(sMediaUrl)
        aLink = oHoster.getMediaLink()
        if (aLink[0] == True):
            oDownload = cDownload()
            oDownload.download(aLink[1], oHoster.getFileName())
            return

        #except:
        #    logger.fatal('could not load plugin: ' + sHosterFileName)

        oGui.setEndOfDirectory()
コード例 #41
0
def __callSearch(sSearchText, iStart):
    oGui = cGui()

    oRequest = cRequestHandler(URL_SEARCH)
    oRequest.addParameters('q', sSearchText)
    oRequest.addParameters('x', 0)
    oRequest.addParameters('y', 0)
    oRequest.addParameters('n', ENTRIES_PER_PAGE)
    oRequest.addParameters('s', iStart)
    sHtmlContent = oRequest.request()

    sPattern = '<div class="smallVideoTeaser"><a href="([^"]+)" title="([^"]+)"><img .+?><img src="([^"]+)".*?/>'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        for aEntry in aResult[1]:
            oHoster = cHosterHandler().getHoster('mtv')
            oHoster.setDisplayName(aEntry[1])

            sUrl = URL_MAIN + str(aEntry[0])
            cHosterGui().showHoster(oGui, oHoster, sUrl)

        __createNextButtonForSearch(oGui, iStart, sSearchText, sHtmlContent)

    oGui.setEndOfDirectory()
コード例 #42
0
ファイル: hoster.py プロジェクト: bobynou/venom-xbmc-addons
    def download(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sHosterIdentifier = oInputParameterHandler.getValue('sHosterIdentifier')
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')

        if (bGetRedirectUrl == 'True'):
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        logger.info('call download: ' + sMediaUrl)

        oHoster = cHosterHandler().getHoster(sHosterIdentifier)
        oHoster.setFileName(sFileName)

        #try:
        oHoster.setUrl(sMediaUrl)
        aLink = oHoster.getMediaLink()
        if (aLink[0] == True):
            oDownload = cDownload()
            oDownload.download(aLink[1], oHoster.getFileName())
            return

        #except:
        #    logger.fatal('could not load plugin: ' + sHosterFileName)

        oGui.setEndOfDirectory()
コード例 #43
0
def getMovieUrl():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sHosterIdentifier = oInputParameterHandler.getValue('hosterIdentifier')

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

    sPattern = '<br><br><script type="text/javascript" src="([^"]+)"></script><br>'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        sMovieUrl = aResult[1][0]

        oRequestHandler = cRequestHandler(sMovieUrl)
        sHtmlContent = oRequestHandler.request()
        sPattern = '<embed src="([^"]+)"'
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
            sMovieUrl = aResult[1][0]

            oHoster = cHosterHandler().getHoster(sHosterIdentifier)
            cHosterGui().showHoster(oGui, oHoster, sMovieUrl)

    oGui.setEndOfDirectory()
コード例 #44
0
def getMovieUrl():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sHosterIdentifier = oInputParameterHandler.getValue('hosterIdentifier')

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

    sPattern = '<br><br><script type="text/javascript" src="([^"]+)"></script><br>'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        sMovieUrl = aResult[1][0]
                
        oRequestHandler = cRequestHandler(sMovieUrl)
        sHtmlContent = oRequestHandler.request();
        sPattern = '<embed src="([^"]+)"'
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0] == True):
            sMovieUrl = aResult[1][0]
            
            oHoster = cHosterHandler().getHoster(sHosterIdentifier)            
            cHosterGui().showHoster(oGui, oHoster, sMovieUrl)


    oGui.setEndOfDirectory()
コード例 #45
0
    def __getMediaLinkForGuest(self):
        oHosterHandler = cHosterHandler()
        aResult = oHosterHandler.getUrl(self)        
        if (aResult[0] == True):
            return True, cUtil().urlDecode(aResult[1])

        return False, ''
コード例 #46
0
    def showHosterMenu(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sHosterIdentifier = oInputParameterHandler.getValue('sHosterIdentifier')
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
	sFileName = oInputParameterHandler.getValue('sFileName')

        oHoster = cHosterHandler().getHoster(sHosterIdentifier)
	oHoster.setFileName(sFileName)

        # play
        self.__showPlayMenu(oGui, sMediaUrl, oHoster, bGetRedirectUrl)

	# playlist
	self.__showPlaylistMenu(oGui, sMediaUrl, oHoster, bGetRedirectUrl)

        # download
        if (oHoster.isDownloadable() == True):
            self.__showDownloadMenu(oGui, sMediaUrl, oHoster, bGetRedirectUrl)        

        # JD
        if (oHoster.isJDownloaderable() == True):
            self.__showJDMenu(oGui, sMediaUrl, oHoster, bGetRedirectUrl)	

        oGui.setEndOfDirectory()
コード例 #47
0
def showTrailerDetails():
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    if (oInputParameterHandler.exist('sUrl')):
        sUrl = oInputParameterHandler.getValue('sUrl')

        oRequest = cRequestHandler(sUrl)
        sHtmlContent = oRequest.request()

        sPattern = '<div class="srTrailerListItem .*?">.*?<a href="([^"]+)">.*?<img src="([^"]+)".+?/>.*?<a.+?>(.*?)<br class'

        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)

        if (aResult[0] == True):
            for aEntry in aResult[1]:
                sTitle = cUtil().removeHtmlTags(aEntry[2], '')
                sTitle = oParser.replace('[ ]{2,}', ' ', sTitle)

                oHoster = cHosterHandler().getHoster('kinode')
                oHoster.setDisplayName(sTitle)
                oHoster.setFileName(sTitle)

                sUrl = URL_MAIN + str(aEntry[0])
                cHosterGui().showHoster(oGui, oHoster, sUrl)

    oGui.setEndOfDirectory()
コード例 #48
0
    def play(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()

        sHosterIdentifier = oInputParameterHandler.getValue(
            'sHosterIdentifier')
        sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
        bGetRedirectUrl = oInputParameterHandler.getValue('bGetRedirectUrl')
        sFileName = oInputParameterHandler.getValue('sFileName')
        #sThumbnail = oInputParameterHandler.getValue('sThumbnail')

        if (bGetRedirectUrl == 'True'):
            sMediaUrl = self.__getRedirectUrl(sMediaUrl)

        cConfig().log("Hoster - play " + sMediaUrl)

        oHoster = cHosterHandler().getHoster(sHosterIdentifier)
        oHoster.setFileName(sFileName)

        sHosterName = oHoster.getDisplayName()
        cConfig().showInfo(sHosterName, 'Resolve')

        try:

            oHoster.setUrl(sMediaUrl)
            aLink = oHoster.getMediaLink()

            if (aLink[0] == True):
                oGuiElement = cGuiElement()
                oGuiElement.setSiteName(self.SITE_NAME)
                oGuiElement.setMediaUrl(aLink[1])
                oGuiElement.setTitle(oHoster.getFileName())
                oGuiElement.getInfoLabel()

                oPlayer = cPlayer()
                oPlayer.run(oGuiElement, oHoster.getFileName(), aLink[1])

                # oGuiElement = cGuiElement()
                # oGuiElement.setSiteName(self.SITE_NAME)
                # oGuiElement.setMediaUrl(aLink[1])
                # oGuiElement.setTitle(oHoster.getFileName())
                # oGuiElement.getInfoLabel()

                # oPlayer = cPlayer()
                # oPlayer.clearPlayList()
                # oPlayer.addItemToPlaylist(oGuiElement)
                # oPlayer.startPlayer()
                return
            else:
                #cConfig().showInfo(sHosterName, 'Fichier introuvable')
                cConfig().error("Fichier introuvable ")
                return

        except:
            #cConfig().showInfo(sHosterName, 'Fichier introuvable')
            cConfig().error("Fichier introuvable ")
            return

        oGui.setEndOfDirectory()
コード例 #49
0
def __checkHoster(sHosterName):
    if (sHosterName == 'Megavideo'):
        return cHosterHandler().getHoster('megavideo')

    if (sHosterName == 'zShare'):
        return cHosterHandler().getHoster('zshare')

    if (sHosterName == 'Duckload'):
        return cHosterHandler().getHoster('duckload')

    if (sHosterName == 'FileBase'):
        return cHosterHandler().getHoster('filebase')

    if (sHosterName == 'MyStream'):
        return cHosterHandler().getHoster('mystream')

    return False
コード例 #50
0
def __checkHoster(sHosterName):
    if (sHosterName == 'Megavideo'):
        return cHosterHandler().getHoster('megavideo')

    if (sHosterName == 'zShare'):
        return cHosterHandler().getHoster('zshare')

    if (sHosterName == 'Duckload'):
        return cHosterHandler().getHoster('duckload')

    if (sHosterName == 'FileBase'):
        return cHosterHandler().getHoster('filebase')

    if (sHosterName == 'MyStream'):
        return cHosterHandler().getHoster('mystream')

    return False
コード例 #51
0
def parseSubChannels():    
    oGui = cGui()

    oInputParameterHandler = cInputParameterHandler()
    if (oInputParameterHandler.exist('channelUrl') and oInputParameterHandler.exist('channelType')):
        sChanellUrl = oInputParameterHandler.getValue('channelUrl')

        iChannelType = oInputParameterHandler.getValue('channelType')

        sCategoryName = 'No category'

        if (iChannelType == '0'):
            sCategoryName = 'No category'

        if (iChannelType == '1'):
            sCategoryName = 'Entertainment'

        if (iChannelType == '2'):
            sCategoryName = 'Kids'

        if (iChannelType == '3'):
            sCategoryName = 'Music'

        if (iChannelType == '4'):
            sCategoryName = 'News'

        if (iChannelType == '5'):
            sCategoryName = 'Sports'

        if (iChannelType == '5'):
            sCategoryName = '.+?'

        sPattern ='<tr><td class="competition"[^>]+>' + str(sCategoryName) + '</td></tr><tr><td></td><td><table[^>]+>(.+?)</table>'

        # request
        oRequest = cRequestHandler(sChanellUrl)
        sHtmlContent = oRequest.request()

        # parse content
        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)

        if (aResult[0] == True):
            for aEntry in aResult[1]:
                sHtmlContent = aEntry                
                sPattern = '<td onclick="window.open\(\\\'([^\']+)\\\'\); return false;" style="cursor: pointer; padding-top: 1px; padding-bottom: 1px;">([^"]+)</td>'

                oParser = cParser()
                aResult = oParser.parse(sHtmlContent, sPattern)
                
                if (aResult[0] == True):
                    for aEntry in aResult[1]:
                        oHoster = cHosterHandler().getHoster('myp2p')
                        oHoster.setDisplayName(aEntry[1])
			oHoster.setFileName(str(aEntry[1]))
                        cHosterGui().showHoster(oGui, oHoster, aEntry[0])

    oGui.setEndOfDirectory()
コード例 #52
0
def __checkHoster(sHosterName):
    sHosterName = sHosterName.lower()

    if (sHosterName == 'mystream.to'):
        return cHosterHandler().getHoster('mystream')

    if (sHosterName == 'megavideo.com'):
        return cHosterHandler().getHoster('megavideo')

    if (sHosterName == 'duckload.com'):
        return cHosterHandler().getHoster('duckload')

    if (sHosterName == 'zshare.net'):
        return cHosterHandler().getHoster('zshare')

    if (sHosterName == 'videoweed.com'):
       return cHosterHandler().getHoster('videoweed')

    if (sHosterName == 'tubeload.to'):
       return cHosterHandler().getHoster('tubeload')

    if (sHosterName == 'qip.ru'):
        return cHosterHandler().getHoster('qip')

    return False
           
コード例 #53
0
def getHosterUrlandPlay():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    #sHoster = oInputParameterHandler.getValue('hosterName')
    sSecurityValue = oInputParameterHandler.getValue('securityCookie')
    sTitle = oInputParameterHandler.getValue('sTitle')

    sUrl = sUrl.replace('&amp;', '&')
    oRequest = cRequestHandler(sUrl)
    oRequest.addHeaderEntry('Cookie', sSecurityValue)
    oRequest.addHeaderEntry('Referer', 'http://kinox.to/')
    sHtmlContent = oRequest.request()
    #pattern for stream url
    sPattern = '<a rel=\\\\"(.*?)\\\\"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if (aResult[0]):
        aMovieParts = aResult[1]
        if (len(aMovieParts) > 1):
            iCounter = 0
            for sPartUrl in aMovieParts:
                #sPartUrl = sPartUrl.replace('\\/', '/')
                iCounter = iCounter + 1

                #oHoster = cHosterHandler().getHoster2(sPartUrl)
                #if (oHoster != False):
                oGuiElement = cGuiElement()
                oGuiElement.setSiteName(SITE_IDENTIFIER)
                oGuiElement.setFunction('multiPartMovie')
                oGuiElement.setTitle("Part " + str(iCounter))
                #oGuiElement.setThumbnail(sThumbnail)

                oOutputParameterHandler = cOutputParameterHandler()
                oOutputParameterHandler.addParameter('sUrl',
                                                     URL_MIRROR + sPartUrl)
                oOutputParameterHandler.addParameter(
                    'sTitle', sTitle + " Part " + str(iCounter))
                oOutputParameterHandler.addParameter('securityCookie',
                                                     sSecurityValue)
                oGui.addFolder(oGuiElement, oOutputParameterHandler)

    else:
        #pattern for stream url
        sPattern = '<a\shref=\\\\"(.*?)\\\\"'
        oParser = cParser()
        aResult = oParser.parse(sHtmlContent, sPattern)
        if (aResult[0]):
            aMovieParts = aResult[1]
            sPartUrl = aMovieParts[0].replace('\\/', '/')
            oHoster = cHosterHandler().getHoster2(sPartUrl)
            cHosterGui().showHosterMenuDirect(oGui,
                                              oHoster,
                                              sPartUrl,
                                              sFileName=sTitle)
    oGui.setEndOfDirectory()
コード例 #54
0
def __getMovieUrls(oGui, sHtmlContent, sPattern, sLabel, sTitle):
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)

    if (aResult[0] == True):
        for aEntry in aResult[1]:
            oHoster = cHosterHandler().getHoster('bronline')
            oHoster.setDisplayName(sLabel)
            if (sTitle != False):
                oHoster.setFileName(sTitle)
            cHosterGui().showHoster(oGui, oHoster, str(aEntry))
コード例 #55
0
def parseStream():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')

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

    sStreamUrl = __isAsx(sHtmlContent)
    if (sStreamUrl != False):
        #print 'ASX'
        oHoster = cHosterHandler().getHoster('asx')
        cHosterGui().showHoster(oGui, oHoster, sStreamUrl)
        oGui.setEndOfDirectory()
        return

    sStreamUrl = __isSilverlight(sHtmlContent)
    if (sStreamUrl != False):
        #print 'SILVERLIGHT'
        oHoster = cHosterHandler().getHoster('silverlight')
        cHosterGui().showHoster(oGui, oHoster, sStreamUrl)
        oGui.setEndOfDirectory()
        return

    sStreamUrl = __isRtmp(sHtmlContent)
    if (sStreamUrl != False):
        #print 'RTMP WITH FLV'
        oHoster = cHosterHandler().getHoster('silverlight')
        cHosterGui().showHoster(oGui, oHoster, sStreamUrl)
        oGui.setEndOfDirectory()
        return

    if (__isIFrameWithSwf(sHtmlContent)):
        print 'SWF - FUUU'

    if (__isJustinTv(sHtmlContent)):
        print 'JUSTIN - FUUU'

    oGui.setEndOfDirectory()
コード例 #56
0
def __createTrailerMenuEntry(oGui, sHtmlContent, sLanguage):
    sPattern = '<a href="([^"]+)" target="_blank" title="([^"]+)".*?>'
    oParser = cParser()
    aResult = oParser.parse(str(sHtmlContent), sPattern)

    if (aResult[0] == True):
        for aEntry in aResult[1]:
            oHoster = cHosterHandler().getHoster('moviemaze')
            sTitle = __createTitle(aEntry[1]) + ' (' + sLanguage + ')'
            oHoster.setDisplayName(sTitle)
	    oHoster.setFileName(sTitle)
            sUrl = URL_MAIN + str(aEntry[0])
            cHosterGui().showHoster(oGui, oHoster, sUrl)