本文整理汇总了Python中ParameterHandler.setParam方法的典型用法代码示例。如果您正苦于以下问题:Python ParameterHandler.setParam方法的具体用法?Python ParameterHandler.setParam怎么用?Python ParameterHandler.setParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterHandler
的用法示例。
在下文中一共展示了ParameterHandler.setParam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __parseMovieList
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import setParam [as 别名]
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)
示例2: showHosters
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import setParam [as 别名]
def showHosters():
oGui = cGui()
oParams = ParameterHandler()
sUrl = oParams.getValue('siteUrl')
sTitle = oParams.getValue('sTitle')
oRequestHandler = cRequestHandler(sUrl)
sHtmlContent = oRequestHandler.request()
sPattern = '<h3>Hoster dieser Episode(.*?)</ul>'
oParser = cParser()
aResult = oParser.parse(sHtmlContent, sPattern)
if aResult[0]:
sHtmlContent = aResult[1][0]
sPattern = '<li><a href="(.+?)"><span .+? class="icon (.+?)"></span>.+?</a>'
aResult = oParser.parse(sHtmlContent, sPattern)
if aResult[0]:
for sUrl, sHoster in aResult[1]:
sUrl = '%s/%s' % (URL_MAIN, sUrl)
oGuiElement = cGuiElement(sHoster, SITE_IDENTIFIER, 'getHosterUrlandPlay')
oParams.setParam('siteUrl', sUrl)
oParams.setParam('sTitle', sTitle)
oGui.addFolder(oGuiElement, oParams, bIsFolder=True)
oGui.setEndOfDirectory()
示例3: showXXX
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import setParam [as 别名]
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()
示例4: showHosters
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import setParam [as 别名]
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()
示例5: showMovies
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import setParam [as 别名]
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 = ParameterHandler()
oParams.setParam('siteUrl',aResult[1][0])
oGui.addNextPage(SITE_IDENTIFIER, 'showMovies', oParams)
oGui.setView('movies')
oGui.setEndOfDirectory()
示例6: showGenres
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import setParam [as 别名]
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()
示例7: __createMainMenuItem
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import setParam [as 别名]
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)
示例8: __createMenuEntry
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import setParam [as 别名]
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 = ""
示例9: showSeriesMenu
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import setParam [as 别名]
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()
示例10: showMovieMenu
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import setParam [as 别名]
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()
示例11: showDocuMenu
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import setParam [as 别名]
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()
示例12: load
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import setParam [as 别名]
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()
示例13: __parseMovieResultSite
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import setParam [as 别名]
def __parseMovieResultSite(oGui, siteUrl, normalySiteUrl = '', iPage = 1):
if not normalySiteUrl:
normalySiteUrl = siteUrl+'&page='
params = ParameterHandler()
sPattern = '<a class="p1" href="[^"]+".*?<img class="large" src="(http://[^"]+)"(.*?)<a href="([^"]+)" id="([^"]+)">([^<]+)<(.*?)</tr>'
#sPattern = 'class="alt1Active".*?<a href="(forumdisplay.php[^"]+)".*?>([^<]+)<.*?(src="([^"]+)|</td>).*?</tr>' #Serien
# request
sHtmlContent = __getHtmlContent(sUrl = siteUrl)
sHtmlContent
# parse content
oParser = cParser()
aResult = oParser.parse(sHtmlContent, sPattern)
if (aResult[0] == False):
return
total = len(aResult[1])
for aEntry in aResult[1]:
sMovieTitle = aEntry[4].replace('&','&')
sTitle = sMovieTitle
sUrl = URL_SHOW_MOVIE + str(aEntry[3]).replace('thread_title_', '')
year = ''
aResult = oParser.parse(aEntry[5], ' ([0-9]{4}) -')
if aResult[0]:
year = aResult[1][0]
aResult = oParser.parse(aEntry[1], '(title="HD Quali")')
if aResult[0]:
sTitle = sTitle + ' [HD]'
oGuiElement = cGuiElement(sTitle,SITE_IDENTIFIER,'getHosters')
oGuiElement.setMediaType('movie')
oGuiElement.setYear(year)
oGuiElement.setThumbnail(aEntry[0])
params.setParam('movieUrl', sUrl)
params.setParam('sMovieTitle', sMovieTitle)
oGui.addFolder(oGuiElement, params, bIsFolder = False, iTotal = total)
# check for next site
iTotalPages = __getTotalPages(iPage, sHtmlContent)
if (iTotalPages >= int(iPage)+1):
params = ParameterHandler()
params.setParam('iPage', int(iPage)+1)
params.setParam('normalySiteUrl', normalySiteUrl)
params.setParam('siteUrl', normalySiteUrl+str(int(iPage)+1))
oGui.addNextPage(SITE_IDENTIFIER,'parseMovieResultSite', params, iTotalPages)
if iTotalPages > 1:
oGuiElement = cGuiElement('Go to page x of '+str(iTotalPages),SITE_IDENTIFIER,'gotoPage')
params = ParameterHandler()
oGui.addFolder(oGuiElement, params)
oGui.setView('movies')
示例14: showEpisodes
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import setParam [as 别名]
def showEpisodes():
oGui = cGui()
oParams = ParameterHandler()
sShowTitle = oParams.getValue('Title')
sUrl = oParams.getValue('siteUrl')
sImdb = oParams.getValue('imdbID')
sSeason = oParams.getValue('Season')
logger.info("%s: show episodes of '%s' season '%s' " % (SITE_NAME, sShowTitle, sSeason))
oRequestHandler = cRequestHandler(sUrl)
sHtmlContent = oRequestHandler.request();
sPattern = '<table>(.*?)</table>'
oParser = cParser()
aResult = oParser.parse(sHtmlContent, sPattern)
if (aResult[0] == True):
sHtmlContent = aResult[1][0]
sPattern = '<td>([^<]+)</td>\s*<td><a href="([^"]+)">(.*?)</a>.*?<td class="nowrap">(\s*<a|\s*</td).*?</tr>'
aResult = oParser.parse(sHtmlContent, sPattern)
if (aResult[0] == True):
for aEntry in aResult[1]:
if aEntry[3].strip() == '</td':
continue
sNumber = str(aEntry[0]).strip()
oGuiElement = cGuiElement('Episode ' + sNumber, SITE_IDENTIFIER, 'showHosters')
if META == True and not sImdb == '':
oMetaget = metahandlers.MetaData()
meta = oMetaget.get_episode_meta(sShowTitle, sImdb, sSeason, sNumber)
meta['TVShowTitle'] = sShowTitle
oGuiElement.setItemValues(meta)
oGuiElement.setThumbnail(meta['cover_url'])
oGuiElement.setFanart(meta['backdrop_url'])
sPattern = '<strong>(.*?)</strong>'
aResultTitle = oParser.parse(str(aEntry[2]), sPattern)
if (aResultTitle[0]== True):
sTitleName = str(aResultTitle[1][0]).strip()
else:
sPattern = '<span lang="en">(.*?)</span>'
aResultTitle = oParser.parse(str(aEntry[2]), sPattern)
if (aResultTitle[0]== True):
sTitleName = str(aResultTitle[1][0]).strip()
else:
sTitleName = ''
sTitle = sNumber
sTitleName = cUtil().unescape(sTitleName.decode('utf-8')).encode('utf-8')
oParams.setParam('EpisodeTitle', sTitleName)
sTitle = sTitle + ' - ' + sTitleName
oGuiElement.setTitle(sTitle)
oParams.setParam('siteUrl', URL_MAIN + '/' + str(aEntry[1]))
oParams.setParam('EpisodeNr', sNumber)
oParams.setParam('Title', sShowTitle+' - S'+sSeason+'E'+sTitle)
oGui.addFolder(oGuiElement, oParams, iTotal = len(aResult[1]))
oGui.setView('episodes')
oGui.setEndOfDirectory()
示例15: __createMainMenuEntry
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import setParam [as 别名]
def __createMainMenuEntry(oGui, sMenuName, iCategoryId, sSecurityValue=''):
oGuiElement = cGuiElement()
oGuiElement.setSiteName(SITE_IDENTIFIER)
oGuiElement.setTitle(sMenuName)
oGuiElement.setFunction('parseMovieResultSite')
params = ParameterHandler()
params.setParam('normalySiteUrl', URL_CATEGORIES + str(iCategoryId) + '&order=desc&page=')
params.setParam('siteUrl', URL_CATEGORIES + str(iCategoryId) + '&order=desc&page=1')
params.setParam('iPage', 1)
params.setParam('securityCookie', sSecurityValue)
oGui.addFolder(oGuiElement, params)