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


Python ParameterHandler类代码示例

本文整理汇总了Python中ParameterHandler的典型用法代码示例。如果您正苦于以下问题:Python ParameterHandler类的具体用法?Python ParameterHandler怎么用?Python ParameterHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ParameterHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __parseMovieList

def __parseMovieList(oGui, sHtml, oParams = False):
    if not oParams:
        oParams = ParameterHandler()
    sPattern = '<div class="avs_thumb".*?href="([^"]+)".*?class="image" src="([^"]+)".*?<span class="title">([^<]+)</span>'
    oParser = cParser()
    aResult = oParser.parse(sHtml, sPattern)
    if not aResult[0]:
        return
    sFunction = 'getHosters'
    iTotal = len(aResult[1])
    for aEntry in aResult[1]:
        sLabel = aEntry[2].strip()
        sNextUrl = aEntry[0]
        sThumb = aEntry[1] 
        oParams.setParam('siteUrl',sNextUrl)
        oParams.setParam('Title', sLabel)
        oGuiElement = cGuiElement(sLabel, SITE_IDENTIFIER, sFunction)
        oGuiElement.setThumbnail(sThumb)
        if META:
            oMetaget = metahandlers.MetaData()
            meta = oMetaget.get_meta('movie', sLabel)
            oGuiElement.setItemValues(meta)
            if not meta['cover_url'] == '':
                oGuiElement.setThumbnail(meta['cover_url'])
            if not meta['backdrop_url'] == '':
                oGuiElement.setFanart(meta['backdrop_url'])
        oGui.addFolder(oGuiElement, oParams, bIsFolder = False, iTotal = iTotal)
开发者ID:Lokke,项目名称:plugin.video.xstream,代码行数:27,代码来源:stream_oase_tv.py

示例2: showXXX

def showXXX():
    params = ParameterHandler()
    oGui = cGui()
    __createMainMenuEntry(oGui, 'Alle Pornos', 661)
    #im Moment können keine Clips abgespielt werden da die Cliphoster nicht aufgelöst werden können
    #__createMainMenuEntry(oGui, 'Clips', 669, sSecurityValue)
       
    oGuiElement = cGuiElement()
    oGuiElement.setSiteName(SITE_IDENTIFIER)
    oGuiElement.setFunction('displaySearch')
    oGuiElement.setTitle('Suche XXX Streams')
    params.setParam('searchType', '530')
    oGui.addFolder(oGuiElement, params)
    
    __createMainMenuEntry(oGui, 'Amateure', '661&prefixid=Amateure1')
    __createMainMenuEntry(oGui, 'Anal', '661&prefixid=Anal')
    __createMainMenuEntry(oGui, 'Asia', '661&prefixid=Asia')
    __createMainMenuEntry(oGui, 'Black', '661&prefixid=Ebony')
    __createMainMenuEntry(oGui, 'Blowjob', '661&prefixid=Blowjob')
    __createMainMenuEntry(oGui, 'Deutsch', '661&prefixid=Deutsch')
    __createMainMenuEntry(oGui, 'Fetish', '661&prefixid=Fetish')
    __createMainMenuEntry(oGui, 'Große Brüste', '661&prefixid=GrosseBrueste')
    __createMainMenuEntry(oGui, 'Gruppensex', '661&prefixid=Gruppensex')
    __createMainMenuEntry(oGui, 'Gay', '661&prefixid=Gay')
    __createMainMenuEntry(oGui, 'Hardcore', '661&prefixid=Hardcore')
    __createMainMenuEntry(oGui, 'International', '661&prefixid=International')
    __createMainMenuEntry(oGui, 'Lesben', '661&prefixid=Lesben')
    __createMainMenuEntry(oGui, 'Masturbation', '661&prefixid=Masturbation')
    __createMainMenuEntry(oGui, 'Teens', '661&prefixid=Teens')
    oGui.setEndOfDirectory()
开发者ID:choiipad,项目名称:plugin.video.xstream,代码行数:30,代码来源:gstream_in.py

示例3: showMovies

def showMovies():
    oParams = ParameterHandler()
    if oParams.getValue('siteUrl'):
        sUrl = URL_MAIN+oParams.getValue('siteUrl')     
    else:
        return  
    oGui = cGui()    
       
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()

    sPattern = '<div id="inner_content".*?<div class="clr">'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if not aResult[0]:
        return
    # parse movie entries
    __parseMovieList(oGui, str(aResult[1][0]), oParams = oParams)
    # check for next site
    aResult = oParser.parse(sHtmlContent, 'href="([^"]+)" title="Weiter"')
    if aResult[0]:
        oParams.setParam('siteUrl',aResult[1][0])
        oGuiElement = cGuiElement(' Next page ...', SITE_IDENTIFIER, 'showMovies')
        oGui.addFolder(oGuiElement, oParams)
    oGui.setView('movies')
    oGui.setEndOfDirectory()
