Example #1
0
def showHosters():
    sUrl = ParameterHandler().getValue('entryUrl')
    sHtmlContent = cRequestHandler(sUrl).request()
    pattern = 'src="([^"]+)"[^>]*frameborder'
    aResult = cParser().parse(sHtmlContent, pattern)
    hosters = []
    for hUrl in aResult[1]:
        if not hUrl.startswith('http'):
            hUrl = 'https:' + hUrl
        if 'view.php' in hUrl:
            oRequest = cRequestHandler(hUrl)
            oRequest.addHeaderEntry('Referer', hUrl)
            sHtmlContent = oRequest.request()
            isMatch, aResult = cParser().parse(sHtmlContent, "(?:jbdaskgs|m3u8File)[^>]=[^>]'([^']+).*?urlVideo = '([^;]+)'")
            for sID, sUrl in aResult:
                sUrl = sUrl.replace("'+m3u8File+'", sID)
                sHtmlContent = cRequestHandler(sUrl).request()
                url = cParser().urlparse(sUrl)
                pattern = 'RESOLUTION=\d+x([\d]+)([^#]+)'
                isMatch, aResult = cParser().parse(sHtmlContent, pattern)
            for sUrl, sName in aResult:
                hoster = {'link': 'http://' + url + sName, 'name': sUrl}
                hosters.append(hoster)
    if hosters:
        hosters.append('getHosterUrl')
    return hosters
Example #2
0
def getEpisodes():
    oGui = cGui()
    oParser = cParser()
    params = ParameterHandler()
    eUrl = ParameterHandler().getValue('eUrl')
    eUrl = eUrl.replace(" ", "%20"); eUrl = eUrl.replace("+", "%2B") #Decode(Leerzeichen, +)
    isMovie = True

    pattern = "class='post-title entry-title'><a href='([^']+)'>" #link
    pattern += "([^><]+).*?" #ep_Name
    pattern += '<img.*?src="([^"]+)".*?bung:.*?/>' #Img
    pattern += "(.*?)<br./>" #plot /Gen

    sHtmlContent = cRequestHandler(eUrl).request()
    aResult = oParser.parse(sHtmlContent, pattern)
    bResult = oParser.parse(sHtmlContent, "older-link'.*?href='([^']+)'")

    if not aResult[0]:
        oGui.showInfo('xStream', 'Es wurde kein Eintrag gefunden')
        return

    total = len(aResult[1]) 
    for link, title, img, plot in aResult[1]:
        GuiElement = cGuiElement(title, SITE_IDENTIFIER, 'getHosters')
        GuiElement.setMediaType('movie' if isMovie else 'tvshow')
        GuiElement.setThumbnail(img)
        plot.replace('<b>', '')
        GuiElement.setDescription(plot)#.decode('iso-8859-1').encode('utf-8'))
        #GuiElement.setYear(year)
        params.setParam('siteUrl', link)
        params.setParam('sName', title)
        oGui.addFolder(GuiElement, params, False, total)

    if 'entry-title' in cRequestHandler(bResult[1][0]).request():
        params.setParam('eUrl', bResult[1][0])
        oGui.addFolder(cGuiElement("Weitere Episoden -->", SITE_IDENTIFIER, 'getEpisodes'),params)
    
    #logger.info('[[suhmser]] %s: ' % str(bResult[1][0]))    
    oGui.setView('movies')
    oGui.setEndOfDirectory()
def getHosterUrl(sUrl=False):
    if not sUrl:
        sUrl = ParameterHandler().getValue('sUrl')
    return [{'streamUrl': sUrl.replace(' ', '%20'), 'resolved': True}]