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


Python xbmc.getInfoLabel函数代码示例

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


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

示例1: main

def main():
    path = xbmc.getInfoLabel('ListItem.Path')    
    db_type = xbmc.getInfoLabel('ListItem.DBTYPE')
    if db_type == "tvshow":
        path = urllib.quote_plus(path)
        url = "plugin://{0}/tv/set_library_player/{1}".format(pluginid, path)
        xbmc.executebuiltin("RunPlugin({0})".format(url))
开发者ID:podgod,项目名称:podgod,代码行数:7,代码来源:context_tvshow.py

示例2: get_folderandprefix

 def get_folderandprefix(self):
     '''get the current folder and prefix'''
     cur_folder = ""
     cont_prefix = ""
     try:
         widget_container = self.win.getProperty("SkinHelper.WidgetContainer").decode('utf-8')
         if xbmc.getCondVisibility("Window.IsActive(movieinformation)"):
             cont_prefix = ""
             cur_folder = xbmc.getInfoLabel(
                 "movieinfo-$INFO[Container.FolderPath]"
                 "$INFO[Container.NumItems]"
                 "$INFO[Container.Content]").decode('utf-8')
         elif widget_container:
             cont_prefix = "Container(%s)." % widget_container
             cur_folder = xbmc.getInfoLabel(
                 "widget-%s-$INFO[Container(%s).NumItems]-$INFO[Container(%s).ListItemAbsolute(1).Label]" %
                 (widget_container, widget_container, widget_container)).decode('utf-8')
         else:
             cont_prefix = ""
             cur_folder = xbmc.getInfoLabel(
                 "$INFO[Container.FolderPath]$INFO[Container.NumItems]$INFO[Container.Content]").decode(
                 'utf-8')
     except Exception as exc:
         log_exception(__name__, exc)
         cur_folder = ""
         cont_prefix = ""
     return (cur_folder, cont_prefix)
开发者ID:marcelveldt,项目名称:script.skin.helper.service,代码行数:27,代码来源:listitem_monitor.py

示例3: myPlayerChanged

    def myPlayerChanged( self, event, force_update=False ):
        LOG( LOG_DEBUG, "%s (rev: %s) GUI::myPlayerChanged [%s]", __scriptname__, __svn_revision__, [ "stopped","ended","started" ][ event ] )
        if ( event < 2 ): 
            self.exit_script()
        else:
            for cnt in range( 5 ):
                song = xbmc.getInfoLabel( "MusicPlayer.Title" )
                #print "Song" + song

                artist = xbmc.getInfoLabel( "MusicPlayer.Artist" )
                #print "Artist" + artist                
                if ( song and ( not artist or self.settings[ "use_filename" ] ) ):
                    artist, song = self.get_artist_from_filename( xbmc.Player().getPlayingFile() )
                if ( song and ( self.song != song or self.artist != artist or force_update ) ):
                    self.artist = artist
                    self.song = song
                    self.lock.acquire()
                    try:
                        self.timer.cancel()
                    except:
                        pass
                    self.lock.release()
                    self.get_lyrics( artist, song )
                    break
                xbmc.sleep( 50 )
            if (self.allowtimer and self.settings[ "smooth_scrolling" ] and self.getControl( 110 ).size() > 1):
                self.lock.acquire()
                try:
                    self.timer.cancel()
                except:
                    pass
                self.lock.release()
                self.refresh()
开发者ID:EddyPan,项目名称:xbmc-addons-chinese-1,代码行数:33,代码来源:gui.py

