def acestreams_builtin(name, iconimage, chid, pvr=False): if xbmc.getCondVisibility("system.platform.windows"): try: import _winreg t = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, "Software\AceStream") needed_value = _winreg.QueryValueEx(t, "EnginePath")[0] print needed_value.replace("\\", "\\\\") subprocess.Popen( "wmic process where ExecutablePath='" + needed_value.replace("\\", "\\\\") + "' delete", shell=True ) xbmc.sleep(200) subprocess.Popen("taskkill /F /IM ace_player.exe /T", shell=True) xbmc.sleep(200) except: pass elif xbmc.getCondVisibility("System.Platform.OSX"): if settings.getSetting("shutdown-engine") == "true": os.system("kill $(ps aux | grep '[s]tart.py')") try: from acecore import TSengine as tsengine except: mensagemok(translate(40000), translate(40037)) return if not pvr: xbmc.executebuiltin("Action(Stop)") lock_file = xbmc.translatePath("special://temp/" + "ts.lock") if xbmcvfs.exists(lock_file): xbmcvfs.delete(lock_file) if chid != "": chid = chid.replace("acestream://", "").replace("ts://", "").replace("st://", "") print ("Starting Player Ace hash: " + chid) if name == "acepvrservice": TSPlayer = tsengine(True) else: if not pvr: TSPlayer = tsengine() else: TSPlayer = tsengine(True) out = None if chid.find("http://") == -1 and chid.find(".torrent") == -1: out = TSPlayer.load_torrent(chid, "PID", port=aceport) elif chid.find("http://") == -1 and chid.find(".torrent") != -1: out = TSPlayer.load_torrent(chid, "TORRENT", port=aceport) else: out = TSPlayer.load_torrent(chid, "TORRENT", port=aceport) if out == "Ok": TSPlayer.play_url_ind(0, name + " (" + chid + ")", iconimage, iconimage) TSPlayer.end() return else: mensagemok(translate(40000), translate(40038)) TSPlayer.end() return else: mensagemprogresso.close()
def acestreams_builtin(name, iconimage, chid, pvr=False): if xbmc.getCondVisibility('system.platform.windows'): try: import _winreg t = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, 'Software\AceStream') needed_value = _winreg.QueryValueEx(t, 'EnginePath')[0] print needed_value.replace('\\', '\\\\') subprocess.Popen("wmic process where ExecutablePath='" + needed_value.replace('\\', '\\\\') + "' delete", shell=True) xbmc.sleep(200) subprocess.Popen('taskkill /F /IM ace_player.exe /T', shell=True) xbmc.sleep(200) except: pass elif xbmc.getCondVisibility('System.Platform.OSX'): if settings.getSetting('shutdown-engine') == "true": os.system("kill $(ps aux | grep '[s]tart.py')") try: from acecore import TSengine as tsengine except: mensagemok(translate(40000), translate(40037)) return if not pvr: xbmc.executebuiltin('Action(Stop)') lock_file = xbmc.translatePath('special://temp/' + 'ts.lock') if xbmcvfs.exists(lock_file): xbmcvfs.delete(lock_file) if chid != '': chid = chid.replace('acestream://', '').replace('ts://', '').replace('st://', '') print("Starting Player Ace hash: " + chid) if name == 'acepvrservice': TSPlayer = tsengine(True) else: if not pvr: TSPlayer = tsengine() else: TSPlayer = tsengine(True) out = None if chid.find('http://') == -1 and chid.find('.torrent') == -1: out = TSPlayer.load_torrent(chid, 'PID', port=aceport) elif chid.find('http://') == -1 and chid.find('.torrent') != -1: out = TSPlayer.load_torrent(chid, 'TORRENT', port=aceport) else: out = TSPlayer.load_torrent(chid, 'TORRENT', port=aceport) if out == 'Ok': TSPlayer.play_url_ind(0, name + ' (' + chid + ')', iconimage, iconimage) TSPlayer.end() return else: mensagemok(translate(40000), translate(40038)) TSPlayer.end() return else: mensagemprogresso.close()
def acestreams_builtin(name, iconimage, chid): from acecore import TSengine as tsengine xbmc.executebuiltin('Action(Stop)') lock_file = xbmc.translatePath('special://temp/' + 'ts.lock') if xbmcvfs.exists(lock_file): xbmcvfs.delete(lock_file) if chid != '': chid = chid.replace('acestream://', '').replace('ts://', '') print("Starting Player Ace hash: " + chid) TSPlayer = tsengine() out = None if chid.find('http://') == -1 and chid.find('.torrent') == -1: out = TSPlayer.load_torrent(chid, 'PID', port=aceport) elif chid.find('http://') == -1 and chid.find('.torrent') != -1: out = TSPlayer.load_torrent(chid, 'TORRENT', port=aceport) else: out = TSPlayer.load_torrent(chid, 'TORRENT', port=aceport) if out == 'Ok': TSPlayer.play_url_ind(0, name + ' (' + chid + ')', iconimage, iconimage) TSPlayer.end() return else: mensagemok("Streams", "Torrent not available or invalid") TSPlayer.end() return else: mensagemprogresso.close()
def acestreams_builtin(name,iconimage,chid,geturl=False): if xbmc.getCondVisibility('system.platform.windows'): try: import _winreg t = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, 'Software\AceStream') needed_value = _winreg.QueryValueEx(t , 'EnginePath')[0] print needed_value.replace('\\','\\\\') subprocess.Popen("wmic process where ExecutablePath='"+needed_value.replace('\\','\\\\')+"' delete",shell=True) xbmc.sleep(200) subprocess.Popen('taskkill /F /IM ace_player.exe /T',shell=True) xbmc.sleep(200) except: pass elif xbmc.getCondVisibility('System.Platform.OSX'): if settings.getSetting('shutdown-engine') == "true": os.system("kill $(ps aux | grep '[s]tart.py')") try:from acecore import TSengine as tsengine except: mensagemok(translate(40000),translate(40037)) return xbmc.executebuiltin('Action(Stop)') lock_file = xbmc.translatePath('special://temp/'+ 'ts.lock') if xbmcvfs.exists(lock_file): xbmcvfs.delete(lock_file) if chid != '': chid=chid.replace('acestream://','').replace('ts://','').replace('st://','') print("Starting Player Ace hash: " + chid) #global TSPlayer TSPlayer = tsengine() out = None if chid.find('http://') == -1 and chid.find('.torrent') == -1: out = TSPlayer.load_torrent(chid,'PID',port=aceport) elif chid.find('http://') == -1 and chid.find('.torrent') != -1: out = TSPlayer.load_torrent(chid,'TORRENT',port=aceport) else: out = TSPlayer.load_torrent(chid,'TORRENT',port=aceport) if out == 'Ok': #rtt = '' if geturl:return TSPlayer.return_url(0,name) TSPlayer.play_url_ind(0,name + ' (' + chid + ')',iconimage,iconimage) TSPlayer.end() #if geturl:return rtt return else: mensagemok(translate(40000),translate(40038)) TSPlayer.end() return else: mensagemprogresso.close()