def showHoster(self, oGui, oHoster, sMediaUrl, sThumbnail, bGetRedirectUrl = False): oGuiElement = cGuiElement() oGuiElement.setSiteName(self.SITE_NAME) #oGuiElement.setFunction('showHosterMenu') oGuiElement.setFunction('play') oGuiElement.setTitle(oHoster.getDisplayName()) oGuiElement.setThumbnail(sThumbnail) oGuiElement.setIcon('host.png') oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sMediaUrl', sMediaUrl) oOutputParameterHandler.addParameter('sHosterIdentifier', oHoster.getPluginIdentifier()) oOutputParameterHandler.addParameter('bGetRedirectUrl', bGetRedirectUrl) oOutputParameterHandler.addParameter('sFileName', oHoster.getFileName()) #context playlit menu oContext = cContextElement() oContext.setFile('cHosterGui') oContext.setSiteName(self.SITE_NAME) oContext.setFunction('addToPlaylist') oContext.setTitle('Ajouter à la playlist') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) #context download menu oContext = cContextElement() oContext.setFile('cHosterGui') oContext.setSiteName(self.SITE_NAME) oContext.setFunction('download') oContext.setTitle('Télécharger') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) oGui.addFolder(oGuiElement, oOutputParameterHandler)
def createContexMenuPageSelect(self, oGuiElement, oOutputParameterHandler): #sSiteUrl = oGuiElement.getSiteName() oContext = cContextElement() oContext.setFile('cGui') oContext.setSiteName('cGui') oContext.setFunction('selectpage') oContext.setTitle('[COLOR azure]Selectionner page[/COLOR]') oOutputParameterHandler.addParameter('OldFunction', oGuiElement.getFunction()) oOutputParameterHandler.addParameter('sId', oGuiElement.getSiteName()) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) oContext = cContextElement() oContext.setFile('cGui') oContext.setSiteName('cGui') oContext.setFunction('viewback') oContext.setTitle('[COLOR azure]Retour Site[/COLOR]') oOutputParameterHandler.addParameter('sId', oGuiElement.getSiteName()) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def __createContextMenu(self, oGuiElement, oListItem): sPluginPath = cPluginHandler().getPluginPath(); aContextMenus = [] #Menus classiques reglés a la base if (len(oGuiElement.getContextItems()) > 0): for oContextItem in oGuiElement.getContextItems(): oOutputParameterHandler = oContextItem.getOutputParameterHandler() sParams = oOutputParameterHandler.getParameterAsUri() sTest = '%s?site=%s&function=%s&%s' % (sPluginPath, oContextItem.getFile(), oContextItem.getFunction(), sParams) aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s)" % (sTest,),)] #oListItem.addContextMenuItems(aContextMenus) oListItem.addContextMenuItems(aContextMenus, True) #Ajout de voir marque page oContextItem = cContextElement() oContextItem.setFile('cFav') oContextItem.setSiteName('cFav') oContextItem.setTitle('[COLOR teal]'+cConfig().getlanguage(30210)+'[/COLOR]') oContextItem.setFunction('getFavourites') oOutputParameterHandler = oContextItem.getOutputParameterHandler() sParams = oOutputParameterHandler.getParameterAsUri() sTest = '%s?site=%s&function=%s&contextFav=true&%s' % (sPluginPath, oContextItem.getFile(), oContextItem.getFunction(), sParams) aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.Container.Update(%s)" % (sTest,),)] oListItem.addContextMenuItems(aContextMenus) #Menu speciaux si metadata if oGuiElement.getTrailerUrl(): oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sHosterIdentifier', 'youtube') oOutputParameterHandler.addParameter('sMediaUrl', oGuiElement.getTrailerUrl()) oOutputParameterHandler.addParameter('sFileName', oGuiElement.getTitle()) oOutputParameterHandler.addParameter('sTitle', oGuiElement.getTitle()) oContextItem = cContextElement() oContextItem.setFile('cHosterGui') oContextItem.setSiteName('cHosterGui') oContextItem.setTitle('[COLOR azure]Bande Annonce[/COLOR]') oContextItem.setFunction('play') oContextItem.setOutputParameterHandler(oOutputParameterHandler) oOutputParameterHandler = oContextItem.getOutputParameterHandler() sParams = oOutputParameterHandler.getParameterAsUri() sTest = '%s?site=%s&function=%s&%s' % (sPluginPath, oContextItem.getFile(), oContextItem.getFunction(), sParams) aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s)" % (sTest,),)] oListItem.addContextMenuItems(aContextMenus) return oListItem
def createContexMenuDownload(self, oGuiElement, oOutputParameterHandler='', status='0'): if status == '0': oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('StartDownloadOneFile') oContext.setTitle('Demarrer ce telechargement') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) if status == '0' or status == '2': oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('delDownload') oContext.setTitle('Supprimer de la liste') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('DelFile') oContext.setTitle('[COLOR=red]Supprimer definitivement[/COLOR]') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) if status == '1': oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('StopDownloadList') oContext.setTitle('Arreter le telechargement') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) if status == '2': oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('ReadDownload') oContext.setTitle('Lire') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def __createContextMenu(self, oGuiElement, oListItem): sPluginPath = cPluginHandler().getPluginPath(); aContextMenus = [] if len(oGuiElement.getContextItems()) > 0: for oContextItem in oGuiElement.getContextItems(): oOutputParameterHandler = oContextItem.getOutputParameterHandler() sParams = oOutputParameterHandler.getParameterAsUri() sTest = "%s?site=%s&function=%s&%s" % (sPluginPath, oContextItem.getFile(), oContextItem.getFunction(), sParams) aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s)" % (sTest,),)] oListItem.addContextMenuItems(aContextMenus) #oListItem.addContextMenuItems(aContextMenus, True) if oGuiElement.getSiteName() != "cAboutGui": oContextItem = cContextElement() oContextItem.setFile("cAboutGui") oContextItem.setTitle("Ueber xStream") oContextItem.setFunction("show") oOutputParameterHandler = oContextItem.getOutputParameterHandler() sParams = oOutputParameterHandler.getParameterAsUri() sTest = "%s?site=%s&function=%s&%s" % (sPluginPath, oContextItem.getFile(), oContextItem.getFunction(), sParams) aContextMenus+= [ ( oContextItem.getTitle(), "Container.Update(%s)" % (sTest,),)] oListItem.addContextMenuItems(aContextMenus) return oListItem
def addMisc(self, sId, sFunction, sLabel, sIcon, sThumbnail, sDesc, oOutputParameterHandler = ''): cGui.CONTENT = "files" oGuiElement = cGuiElement() oGuiElement.setSiteName(sId) oGuiElement.setFunction(sFunction) oGuiElement.setTitle(sLabel) oGuiElement.setIcon(sIcon) oGuiElement.setThumbnail(sThumbnail) oGuiElement.setMeta(0) oGuiElement.getInfoLabel() oGuiElement.setDescription(sDesc) self.__createContexMenuWatch(oGuiElement, oOutputParameterHandler) #context oContext = cContextElement() oContext.setFile('cFav') oContext.setSiteName('cFav') oContext.setFunction('setFavorite') #oContext.setTitle('[COLOR teal]Marque-diver[/COLOR]') oContext.setTitle('[COLOR teal]'+cConfig().getLocalizedString(30208)+'[/COLOR]') #oOutputParameterHandler.addParameter('sTitle', sLabel) oOutputParameterHandler.addParameter('sId', sId) oOutputParameterHandler.addParameter('sFav', sFunction) oOutputParameterHandler.addParameter('sCat', 5) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) self.addFolder(oGuiElement, oOutputParameterHandler)
def __createContextMenu(self, oGuiElement, oListItem, bIsFolder, oOutputParams=''): sPluginPath = cPluginHandler().getPluginPath() aContextMenus = [] if len(oGuiElement.getContextItems()) > 0: for oContextItem in oGuiElement.getContextItems(): oOutputParameterHandler = oContextItem.getOutputParameterHandler() sParams = oOutputParameterHandler.getParameterAsUri() sTest = "%s?site=%s&function=%s&%s" % (sPluginPath, oContextItem.getFile(), oContextItem.getFunction(), sParams) aContextMenus += [(oContextItem.getTitle(), "XBMC.RunPlugin(%s)" % (sTest,),)] oContextItem = cContextElement() oContextItem.setTitle("Info") aContextMenus += [(oContextItem.getTitle(), "XBMC.Action(Info)",)] if not bIsFolder: oContextItem.setTitle("add to Playlist") aContextMenus += [(oContextItem.getTitle(), "XBMC.Action(Info)",)] oContextItem.setTitle("Download") aContextMenus += [(oContextItem.getTitle(), "XBMC.Action(Info)",)] oContextItem.setTitle("send to JDownloader") aContextMenus += [(oContextItem.getTitle(), "XBMC.Action(Info)",)] oListItem.addContextMenuItems(aContextMenus) return oListItem
def addMovie(self, sId, sFunction, sLabel, sIcon, sThumbnail, sDesc, oOutputParameterHandler = ''): cGui.CONTENT = "movies" oGuiElement = cGuiElement() oGuiElement.setSiteName(sId) oGuiElement.setFunction(sFunction) oGuiElement.setTitle(sLabel) oGuiElement.setIcon(sIcon) oGuiElement.setThumbnail(sThumbnail) oGuiElement.setMeta(1) oGuiElement.setDescription(sDesc) self.__createContexMenuWatch(oGuiElement, oOutputParameterHandler) self.__createContexMenuWriteFav(oGuiElement, oOutputParameterHandler) #oInputParameterHandler = cInputParameterHandler() #sUrl = oInputParameterHandler.getValue('siteUrl') #print oGuiElement.getMediaUrl() #context oContext = cContextElement() oContext.setFile('cFav') oContext.setSiteName('cFav') oContext.setFunction('writeFavourites') oContext.setTitle('[COLOR teal]Marque-film[/COLOR]') oOutputParameterHandler.addParameter('sTitle', sLabel) oOutputParameterHandler.addParameter('sId', sId) oOutputParameterHandler.addParameter('sFav', sFunction) oOutputParameterHandler.addParameter('sCat', 1) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) self.addFolder(oGuiElement, oOutputParameterHandler)
def addMovie(self, sId, sFunction, sLabel, sIcon, sThumbnail, sDesc, oOutputParameterHandler = ''): cGui.CONTENT = "movies" oGuiElement = cGuiElement() oGuiElement.setSiteName(sId) oGuiElement.setFunction(sFunction) oGuiElement.setTitle(sLabel) oGuiElement.setIcon(sIcon) oGuiElement.setThumbnail(sThumbnail) oGuiElement.setMeta(1) oGuiElement.setDescription(sDesc) if oOutputParameterHandler.getValue('sMovieTitle'): sTitle = oOutputParameterHandler.getValue('sMovieTitle') oGuiElement.setFileName(sTitle) self.__createContexMenuWatch(oGuiElement, oOutputParameterHandler) self.__createContexMenuinfo(oGuiElement, oOutputParameterHandler) #context fav oContext = cContextElement() #sAction = 'setFavorite("%s", "%s", "%s")' % (1, sFunction, sId) oContext.setFile('cFav') oContext.setSiteName('cFav') oContext.setFunction('setFavorite') #oContext.setTitle('[COLOR teal]Marque-film[/COLOR]') oContext.setTitle('[COLOR teal]'+cConfig().getLocalizedString(30206)+'[/COLOR]') #oOutputParameterHandler.addParameter('sTitle', sLabel) oOutputParameterHandler.addParameter('sId', sId) oOutputParameterHandler.addParameter('sFav', sFunction) oOutputParameterHandler.addParameter('sCat', 1) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) self.addFolder(oGuiElement, oOutputParameterHandler)
def CreateFolder(oGui, sTitle, sFunction, oOutputParameterHandler): oInputParameterHandler = cInputParameterHandler() sType = oInputParameterHandler.getValue('type') oGuiElement = cGuiElement() if cConfig().getSetting("meta-view") == 'false': oGuiElement.setMetaAddon('true') oGuiElement.setSiteName(SITE_IDENTIFIER) oGuiElement.setFunction(sFunction) oGuiElement.setTitle(sTitle) oGuiElement.setFileName(sTitle) oGuiElement.setIcon("genres.png") oGuiElement.setMeta(int(sType)) #my menu oContext = cContextElement() oContext.setFile(SITE_IDENTIFIER) oContext.setSiteName(SITE_IDENTIFIER) oContext.setFunction('Rename') oContext.setTitle('Renommer') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) oGui.addFolder(oGuiElement, oOutputParameterHandler)
def addTV(self, sId, sFunction, sLabel, sIcon, sThumbnail, sDesc, oOutputParameterHandler = ''): cGui.CONTENT = "tvshows" oGuiElement = cGuiElement() oGuiElement.setSiteName(sId) oGuiElement.setFunction(sFunction) oGuiElement.setTitle(sLabel) oGuiElement.setIcon(sIcon) oGuiElement.setThumbnail(sThumbnail) oGuiElement.setMeta(2) oGuiElement.setDescription(sDesc) self.__createContexMenuWatch(oGuiElement, oOutputParameterHandler) self.__createContexMenuWriteFav(oGuiElement, oOutputParameterHandler) #context oContext = cContextElement() oContext.setFile('cFav') oContext.setSiteName('cFav') oContext.setFunction('writeFavourites') oContext.setTitle('[COLOR teal]Marque-série[/COLOR]') oOutputParameterHandler.addParameter('sTitle', sLabel) oOutputParameterHandler.addParameter('sId', sId) oOutputParameterHandler.addParameter('sFav', sFunction) oOutputParameterHandler.addParameter('sCat', 2) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) self.addFolder(oGuiElement, oOutputParameterHandler)
def __createContexMenuWriteFav(self, oGuiElement, oOutputParameterHandler=''): oInputParameterHandler = cInputParameterHandler() sUrl = oInputParameterHandler.getValue('siteUrl') sFav = oInputParameterHandler.getValue('sFav') oContext = cContextElement() oContext.setFile('cFav') oContext.setSiteName('cFav') oContext.setFunction('writeFavourites') oContext.setTitle('[COLOR teal]Marque-page[/COLOR]') oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sTitle', oGuiElement.getSiteName()) oOutputParameterHandler.addParameter('sId', oGuiElement.getSiteName()) oOutputParameterHandler.addParameter('siteUrl', sUrl) oOutputParameterHandler.addParameter('sFav', sFav) oOutputParameterHandler.addParameter('sCat', 3) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) return
def createContexMenuDownload(self, oGuiElement, oOutputParameterHandler= '', status = '0'): if status == '0': oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('StartDownloadOneFile') oContext.setTitle('Demarrer ce telechargement') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) if status == '0' or status == '2': oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('delDownload') oContext.setTitle('Supprimer de la liste') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('DelFile') oContext.setTitle('[COLOR=red]Supprimer definitivement[/COLOR]') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) if status == '1': oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('StopDownloadList') oContext.setTitle('Arreter le telechargement') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) if status == '2': oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('ReadDownload') oContext.setTitle('Lire') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def CreateSimpleMenu(self, oGuiElement, oOutputParameterHandler, sFile, sName, sFunction, sTitle): oContext = cContextElement() oContext.setFile(sFile) oContext.setSiteName(sName) oContext.setFunction(sFunction) oContext.setTitle(sTitle) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def createContexMenuViewBack(self, oGuiElement, oOutputParameterHandler): oContext = cContextElement() oContext.setFile('cGui') oContext.setSiteName('cGui') oContext.setFunction('viewBack') oContext.setTitle(self.ADDON.VSlang(30018)) oOutputParameterHandler.addParameter('sId', oGuiElement.getSiteName()) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def showHoster(self, oGui, oHoster, sMediaUrl, sThumbnail, bGetRedirectUrl = False): #oInputParameterHandler = cInputParameterHandler() #aParams = oInputParameterHandler.getAllParameter() oGuiElement = cGuiElement() oGuiElement.setSiteName(self.SITE_NAME) #oGuiElement.setFunction('showHosterMenu') oGuiElement.setFunction('play') oGuiElement.setTitle(oHoster.getDisplayName()) #oGuiElement.setThumbnail(sThumbnail) # if (oInputParameterHandler.exist('sMeta')): # sMeta = oInputParameterHandler.getValue('sMeta') # oGuiElement.setMeta(int(sMeta)) oGuiElement.setFileName(oHoster.getFileName()) oGuiElement.getInfoLabel() oGuiElement.setCat(4) #oGuiElement.setThumbnail(xbmc.getInfoLabel('ListItem.Art(thumb)')) if sThumbnail: oGuiElement.setThumbnail(sThumbnail) #oGuiElement.setMeta(1) oGuiElement.setIcon('host.png') oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sMediaUrl', sMediaUrl) #oOutputParameterHandler.addParameter('sThumbnail', oGuiElement.getThumbnail()) oOutputParameterHandler.addParameter('sHosterIdentifier', oHoster.getPluginIdentifier()) oOutputParameterHandler.addParameter('bGetRedirectUrl', bGetRedirectUrl) oOutputParameterHandler.addParameter('sFileName', oHoster.getFileName()) oOutputParameterHandler.addParameter('sTitle', oHoster.getDisplayName()) oOutputParameterHandler.addParameter('sId', 'cHosterGui') oOutputParameterHandler.addParameter('siteUrl', sMediaUrl) #oOutputParameterHandler.addParameter('sFav', 'play') #oOutputParameterHandler.addParameter('sCat', '4') #context playlit menu oContext = cContextElement() oContext.setFile('cHosterGui') oContext.setSiteName(self.SITE_NAME) oContext.setFunction('addToPlaylist') oContext.setTitle(cConfig().getlanguage(30201)) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) #context FAV menu oGui.createContexMenuFav(oGuiElement, oOutputParameterHandler) #bug oGui.addHost(oGuiElement, oOutputParameterHandler)
def __createContextMenu(self, oGuiElement, oListItem, bIsFolder, sItemUrl, oOutputParams=''): aContextMenus = [] if len(oGuiElement.getContextItems()) > 0: for oContextItem in oGuiElement.getContextItems(): oOutputParameterHandler = oContextItem.getOutputParameterHandler() sParams = oOutputParameterHandler.getParameterAsUri() sTest = "%s?site=%s&function=%s&%s" % (self.pluginPath, oContextItem.getFile(), oContextItem.getFunction(), sParams) aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s)" % (sTest,),)] oContextItem = cContextElement() oContextItem.setTitle("Info") aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.Action(Info)",)] itemValues = oGuiElement.getItemValues() if 'imdb_id' in itemValues and 'title' in itemValues: metaParams = {} if itemValues['title']: metaParams['title'] = itemValues['title'] if 'mediaType' in itemValues and itemValues['mediaType']: metaParams['mediaType'] = itemValues['mediaType'] elif 'TVShowTitle' in itemValues and itemValues['TVShowTitle']: metaParams['mediaType'] = 'tvshow' else: metaParams['mediaType'] = 'movie' if 'season' in itemValues and itemValues['season'] and int(itemValues['season'])>0: metaParams['season'] = itemValues['season'] metaParams['mediaType'] = 'season' if ( 'episode' in itemValues and itemValues['episode'] and int(itemValues['episode'])>0 and 'season' in itemValues and itemValues['season'] and int(itemValues['season']) ): metaParams['episode'] = itemValues['episode'] metaParams['mediaType'] = 'episode' if itemValues['imdb_id']: metaParams['imdbID'] = itemValues['imdb_id'] if itemValues['overlay'] == '7': oContextItem.setTitle("Als ungesehen markieren") else: oContextItem.setTitle("Als gesehen markieren") aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s?function=changeWatched&%s)" % (self.pluginPath, urllib.urlencode(metaParams),),)] if 'year' in itemValues and itemValues['year']: metaParams['year'] = itemValues['year'] oContextItem.setTitle("Suche Metainfos") aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s?function=updateMeta&%s)" % (self.pluginPath, urllib.urlencode(metaParams),),)] if not bIsFolder: oContextItem.setTitle("add to Playlist") aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s&playMode=enqueue)" % (sItemUrl,),)] oContextItem.setTitle("download") aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s&playMode=download)" % (sItemUrl,),)] if cConfig().getSetting('jd_enabled') == 'true': oContextItem.setTitle("send to JDownloader") aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s&playMode=jd)" % (sItemUrl,),)] if cConfig().getSetting('pyload_enabled') == 'true': oContextItem.setTitle("send to PyLoad") aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s&playMode=pyload)" % (sItemUrl,),)] oListItem.addContextMenuItems(aContextMenus) #oListItem.addContextMenuItems(aContextMenus, True) return oListItem
def CreateSimpleMenu(self,oGuiElement,oOutputParameterHandler,file,name,function,title): oContext = cContextElement() oContext.setFile(file) oContext.setSiteName(name) oContext.setFunction(function) oContext.setTitle(title) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def createContexMenuPageSelect(self, oGuiElement, oOutputParameterHandler): oContext = cContextElement() oContext.setFile('cGui') oContext.setSiteName('cGui') oContext.setFunction('selectPage') oContext.setTitle(self.ADDON.VSlang(30017)) oOutputParameterHandler.addParameter('OldFunction', oGuiElement.getFunction()) oOutputParameterHandler.addParameter('sId', oGuiElement.getSiteName()) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def showHoster(self, oGui, oHoster, sMediaUrl, sThumbnail, bGetRedirectUrl=False): oGuiElement = cGuiElement() oGuiElement.setSiteName(self.SITE_NAME) #oGuiElement.setFunction('showHosterMenu') oGuiElement.setFunction('play') oGuiElement.setTitle(oHoster.getDisplayName()) oGuiElement.setThumbnail(sThumbnail) oGuiElement.setIcon('host.png') oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sMediaUrl', sMediaUrl) oOutputParameterHandler.addParameter('sHosterIdentifier', oHoster.getPluginIdentifier()) oOutputParameterHandler.addParameter('bGetRedirectUrl', bGetRedirectUrl) oOutputParameterHandler.addParameter('sFileName', oHoster.getFileName()) #context playlit menu oContext = cContextElement() oContext.setFile('cHosterGui') oContext.setSiteName(self.SITE_NAME) oContext.setFunction('addToPlaylist') oContext.setTitle('Ajouter à la playlist') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) #context download menu oContext = cContextElement() oContext.setFile('cHosterGui') oContext.setSiteName(self.SITE_NAME) oContext.setFunction('download') oContext.setTitle('Télécharger') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) oGui.addFolder(oGuiElement, oOutputParameterHandler)
def createContexMenuEpg(self, oGuiElement, oOutputParameterHandler=''): oContext = cContextElement() oContext.setFile('cGui') oContext.setSiteName('cGui') oContext.setFunction('direct_epg') oContext.setTitle('Guide tv direct') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) oContext = cContextElement() oContext.setFile('cGui') oContext.setSiteName('cGui') oContext.setFunction('soir_epg') oContext.setTitle('Guide tv soir') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def createContexMenuEpg(self, oGuiElement, oOutputParameterHandler= ''): oContext = cContextElement() oContext.setFile('cGui') oContext.setSiteName('cGui') oContext.setFunction('viewepg') #oContext.setTitle('[COLOR red]Supprimer Marque-page[/COLOR]') oContext.setTitle('[COLOR red]epg[/COLOR]') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def __createContexMenuDelFav(self, oGuiElement, oOutputParameterHandler= ''): oContext = cContextElement() oContext.setFile('cFav') oContext.setSiteName('cFav') oContext.setFunction('delFavourites') #oContext.setTitle('[COLOR red]Supprimer Marque-page[/COLOR]') oContext.setTitle('[COLOR red]'+cConfig().getLocalizedString(30209)+'[/COLOR]') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def createContexMenuEpg(self, oGuiElement, oOutputParameterHandler= ''): oContext = cContextElement() oContext.setFile('cGui') oContext.setSiteName('cGui') oContext.setFunction('direct_epg') oContext.setTitle('Guide tv direct') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) oContext = cContextElement() oContext.setFile('cGui') oContext.setSiteName('cGui') oContext.setFunction('soir_epg') oContext.setTitle('Guide tv soir') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def createContexMenuSimil(self, oGuiElement, oOutputParameterHandler= ''): oContext = cContextElement() oContext.setFile('cGui') oContext.setSiteName(oGuiElement.getSiteName()) oContext.setFunction('viewsimil') oContext.setTitle('[COLOR azure]Recherche Similaire[/COLOR]') oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sTitle', oGuiElement.getFileName()) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def createContexMenuFav(self, oGuiElement, oOutputParameterHandler= ''): oContext = cContextElement() oContext.setFile('cFav') oContext.setSiteName('cFav') oContext.setFunction('setFavorite') oContext.setTitle('[COLOR teal]Marque-Page[/COLOR]') oOutputParameterHandler.addParameter('sId', oGuiElement.getSiteName()) oOutputParameterHandler.addParameter('sFav', oGuiElement.getFunction()) oOutputParameterHandler.addParameter('sCat', oGuiElement.getCat()) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def createContexMenuSimil(self, oGuiElement, oOutputParameterHandler= ''): oContext = cContextElement() oContext.setFile('cGui') oContext.setSiteName(oGuiElement.getSiteName()) oContext.setFunction('viewsimil') oContext.setTitle('[COLOR azure]Recherche Similaire[/COLOR]') oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sFileName', oGuiElement.getFileName()) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def createContexMenuFav(self, oGuiElement, oOutputParameterHandler=''): oContext = cContextElement() oContext.setFile('cFav') oContext.setSiteName('cFav') oContext.setFunction('setFavorite') oContext.setTitle('[COLOR teal]Marque-Page[/COLOR]') oOutputParameterHandler.addParameter('sId', oGuiElement.getSiteName()) oOutputParameterHandler.addParameter('sFav', oGuiElement.getFunction()) oOutputParameterHandler.addParameter('sCat', oGuiElement.getCat()) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def __createContexMenuinfo(self, oGuiElement, oOutputParameterHandler= ''): oContext = cContextElement() oContext.setFile('cGui') oContext.setSiteName(oGuiElement.getSiteName()) oContext.setFunction('viewinfo') oContext.setTitle('[COLOR azure]Information[/COLOR]') oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sTitle', oGuiElement.getTitle()) oOutputParameterHandler.addParameter('sId', oGuiElement.getSiteName()) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def __createContexMenuWatch(self, oGuiElement, oOutputParameterHandler= ''): oContext = cContextElement() oContext.setFile('cGui') oContext.setSiteName(oGuiElement.getSiteName()) oContext.setFunction('setWatched') oContext.setTitle('[COLOR azure]Marquer vu/Non vu[/COLOR]') #oOutputParameterHandler = cOutputParameterHandler() #oOutputParameterHandler.addParameter('sTitle', oGuiElement.getTitle()) #oOutputParameterHandler.addParameter('sId', oGuiElement.getSiteName()) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def __createContexMenuinfo(self, oGuiElement, oOutputParameterHandler=''): oContext = cContextElement() oContext.setFile('cGui') oContext.setSiteName(oGuiElement.getSiteName()) oContext.setFunction('viewinfo') oContext.setTitle('[COLOR azure]Information[/COLOR]') oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sTitle', oGuiElement.getTitle()) oOutputParameterHandler.addParameter('sId', oGuiElement.getSiteName()) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def __createContexMenuWatch(self, oGuiElement, oOutputParameterHandler=''): oContext = cContextElement() oContext.setFile('cGui') oContext.setSiteName(oGuiElement.getSiteName()) oContext.setFunction('setWatched') oContext.setTitle('[COLOR azure]Marquer vu/Non vu[/COLOR]') oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sTitle', oGuiElement.getTitle()) oOutputParameterHandler.addParameter('sId', oGuiElement.getSiteName()) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def __createContexMenuDelFav(self, oGuiElement, oOutputParameterHandler= ''): oContext = cContextElement() oContext.setFile('cFav') oContext.setSiteName('cFav') oContext.setFunction('delFavourites') oContext.setTitle('[COLOR red]Supprimer Marque-page[/COLOR]') oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sTitle', oGuiElement.getTitle()) oOutputParameterHandler.addParameter('sId', oGuiElement.getSiteName()) oOutputParameterHandler.addParameter('siteUrl', oGuiElement.getMediaUrl()) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def __createContexMenuDelFav(self, oGuiElement, oOutputParameterHandler=''): oContext = cContextElement() oContext.setFile('cFav') oContext.setSiteName('cFav') oContext.setFunction('delFavourites') oContext.setTitle('[COLOR red]Supprimer Marque-page[/COLOR]') oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sTitle', oGuiElement.getTitle()) oOutputParameterHandler.addParameter('sId', oGuiElement.getSiteName()) oOutputParameterHandler.addParameter('siteUrl', oGuiElement.getMediaUrl()) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext)
def addMovie(self, sId, sFunction, sLabel, sIcon, sThumbnail, sDesc, oOutputParameterHandler=''): cGui.CONTENT = "movies" oGuiElement = cGuiElement() oGuiElement.setSiteName(sId) oGuiElement.setFunction(sFunction) oGuiElement.setTitle(sLabel) oGuiElement.setIcon(sIcon) oGuiElement.setThumbnail(sThumbnail) oGuiElement.setMeta(1) oGuiElement.setDescription(sDesc) self.__createContexMenuWatch(oGuiElement, oOutputParameterHandler) self.__createContexMenuinfo(oGuiElement, oOutputParameterHandler) self.__createContexMenuWriteFav(oGuiElement, oOutputParameterHandler) #oInputParameterHandler = cInputParameterHandler() #sUrl = oInputParameterHandler.getValue('siteUrl') #print oGuiElement.getMediaUrl() #context fav oContext = cContextElement() oContext.setFile('cFav') oContext.setSiteName('cFav') oContext.setFunction('writeFavourites') oContext.setTitle('[COLOR teal]Marque-film[/COLOR]') oOutputParameterHandler.addParameter('sTitle', sLabel) oOutputParameterHandler.addParameter('sId', sId) oOutputParameterHandler.addParameter('sFav', sFunction) oOutputParameterHandler.addParameter('sCat', 1) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) self.addFolder(oGuiElement, oOutputParameterHandler)
def __createContexMenuWriteFav(self, oGuiElement, oOutputParameterHandler= ''): oInputParameterHandler = cInputParameterHandler() sUrl = oInputParameterHandler.getValue('siteUrl') sFav = oInputParameterHandler.getValue('sFav') oContext = cContextElement() oContext.setFile('cFav') oContext.setSiteName('cFav') oContext.setFunction('writeFavourites') oContext.setTitle('[COLOR teal]Marque-page[/COLOR]') oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sTitle', oGuiElement.getTitle()) oOutputParameterHandler.addParameter('sId', oGuiElement.getSiteName()) oOutputParameterHandler.addParameter('siteUrl', sUrl) oOutputParameterHandler.addParameter('sFav', sFav) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) return
def addTV(self, sId, sFunction, sLabel, sIcon, sThumbnail, sDesc, oOutputParameterHandler=''): cGui.CONTENT = "tvshows" oGuiElement = cGuiElement() oGuiElement.setSiteName(sId) oGuiElement.setFunction(sFunction) oGuiElement.setTitle(sLabel) oGuiElement.setIcon(sIcon) oGuiElement.setThumbnail(sThumbnail) oGuiElement.setMeta(2) oGuiElement.setDescription(sDesc) self.__createContexMenuWatch(oGuiElement, oOutputParameterHandler) self.__createContexMenuinfo(oGuiElement, oOutputParameterHandler) self.__createContexMenuWriteFav(oGuiElement, oOutputParameterHandler) #context oContext = cContextElement() oContext.setFile('cFav') oContext.setSiteName('cFav') oContext.setFunction('writeFavourites') oContext.setTitle('[COLOR teal]Marque-série[/COLOR]') oOutputParameterHandler.addParameter('sTitle', sLabel) oOutputParameterHandler.addParameter('sId', sId) oOutputParameterHandler.addParameter('sFav', sFunction) oOutputParameterHandler.addParameter('sCat', 2) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) self.addFolder(oGuiElement, oOutputParameterHandler)
def addTV(self, sId, sFunction, sLabel, sIcon, sThumbnail, sDesc, oOutputParameterHandler = ''): cGui.CONTENT = "tvshows" oGuiElement = cGuiElement() oGuiElement.setSiteName(sId) oGuiElement.setFunction(sFunction) oGuiElement.setTitle(sLabel) oGuiElement.setIcon(sIcon) oGuiElement.setThumbnail(sThumbnail) oGuiElement.setMeta(2) oGuiElement.setDescription(sDesc) if oOutputParameterHandler.getValue('sMovieTitle'): sTitle = oOutputParameterHandler.getValue('sMovieTitle') oGuiElement.setFileName(sTitle) self.__createContexMenuWatch(oGuiElement, oOutputParameterHandler) self.__createContexMenuinfo(oGuiElement, oOutputParameterHandler) #context oContext = cContextElement() oContext.setFile('cFav') oContext.setSiteName('cFav') oContext.setFunction('setFavorite') #oContext.setTitle('[COLOR teal]Marque-série[/COLOR]') oContext.setTitle('[COLOR teal]'+cConfig().getlanguage(30207)+'[/COLOR]') #oOutputParameterHandler.addParameter('sTitle', sLabel) oOutputParameterHandler.addParameter('sId', sId) oOutputParameterHandler.addParameter('sFav', sFunction) oOutputParameterHandler.addParameter('sCat', 2) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) self.addFolder(oGuiElement, oOutputParameterHandler)
def showHoster(self, oGui, oHoster, sMediaUrl, sThumbnail, bGetRedirectUrl=False): oInputParameterHandler = cInputParameterHandler() sMovieTitle = oInputParameterHandler.getValue('title') oGuiElement = cGuiElement() oGuiElement.setSiteName(self.SITE_NAME) #oGuiElement.setFunction('showHosterMenu') oGuiElement.setFunction('play') oGuiElement.setTitle(oHoster.getDisplayName()) #oGuiElement.setThumbnail(sThumbnail) # if (oInputParameterHandler.exist('sMeta')): # sMeta = oInputParameterHandler.getValue('sMeta') # oGuiElement.setMeta(int(sMeta)) oGuiElement.setFileName(oHoster.getFileName()) oGuiElement.getInfoLabel() if sThumbnail: oGuiElement.setThumbnail(sThumbnail) #oGuiElement.setMeta(1) oGuiElement.setIcon('host.png') oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sMediaUrl', sMediaUrl) #oOutputParameterHandler.addParameter('sThumbnail', oGuiElement.getThumbnail()) oOutputParameterHandler.addParameter('sHosterIdentifier', oHoster.getPluginIdentifier()) oOutputParameterHandler.addParameter('bGetRedirectUrl', bGetRedirectUrl) oOutputParameterHandler.addParameter('sFileName', oHoster.getFileName()) oOutputParameterHandler.addParameter('sTitle', oHoster.getDisplayName()) oOutputParameterHandler.addParameter('sId', 'cHosterGui') oOutputParameterHandler.addParameter('siteUrl', sMediaUrl) #oOutputParameterHandler.addParameter('sFav', 'play') #oOutputParameterHandler.addParameter('sCat', '4') #nouveaux pour la lecture. if (oInputParameterHandler.exist('sCat')): sCat = oInputParameterHandler.getValue('sCat') oGuiElement.setCat(sCat) oOutputParameterHandler.addParameter('sCat', sCat) else: oGuiElement.setCat('4') #existe dans le menu krypton 17 if not isKrypton(): oGui.createContexMenuWatch(oGuiElement, oOutputParameterHandler) #context playlit menu oContext = cContextElement() oContext.setFile('cHosterGui') oContext.setSiteName(self.SITE_NAME) oContext.setFunction('addToPlaylist') oContext.setTitle(self.ADDON.VSlang(30201)) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) #Download menu if (oHoster.isDownloadable() == True): oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('AddtoDownloadList') oContext.setTitle(self.ADDON.VSlang(30202)) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) if (oHoster.isDownloadable() == True): #Beta context download and view menu oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('AddtoDownloadListandview') oContext.setTitle(self.ADDON.VSlang(30326)) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) #Upload menu if cInputParameterHandler().getValue( 'site') != 'siteuptobox' and self.ADDON.getSetting( 'hoster_uptobox_premium') == 'true': host = oHoster.getPluginIdentifier() accept = [ 'uptobox', 'uptostream', 'onefichier', 'uploaded', 'uplea' ] for i in accept: if host == i: oGui.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'siteuptobox', 'siteuptobox', 'UptomyAccount', self.ADDON.VSlang(30325)) #context FAV menu oGui.createContexMenuFav(oGuiElement, oOutputParameterHandler) #context Library menu oGui.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'cLibrary', 'cLibrary', 'setLibrary', self.ADDON.VSlang(30324)) #bug oGui.addHost(oGuiElement, oOutputParameterHandler)
def showHoster(self, oGui, oHoster, sMediaUrl, sThumbnail, bGetRedirectUrl = False): oInputParameterHandler = cInputParameterHandler() aParams = oInputParameterHandler.getAllParameter() oGuiElement = cGuiElement() oGuiElement.setSiteName(self.SITE_NAME) #oGuiElement.setFunction('showHosterMenu') oGuiElement.setFunction('play') oGuiElement.setTitle(oHoster.getDisplayName()) # oGuiElement.setThumbnail(sThumbnail) # if (oInputParameterHandler.exist('sMeta')): # sMeta = oInputParameterHandler.getValue('sMeta') # oGuiElement.setMeta(int(sMeta)) oGuiElement.setFileName(oHoster.getFileName()) oGuiElement.getInfoLabel() #oGuiElement.setThumbnail(xbmc.getInfoLabel('ListItem.Art(thumb)')) #oGuiElement.setMeta(1) oGuiElement.setIcon('host.png') oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sMediaUrl', sMediaUrl) oOutputParameterHandler.addParameter('sThumbnail', sThumbnail) oOutputParameterHandler.addParameter('sHosterIdentifier', oHoster.getPluginIdentifier()) oOutputParameterHandler.addParameter('bGetRedirectUrl', bGetRedirectUrl) oOutputParameterHandler.addParameter('sFileName', oHoster.getFileName()) oOutputParameterHandler.addParameter('sTitle', oHoster.getDisplayName()) oOutputParameterHandler.addParameter('sId', 'cHosterGui') oOutputParameterHandler.addParameter('siteUrl', sMediaUrl) oOutputParameterHandler.addParameter('sFav', 'play') oOutputParameterHandler.addParameter('sCat', '4') #context read and noread oContext = cContextElement() oContext.setFile('cGui') oContext.setSiteName('cGui') oContext.setFunction('setWatched') oContext.setTitle('[COLOR azure]Marquer vu/Non vu[/COLOR]') #oOutputParameterHandler.addParameter('sTitle', oGuiElement.getTitle()) #oOutputParameterHandler.addParameter('sId', oGuiElement.getSiteName()) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) #context playlit menu oContext = cContextElement() oContext.setFile('cHosterGui') oContext.setSiteName(self.SITE_NAME) oContext.setFunction('addToPlaylist') oContext.setTitle(cConfig().getLocalizedString(30201)) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) #context download menu oContext = cContextElement() oContext.setFile('cHosterGui') oContext.setSiteName(self.SITE_NAME) oContext.setFunction('download') oContext.setTitle(cConfig().getLocalizedString(30202)) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) #context FAV menu oContext = cContextElement() oContext.setFile('cFav') oContext.setSiteName('cFav') oContext.setFunction('setFavorite') oContext.setTitle('[COLOR teal]'+cConfig().getLocalizedString(30203)+'[/COLOR]') #oOutputParameterHandler = cOutputParameterHandler() #oOutputParameterHandler.addParameter('sTitle', oGuiElement.getTitle()) #oOutputParameterHandler.addParameter('siteUrl', sMediaUrl) #oOutputParameterHandler.addParameter('sFav', 'play') #oOutputParameterHandler.addParameter('sId', 'cHosterGui') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) oGui.addFolder(oGuiElement, oOutputParameterHandler, False)
def showHoster(self, oGui, oHoster, sMediaUrl, sThumbnail, bGetRedirectUrl = False): #oInputParameterHandler = cInputParameterHandler() #aParams = oInputParameterHandler.getAllParameter() oGuiElement = cGuiElement() oGuiElement.setSiteName(self.SITE_NAME) #oGuiElement.setFunction('showHosterMenu') oGuiElement.setFunction('play') oGuiElement.setTitle(oHoster.getDisplayName()) #oGuiElement.setThumbnail(sThumbnail) # if (oInputParameterHandler.exist('sMeta')): # sMeta = oInputParameterHandler.getValue('sMeta') # oGuiElement.setMeta(int(sMeta)) oGuiElement.setFileName(oHoster.getFileName()) oGuiElement.getInfoLabel() oGuiElement.setCat(4) #oGuiElement.setThumbnail(xbmc.getInfoLabel('ListItem.Art(thumb)')) if sThumbnail: oGuiElement.setThumbnail(sThumbnail) #oGuiElement.setMeta(1) oGuiElement.setIcon('host.png') oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sMediaUrl', sMediaUrl) #oOutputParameterHandler.addParameter('sThumbnail', oGuiElement.getThumbnail()) oOutputParameterHandler.addParameter('sHosterIdentifier', oHoster.getPluginIdentifier()) oOutputParameterHandler.addParameter('bGetRedirectUrl', bGetRedirectUrl) oOutputParameterHandler.addParameter('sFileName', oHoster.getFileName()) oOutputParameterHandler.addParameter('sTitle', oHoster.getDisplayName()) oOutputParameterHandler.addParameter('sId', 'cHosterGui') oOutputParameterHandler.addParameter('siteUrl', sMediaUrl) #oOutputParameterHandler.addParameter('sFav', 'play') #oOutputParameterHandler.addParameter('sCat', '4') oGui.createContexMenuWatch(oGuiElement, oOutputParameterHandler) #context playlit menu oContext = cContextElement() oContext.setFile('cHosterGui') oContext.setSiteName(self.SITE_NAME) oContext.setFunction('addToPlaylist') oContext.setTitle(cConfig().getlanguage(30201)) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) if (oHoster.isDownloadable() == True): #Beta context download menu oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('AddtoDownloadList') oContext.setTitle(cConfig().getlanguage(30202)) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) #context FAV menu oGui.createContexMenuFav(oGuiElement, oOutputParameterHandler) #context Library menu oGui.CreateSimpleMenu(oGuiElement,oOutputParameterHandler,'cLibrary','cLibrary','setLibrary','[COLOR teal]Ajouter a la librairie[/COLOR]') #bug oGui.addFolder(oGuiElement, oOutputParameterHandler, False)
def showHoster(self, oGui, oHoster, sMediaUrl, sThumbnail, bGetRedirectUrl=False): oOutputParameterHandler = cOutputParameterHandler() oInputParameterHandler = cInputParameterHandler() # Gestion NextUp siteUrl = oInputParameterHandler.getValue('siteUrl') site = oInputParameterHandler.getValue('site') saisonUrl = oInputParameterHandler.getValue('saisonUrl') nextSaisonFunc = oInputParameterHandler.getValue('nextSaisonFunc') movieUrl = oInputParameterHandler.getValue('movieUrl') movieFunc = oInputParameterHandler.getValue('movieFunc') sLang = oInputParameterHandler.getValue('sLang') sRes = oInputParameterHandler.getValue('sRes') sTmdbId = oInputParameterHandler.getValue('sTmdbId') sFav = oInputParameterHandler.getValue('sFav') if not sFav: sFav = oInputParameterHandler.getValue('function') oGuiElement = cGuiElement() oGuiElement.setSiteName(self.SITE_NAME) oGuiElement.setFunction('play') oGuiElement.setTitle(oHoster.getDisplayName()) # Catégorie de lecture if oInputParameterHandler.exist('sCat'): sCat = oInputParameterHandler.getValue('sCat') if sCat == '4': # Si on vient de passer par un menu "Saison" ... sCat = '8' # ... On est maintenant au niveau "Episode" else: sCat = '5' # Divers oGuiElement.setCat(sCat) oOutputParameterHandler.addParameter('sCat', sCat) if (oInputParameterHandler.exist('sMeta')): sMeta = oInputParameterHandler.getValue('sMeta') oGuiElement.setMeta(int(sMeta)) oGuiElement.setFileName(oHoster.getFileName()) oGuiElement.getInfoLabel() if sThumbnail: oGuiElement.setThumbnail(sThumbnail) oGuiElement.setIcon('host.png') title = oGuiElement.getCleanTitle() oOutputParameterHandler.addParameter('sMediaUrl', sMediaUrl) oOutputParameterHandler.addParameter('sHosterIdentifier', oHoster.getPluginIdentifier()) oOutputParameterHandler.addParameter('bGetRedirectUrl', bGetRedirectUrl) oOutputParameterHandler.addParameter('sFileName', oHoster.getFileName()) oOutputParameterHandler.addParameter('sTitleWatched', oGuiElement.getTitleWatched()) oOutputParameterHandler.addParameter('sTitle', title) oOutputParameterHandler.addParameter('sLang', sLang) oOutputParameterHandler.addParameter('sRes', sRes) oOutputParameterHandler.addParameter('sId', 'cHosterGui') oOutputParameterHandler.addParameter('siteUrl', siteUrl) oOutputParameterHandler.addParameter('sTmdbId', sTmdbId) # gestion NextUp oOutputParameterHandler.addParameter('sourceName', site) # source d'origine oOutputParameterHandler.addParameter('sourceFav', sFav) # source d'origine oOutputParameterHandler.addParameter('nextSaisonFunc', nextSaisonFunc) oOutputParameterHandler.addParameter('saisonUrl', saisonUrl) # gestion Lecture en cours oOutputParameterHandler.addParameter('movieUrl', movieUrl) oOutputParameterHandler.addParameter('movieFunc', movieFunc) # context playlist menu oContext = cContextElement() oContext.setFile('cHosterGui') oContext.setSiteName(self.SITE_NAME) oContext.setFunction('addToPlaylist') oContext.setTitle(self.ADDON.VSlang(30201)) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) # Download menu if oHoster.isDownloadable(): oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('AddtoDownloadList') oContext.setTitle(self.ADDON.VSlang(30202)) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) if oHoster.isDownloadable(): # Beta context download and view menu oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('AddtoDownloadListandview') oContext.setTitle(self.ADDON.VSlang(30326)) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) # Upload menu uptobox if cInputParameterHandler().getValue( 'site') != 'siteuptobox' and self.ADDON.getSetting( 'hoster_uptobox_premium') == 'true': host = oHoster.getPluginIdentifier() accept = [ 'uptobox', 'uptostream', 'onefichier', 'uploaded', 'uplea' ] for i in accept: if host == i: oGui.createSimpleMenu(oGuiElement, oOutputParameterHandler, 'siteuptobox', 'siteuptobox', 'UptomyAccount', self.ADDON.VSlang(30325)) # onefichier if cInputParameterHandler().getValue( 'site') != 'siteonefichier' and self.ADDON.getSetting( 'hoster_onefichier_premium') == 'true': host = oHoster.getPluginIdentifier() accept = 'onefichier' # les autres ne fonctionnent pas if host == accept: oGui.createSimpleMenu(oGuiElement, oOutputParameterHandler, 'siteonefichier', 'siteonefichier', 'UptomyAccount', '1fichier') # context Library menu oGui.createSimpleMenu(oGuiElement, oOutputParameterHandler, 'cLibrary', 'cLibrary', 'setLibrary', self.ADDON.VSlang(30324)) oGui.addFolder(oGuiElement, oOutputParameterHandler, False)
def showHoster(self, oGui, oHoster, sMediaUrl, sThumbnail, bGetRedirectUrl=False): #oInputParameterHandler = cInputParameterHandler() #aParams = oInputParameterHandler.getAllParameter() oGuiElement = cGuiElement() oGuiElement.setSiteName(self.SITE_NAME) #oGuiElement.setFunction('showHosterMenu') oGuiElement.setFunction('play') oGuiElement.setTitle(oHoster.getDisplayName()) #oGuiElement.setThumbnail(sThumbnail) # if (oInputParameterHandler.exist('sMeta')): # sMeta = oInputParameterHandler.getValue('sMeta') # oGuiElement.setMeta(int(sMeta)) oGuiElement.setFileName(oHoster.getFileName()) oGuiElement.getInfoLabel() oGuiElement.setCat(4) #oGuiElement.setThumbnail(xbmc.getInfoLabel('ListItem.Art(thumb)')) if sThumbnail: oGuiElement.setThumbnail(sThumbnail) #oGuiElement.setMeta(1) oGuiElement.setIcon('host.png') oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sMediaUrl', sMediaUrl) #oOutputParameterHandler.addParameter('sThumbnail', oGuiElement.getThumbnail()) oOutputParameterHandler.addParameter('sHosterIdentifier', oHoster.getPluginIdentifier()) oOutputParameterHandler.addParameter('bGetRedirectUrl', bGetRedirectUrl) oOutputParameterHandler.addParameter('sFileName', oHoster.getFileName()) oOutputParameterHandler.addParameter('sTitle', oHoster.getDisplayName()) oOutputParameterHandler.addParameter('sId', 'cHosterGui') oOutputParameterHandler.addParameter('siteUrl', sMediaUrl) #oOutputParameterHandler.addParameter('sFav', 'play') #oOutputParameterHandler.addParameter('sCat', '4') oGui.createContexMenuWatch(oGuiElement, oOutputParameterHandler) #context playlit menu oContext = cContextElement() oContext.setFile('cHosterGui') oContext.setSiteName(self.SITE_NAME) oContext.setFunction('addToPlaylist') oContext.setTitle(cConfig().getlanguage(30201)) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) #Download menu if (oHoster.isDownloadable() == True): oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('AddtoDownloadList') oContext.setTitle(cConfig().getlanguage(30202)) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) if (oHoster.isDownloadable() == True): #Beta context download and view menu oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('AddtoDownloadListandview') oContext.setTitle('DL et Visualiser') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) #context FAV menu oGui.createContexMenuFav(oGuiElement, oOutputParameterHandler) #context Library menu oGui.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'cLibrary', 'cLibrary', 'setLibrary', '[COLOR teal]Ajouter a la librairie[/COLOR]') #bug oGui.addFolder(oGuiElement, oOutputParameterHandler, False)
def __createContextMenu(self, oGuiElement, oListItem): sPluginPath = cPluginHandler().getPluginPath() aContextMenus = [] if (len(oGuiElement.getContextItems()) > 0): for oContextItem in oGuiElement.getContextItems(): oOutputParameterHandler = oContextItem.getOutputParameterHandler( ) sParams = oOutputParameterHandler.getParameterAsUri() sTest = '%s?site=%s&function=%s&%s' % ( sPluginPath, oContextItem.getFile(), oContextItem.getFunction(), sParams) aContextMenus += [( oContextItem.getTitle(), "XBMC.RunPlugin(%s)" % (sTest, ), )] oListItem.addContextMenuItems(aContextMenus) #oListItem.addContextMenuItems(aContextMenus, True) oContextItem = cContextElement() oContextItem.setFile('cFav') oContextItem.setSiteName('cFav') oContextItem.setTitle('[COLOR teal]Voir Marque-page[/COLOR]') oContextItem.setFunction('getFavourites') oOutputParameterHandler = oContextItem.getOutputParameterHandler() sParams = oOutputParameterHandler.getParameterAsUri() sTest = '%s?site=%s&function=%s&contextFav=true&%s' % ( sPluginPath, oContextItem.getFile(), oContextItem.getFunction(), sParams) aContextMenus += [( oContextItem.getTitle(), "XBMC.Container.Update(%s)" % (sTest, ), )] oListItem.addContextMenuItems(aContextMenus) if oGuiElement.getTrailerUrl(): oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sHosterIdentifier', 'youtube') oOutputParameterHandler.addParameter('sMediaUrl', oGuiElement.getTrailerUrl()) oOutputParameterHandler.addParameter('sFileName', oGuiElement.getTitle()) oContextItem = cContextElement() oContextItem.setFile('cHosterGui') oContextItem.setSiteName('cHosterGui') oContextItem.setTitle('[COLOR azure]Bande Annonce[/COLOR]') oContextItem.setFunction('play') oContextItem.setOutputParameterHandler(oOutputParameterHandler) oOutputParameterHandler = oContextItem.getOutputParameterHandler() sParams = oOutputParameterHandler.getParameterAsUri() sTest = '%s?site=%s&function=%s&%s' % ( sPluginPath, oContextItem.getFile(), oContextItem.getFunction(), sParams) aContextMenus += [( oContextItem.getTitle(), "XBMC.RunPlugin(%s)" % (sTest, ), )] oListItem.addContextMenuItems(aContextMenus) return oListItem
def __createContextMenu(self, oGuiElement, oListItem, bIsFolder, sItemUrl, oOutputParams=''): aContextMenus = [] if len(oGuiElement.getContextItems()) > 0: for oContextItem in oGuiElement.getContextItems(): oOutputParameterHandler = oContextItem.getOutputParameterHandler( ) sParams = oOutputParameterHandler.getParameterAsUri() sTest = "%s?site=%s&function=%s&%s" % ( self.pluginPath, oContextItem.getFile(), oContextItem.getFunction(), sParams) aContextMenus += [( oContextItem.getTitle(), "XBMC.RunPlugin(%s)" % (sTest, ), )] itemValues = oGuiElement.getItemValues() oContextItem = cContextElement() oContextItem.setTitle("Info") aContextMenus += [( oContextItem.getTitle(), "XBMC.Action(Info)", )] #search for alternative source oContextItem.setTitle("Weitere Quellen") searchParams = {} searchParams['searchTitle'] = oGuiElement.getTitle() if 'imdb_id' in itemValues: searchParams['searchImdbID'] = itemValues['imdb_id'] aContextMenus += [( oContextItem.getTitle(), "XBMC.Container.Update(%s?function=searchAlter&%s)" % ( self.pluginPath, urllib.urlencode(searchParams), ), )] if 'imdb_id' in itemValues and 'title' in itemValues: metaParams = {} if itemValues['title']: metaParams['title'] = oGuiElement.getTitle() if 'mediaType' in itemValues and itemValues['mediaType']: metaParams['mediaType'] = itemValues['mediaType'] elif 'TVShowTitle' in itemValues and itemValues['TVShowTitle']: metaParams['mediaType'] = 'tvshow' else: metaParams['mediaType'] = 'movie' if 'season' in itemValues and itemValues['season'] and int( itemValues['season']) > 0: metaParams['season'] = itemValues['season'] metaParams['mediaType'] = 'season' if ('episode' in itemValues and itemValues['episode'] and int(itemValues['episode']) > 0 and 'season' in itemValues and itemValues['season'] and int(itemValues['season'])): metaParams['episode'] = itemValues['episode'] metaParams['mediaType'] = 'episode' # if an imdb id is available we can mark this element as seen/unseen in the metahandler if itemValues['imdb_id']: metaParams['imdbID'] = itemValues['imdb_id'] if itemValues['overlay'] == '7': oContextItem.setTitle("Als ungesehen markieren") else: oContextItem.setTitle("Als gesehen markieren") aContextMenus += [( oContextItem.getTitle(), "XBMC.RunPlugin(%s?function=changeWatched&%s)" % ( self.pluginPath, urllib.urlencode(metaParams), ), )] # if year is set we can search reliably for metainfos via metahandler if 'year' in itemValues and itemValues['year']: metaParams['year'] = itemValues['year'] oContextItem.setTitle("Suche Metainfos") aContextMenus += [( oContextItem.getTitle(), "XBMC.RunPlugin(%s?function=updateMeta&%s)" % ( self.pluginPath, urllib.urlencode(metaParams), ), )] # context options for movies or episodes if not bIsFolder: oContextItem.setTitle("add to Playlist") aContextMenus += [( oContextItem.getTitle(), "XBMC.RunPlugin(%s&playMode=enqueue)" % (sItemUrl, ), )] oContextItem.setTitle("download") aContextMenus += [( oContextItem.getTitle(), "XBMC.RunPlugin(%s&playMode=download)" % (sItemUrl, ), )] if cConfig().getSetting('jd_enabled') == 'true': oContextItem.setTitle("send to JDownloader") aContextMenus += [( oContextItem.getTitle(), "XBMC.RunPlugin(%s&playMode=jd)" % (sItemUrl, ), )] if cConfig().getSetting('pyload_enabled') == 'true': oContextItem.setTitle("send to PyLoad") aContextMenus += [( oContextItem.getTitle(), "XBMC.RunPlugin(%s&playMode=pyload)" % (sItemUrl, ), )] if cConfig().getSetting('hosterSelect') == 'Auto': oContextItem.setTitle("select hoster") aContextMenus += [( oContextItem.getTitle(), "XBMC.RunPlugin(%s&playMode=play&manual=1)" % (sItemUrl, ), )] oListItem.addContextMenuItems(aContextMenus) #oListItem.addContextMenuItems(aContextMenus, True) return oListItem
def __createContextMenu(self, oGuiElement, oListItem, bIsFolder, sItemUrl, oOutputParams=""): aContextMenus = [] if len(oGuiElement.getContextItems()) > 0: for oContextItem in oGuiElement.getContextItems(): oOutputParameterHandler = oContextItem.getOutputParameterHandler() sParams = oOutputParameterHandler.getParameterAsUri() sTest = "%s?site=%s&function=%s&%s" % ( self.pluginPath, oContextItem.getFile(), oContextItem.getFunction(), sParams, ) aContextMenus += [(oContextItem.getTitle(), "XBMC.RunPlugin(%s)" % (sTest,))] itemValues = oGuiElement.getItemValues() oContextItem = cContextElement() oContextItem.setTitle("Info") aContextMenus += [(oContextItem.getTitle(), "XBMC.Action(Info)")] # search for alternative source oContextItem.setTitle("Weitere Quellen") searchParams = {} searchParams["searchTitle"] = oGuiElement.getTitle() if "imdb_id" in itemValues: searchParams["searchImdbID"] = itemValues["imdb_id"] aContextMenus += [ ( oContextItem.getTitle(), "XBMC.Container.Update(%s?function=searchAlter&%s)" % (self.pluginPath, urllib.urlencode(searchParams)), ) ] if "imdb_id" in itemValues and "title" in itemValues: metaParams = {} if itemValues["title"]: metaParams["title"] = oGuiElement.getTitle() if "mediaType" in itemValues and itemValues["mediaType"]: metaParams["mediaType"] = itemValues["mediaType"] elif "TVShowTitle" in itemValues and itemValues["TVShowTitle"]: metaParams["mediaType"] = "tvshow" else: metaParams["mediaType"] = "movie" if "season" in itemValues and itemValues["season"] and int(itemValues["season"]) > 0: metaParams["season"] = itemValues["season"] metaParams["mediaType"] = "season" if ( "episode" in itemValues and itemValues["episode"] and int(itemValues["episode"]) > 0 and "season" in itemValues and itemValues["season"] and int(itemValues["season"]) ): metaParams["episode"] = itemValues["episode"] metaParams["mediaType"] = "episode" # if an imdb id is available we can mark this element as seen/unseen in the metahandler if itemValues["imdb_id"]: metaParams["imdbID"] = itemValues["imdb_id"] if itemValues["overlay"] == "7": oContextItem.setTitle("Als ungesehen markieren") else: oContextItem.setTitle("Als gesehen markieren") aContextMenus += [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s?function=changeWatched&%s)" % (self.pluginPath, urllib.urlencode(metaParams)), ) ] # if year is set we can search reliably for metainfos via metahandler if "year" in itemValues and itemValues["year"]: metaParams["year"] = itemValues["year"] oContextItem.setTitle("Suche Metainfos") aContextMenus += [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s?function=updateMeta&%s)" % (self.pluginPath, urllib.urlencode(metaParams)), ) ] # context options for movies or episodes if not bIsFolder: oContextItem.setTitle("add to Playlist") aContextMenus += [(oContextItem.getTitle(), "XBMC.RunPlugin(%s&playMode=enqueue)" % (sItemUrl,))] oContextItem.setTitle("download") aContextMenus += [(oContextItem.getTitle(), "XBMC.RunPlugin(%s&playMode=download)" % (sItemUrl,))] if cConfig().getSetting("jd_enabled") == "true": oContextItem.setTitle("send to JDownloader") aContextMenus += [(oContextItem.getTitle(), "XBMC.RunPlugin(%s&playMode=jd)" % (sItemUrl,))] if cConfig().getSetting("pyload_enabled") == "true": oContextItem.setTitle("send to PyLoad") aContextMenus += [(oContextItem.getTitle(), "XBMC.RunPlugin(%s&playMode=pyload)" % (sItemUrl,))] if cConfig().getSetting("hosterSelect") == "auto": oContextItem.setTitle("select hoster") aContextMenus += [(oContextItem.getTitle(), "XBMC.RunPlugin(%s&playMode=play&manual=1)" % (sItemUrl,))] oListItem.addContextMenuItems(aContextMenus) # oListItem.addContextMenuItems(aContextMenus, True) return oListItem
def showHoster(oGui, oHoster, sMediaUrl, sTitle, sDisplayTitle, sType): oGuiElement = cGuiElement() mTitle = sTitle ftitle = sTitle.lower() iliste = ['.mp4', '.avi', '.mkv', '.mov', '.wmv', '.divx', 'xvid', '.ts'] for item in iliste: if item in ftitle: mTitle = ftitle.replace(item, '') if cConfig().getSetting("meta-view") == 'false': oGuiElement.setMetaAddon('true') oGuiElement.setMeta(int(sType)) oGuiElement.setSiteName('cHosterGui') oGuiElement.setFunction('play') oGuiElement.setTitle(sDisplayTitle) oGuiElement.setFileName(mTitle) oGuiElement.setIcon('host.png') oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sMediaUrl', sMediaUrl) oOutputParameterHandler.addParameter('sHosterIdentifier', 'uptobox') oOutputParameterHandler.addParameter('sFileName', sTitle) oOutputParameterHandler.addParameter('sTitle', sDisplayTitle) oOutputParameterHandler.addParameter('sId', 'cHosterGui') oOutputParameterHandler.addParameter('siteUrl', sMediaUrl) #my menu if (oHoster.isDownloadable() == True): oContext = cContextElement() oContext.setFile(SITE_IDENTIFIER) oContext.setSiteName(SITE_IDENTIFIER) oContext.setFunction('Rename') oContext.setTitle('Renommer') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) oGui.createContexMenuWatch(oGuiElement, oOutputParameterHandler) #Download menu if (oHoster.isDownloadable() == True): oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('AddtoDownloadList') oContext.setTitle(cConfig().getlanguage(30202)) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) if (oHoster.isDownloadable() == True): #Beta context download and view menu oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('AddtoDownloadListandview') oContext.setTitle('DL et Visualiser') oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) #context FAV menu oGui.createContexMenuFav(oGuiElement, oOutputParameterHandler) #context Library menu #oGui.CreateSimpleMenu(oGuiElement,oOutputParameterHandler,'cLibrary','cLibrary','setLibrary','[COLOR teal]Ajouter a la librairie[/COLOR]') oGui.addHost(oGuiElement, oOutputParameterHandler)
def showHoster(self, oGui, oHoster, sMediaUrl, sThumbnail, bGetRedirectUrl = False): oInputParameterHandler = cInputParameterHandler() sMovieTitle = oInputParameterHandler.getValue('title') oGuiElement = cGuiElement() oGuiElement.setSiteName(self.SITE_NAME) #oGuiElement.setFunction('showHosterMenu') oGuiElement.setFunction('play') oGuiElement.setTitle(oHoster.getDisplayName()) #oGuiElement.setThumbnail(sThumbnail) # if (oInputParameterHandler.exist('sMeta')): # sMeta = oInputParameterHandler.getValue('sMeta') # oGuiElement.setMeta(int(sMeta)) oGuiElement.setFileName(oHoster.getFileName()) oGuiElement.getInfoLabel() if sThumbnail: oGuiElement.setThumbnail(sThumbnail) #oGuiElement.setMeta(1) oGuiElement.setIcon('host.png') oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sMediaUrl', sMediaUrl) #oOutputParameterHandler.addParameter('sThumbnail', oGuiElement.getThumbnail()) oOutputParameterHandler.addParameter('sHosterIdentifier', oHoster.getPluginIdentifier()) oOutputParameterHandler.addParameter('bGetRedirectUrl', bGetRedirectUrl) oOutputParameterHandler.addParameter('sFileName', oHoster.getFileName()) oOutputParameterHandler.addParameter('sTitle', oHoster.getDisplayName()) oOutputParameterHandler.addParameter('sId', 'cHosterGui') oOutputParameterHandler.addParameter('siteUrl', sMediaUrl) #oOutputParameterHandler.addParameter('sFav', 'play') #oOutputParameterHandler.addParameter('sCat', '4') #nouveaux pour la lecture. if (oInputParameterHandler.exist('sCat')): sCat = oInputParameterHandler.getValue('sCat') oGuiElement.setCat(sCat) oOutputParameterHandler.addParameter('sCat', sCat) else: oGuiElement.setCat('4') #existe dans le menu krypton 17 if not isKrypton(): oGui.createContexMenuWatch(oGuiElement, oOutputParameterHandler) #context playlit menu oContext = cContextElement() oContext.setFile('cHosterGui') oContext.setSiteName(self.SITE_NAME) oContext.setFunction('addToPlaylist') oContext.setTitle(self.ADDON.VSlang(30201)) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) #Download menu if (oHoster.isDownloadable() == True): oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('AddtoDownloadList') oContext.setTitle(self.ADDON.VSlang(30202)) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) if (oHoster.isDownloadable() == True): #Beta context download and view menu oContext = cContextElement() oContext.setFile('cDownload') oContext.setSiteName('cDownload') oContext.setFunction('AddtoDownloadListandview') oContext.setTitle(self.ADDON.VSlang(30326)) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) #Upload menu uptobox if cInputParameterHandler().getValue('site') != 'siteuptobox' and self.ADDON.getSetting('hoster_uptobox_premium') == 'true' : host = oHoster.getPluginIdentifier() accept = ['uptobox','uptostream','onefichier','uploaded','uplea'] for i in accept: if host == i : oGui.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'siteuptobox', 'siteuptobox', 'UptomyAccount', self.ADDON.VSlang(30325)) #onefichier if cInputParameterHandler().getValue('site') != 'siteonefichier' and self.ADDON.getSetting('hoster_onefichier_premium') == 'true' : host = oHoster.getPluginIdentifier() accept = 'onefichier' #les autres ne fonctionnent pas if host == accept : oGui.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'siteonefichier', 'siteonefichier', 'UptomyAccount', '1fichier') #context FAV menu oGui.createContexMenuFav(oGuiElement, oOutputParameterHandler) #context Library menu oGui.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'cLibrary', 'cLibrary', 'setLibrary', self.ADDON.VSlang(30324)) #bug oGui.addHost(oGuiElement, oOutputParameterHandler)
def __createContextMenu(self, oGuiElement, oListItem, bIsFolder, sItemUrl, oOutputParams=''): aContextMenus = [] if len(oGuiElement.getContextItems()) > 0: for oContextItem in oGuiElement.getContextItems(): oOutputParameterHandler = oContextItem.getOutputParameterHandler() sParams = oOutputParameterHandler.getParameterAsUri() sTest = "%s?site=%s&function=%s&%s" % (self.pluginPath, oContextItem.getFile(), oContextItem.getFunction(), sParams) aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s)" % (sTest,),)] itemValues = oGuiElement.getItemValues() oContextItem = cContextElement() oContextItem.setTitle("Info") aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.Action(Info)",)] #search for alternative source oContextItem.setTitle("Weitere Quellen") searchParams = {} searchParams['searchTitle'] = oGuiElement.getTitle() if 'imdb_id' in itemValues: searchParams['searchImdbID'] = itemValues['imdb_id'] aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.Container.Update(%s?function=searchAlter&%s)" % (self.pluginPath, urllib.urlencode(searchParams),),)] if 'imdb_id' in itemValues and 'title' in itemValues: metaParams = {} if itemValues['title']: metaParams['title'] = itemValues['title'] if 'mediaType' in itemValues and itemValues['mediaType']: metaParams['mediaType'] = itemValues['mediaType'] elif 'TVShowTitle' in itemValues and itemValues['TVShowTitle']: metaParams['mediaType'] = 'tvshow' else: metaParams['mediaType'] = 'movie' if 'season' in itemValues and itemValues['season'] and int(itemValues['season'])>0: metaParams['season'] = itemValues['season'] metaParams['mediaType'] = 'season' if ( 'episode' in itemValues and itemValues['episode'] and int(itemValues['episode'])>0 and 'season' in itemValues and itemValues['season'] and int(itemValues['season']) ): metaParams['episode'] = itemValues['episode'] metaParams['mediaType'] = 'episode' # if an imdb id is available we can mark this element as seen/unseen in the metahandler if itemValues['imdb_id']: metaParams['imdbID'] = itemValues['imdb_id'] if itemValues['overlay'] == '7': oContextItem.setTitle("Als ungesehen markieren") else: oContextItem.setTitle("Als gesehen markieren") aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s?function=changeWatched&%s)" % (self.pluginPath, urllib.urlencode(metaParams),),)] # if year is set we can search reliably for metainfos via metahandler if 'year' in itemValues and itemValues['year']: metaParams['year'] = itemValues['year'] oContextItem.setTitle("Suche Metainfos") aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s?function=updateMeta&%s)" % (self.pluginPath, urllib.urlencode(metaParams),),)] # context options for movies or episodes if not bIsFolder: oContextItem.setTitle("add to Playlist") aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s&playMode=enqueue)" % (sItemUrl,),)] oContextItem.setTitle("download") aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s&playMode=download)" % (sItemUrl,),)] if cConfig().getSetting('jd_enabled') == 'true': oContextItem.setTitle("send to JDownloader") aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s&playMode=jd)" % (sItemUrl,),)] if cConfig().getSetting('pyload_enabled') == 'true': oContextItem.setTitle("send to PyLoad") aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s&playMode=pyload)" % (sItemUrl,),)] if cConfig().getSetting('autoPlay')=='true': oContextItem.setTitle("select hoster") aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s&playMode=play&manual=1)" % (sItemUrl,),)] oListItem.addContextMenuItems(aContextMenus) #oListItem.addContextMenuItems(aContextMenus, True) return oListItem