示例4: __init__

 def __init__(self):
     self.log("__init__")
     # InfoLabel Parameters  
     self.Label       = xbmc.getInfoLabel('ListItem.Label')
     self.Path        = xbmc.getInfoLabel('ListItem.FolderPath')
     self.FileName    = xbmc.getInfoLabel('ListItem.FilenameAndPath')
     self.DBIDType    = xbmc.getInfoLabel('ListItem.DBTYPE')
     self.AddonName   = xbmc.getInfoLabel('Container.PluginName')
     self.AddonType   = xbmc.getInfoLabel('Container.Property(addoncategory)')
     self.Description = xbmc.getInfoLabel('ListItem.Property(Addon.Description)')
     self.plot        = xbmc.getInfoLabel('ListItem.Plot')
     self.plotOutline = xbmc.getInfoLabel('ListItem.PlotOutline')
     self.isPlayable  = xbmc.getInfoLabel('ListItem.Property(IsPlayable)').lower() == 'true'
     self.isFolder    = xbmc.getCondVisibility('ListItem.IsFolder') == 1
     
     if not self.plot:
         if self.plotOutline:
             self.Description = self.plotOutline
         elif not self.Description:   
             self.Description = self.Label
     else:  
         self.Description = self.plot
       
     if self.AddonName:
         ADDON = xbmcaddon.Addon(id=self.AddonName)
         ADDON_ID = ADDON.getAddonInfo('id')
         self.AddonName = ADDON.getAddonInfo('name')
         
     self.chnlst = ChannelList()
     self.Label = self.chnlst.cleanLabels(self.Label)
     self.Description  = self.chnlst.cleanLabels(self.Description)
     self.AddonName = self.chnlst.cleanLabels(self.AddonName)
     self.log("%s, %s, %s, %s, %s, %s, %s, %s, %s"%(self.Label,self.Path,self.FileName,self.DBIDType,self.AddonName,self.AddonType,self.Description,str(self.isPlayable),str(self.isFolder)))
     self.ImportChannel()
开发者ID:mrioan,项目名称:XBMC_Addons,代码行数:34,代码来源:capture.py

示例5: detail

def detail(params, url, category):
    logger.info("[documentalesatonline.py] detail")

    title = unicode(xbmc.getInfoLabel("ListItem.Title"), "utf-8")
    thumbnail = urllib.unquote_plus(params.get("thumbnail"))
    plot = unicode(xbmc.getInfoLabel("ListItem.Plot"), "utf-8")

    # Descarga la página
    data = scrapertools.cachePage(url)
    # logger.info(data)

    # ------------------------------------------------------------------------------------
    # Busca los enlaces a los videos
    # ------------------------------------------------------------------------------------
    listavideos = servertools.findvideos(data)

    for video in listavideos:
        xbmctools.addvideo(CHANNELNAME, "Megavideo - " + video[0], video[1], category, video[2])
        # ------------------------------------------------------------------------------------

        # Label (top-right)...
    xbmcplugin.setPluginCategory(handle=pluginhandle, category=category)

    # Disable sorting...
    xbmcplugin.addSortMethod(handle=pluginhandle, sortMethod=xbmcplugin.SORT_METHOD_NONE)

    # End of directory...
    xbmcplugin.endOfDirectory(handle=pluginhandle, succeeded=True)
开发者ID:jorik041,项目名称:pelisalacarta-personal-fork,代码行数:28,代码来源:documentalesatonline.py

示例6: CreateDialogYesNo

def CreateDialogYesNo(header="", line1="", nolabel="", yeslabel="", noaction="", yesaction=""):
    if yeslabel == "":
        yeslabel = xbmc.getInfoLabel("Window.Property(Dialog.yes.Label)")
        if yeslabel == "":
            yeslabel = "yes"
    if nolabel == "":
        nolabel = xbmc.getInfoLabel("Window.Property(Dialog.no.Label)")
        if nolabel == "":
            nolabel = "no"
    if yesaction == "":
        yesaction = xbmc.getInfoLabel("Window.Property(Dialog.yes.Builtin)")
    if noaction == "":
        noaction = xbmc.getInfoLabel("Window.Property(Dialog.no.Builtin)")
    dialog = xbmcgui.Dialog()
    ret = dialog.yesno(heading=header, line1=line1, nolabel=nolabel, yeslabel=yeslabel)  # autoclose missing
    if ret:
        for builtin in yesaction.split("||"):
            xbmc.executebuiltin(builtin)
            xbmc.sleep(30)
    else:
        for builtin in noaction.split("||"):
            xbmc.executebuiltin(builtin)
            xbmc.sleep(30)
    xbmc.executebuiltin("ClearProperty(Dialog.yes.Label")
    xbmc.executebuiltin("ClearProperty(Dialog.no.Label")
    xbmc.executebuiltin("ClearProperty(Dialog.yes.Builtin")
    xbmc.executebuiltin("ClearProperty(Dialog.no.Builtin")
    return ret
开发者ID:braz96,项目名称:script.toolbox,代码行数:28,代码来源:Utils.py