开发者ID:Lokke,项目名称:plugin.video.xstream,代码行数:26,代码来源:stream_oase_tv.py

示例4: getHosters

def getHosters():
    oParams = ParameterHandler()
    sTitle = oParams.getValue('Title')
    sUrl = oParams.getValue('siteUrl')   
    
    logger.info("%s: hosters for movie '%s' " % (SITE_IDENTIFIER, sTitle)) 
    
    oRequestHandler = cRequestHandler(URL_MAIN+sUrl)
    sHtmlContent = oRequestHandler.request();

    sPattern = '<iframe src="([^"]+)"'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent.lower(), sPattern)
    hosters = []
    sFunction='getHosterUrl'
    if (aResult[0] == True):
        for aEntry in aResult[1]:
            hoster = {}
            hoster['link'] = aEntry
            # extract domain name
            temp = aEntry.split('//')
            temp = str(temp[-1]).split('/')
            temp = str(temp[0]).split('.')
            hoster['name'] = temp[-2]
            hosters.append(hoster)
    hosters.append(sFunction)
    return hosters
开发者ID:Johsnon,项目名称:plugin.video.xstream,代码行数:27,代码来源:stream_oase_tv.py

示例5: showGenres

def showGenres():
    oGui = cGui()
    oParams = ParameterHandler()
    
    oParams.setParam('siteUrl','/index.php/hd-oase/video/latest')
    oGuiElement = cGuiElement('Neuste', SITE_IDENTIFIER, 'showMovies')
    oGui.addFolder(oGuiElement, oParams)
    
    sUrl = URL_HD_GENRE
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    sPattern = '<div id="inner_content".*?<div class="clr">'
    oParser = cParser()
    aResult = oParser.parse(sHtmlContent, sPattern)
    if not aResult[0]:
        return
    sPattern = '<div class="avs_thumb".*?href="([^"]+)".*?<span class="name">(.*?)</span>'   
    aResult = oParser.parse(aResult[1][0], sPattern)
    if not aResult[0]:
        return
    sFunction = 'showMovies'
    iTotal = len(aResult[1])
    for aEntry in aResult[1]:
        sLabel = aEntry[1]
        sUrl = aEntry[0]
        oParams.setParam('siteUrl',sUrl)
        oGuiElement = cGuiElement(sLabel, SITE_IDENTIFIER, sFunction)
        oGui.addFolder(oGuiElement, oParams, iTotal = iTotal+1)
    oGui.setEndOfDirectory()
开发者ID:Johsnon,项目名称:plugin.video.xstream,代码行数:29,代码来源:stream_oase_tv.py

示例6: __getHtmlContent

def __getHtmlContent(sUrl = None, sSecurityValue=None):
    params = ParameterHandler()

    # Test if a url is available and set it
    if sUrl is None and not params.exist('siteUrl'):
        logger.info("There is no url we can request.")
        return False
    else:
        if sUrl is None:
            sUrl = params.getValue('siteUrl')

    # Test if a security value is available
    if sSecurityValue is None:
        if params.exist('securityCookie'):
            sSecurityValue = params.getValue('securityCookie')
        else :
            sSecurityValue = ''

    # Make the request
    oRequest = cRequestHandler(sUrl)
    #oRequest.addHeaderEntry('Cookie', sSecurityValue)
    #oRequest.addHeaderEntry('Accept', '*/*')
    #oRequest.addHeaderEntry('Host', 'g-stream.in')

    return oRequest.request()
开发者ID:choiipad,项目名称:plugin.video.xstream,代码行数:25,代码来源:gstream_in.py

示例7: __createMainMenuItem

def __createMainMenuItem(oGui, sTitle, sPlaylistId):
    oGuiElement = cGuiElement()
    oGuiElement.setSiteName(SITE_IDENTIFIER)
    oGuiElement.setFunction('listVideos')
    oGuiElement.setTitle(sTitle)
    oOutputParameterHandler = ParameterHandler()
    oOutputParameterHandler.setParam('playlistId', sPlaylistId)
    oGui.addFolder(oGuiElement, oOutputParameterHandler)
开发者ID:Lokke,项目名称:plugin.video.xstream,代码行数:8,代码来源:bundesliga_de.py

示例8: __createMenuEntry

def __createMenuEntry(oGui, sFunction, sLabel, lParams, sMetaTitle='', iTotal=0):
    oParams = ParameterHandler()
    try:
        for param in lParams:
            oParams.setParam(param[0], param[1])
    except Exception, e:
        logger.error("Can't add parameter to menu entry with label: %s: %s" % (sLabel, e))
        oParams = ""
开发者ID:krikkiteer,项目名称:xbmc-xstream-plugin,代码行数:8,代码来源:burning_series_org.py

示例9: showSeriesMenu

