Python xbmc.executebuiltin() Examples

The following are 30 code examples of xbmc.executebuiltin(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module xbmc , or try the search function .
Example #1
Source File: context.py    From plugin.video.emby with GNU General Public License v3.0 6 votes vote down vote up
def action_menu(self):

        selected = self._selected_option.decode('utf-8')

        if selected == OPTIONS['Refresh']:
            self.server['api'].refresh_item(self.item['Id'])

        elif selected == OPTIONS['AddFav']:
            self.server['api'].favorite(self.item['Id'], True)

        elif selected == OPTIONS['RemoveFav']:
            self.server['api'].favorite(self.item['Id'], False)

        elif selected == OPTIONS['Addon']:
            xbmc.executebuiltin('Addon.OpenSettings(plugin.video.emby)')

        elif selected == OPTIONS['Delete']:
            self.delete_item() 
Example #2
Source File: advancedfunctions.py    From program.plexus with GNU General Public License v2.0 6 votes vote down vote up
def shutdown_hooks():
	opcao= xbmcgui.Dialog().yesno(translate(40000), translate(70027),translate(70028) + str(xbmc.getSkinDir()) )
	if opcao:
		mensagemok(translate(40000),translate(70029),translate(70030))
		mensagemok(translate(40000),translate(70031))
		opcao= xbmcgui.Dialog().yesno(translate(40000), translate(70032) )
		if opcao:
			import xml.etree.ElementTree as ET
			skin_path = xbmc.translatePath("special://skin/")
			tree = ET.parse(os.path.join(skin_path, "addon.xml"))
			try: res = tree.findall("./res")[0]
			except: res = tree.findall("./extension/res")[0]
			xml_specific_folder = str(res.attrib["folder"])
			xml_video_osd = os.path.join(xbmc.translatePath("special://skin/"),xml_specific_folder,"VideoOSD.xml")
			xml_content = readfile(xml_video_osd).replace('PlayerControl(Stop)','RunPlugin(plugin://plugin.video.p2p-streams/?mode=7)')
			try:
				save(xml_video_osd,xml_content)
				xbmc.executebuiltin("Notification(%s,%s,%i,%s)" % (translate(40000), translate(600026), 1,addonpath+"/icon.png"))
			except: mensagemok(translate(40000),'No permissions.')
			opcao= xbmcgui.Dialog().yesno(translate(40000), translate(70033) )
			if opcao:
				from peertopeerutils.keymapeditor import *
				run() 
Example #3
Source File: default.py    From bugatsinho.github.io with GNU General Public License v3.0 6 votes vote down vote up
def run(self):
        if os.path.isfile(DOWNLOAD_LIST):
            s = read_from_file(DOWNLOAD_LIST)
            search_list = s.split('\n')
            for list in search_list:
                if list != '':
                    splitlist = list.split('<>')
                    filename = os.path.join(splitlist[0], splitlist[4])
                    artist = splitlist[1]
                    album = splitlist[2]
                    track = splitlist[3]
                    trackname = splitlist[4]
                    tracktitle = trackname
                    if os.path.exists(filename):
                        audio = MP3(filename, ID3=EasyID3)
                        audio["title"] = tracktitle
                        audio["artist"] = artist
                        audio["album"] = album
                        audio["tracknumber"] = track
                        audio.save()
                        remove_from_list(list, DOWNLOAD_LIST)
        notification('Music Library', 'ID3 tags updated', '3000', iconart)
        xbmc.executebuiltin('UpdateLibrary(music)') 
Example #4
Source File: context_menu_extendedinfo.py    From repository.guilouz with GNU General Public License v2.0 6 votes vote down vote up
def main():
    info = sys.listitem.getVideoInfoTag()
    dbid = info.getDbId()
    db_type = info.getMediaType()
    remote_id = sys.listitem.getProperty("id")
    BASE = "RunScript(script.extendedinfo,info="
    if not dbid:
        dbid = sys.listitem.getProperty("dbid")
    if db_type == "movie":
        xbmc.executebuiltin("%sextendedinfo,dbid=%s,id=%s,name=%s)" % (BASE, dbid, remote_id, info.getTitle()))
    elif db_type == "tvshow":
        xbmc.executebuiltin("%sextendedtvinfo,dbid=%s,id=%s)" % (BASE, dbid, remote_id))
    elif db_type == "season":
        xbmc.executebuiltin("%sseasoninfo,tvshow=%s,season=%s)" % (BASE, info.getTVShowTitle(), info.getSeason()))
    elif db_type in ["actor", "director"]:
        xbmc.executebuiltin("%sextendedactorinfo,name=%s)" % (BASE, sys.listitem.getLabel())) 
Example #5
Source File: advancedfunctions.py    From program.plexus with GNU General Public License v2.0 6 votes vote down vote up
def set_acestream_engine_cache_folder(url):
	if not xbmc.getCondVisibility('system.platform.windows'):
		opcao= xbmcgui.Dialog().yesno(translate(40000), translate(70011))
	else: opcao = ''
	if opcao:
		if not xbmc.getCondVisibility('system.platform.Android'):
			acestream_settings_file = os.path.join(os.getenv("HOME"),'.ACEStream','playerconf.pickle')
		else:
			acestream_settings_file = os.path.join('/sdcard','.ACEStream','playerconf.pickle')
		settings_content = readfile(acestream_settings_file)
		cachefolder = xbmcgui.Dialog().browse(3, translate(70012) , 'myprograms','')
		if cachefolder:
			settings_content = settings_content.replace(url,cachefolder)
			save(acestream_settings_file, settings_content)
			settings.setSetting('acestream_cachefolder',cachefolder)
			xbmc.executebuiltin("Notification(%s,%s,%i,%s)" % (translate(40000), translate(600026), 1,addonpath+"/icon.png"))
			xbmc.executebuiltin("Container.Refresh") 
Example #6
Source File: service.py    From service.subtitles.addic7ed with GNU General Public License v2.0 6 votes vote down vote up
def download(link):
  subtitle_list = []

  if xbmcvfs.exists(__temp__):
    shutil.rmtree(__temp__)
  xbmcvfs.mkdirs(__temp__)

  file = os.path.join(__temp__, "addic7ed.srt")

  f = get_url(link)

  local_file_handle = open(file, "wb")
  local_file_handle.write(f)
  local_file_handle.close()

  subtitle_list.append(file)

  if len(subtitle_list) == 0:
    if search_string:
      xbmc.executebuiltin((u'Notification(%s,%s)' % (__scriptname__ , __language__(32002))).encode('utf-8'))
    else:
      xbmc.executebuiltin((u'Notification(%s,%s)' % (__scriptname__ , __language__(32003))).encode('utf-8'))

  return subtitle_list 
Example #7
Source File: contextmenu.py    From plugin.video.ustvvod with GNU General Public License v2.0 6 votes vote down vote up
def queue():
	playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
	show_title, season, episode, thumb, displayname, qmode, url = args.url.split('<join>')
	name =  base64.b64decode(displayname)
	item = xbmcgui.ListItem(name, path = url)
	try:
		item.setThumbnailImage(thumb)
	except:
		pass
	try:
		item.setInfo('Video', {	'title' : name,
						'season' : season,
						'episode' : episode,
						'TVShowTitle' : show_title})
	except:
		pass
	playlist.add(url, item)
	xbmc.executebuiltin('XBMC.Notification(%s, %s, 5000, %s)' % ("Queued", name, thumb)) 
Example #8
Source File: service.py    From xbmc-betaseries with GNU General Public License v2.0 6 votes vote down vote up
def get_soup(content):
    # check if page content can be used
    pattern = "subtitles from the source! - Addic7ed.com"
    try:
        soup = BeautifulSoup(content)
        title = str(soup.findAll("title")[0])
        if title.find(pattern) > -1:
            return soup
        else:
            log("bad page, maybe index after 404")
            return False
    except:
        log("badly formatted content")
        if self_notify:
            xbmc.executebuiltin((u'Notification(%s,%s,%s,%s)' % (__addonname__, __language__(30009), 750, __icon__)).encode('utf-8', 'ignore'))
        return False 
Example #9
Source File: service.py    From xbmc-betaseries with GNU General Public License v2.0 6 votes vote down vote up
def get_soup(content):
    # check if page content can be used
    pattern = "TVsubtitles.net - "
    try:
        soup = BeautifulSoup(content)
        title = str(soup.findAll("title")[0])
        if title.find(pattern) > -1:
            return soup
        else:
            log("bad page, maybe index after 404")
            return False
    except:
        log("badly formatted content")
        if self_notify:
            xbmc.executebuiltin((u'Notification(%s,%s,%s,%s)' % (__addonname__, __language__(30009), 750, __icon__)).encode('utf-8', 'ignore'))
        return False 
Example #10
Source File: betaseries.py    From xbmc-betaseries with GNU General Public License v2.0 6 votes vote down vote up
def _get_settings( self ):
        log('reading settings')
        service    = []
        BetaActive = __addon__.getSetting('betaactive') == 'true'
        BetaFirst  = __addon__.getSetting('betafirst') == 'true'
        BetaUser   = __addon__.getSetting('betauser')
        BetaPass   = __addon__.getSetting('betapass')
        BetaBulk   = __addon__.getSetting('betabulk') == 'true'
        BetaMark   = __addon__.getSetting('betamark') == 'true'
        BetaUnMark = __addon__.getSetting('betaunmark') == 'true'
        BetaFollow = __addon__.getSetting('betafollow') == 'true'
        BetaNotify = __addon__.getSetting('betanotify') == 'true'
        if BetaActive and BetaUser and BetaPass:
            # [service, api-url, api-key, user, pass, first-only, token, auth-fail, failurecount, timercounter, timerexpiretime, bulk, mark, unmark, follow]
            service = ['betaseries', self.apiurl, self.apikey, BetaUser, BetaPass, BetaFirst, '', False, 0, 0, 0, BetaBulk, BetaMark, BetaUnMark, BetaFollow, BetaNotify]
            self.Player = MyPlayer(action = self._service_betaserie, service = service)
            if service[15]:
                xbmc.executebuiltin((u'Notification(%s,%s,%s,%s)' % (__addonname__, __language__(30003), 750, __icon__)).encode('utf-8', 'ignore')) 
Example #11
Source File: autoplay.py    From script.tvguide.fullscreen with GNU General Public License v2.0 6 votes vote down vote up
def _scheduleAutoplay(self, channelId, programTitle, startTime, endTime):
        t = startTime - datetime.datetime.now()
        timeToAutoplay = ((t.days * 86400) + t.seconds) / 60
        if timeToAutoplay < 0:
            return
        #timeToAutoplay = 1
        name = self.createAlarmClockName(programTitle, startTime)
        xbmc.executebuiltin('AlarmClock(%s-start,RunScript(special://home/addons/script.tvguide.fullscreen/play.py,%s,%s),%d,True)' %
        (name.encode('utf-8', 'replace'), channelId.encode('utf-8'), startTime, timeToAutoplay - int(ADDON.getSetting('autoplays.before'))))

        t = endTime - datetime.datetime.now()
        timeToAutoplay = ((t.days * 86400) + t.seconds) / 60
        #timeToAutoplay = 0
        if ADDON.getSetting('autoplays.stop') == 'true':
            xbmc.executebuiltin('AlarmClock(%s-stop,RunScript(special://home/addons/script.tvguide.fullscreen/stop.py,%s,%s),%d,True)' %
            (name.encode('utf-8', 'replace'), channelId.encode('utf-8'), startTime, timeToAutoplay + int(ADDON.getSetting('autoplays.after')))) 
Example #12
Source File: sync.py    From plugin.video.emby with GNU General Public License v3.0 6 votes vote down vote up
def __exit__(self, exc_type, exc_val, exc_tb):

        ''' Exiting sync
        '''
        self.running = False
        window('emby_sync', clear=True)

        if self.screensaver is not None:

            xbmc.executebuiltin('InhibitIdleShutdown(false)')
            set_screensaver(value=self.screensaver)
            self.screensaver = None

        if self.artwork is not None:

            settings('enableTextureCache.bool', True)
            self.artwork = None
            LOG.info("[ enable artwork cache ]")

        LOG.info("--<[ fullsync ]") 
Example #13
Source File: sync.py    From plugin.video.emby with GNU General Public License v3.0 6 votes vote down vote up
def __enter__(self):

        ''' Do everything we need before the sync
        '''
        LOG.info("-->[ fullsync ]")

        if not settings('dbSyncScreensaver.bool'):

            xbmc.executebuiltin('InhibitIdleShutdown(true)')
            self.screensaver = get_screensaver()
            set_screensaver(value="")

        self.running = True

        if settings('enableTextureCache.bool') and settings('lowPowered.bool'):

            self.artwork = True
            settings('enableTextureCache.bool', False)
            LOG.info("[ disable artwork cache ]")

        window('emby_sync.bool', True)

        return self 
Example #14
Source File: xmldialogs.py    From plugin.video.netflix with MIT License 6 votes vote down vote up
def _show_modal_dialog(dlg_class, xml, path, **kwargs):
    dlg = dlg_class(xml, path, 'default', '1080i', **kwargs)
    minutes = kwargs.get('minutes', 0)
    seconds = kwargs.get('seconds', 0)
    if minutes > 0 or seconds > 0:
        # Bug in Kodi AlarmClock function, if only the seconds are passed
        # the time conversion inside the function multiply the seconds by 60
        if seconds > 59 and minutes == 0:
            alarm_time = time.strftime('%M:%S', time.gmtime(seconds))
        else:
            alarm_time = '{:02d}:{:02d}'.format(minutes, seconds)
        xbmc.executebuiltin(CMD_CLOSE_DIALOG_BY_NOOP.format(alarm_time))
    dlg.doModal()
    if hasattr(dlg, 'return_value'):
        return dlg.return_value
    return None 
Example #15
Source File: gui.py    From romcollectionbrowser with GNU General Public License v2.0 6 votes vote down vote up
def doImport(self, romCollections, isRescrape, scrapeInBackground, selectedRomCollection=None,
                 selectedScraper=None):

        if scrapeInBackground:
            path = os.path.join(self.Settings.getAddonInfo('path'), 'dbUpLauncher.py')
            log.info('Launch external update script: %s' % path)
            xbmc.executebuiltin("RunScript(%s, selectedRomCollection=%s, selectedScraper=%s)"
                                % (path, selectedRomCollection, selectedScraper))
            #exit RCB
            self.quit = True
            self.exit()
        else:
            import dbupdate

            progressDialog = dialogprogress.ProgressDialogGUI()
            #32111 = Import Games...
            progressDialog.create(util.localize(32111))

            updater = dbupdate.DBUpdate()
            updater.updateDB(self.gdb, progressDialog, romCollections, isRescrape)
            del updater
            progressDialog.writeMsg("", -1)
            del progressDialog 
Example #16
Source File: gui.py    From romcollectionbrowser with GNU General Public License v2.0 6 votes vote down vote up
def load_color_schemes(self):
        log.info('load_color_schemes')

        color_file = self.Settings.getSetting(util.SETTING_RCB_COLORFILE)
        if not color_file \
            or not xbmcvfs.exists(color_file) \
            or util.getConfiguredSkin() not in color_file:
            log.info('setting "rcb_colorfile" not found or color file not readable. using "defaults.xml"')
            color_file = os.path.join(util.getAddonInstallPath(), 'resources', 'skins', util.getConfiguredSkin(), 'colors', 'defaults.xml')

        tree = ElementTree()
        if sys.version_info >= (2, 7):
            parser = XMLParser(encoding='utf-8')
        else:
            parser = XMLParser()

        log.info('Reading color file: %s' %color_file)
        tree.parse(color_file, parser)

        for color in tree.findall('color'):
            log.debug('set color: %s: %s' % (color.attrib.get('name'), color.text))
            xbmc.executebuiltin("Skin.SetString(%s, %s)" % (color.attrib.get('name'), color.text)) 
Example #17
Source File: kodiops.py    From plugin.video.netflix with MIT License 5 votes vote down vote up
def run_plugin_action(path, block=False):
    """Create an action that can be run with xbmc.executebuiltin in order to run a Kodi plugin specified by path.
    If block is True (default=False), the execution of code will block until the called plugin has finished running."""
    return 'RunPlugin({}, {})'.format(path, block) 
Example #18
Source File: advancedfunctions.py    From program.plexus with GNU General Public License v2.0 5 votes vote down vote up
def set_engine_setting(file):
	if 'port.txt' in file:
		ficheiro = file.split('|')[0]
	else: ficheiro = file
	acestream_settings_file = os.path.join(os.getenv("HOME"),'.ACEStream','sessconfig.pickle')
	value = readfile(ficheiro)
	keyb = xbmc.Keyboard(str(int(value)), translate(600024))
	keyb.doModal()
	if (keyb.isConfirmed()):
		search = keyb.getText()
		try:
			int(search)
			integer = True
		except: integer = False
		if integer == True:
			save(ficheiro, search)
			if 'port.txt' in file:
				try:
					text = readfile(acestream_settings_file)
					minport = eval(file.split('|')[1])
					maxport = eval(file.split('|')[2])
					text = text.replace("S'minport'\np" + minport[0][0] +"\nI" + minport[0][1] +"\n","S'minport'\np" + minport[0][0] +"\nI" + search +"\n").replace("S'maxport'\np" + maxport[0][0] +"\nI" + maxport[0][1] +"\n","S'maxport'\np" + maxport[0][0] +"\nI" + search +"\n")
					save(acestream_settings_file,text)
				except: pass
			xbmc.executebuiltin("Notification(%s,%s,%i,%s)" % (translate(40000), translate(600026), 1,os.path.join(addonpath,"icon.png")))
			xbmc.executebuiltin("Container.Refresh")
		else:
			mensagemok(translate(40000),translate(600025))
			sys.exit(0) 
Example #19
Source File: advancedfunctions.py    From program.plexus with GNU General Public License v2.0 5 votes vote down vote up
def remove_lock():
	lock_file = xbmc.translatePath('special://temp/'+ 'ts.lock')
	xbmcvfs.delete(lock_file)
	mensagemok(translate(40000),translate(40069))
	xbmc.executebuiltin("Container.Refresh") 
Example #20
Source File: dialogs.py    From plugin.video.netflix with MIT License 5 votes vote down vote up
def show_notification(msg, title='Netflix', time=3000):
    """Show a notification"""
    xbmc.executebuiltin(g.py2_encode('Notification({}, {}, {}, {})'
                                     .format(title, msg, time, g.ICON))) 
Example #21
Source File: kodiops.py    From plugin.video.netflix with MIT License 5 votes vote down vote up
def container_update(url, reset_history=False):
    """Update the current container"""
    func_str = 'Container.Update({},replace)' if reset_history else 'Container.Update({})'
    xbmc.executebuiltin(func_str.format(url)) 
Example #22
Source File: history.py    From program.plexus with GNU General Public License v2.0 5 votes vote down vote up
def remove_history():
	if xbmcvfs.exists(history_file):
		xbmcvfs.delete(history_file)
		xbmc.executebuiltin("Notification(%s,%s,%i,%s)" % (translate(30000), translate(30017), 1,os.path.join(addonpath,"icon.png"))) 
Example #23
Source File: advancedfunctions.py    From program.plexus with GNU General Public License v2.0 5 votes vote down vote up
def delete_advancedxml():
	userdatapath = xbmc.translatePath(os.path.join('special://home/userdata'.decode('utf-8'),''.decode('utf-8')))
	advancedsettings_var = os.path.join(userdatapath,'advancedsettings.xml')
	advancedsettingsbackup_var = os.path.join(userdatapath,'advancedsettingsbackup.xml')
	xbmcvfs.delete(advancedsettings_var)
	mensagemok(translate(40000),translate(40066))
	xbmc.executebuiltin("Container.Refresh") 
Example #24
Source File: advancedfunctions.py    From program.plexus with GNU General Public License v2.0 5 votes vote down vote up
def recoverbackup_advancedxml():
	userdatapath = xbmc.translatePath(os.path.join('special://home/userdata'.decode('utf-8'),''.decode('utf-8')))
	advancedsettings_var = os.path.join(userdatapath,'advancedsettings.xml')
	advancedsettingsbackup_var = os.path.join(userdatapath,'advancedsettingsbackup.xml')
	xbmcvfs.delete(advancedsettings_var)
	xbmcvfs.rename(advancedsettingsbackup_var,advancedsettings_var)
	mensagemok(translate(40000),translate(40062))
	xbmc.executebuiltin("Container.Refresh") 
Example #25
Source File: advancedfunctions.py    From program.plexus with GNU General Public License v2.0 5 votes vote down vote up
def import_advancedxml():
	userdatapath = xbmc.translatePath(os.path.join('special://home/userdata'.decode('utf-8'),''.decode('utf-8')))
	advancedsettings_var = os.path.join(userdatapath,'advancedsettings.xml')
	advancedsettingsbackup_var = os.path.join(userdatapath,'advancedsettingsbackup.xml')
	if xbmcvfs.exists(advancedsettings_var):
		print("An advanced settings XML file already exists")
		if xbmcvfs.exists(advancedsettingsbackup_var):
			print("An advanced settings backup already exists")
			xbmcvfs.delete(advancedsettingsbackup_var)
			xbmcvfs.rename(advancedsettings_var,advancedsettingsbackup_var)
			advancedname = ["Cachemembuffer=252420","freememorycachepercent=5"]
			advancedurl = ["http://p2p-strm.googlecode.com/svn/trunk/Advancedsettings/advancedsettings.xml","http://p2p-strm.googlecode.com/svn/trunk/Advancedsettings/advancedsettingstonicillo.xml"]
			index = xbmcgui.Dialog().select(translate(40185), advancedname)
    			if index > -1:
    				download_tools().Downloader(advancedurl[index],advancedsettings_var,translate(40059),translate(40000))
				mensagemok(translate(40000),translate(40060))
		else:	
			xbmcvfs.rename(advancedsettings_var,advancedsettingsbackup_var)
			advancedname = ["Cachemembuffer=252420","freememorycachepercent=5"]
			advancedurl = ["http://p2p-strm.googlecode.com/svn/trunk/Advancedsettings/advancedsettings.xml","http://p2p-strm.googlecode.com/svn/trunk/Advancedsettings/advancedsettingstonicillo.xml"]
			index = xbmcgui.Dialog().select(translate(40185), advancedname)
    			if index > -1:
    				download_tools().Downloader(advancedurl[index],advancedsettings_var,translate(40059),translate(40000))
				mensagemok(translate(40000),translate(40060))
	else:
		print("No advancedsettings.xml in the system yet")
		advancedname = ["Cachemembuffer=252420","freememorycachepercent=5"]
		advancedurl = ["http://p2p-strm.googlecode.com/svn/trunk/Advancedsettings/advancedsettings.xml","http://p2p-strm.googlecode.com/svn/trunk/Advancedsettings/advancedsettingstonicillo.xml"]
		index = xbmcgui.Dialog().select(translate(40185), advancedname)
    		if index > -1:
    			download_tools().Downloader(advancedurl[index],advancedsettings_var,translate(40059),translate(40000))
			mensagemok(translate(40000),translate(40060))
	xbmc.executebuiltin("Container.Refresh") 
Example #26
Source File: mystreams.py    From program.plexus with GNU General Public License v2.0 5 votes vote down vote up
def remove_stream(name,url):
	filename = hashlib.md5(name + '|' + url).hexdigest() + '.txt'
	ficheiro = os.path.join(mystrm_folder,filename)
	try:
		os.remove(ficheiro)
		xbmc.executebuiltin("Notification(%s,%s,%i,%s)" % (translate(30000), translate(30016), 1,os.path.join(addonpath,"icon.png")))
		xbmc.executebuiltin("Container.Refresh")
	except: pass 
Example #27
Source File: acestream.py    From program.plexus with GNU General Public License v2.0 5 votes vote down vote up
def acestreams(name,iconimage,chid):
	if not iconimage: iconimage=os.path.join(addonpath,'resources','art','acestream-menu-item.png')
	else: iconimage = urllib.unquote(iconimage)
	if settings.getSetting('addon_history') == "true":
		try: add_to_history(name, str(chid),1, iconimage)
		except: pass
	if settings.getSetting('engine_app') != '1' and settings.getSetting('engine_app') != '2':
		if settings.getSetting('aceplay_type') == "1":
			pDialog = xbmcgui.DialogProgress()
			ret = pDialog.create(translate(30000), translate(30038),translate(30039),translate(30040))
			pDialog.update(0)
			xbmc.sleep(3000)
			pDialog.update(100)
			pDialog.close()
			ip_adress = settings.getSetting('ip_addr')
			proxy_port = settings.getSetting('aceporta')
			chid=chid.replace('acestream://','').replace('ts://','')
			strm = "http://" + ip_adress + ":" + proxy_port + "/pid/" + chid + "/stream.mp4"
			listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
			listitem.setLabel(name + " (" + chid + ")")
			listitem.setInfo('video', {'Title': name + " (" + chid + ")"})
			xbmc.Player().play(strm,listitem)
		else: acestreams_builtin(name,iconimage,chid)
	else:
		if '.acelive' in chid: pass
		elif '.torrent' in chid: pass
		else:
			if 'acestream://' in chid: pass
			else: chid = 'acestream://' + chid
		if settings.getSetting('engine_app') == '1':
			xbmc.executebuiltin('XBMC.StartAndroidActivity("org.acestream.media","android.intent.action.VIEW","","'+chid+'")')
		elif settings.getSetting('engine_app') == '2':
			xbmc.executebuiltin('XBMC.StartAndroidActivity("ru.vidsoftware.acestreamcontroller.free","android.intent.action.VIEW","","'+chid+'")') 
Example #28
Source File: gui.py    From romcollectionbrowser with GNU General Public License v2.0 5 votes vote down vote up
def set_skin_flag(self, flag):
        if self.Settings.getSetting(flag).upper() == "TRUE":
            xbmc.executebuiltin('Skin.SetBool(%s)' % flag)
        else:
            xbmc.executebuiltin('Skin.Reset(%s)' % flag) 
Example #29
Source File: dialogimportoptions.py    From romcollectionbrowser with GNU General Public License v2.0 5 votes vote down vote up
def onInit(self):
        log.info('onInit ImportOptions')
        # 32120 = All
        romCollectionList = [util.localize(32120)] + self.gui.config.getRomCollectionNames()
        log.debug("Adding list of RC names: {0}".format(romCollectionList))
        self.addItemsToList(CONTROL_LIST_ROMCOLLECTIONS, romCollectionList)

        # Deactivate Rom Collection list
        if self.romCollections is not None:
            # Set overwrite flag to false
            xbmc.executebuiltin('Skin.SetBool(%s)' % util.SETTING_RCB_IMPORTOPTIONS_DISABLEROMCOLLECTIONS)
            if not self.isRescrape:
                self.setFocus(self.getControl(CONTROL_BUTTON_SCRAPEINBACKGROUND))
        else:
            xbmc.executebuiltin('Skin.Reset(%s)' % util.SETTING_RCB_IMPORTOPTIONS_DISABLEROMCOLLECTIONS)

        #disable background scraping control when in rescrape-mode
        if self.isRescrape:
            xbmc.executebuiltin('Skin.SetBool(%s)' % util.SETTING_RCB_IMPORTOPTIONS_ISRESCRAPE)
            self.setFocus(self.getControl(CONTROL_BUTTON_SCRAPER_DOWN))
        else:
            xbmc.executebuiltin('Skin.Reset(%s)' % util.SETTING_RCB_IMPORTOPTIONS_ISRESCRAPE)

        #only provide online scrapers for option All Rom Collections
        sitesInList = AbstractScraper().get_available_online_scrapers()
        # add option for all rom collections
        # 32804 = Use configured default scrapers
        sitesInList.append(util.localize(32804))
        self.addItemsToList(CONTROL_LIST_SCRAPER1, sitesInList)
        self.selectItemInList(util.localize(32804), CONTROL_LIST_SCRAPER1) 
Example #30
Source File: launcher.py    From romcollectionbrowser with GNU General Public License v2.0 5 votes vote down vote up
def __audioSuspend(self):
        if __addon__.getSetting(util.SETTING_RCB_SUSPENDAUDIO).upper() == 'TRUE':
            log.debug("Suspending audio")
            xbmc.executebuiltin("PlayerControl(Stop)")
            xbmc.enableNavSounds(False)
            xbmc.audioSuspend()