示例7: onPlayBackStopped

  def onPlayBackStopped(self):
	log('player stops')
	type = 'unkown'
	if (self.isPlayingAudio()):
	  type = "music"
	else:
		if xbmc.getCondVisibility('VideoPlayer.Content(movies)'):
			filename = ''
			isMovie = True
		try:
			filename = self.getPlayingFile()
		except:
			pass
		if filename != '':
			for string in self.substrings:
				if string in filename:
					isMovie = False
					break
		if isMovie:
			type = "movie"
		elif xbmc.getCondVisibility('VideoPlayer.Content(episodes)'):
	  # Check for tv show title and season to make sure it's really an episode
			if xbmc.getInfoLabel('VideoPlayer.Season') != "" and xbmc.getInfoLabel('VideoPlayer.TVShowTitle') != "":
				type = "episode"
	typevar=type
	
	if typevar!="music":
		global script_playerV_stops
		log('Going to execute script = "' + script_playerV_stops + '"')
		xbmc.executebuiltin('XBMC.RunScript('+script_playerV_stops+ ", " + self.playing_type()+')')
	if typevar=="music":
		global script_playerA_stops
		log('Going to execute script = "' + script_playerA_stops + '"')
		xbmc.executebuiltin('XBMC.RunScript('+script_playerA_stops+ ", " + self.playing_type()+')')
开发者ID:Homidom,项目名称:HoMIDoM-Plugin-XBMC-KODI,代码行数:34,代码来源:default.py

示例8: getControls

    def getControls( self ):
        coordinates = self.getControl( 2000 ).getPosition()

        c_anim = []
        try:
            import re
            for anim in re.findall( "(\[.*?\])", xbmc.getInfoLabel( "Control.GetLabel(1999)" ), re.S ):
                try: c_anim.append( tuple( eval( anim ) ) )
                except: pass
        except:
            print_exc()

        self.controls[ "background" ] = Control( self.getControl( 2001 ), coordinates, c_anim )

        self.controls[ "heading" ] = Control( self.getControl( 2002 ), coordinates, c_anim )

        self.controls[ "label" ] = Control( self.getControl( 2003 ), coordinates, c_anim )

        try:
            v = xbmc.getInfoLabel( "Control.GetLabel(2045)" ).replace( ", ", "," )
            progressTextures = dict( [ k.split( "=" ) for k in v.split( "," ) ] )
        except:
            progressTextures = {}

        self.controls[ "progress1" ] = Control( self.getControl( 2004 ), coordinates, c_anim, **progressTextures )

        self.controls[ "progress2" ] = Control( self.getControl( 2005 ), coordinates, c_anim, **progressTextures )

        self.controls[ "button" ] = Control( self.getControl( 2006 ), coordinates, c_anim )
开发者ID:cClaude,项目名称:plugin.image.mypicsdb,代码行数:29,代码来源:AddonScan.py

示例9: onPlayBackStarted

 def onPlayBackStarted(self):
     xbmc.sleep(1000)
     # Set values based on the file content
     if (self.isPlayingAudio()):
         self.type = "music"
     else:
         if xbmc.getCondVisibility('VideoPlayer.Content(movies)'):
             filename = ''
             isMovie = True
             try:
                 filename = self.getPlayingFile()
             except:
                 pass
             if filename != '':
                 for string in self.substrings:
                     if string in filename:
                         isMovie = False
                         break
             if isMovie:
                 self.type = "movie"
         elif xbmc.getCondVisibility('VideoPlayer.Content(episodes)'):
             # Check for tv show title and season
             # to make sure it's really an episode
             if xbmc.getInfoLabel('VideoPlayer.Season') != "" and xbmc.getInfoLabel('VideoPlayer.TVShowTitle') != "":
                 self.type = "episode"
         elif xbmc.getCondVisibility('VideoPlayer.Content(musicvideos)'):
             self.type = "musicvideo"
开发者ID:hitmixer,项目名称:service.library.data.provider,代码行数:27,代码来源:service.py

