dp = xbmcgui.DialogProgressBG(); dp.create('IPTV', 'Just A Second ...'); if action == 'start': if server.serverOnline(): xbmcgui.Dialog().notification(addonname, 'Server already started.\nPort: ' + str(port), xbmcgui.NOTIFICATION_INFO ); else: server.startServer(); time.sleep(5); if server.serverOnline(): xbmcgui.Dialog().notification(addonname, 'Server started.\nPort: ' + str(port), xbmcgui.NOTIFICATION_INFO ); else: xbmcgui.Dialog().notification(addonname, 'Server not started. Wait one moment and try again. ', xbmcgui.NOTIFICATION_ERROR ); else: if server.serverOnline(): server.stopServer(); time.sleep(5); xbmcgui.Dialog().notification(addonname, 'Server stopped.', xbmcgui.NOTIFICATION_INFO ); else: xbmcgui.Dialog().notification(addonname, 'Server is already stopped.', xbmcgui.NOTIFICATION_INFO ); dp.close(); xbmcplugin.endOfDirectory(int(sys.argv[1])) xbmcplugin.endOfDirectory(plugin_handle)
addonname, 'Server already started.\nPort: ' + str(port), xbmcgui.NOTIFICATION_INFO) else: server.startServer() time.sleep(5) if server.serverOnline(): xbmcgui.Dialog().notification( addonname, 'Server started.\nPort: ' + str(port), xbmcgui.NOTIFICATION_INFO) else: xbmcgui.Dialog().notification( addonname, 'Server not started. Wait one moment and try again. ', xbmcgui.NOTIFICATION_ERROR) else: if server.serverOnline(): server.stopServer() time.sleep(5) xbmcgui.Dialog().notification(addonname, 'Server stopped.', xbmcgui.NOTIFICATION_INFO) else: xbmcgui.Dialog().notification(addonname, 'Server is already stopped.', xbmcgui.NOTIFICATION_INFO) dp.close() xbmcplugin.endOfDirectory(int(sys.argv[1])) xbmcplugin.endOfDirectory(plugin_handle)
def stopServer(args): return server.stopServer(args)
if action == 'start': if server.serverOnline(): xbmcgui.Dialog().notification(addonname, 'Server already started.\nPort: ' + str(port), xbmcgui.NOTIFICATION_INFO) else: server.startServer() time.sleep(5) if server.serverOnline(): xbmcgui.Dialog().notification(addonname, 'Server started.\nPort: ' + str(port), xbmcgui.NOTIFICATION_INFO) else: xbmcgui.Dialog().notification(addonname, 'Server not started. Wait one moment and try again. ', xbmcgui.NOTIFICATION_ERROR) else: if server.serverOnline(): server.stopServer() time.sleep(5) xbmcgui.Dialog().notification(addonname, 'Server stopped.', xbmcgui.NOTIFICATION_INFO) else: xbmcgui.Dialog().notification(addonname, 'Server is already stopped.', xbmcgui.NOTIFICATION_INFO) dp.close() addon_id = 'cGx1Z2luLnZpZGVvLmRuYXR2NGs='.decode('base64') data_folder = 'c3BlY2lhbDovL3VzZXJkYXRhL2FkZG9uX2RhdGEv'.decode('base64') + addon_id Url= 'aHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL21hY2JsaXp6YXJkL2RuYXJlcG8vbWFzdGVyL3BsdWdpbi52aWRlby5kbmF0di91c2VyZGF0YS8='.decode('base64') File = ['aHR0cF9tdzFfaXB0djY2X3R2LWdlbnJlcw=='.decode('base64'), 'aHR0cF9tdzFfaXB0djY2X3R2'.decode('base64'), 'c2V0dGluZ3MueG1s'.decode('base64')] def download(url, dest, dp = None):
dp = xbmcgui.DialogProgressBG(); dp.create('IPTV', 'Working ...'); if action == 'start': if server.serverOnline(): xbmcgui.Dialog().notification(addonname, 'Server already started.\nPort: ' + str(port), xbmcgui.NOTIFICATION_INFO ); else: server.startServer(); time.sleep(5); if server.serverOnline(): xbmcgui.Dialog().notification(addonname, 'Server started.\nPort: ' + str(port), xbmcgui.NOTIFICATION_INFO ); else: xbmcgui.Dialog().notification(addonname, 'Server not started. Wait one moment and try again. ', xbmcgui.NOTIFICATION_ERROR ); else: if server.serverOnline(): server.stopServer(); time.sleep(5); xbmcgui.Dialog().notification(addonname, 'Server stopped.', xbmcgui.NOTIFICATION_INFO ); else: xbmcgui.Dialog().notification(addonname, 'Server is already stopped.', xbmcgui.NOTIFICATION_INFO ); dp.close();