本文整理汇总了Python中ParameterHandler.getValue方法的典型用法代码示例。如果您正苦于以下问题:Python ParameterHandler.getValue方法的具体用法?Python ParameterHandler.getValue怎么用?Python ParameterHandler.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterHandler
的用法示例。
在下文中一共展示了ParameterHandler.getValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __getHtmlContent
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import getValue [as 别名]
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()
示例2: getHosters
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import getValue [as 别名]
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
示例3: showMovies
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import getValue [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()
示例4: showHosters
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import getValue [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()
示例5: showHosters
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import getValue [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()
示例6: showEpisodes
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import getValue [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()
示例7: parseMovieResultSite
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import getValue [as 别名]
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()
示例8: showEpisodes
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import getValue [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()
oParser = cParser()
hParser = HTMLParser.HTMLParser()
sPattern = '<tr>\s*<td>(.+?)</td>\s*<td><a href="(.+?)">\s*<strong>(.+?)</strong>.*?</tr>'
aResult = oParser.parse(sHtmlContent, sPattern)
try:
if aResult[0]:
for sNumber, sUrl, episodeTitle in aResult[1]:
sUrl = '%s/%s' % (URL_MAIN, sUrl)
episodeTitle = hParser.unescape(episodeTitle)
oGuiElement = cGuiElement('Episode ' + sNumber, SITE_IDENTIFIER, 'showHosters')
if META and 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'])
# how do we detect the language of the episode ?
# fixed to 'de' for now as most of it seems to be german on burning-seri.es
sTitle = 's%se%s - %s (%s)' % (sSeason.zfill(2), sNumber.zfill(2), episodeTitle, 'de')
oGuiElement.setTitle(sTitle)
oParams.setParam('siteUrl', sUrl)
oParams.setParam('EpisodeNr', sNumber)
oParams.setParam('sTitle', sTitle)
oGui.addFolder(oGuiElement, oParams, iTotal=len(aResult[1]))
oGui.setView('episodes')
except:
import traceback
traceback.print_exc()
oGui.setEndOfDirectory()
示例9: gotoPage
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import getValue [as 别名]
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()
示例10: _search
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import getValue [as 别名]
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)
示例11: getHosterUrl
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import getValue [as 别名]
def getHosterUrl(sUrl):
results = []
if 'g-stream.in/secure/' in sUrl :
sHoster = sUrl.split('secure/')[-1].split('/')[0]
params = ParameterHandler()
oRequest = cRequestHandler(sUrl, False)
oRequest.addHeaderEntry('Cookie', params.getValue('securityCookie'))
oRequest.addHeaderEntry('Referer', params.getValue('movieUrl'))
try:
oRequest.request()
sUrl = oRequest.getRealUrl()
sUrl = 'http://%s%s' % (sHoster, sUrl.split(sHoster)[-1])
except:
pass
result = {}
result['streamUrl'] = sUrl
result['resolved'] = False
results.append(result)
return results
示例12: play
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import getValue [as 别名]
def play():
oInputParameterHandler = ParameterHandler()
if (oInputParameterHandler.exist('sUrl') and oInputParameterHandler.exist('sTitle')):
sUrl = oInputParameterHandler.getValue('sUrl')
sTitle = oInputParameterHandler.getValue('sTitle')
oRequest = cRequestHandler(sUrl)
sHtmlContent = oRequest.request()
sPattern = 'ake_playlist.php%3Fflv%3D(.*?)%26'
oParser = cParser()
aResult = oParser.parse(sHtmlContent, sPattern)
if (aResult[0] == True):
sStreamUrl = URL_GET_STREAM + str(aResult[1][0])
result = {}
result['streamUrl'] = sStreamUrl
result['resolved'] = True
return result
return False
示例13: getHosterUrlandPlay
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import getValue [as 别名]
def getHosterUrlandPlay():
oGui = cGui()
oParams = ParameterHandler()
sTitle = oParams.getValue('sTitle')
sUrl = oParams.getValue('siteUrl')
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]:
sStreamUrl = aResult[1][0]
oHoster = cHosterHandler().getHoster(sStreamUrl)
cHosterGui().showHosterMenuDirect(oGui, oHoster, sStreamUrl, sFileName=sTitle)
oGui.setEndOfDirectory()
return
oGui.setEndOfDirectory()
示例14: getHosters
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import getValue [as 别名]
def getHosters():
hosters = []
params = ParameterHandler()
if (params.exist('movieUrl') and params.exist('sMovieTitle')):
sSiteUrl = params.getValue('movieUrl')
sMovieTitle = params.getValue('sMovieTitle')
sHtmlContent = __getHtmlContent(sUrl = sSiteUrl)
sPattern = 'id="ame_noshow_post.*?<a href="([^"]+)" title="[^"]+" target="_blank">([^<]+)</a>'
aResult = cParser().parse(sHtmlContent, sPattern)
if aResult[0] == True:
aHosters = []
for aEntry in aResult[1]:
sUrl = aEntry[0]
# extract hoster domainname
if 'g-stream.in/secure/' in sUrl :
sHoster = sUrl.split('secure/')[-1].split('/')[0].split('.')[-2]
else:
sHoster = sUrl.split('//')[-1].split('/')[0].split('.')[-2]
hoster = {}
hoster['link'] = sUrl
hoster['name'] = sHoster
hosters.append(hoster)
hosters.append('getHosterUrl')
return hosters
示例15: play
# 需要导入模块: import ParameterHandler [as 别名]
# 或者: from ParameterHandler import getValue [as 别名]
def play(self, siteResult=False):
oGui = cGui()
oInputParameterHandler = ParameterHandler()
sMediaUrl = oInputParameterHandler.getValue('sMediaUrl')
sFileName = oInputParameterHandler.getValue('sFileName')
if not sFileName:
sFileName = oInputParameterHandler.getValue('Title')
if not sFileName:
sFileName = oInputParameterHandler.getValue('title')
if not sFileName: #nur vorrübergehend
sFileName = oInputParameterHandler.getValue('sMovieTitle')
sSeason = oInputParameterHandler.getValue('season')
sEpisode = oInputParameterHandler.getValue('episode')
sShowTitle = oInputParameterHandler.getValue('TvShowTitle')
sThumbnail = oInputParameterHandler.getValue('thumb')
if siteResult:
sMediaUrl = siteResult['streamUrl']
logger.info('call play: ' + sMediaUrl)
if siteResult['resolved']:
sLink = sMediaUrl
else:
try:
sLink = urlresolver.resolve(sMediaUrl)
except:
sLink = False
#raise
elif sMediaUrl:
logger.info('call play: ' + sMediaUrl)
sLink = urlresolver.resolve(sMediaUrl)
else:
oGui.showError('xStream', 'Hosterlink not found', 5)
return False
if sLink != False:
logger.info('file link: ' + sLink)
oGuiElement = cGuiElement()
oGuiElement.setSiteName(self.SITE_NAME)
oGuiElement.setMediaUrl(sLink)
oGuiElement.setTitle(sFileName)
if sThumbnail:
oGuiElement.setThumbnail(sThumbnail)
if sShowTitle:
oGuiElement.addItemProperties('Episode',sEpisode)
oGuiElement.addItemProperties('Season',sSeason)
oGuiElement.addItemProperties('TvShowTitle',sShowTitle)
#listItem = xbmcgui.ListItem(path=sLink)
#listItem.setProperty('IsPlayable', 'true')
#pluginHandle = cPluginHandler().getPluginHandle()
#return xbmcplugin.setResolvedUrl(pluginHandle, True, listItem)
oPlayer = cPlayer()
oPlayer.clearPlayList()
oPlayer.addItemToPlaylist(oGuiElement)
if self.dialog:
try:
self.dialog.close()
except:
pass
oPlayer.startPlayer()
else:
logger.info('file link: ' + str(sLink))
oGui.showError('xStream', 'File deleted or Link could not be resolved', 5)
return False
return True