示例10: setupvars

 def setupvars(self):
     xbmcgui.lock()
     self.unreadvalue = 0
     self.click = 0
     self.ziplist = []
     self.subject = self.emailsettings[1][0]
     self.emfrom = self.emailsettings[1][1]
     self.to = self.myemail.get('to').replace("\n","")
     self.cc = self.myemail.get('Cc')
     if self.cc == None:
         self.cc = ""
     else:self.cc = self.cc.replace("\n","")
     date = self.myemail.get('date')
     if date == None:
         mytime = time.strptime(xbmc.getInfoLabel("System.Date") + xbmc.getInfoLabel("System.Time"),'%A , %B %d, %Y %I:%M %p')
         self.sent = time.strftime('%a, %d %b %Y %X +0000',mytime).replace("\n","")
     else:self.sent = str(date).replace("\n","")
     self.attachments = []
     self.replyvalue = 0
     self.curpos = 0
     self.showing = False
     self.returnvalue = "-"
     self.control_action = XinBox_Util.setControllerAction()
     self.attachlist = False
     xbmc.executebuiltin("Skin.Reset(attachlistnotempty)")
     xbmc.executebuiltin("Skin.Reset(emaildialog)")
开发者ID:amitca71,项目名称:xbmc-scripting,代码行数:26,代码来源:XinBox_Email.py

示例11: get_current_list_item

def get_current_list_item():
    import xbmc
    ret = {"info": {}}
    keys = {
        "label": "ListItem.Label",
        "label2": "ListItem.Label2",
        "icon": "ListItem.Icon",
        "thumbnail": "ListItem.Thumb",
    }
    info_keys = {
        "title": "ListItem.Title",
        "genre": "ListItem.Genre",
        "plot": "ListItem.Plot",
        "plot_outline": "ListItem.PlotOutline",
        "tagline": "ListItem.Tagline",
        "rating": "ListItem.Rating",
        "mpaa": "ListItem.Mpaa",
        "cast": "ListItem.Cast",
        "castandrole": "ListItem.CastAndRole",
        "tvshowtitle": "ListItem.TVShowTitle",
        "studio": "ListItem.Studio",
        "picturepath": "ListItem.PicturePath",
        "year": "ListItem.Year",
        "season": "ListItem.Season",
        "episode": "ListItem.Episode",
    }
    for key, infolabel in keys.items():
        ret[key] = xbmc.getInfoLabel(infolabel)
    for key, infolabel in info_keys.items():
        ret["info"][key] = xbmc.getInfoLabel(infolabel)
    return ret
开发者ID:ravishi,项目名称:xbmctorrent,代码行数:31,代码来源:utils.py

示例12: mirror_sub

def mirror_sub(id, filename, sub_file):
    try:
        playerid_query = '{"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1}'
        playerid = json.loads(xbmc.executeJSONRPC(playerid_query))['result'][0]['playerid']
        imdb_id_query = '{"jsonrpc": "2.0", "method": "Player.GetItem", "params": {"playerid": ' + str(playerid) + ', "properties": ["imdbnumber"]}, "id": 1}'
        imdb_id = json.loads(xbmc.executeJSONRPC (imdb_id_query))['result']['item']['imdbnumber']
    except:
        imdb_id = 0

    values = {}
    values['id'] = id
    values['versioname'] = filename
    values['source'] = 'ktuvit'
    values['year'] = xbmc.getInfoLabel("VideoPlayer.Year")
    values['season'] = str(xbmc.getInfoLabel("VideoPlayer.Season"))
    values['episode'] = str(xbmc.getInfoLabel("VideoPlayer.Episode"))
    values['imdb'] = str(imdb_id)
    values['tvshow'] = normalizeString(xbmc.getInfoLabel("VideoPlayer.TVshowtitle"))
    values['title'] = normalizeString(xbmc.getInfoLabel("VideoPlayer.OriginalTitle"))
    values['file_original_path'] = urllib.unquote(unicode(xbmc.Player().getPlayingFile(), 'utf-8'))
    url = 'http://api.wizdom.xyz/upload.php'
    try:
        post(url, files={'sub': open(sub_file, 'rb')}, data=values)
    except:
        pass
开发者ID:XBMCil,项目名称:service.subtitles.subtitle,代码行数:25,代码来源:service.py

示例13: add_next_video

 def add_next_video(self):
     result = 2
     if (xbmc.Player().isPlayingVideo()):
         try: result = (int(xbmc.getInfoLabel('Playlist.Length(video)')) - int(xbmc.getInfoLabel('Playlist.Position(video)')))
         except: pass
         if result < 2:
             self.add_video()