def showSeriesMenu():
    oGui = cGui()
    oParams = ParameterHandler()

    oGui.addFolder(cGuiElement('A-Z', SITE_IDENTIFIER, 'showCharacters'), oParams)
    #oGui.addFolder(cGuiElement('Genres',SITE_IDENTIFIER,'showGenres'),oParams)
    oParams.setParam('siteUrl', URL_FAVOURITE_SERIE_PAGE)
    oGui.addFolder(cGuiElement('Beliebteste Serien', SITE_IDENTIFIER, 'showFavItems'), oParams)
    oGui.setEndOfDirectory()
开发者ID:krikkiteer,项目名称:xbmc-xstream-plugin,代码行数:9,代码来源:kinox_to.py

示例10: gotoPage

def gotoPage():
    oGui = cGui()
    pageNum = oGui.showNumpad()
    if not pageNum:
        return
    params = ParameterHandler()
    siteUrl = params.getValue('normalySiteUrl')+pageNum
    __parseMovieResultSite(oGui, siteUrl, iPage = int(pageNum))
    oGui.setEndOfDirectory()
开发者ID:choiipad,项目名称:plugin.video.xstream,代码行数:9,代码来源:gstream_in.py

示例11: _search

def _search(oGui, sSearchText):
    params = ParameterHandler()
    sSearchType = params.getValue('searchType')
    sUrl = URL_SEARCH+'?do=process&childforums=1&do=process&exactname=1&forumchoice[]='+sSearchType+\
        '&query=' + str(sSearchText) + '&quicksearch=1&s=&securitytoken=guest&titleonly=1'
    oRequest = cRequestHandler(sUrl)
    oRequest.request()
    sUrl = oRequest.getRealUrl()
    __parseMovieResultSite(oGui, sUrl)
开发者ID:Lokke,项目名称:plugin.video.xstream,代码行数:9,代码来源:gstream_in.py

示例12: parseMovieResultSite

def parseMovieResultSite():
    oGui = cGui()
    params = ParameterHandler()
    if (params.exist('siteUrl')):
        siteUrl = params.getValue('siteUrl')
        normalySiteUrl = params.getValue('normalySiteUrl')
        iPage = params.getValue('iPage')
        __parseMovieResultSite(oGui, siteUrl, normalySiteUrl, iPage)
    oGui.setEndOfDirectory()
开发者ID:choiipad,项目名称:plugin.video.xstream,代码行数:9,代码来源:gstream_in.py

示例13: showMovieMenu

def showMovieMenu():
    oGui = cGui()
    oParams = ParameterHandler()

    oGui.addFolder(cGuiElement('Kinofilme', SITE_IDENTIFIER, 'showCinemaMovies'), oParams)
    oGui.addFolder(cGuiElement('A-Z', SITE_IDENTIFIER, 'showCharacters'), oParams)
    oGui.addFolder(cGuiElement('Genres', SITE_IDENTIFIER, 'showGenres'), oParams)
    oParams.setParam('siteUrl', URL_FAVOURITE_MOVIE_PAGE)
    oGui.addFolder(cGuiElement('Beliebteste Filme', SITE_IDENTIFIER, 'showFavItems'), oParams)
    oGui.setEndOfDirectory()
开发者ID:krikkiteer,项目名称:xbmc-xstream-plugin,代码行数:10,代码来源:kinox_to.py

示例14: load

def load():
    oGui = cGui()

    oParams = ParameterHandler()
    oParams.setParam('siteUrl', URL_SERIES)
    oGui.addFolder(cGuiElement('All Shows', SITE_IDENTIFIER, 'showSeries'), oParams)
    oGui.addFolder(cGuiElement('A-Z', SITE_IDENTIFIER, 'showCharacters'), oParams)
    oGui.addFolder(cGuiElement('Last Episodes', SITE_IDENTIFIER, 'showLastEpisodes'), oParams)
    oGui.addFolder(cGuiElement('Search', SITE_IDENTIFIER, 'showSearch'), oParams)

    oGui.setEndOfDirectory()
开发者ID:krikkiteer,项目名称:xbmc-xstream-plugin,代码行数:11,代码来源:streamallthis_ch.py

示例15: showDocuMenu

def showDocuMenu():
    oGui = cGui()
    oParams = ParameterHandler()

    oGui.addFolder(cGuiElement('A-Z', SITE_IDENTIFIER, 'showCharacters'), oParams)
    #oGui.addFolder(cGuiElement('Genres',SITE_IDENTIFIER,'showGenres'),oParams)
    oParams.setParam('siteUrl', URL_FAVOURITE_DOCU_PAGE)
    oGui.addFolder(cGuiElement('Beliebteste Dokumentationen', SITE_IDENTIFIER, 'showFavItems'), oParams)
    oParams.setParam('siteUrl', URL_LATEST_DOCU_PAGE)
    oGui.addFolder(cGuiElement('Neuste Dokumentationen', SITE_IDENTIFIER, 'showFavItems'), oParams)
    oGui.setEndOfDirectory()
开发者ID:krikkiteer,项目名称:xbmc-xstream-plugin,代码行数:11,代码来源:kinox_to.py


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