def createContexMenuFav(self, oGuiElement, oOutputParameterHandler=''): oOutputParameterHandler.addParameter('sId', oGuiElement.getSiteName()) oOutputParameterHandler.addParameter('sFav', oGuiElement.getFunction()) oOutputParameterHandler.addParameter('sCat', oGuiElement.getCat()) self.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'cFav', 'cFav', 'setFavorite', util.VSlang(30207))
def createContexMenuba(self, oGuiElement, oOutputParameterHandler=''): oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sTitle', oGuiElement.getTitle()) oOutputParameterHandler.addParameter('sFileName', oGuiElement.getFileName()) self.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'cGui', oGuiElement.getSiteName(), 'viewBA', util.VSlang(30212))
def createContexMenuinfo(self, oGuiElement, oOutputParameterHandler=''): oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('sTitle', oGuiElement.getTitle()) oOutputParameterHandler.addParameter('sFileName', oGuiElement.getFileName()) oOutputParameterHandler.addParameter('sId', oGuiElement.getSiteName()) oOutputParameterHandler.addParameter('sMeta', oGuiElement.getMeta()) self.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'cGui', oGuiElement.getSiteName(), 'viewinfo', util.VSlang(30208))
def addText(self, sId, sLabel=util.VSlang(30204), sIcon='none.png'): oGuiElement = cGuiElement() oGuiElement.setSiteName(sId) oGuiElement.setFunction('DoNothing') oGuiElement.setTitle(sLabel) oGuiElement.setIcon(sIcon) oGuiElement.setThumbnail(oGuiElement.getIcon()) oGuiElement.setMeta(0) oOutputParameterHandler = cOutputParameterHandler() self.addFolder(oGuiElement, oOutputParameterHandler)
def createContexMenuDownload(self, oGuiElement, oOutputParameterHandler='', status='0'): if status == '0': self.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'cDownload', 'cDownload', 'StartDownloadOneFile', util.VSlang(30215)) if status == '0' or status == '2': self.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'cDownload', 'cDownload', 'delDownload', util.VSlang(30216)) self.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'cDownload', 'cDownload', 'DelFile', util.VSlang(30217)) if status == '1': self.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'cDownload', 'cDownload', 'StopDownloadList', util.VSlang(30218)) if status == '2': self.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'cDownload', 'cDownload', 'ReadDownload', util.VSlang(30219)) self.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'cDownload', 'cDownload', 'ResetDownload', util.VSlang(30220))
def createContexMenuTrakt(self, oGuiElement, oOutputParameterHandler=''): #pas de menu si pas de meta. #if cConfig().getSetting("meta-view") == 'false': # return oOutputParameterHandler.addParameter('sImdbId', oGuiElement.getImdbId()) oOutputParameterHandler.addParameter('sTmdbId', oGuiElement.getTmdbId()) #ajout de filename netoyage deja fait oOutputParameterHandler.addParameter('sFileName', oGuiElement.getFileName()) sType = cGui.CONTENT.replace('tvshows', 'shows') oOutputParameterHandler.addParameter('sType', sType) self.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'cTrakt', 'cTrakt', 'getAction', util.VSlang(30214))
def SearchBA(self): url = "https://www.googleapis.com/youtube/v3/search?part=id,snippet&q=%s&maxResults=1&relevanceLanguage=fr&key=%s" % (self.search, self.key) req = urllib2.Request(url) try: gcontext = ssl.SSLContext(ssl.PROTOCOL_TLSv1) response = urllib2.urlopen(req,context=gcontext) except: response = urllib2.urlopen(req) sHtmlContent = response.read() result = json.loads(sHtmlContent) response.close() try: ids = result['items'][0]['id']['videoId'] url = 'http://www.youtube.com/watch?v=%s' % ids from resources.hosters.youtube import cHoster hote = cHoster() hote.setUrl(url) api_call = hote.getMediaLink()[1] if not api_call: return oGuiElement = cGuiElement() oGuiElement.setSiteName(SITE_IDENTIFIER) oGuiElement.setTitle(self.search.replace('+',' ')) oGuiElement.setMediaUrl(api_call) oGuiElement.setThumbnail(oGuiElement.getIcon()) oPlayer = cPlayer() oPlayer.clearPlayList() oPlayer.addItemToPlaylist(oGuiElement) oPlayer.startPlayer() except: util.VSshowInfo('Vstream',util.VSlang(30204)) return return
def load(self): oGui = cGui() oConfig = cConfig() if (oConfig.getSetting('home_update') == 'true'): oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', 'http://venom') oGui.addDir(SITE_IDENTIFIER, 'showUpdate', util.VSlang(30418), 'update.png', oOutputParameterHandler) oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', 'http://venom') oGui.addDir(SITE_IDENTIFIER, 'showSearchText', util.VSlang(30076), 'search.png', oOutputParameterHandler) oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', 'http://venom') oGui.addDir('themoviedb_org', 'load', util.VSlang(30088), 'searchtmdb.png', oOutputParameterHandler) # oOutputParameterHandler = cOutputParameterHandler() # oOutputParameterHandler.addParameter('siteUrl', 'http://venom') # oGui.addDir('freebox', 'load', oConfig.getlanguage(30115), 'tv.png', oOutputParameterHandler) oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', 'http://venom') oGui.addDir('freebox', 'load', util.VSlang(30115), 'tv.png', oOutputParameterHandler) oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', 'http://venom') oGui.addDir(SITE_IDENTIFIER, 'showReplay', util.VSlang(30117), 'replay.png', oOutputParameterHandler) oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', 'http://venom') oGui.addDir(SITE_IDENTIFIER, 'showMovies', util.VSlang(30120), 'films.png', oOutputParameterHandler) oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', 'http://venom') oGui.addDir(SITE_IDENTIFIER, 'showSeries', util.VSlang(30121), 'series.png', oOutputParameterHandler) oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', 'http://venom') oGui.addDir(SITE_IDENTIFIER, 'showAnimes', util.VSlang(30122), 'animes.png', oOutputParameterHandler) oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', 'http://venom') oGui.addDir(SITE_IDENTIFIER, 'showDocs', util.VSlang(30112), 'doc.png', oOutputParameterHandler) oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', 'SPORT_SPORTS') oGui.addDir(SITE_IDENTIFIER, 'callpluging', util.VSlang(30113), 'sport.png', oOutputParameterHandler) oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', 'http://venom') oGui.addDir(SITE_IDENTIFIER, 'showNets', util.VSlang(30114), 'buzz.png', oOutputParameterHandler) oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', 'http://venom') oGui.addDir('themoviedb_org', 'showMyTmdb', 'TMDB', 'tmdb.png', oOutputParameterHandler) oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', 'http://venom') oGui.addDir('cTrakt', 'getLoad', util.VSlang(30214), 'trakt.png', oOutputParameterHandler) oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', 'http://venom') oGui.addDir('cDownload', 'getDownload', util.VSlang(30202), 'download.png', oOutputParameterHandler) oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', 'http://venom') oGui.addDir('cLibrary', 'getLibrary', util.VSlang(30300), 'library.png', oOutputParameterHandler) oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', 'http://venom') oGui.addDir('cFav', 'getFavourites', util.VSlang(30207), 'mark.png', oOutputParameterHandler) if (oConfig.getSetting("history-view") == 'true'): oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', 'http://venom') oGui.addDir('cHome', 'showHistory', util.VSlang(30308), 'annees.png', oOutputParameterHandler) oOutputParameterHandler = cOutputParameterHandler() oOutputParameterHandler.addParameter('siteUrl', 'http://venom') oGui.addDir('globalSources', 'showSources', util.VSlang(30138), 'host.png', oOutputParameterHandler) # oOutputParameterHandler = cOutputParameterHandler() # oOutputParameterHandler.addParameter('siteUrl', 'http://venom') # oGui.addDir('globalParametre', 'showSources', '[COLOR teal]'+oConfig.getlanguage(30023)+'[/COLOR]', 'param.png', oOutputParameterHandler) view = False if (oConfig.getSetting("active-view") == 'true'): view = oConfig.getSetting('accueil-view') oGui.setEndOfDirectory(view)
def createContexMenuSettings(self, oGuiElement, oOutputParameterHandler=''): self.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'globalParametre', 'globalParametre', 'opensetting', util.VSlang(30023))
def createContexMenuDelFav(self, oGuiElement, oOutputParameterHandler=''): self.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'cFav', 'cFav', 'delFavouritesMenu', util.VSlang(30209))
def createContexMenuWatch(self, oGuiElement, oOutputParameterHandler=''): self.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'cGui', oGuiElement.getSiteName(), 'setWatched', util.VSlang(30206))
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() 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') #existe dans le menu krypton 17 if not util.isKrypton(): oGui.createContexMenuWatch(oGuiElement, oOutputParameterHandler) #context playlit menu oContext = cContextElement() oContext.setFile('cHosterGui') oContext.setSiteName(self.SITE_NAME) oContext.setFunction('addToPlaylist') oContext.setTitle(util.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(util.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(util.VSlang(30326)) oContext.setOutputParameterHandler(oOutputParameterHandler) oGuiElement.addContextItem(oContext) #Upload menu if cInputParameterHandler().getValue('site') != 'siteuptobox' and cConfig().getSetting('hoster_uptobox_premium') == 'true' and oHoster.getPluginIdentifier() == 'uptobox' or oHoster.getPluginIdentifier() == 'uptostream': oGui.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'siteuptobox', 'siteuptobox', 'AddmyAccount', util.VSlang(30325)) #Upload url vers upto if cConfig().getSetting('hoster_uptobox_premium') == 'true' and oHoster.getPluginIdentifier() == 'onefichier' or oHoster.getPluginIdentifier() == 'uplea': oGui.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'siteuptobox', 'siteuptobox', 'UptomyAccount', util.VSlang(30325)) #context FAV menu oGui.createContexMenuFav(oGuiElement, oOutputParameterHandler) #context Library menu oGui.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'cLibrary', 'cLibrary', 'setLibrary', util.VSlang(30324)) #bug oGui.addHost(oGuiElement, oOutputParameterHandler)
def createContexMenuHome(self, oGuiElement, oOutputParameterHandler=''): self.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'server', 'server', 'load', util.VSlang(30025))
def createContexMenuRemove(self, oGuiElement, oOutputParameterHandler=''): self.CreateSimpleMenu(oGuiElement, oOutputParameterHandler, 'cGui', oGuiElement.getSiteName(), 'removeHistory', util.VSlang(30440))