开发者ID:kodinerds,项目名称:repo,代码行数:7,代码来源:player.py

示例14: play

def play(params,url,category):
	xbmc.output("[terratv.py] play")

	title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" )
	thumbnail = urllib.unquote_plus( params.get("thumbnail") )
	plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )
	server = "Directo"
	xbmc.output("[terratv.py] thumbnail="+thumbnail)

	# Abre dialogo
	dialogWait = xbmcgui.DialogProgress()
	dialogWait.create( 'Descargando datos del vídeo...', title )

	# --------------------------------------------------------
	# Descarga pagina detalle
	# --------------------------------------------------------
	data = scrapertools.cachePage(url)
	patron = "'(http\:\/\/www\.terra\.tv\/templates\/getVideo\.aspx[^']+)'"
	matches = re.compile(patron,re.DOTALL).findall(data)
	scrapertools.printMatches(matches)
	url = matches[0]
	xbmc.output("url="+url)

	req = urllib2.Request(url)
	req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
	response = urllib2.urlopen(req)
	data=response.read()
	response.close()
	xbmc.output("data="+data)

	patron = '<ref href="([^"]+)"'
	matches = re.compile(patron,re.DOTALL).findall(data)

	if len(matches)==0:
		patron = '<video src="([^"]+)"'
		matches = re.compile(patron,re.DOTALL).findall(data)

	url = matches[0]
	xbmc.output("url="+url)
	
	# --------------------------------------------------------
	# Amplia el argumento
	# --------------------------------------------------------
	patron = '<div id="encuesta">\s*<div class="cab">.*?</div>(.*?)</div>'
	matches = re.compile(patron,re.DOTALL).findall(data)
	scrapertools.printMatches(matches)
	if len(matches)>0:
		plot = "%s" % matches[0]
		plot = plot.replace("<p>","")
		plot = plot.replace("</p>"," ")
		plot = plot.replace("<strong>","")
		plot = plot.replace("</strong>","")
		plot = plot.replace("<br />"," ")
		plot = plot.strip()
	
	# Cierra dialogo
	dialogWait.close()
	del dialogWait

	xbmctools.playvideo(CHANNELNAME,server,url,category,title,thumbnail,plot)
开发者ID:arieltools,项目名称:plugin.video.tvalacarta,代码行数:60,代码来源:terratv.py

示例15: doFunction

 def doFunction(self, url):
     func = url[0:2]
     url  = url[2:]
     if func == 'AL':
         name = xbmc.getInfoLabel('ListItem.Title')
         profile = self.addon.getAddonInfo('profile').decode(UTF8)
         moviesDir = xbmc.translatePath(os.path.join(profile,'TV Shows'))
         movieDir = xbmc.translatePath(os.path.join(moviesDir, name))
         if not os.path.isdir(movieDir):
             os.makedirs(movieDir)
         ilist = []
         ilist = self.getAddonEpisodes(url, ilist, getFileData = True)
         for season, episode, url in ilist:
             se = 'S%sE%s' % (str(season), str(episode))
             xurl = '%s?mode=GV&url=%s' % (sys.argv[0], qp(url))
             strmFile = xbmc.translatePath(os.path.join(movieDir, se+'.strm'))
             with open(strmFile, 'w') as outfile:
                 outfile.write(xurl)         
     elif func == 'AM':
         name  = xbmc.getInfoLabel('ListItem.Title')
         profile = self.addon.getAddonInfo('profile').decode(UTF8)
         moviesDir  = xbmc.translatePath(os.path.join(profile,'Movies'))
         movieDir  = xbmc.translatePath(os.path.join(moviesDir, name))
         if not os.path.isdir(movieDir):
             os.makedirs(movieDir)
         strmFile = xbmc.translatePath(os.path.join(movieDir, name+'.strm'))
         with open(strmFile, 'w') as outfile:
             outfile.write('%s?mode=GV&url=%s' %(sys.argv[0], url))
     json_cmd = '{"jsonrpc":"2.0","method":"VideoLibrary.Scan", "params": {"directory":"%s/"},"id":1}' % movieDir.replace('\\','/')
     jsonRespond = xbmc.executeJSONRPC(json_cmd)
开发者ID:n8225,项目名称:Kodi-plugins-source,代码行数:30,代码来源:scraper.py


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