2015-12-24 14:07:00 -06:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2016-02-19 20:03:06 +01:00
|
|
|
###############################################################################
|
2016-09-02 17:40:36 +02:00
|
|
|
import logging
|
2015-12-24 14:07:00 -06:00
|
|
|
import threading
|
|
|
|
|
|
|
|
import xbmc
|
|
|
|
import xbmcgui
|
|
|
|
import xbmcaddon
|
2017-05-11 19:26:13 +02:00
|
|
|
from xbmcvfs import exists
|
2017-05-03 20:30:33 +02:00
|
|
|
|
2015-12-24 14:07:00 -06:00
|
|
|
|
2017-05-17 13:55:24 +02:00
|
|
|
from utils import window, settings, language as lang, thread_methods
|
2015-12-24 14:07:00 -06:00
|
|
|
import downloadutils
|
|
|
|
|
2015-12-27 17:12:46 +01:00
|
|
|
import PlexAPI
|
2016-03-24 09:08:58 +01:00
|
|
|
from PlexFunctions import GetMachineIdentifier
|
2017-05-17 10:09:50 +02:00
|
|
|
import state
|
2015-12-27 17:12:46 +01:00
|
|
|
|
2016-02-19 20:03:06 +01:00
|
|
|
###############################################################################
|
2015-12-24 14:07:00 -06:00
|
|
|
|
2016-09-02 17:40:36 +02:00
|
|
|
log = logging.getLogger("PLEX."+__name__)
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
|
2015-12-24 14:07:00 -06:00
|
|
|
|
2017-05-17 13:55:24 +02:00
|
|
|
@thread_methods(add_suspends=['SUSPEND_USER_CLIENT'])
|
2015-12-24 14:07:00 -06:00
|
|
|
class UserClient(threading.Thread):
|
|
|
|
|
|
|
|
# Borg - multiple instances, shared state
|
2016-01-25 10:36:24 +01:00
|
|
|
__shared_state = {}
|
2015-12-24 14:07:00 -06:00
|
|
|
|
2016-12-27 17:33:52 +01:00
|
|
|
def __init__(self, callback=None):
|
2016-04-07 16:41:27 +02:00
|
|
|
self.__dict__ = self.__shared_state
|
2016-12-27 17:33:52 +01:00
|
|
|
if callback is not None:
|
|
|
|
self.mgr = callback
|
2015-12-24 14:07:00 -06:00
|
|
|
|
2016-04-07 16:41:27 +02:00
|
|
|
self.auth = True
|
|
|
|
self.retry = 0
|
2015-12-24 14:07:00 -06:00
|
|
|
|
2016-04-07 16:41:27 +02:00
|
|
|
self.currUser = None
|
|
|
|
self.currServer = None
|
|
|
|
self.currToken = None
|
|
|
|
self.HasAccess = True
|
|
|
|
self.AdditionalUser = []
|
2015-12-24 14:07:00 -06:00
|
|
|
|
2016-04-07 16:41:27 +02:00
|
|
|
self.userSettings = None
|
2015-12-24 14:07:00 -06:00
|
|
|
|
|
|
|
self.addon = xbmcaddon.Addon()
|
|
|
|
self.doUtils = downloadutils.DownloadUtils()
|
2016-01-12 17:23:55 +01:00
|
|
|
|
2015-12-24 14:07:00 -06:00
|
|
|
threading.Thread.__init__(self)
|
|
|
|
|
|
|
|
def getUsername(self):
|
2016-03-07 13:01:45 +01:00
|
|
|
"""
|
|
|
|
Returns username as unicode
|
|
|
|
"""
|
2016-09-02 17:40:36 +02:00
|
|
|
username = settings('username')
|
2015-12-24 14:07:00 -06:00
|
|
|
if not username:
|
2016-09-02 17:40:36 +02:00
|
|
|
log.debug("No username saved, trying to get Plex username")
|
|
|
|
username = settings('plexLogin')
|
2016-03-04 13:34:30 +01:00
|
|
|
if not username:
|
2016-09-02 17:40:36 +02:00
|
|
|
log.debug("Also no Plex username found")
|
2016-03-04 13:34:30 +01:00
|
|
|
return ""
|
2015-12-24 14:07:00 -06:00
|
|
|
return username
|
|
|
|
|
|
|
|
def getServer(self, prefix=True):
|
2016-03-04 13:34:30 +01:00
|
|
|
# Original host
|
2016-03-23 16:07:09 +01:00
|
|
|
self.servername = settings('plex_servername')
|
2016-03-04 13:34:30 +01:00
|
|
|
HTTPS = settings('https') == "true"
|
|
|
|
host = settings('ipaddress')
|
|
|
|
port = settings('port')
|
2016-03-24 09:08:58 +01:00
|
|
|
self.machineIdentifier = settings('plex_machineIdentifier')
|
2015-12-24 14:07:00 -06:00
|
|
|
|
|
|
|
server = host + ":" + port
|
2016-02-19 20:03:06 +01:00
|
|
|
|
2015-12-24 14:07:00 -06:00
|
|
|
if not host:
|
2016-09-02 17:40:36 +02:00
|
|
|
log.debug("No server information saved.")
|
2015-12-24 14:07:00 -06:00
|
|
|
return False
|
|
|
|
|
|
|
|
# If https is true
|
|
|
|
if prefix and HTTPS:
|
|
|
|
server = "https://%s" % server
|
|
|
|
# If https is false
|
|
|
|
elif prefix and not HTTPS:
|
|
|
|
server = "http://%s" % server
|
2016-03-24 09:08:58 +01:00
|
|
|
# User entered IP; we need to get the machineIdentifier
|
|
|
|
if self.machineIdentifier == '' and prefix is True:
|
|
|
|
self.machineIdentifier = GetMachineIdentifier(server)
|
|
|
|
if self.machineIdentifier is None:
|
|
|
|
self.machineIdentifier = ''
|
|
|
|
settings('plex_machineIdentifier', value=self.machineIdentifier)
|
2016-12-20 16:13:19 +01:00
|
|
|
log.debug('Returning active server: %s' % server)
|
2016-03-23 16:07:09 +01:00
|
|
|
return server
|
2015-12-24 14:07:00 -06:00
|
|
|
|
|
|
|
def getSSLverify(self):
|
|
|
|
# Verify host certificate
|
2016-09-02 17:40:36 +02:00
|
|
|
return None if settings('sslverify') == 'true' else False
|
2015-12-24 14:07:00 -06:00
|
|
|
|
|
|
|
def getSSL(self):
|
|
|
|
# Client side certificate
|
2016-09-02 17:40:36 +02:00
|
|
|
return None if settings('sslcert') == 'None' \
|
|
|
|
else settings('sslcert')
|
2015-12-24 14:07:00 -06:00
|
|
|
|
|
|
|
def setUserPref(self):
|
2016-12-20 16:13:19 +01:00
|
|
|
log.debug('Setting user preferences')
|
2016-03-09 15:37:27 +01:00
|
|
|
# Only try to get user avatar if there is a token
|
|
|
|
if self.currToken:
|
|
|
|
url = PlexAPI.PlexAPI().GetUserArtworkURL(self.currUser)
|
|
|
|
if url:
|
2016-09-02 17:40:36 +02:00
|
|
|
window('PlexUserImage', value=url)
|
2015-12-24 14:07:00 -06:00
|
|
|
# Set resume point max
|
2015-12-28 10:35:27 +01:00
|
|
|
# url = "{server}/emby/System/Configuration?format=json"
|
|
|
|
# result = doUtils.downloadUrl(url)
|
2015-12-24 14:07:00 -06:00
|
|
|
|
|
|
|
def hasAccess(self):
|
2016-02-19 20:03:06 +01:00
|
|
|
# Plex: always return True for now
|
|
|
|
return True
|
2015-12-24 14:07:00 -06:00
|
|
|
|
2016-03-09 15:37:27 +01:00
|
|
|
def loadCurrUser(self, username, userId, usertoken, authenticated=False):
|
2016-12-20 16:13:19 +01:00
|
|
|
log.debug('Loading current user')
|
2015-12-24 14:07:00 -06:00
|
|
|
doUtils = self.doUtils
|
2016-02-19 20:03:06 +01:00
|
|
|
|
2016-03-09 15:37:27 +01:00
|
|
|
self.currToken = usertoken
|
2015-12-24 14:07:00 -06:00
|
|
|
self.currServer = self.getServer()
|
|
|
|
self.ssl = self.getSSLverify()
|
|
|
|
self.sslcert = self.getSSL()
|
|
|
|
|
2016-02-19 20:03:06 +01:00
|
|
|
if authenticated is False:
|
2017-05-20 18:52:51 +02:00
|
|
|
if self.currServer is None:
|
|
|
|
return False
|
2016-12-20 16:13:19 +01:00
|
|
|
log.debug('Testing validity of current token')
|
2016-04-06 16:24:03 +02:00
|
|
|
res = PlexAPI.PlexAPI().CheckConnection(self.currServer,
|
|
|
|
token=self.currToken,
|
|
|
|
verifySSL=self.ssl)
|
2016-03-04 13:34:30 +01:00
|
|
|
if res is False:
|
2016-12-20 16:13:19 +01:00
|
|
|
# PMS probably offline
|
2016-03-04 13:34:30 +01:00
|
|
|
return False
|
|
|
|
elif res == 401:
|
2016-12-20 16:13:19 +01:00
|
|
|
log.error('Token is no longer valid')
|
|
|
|
return 401
|
2016-03-04 13:34:30 +01:00
|
|
|
elif res >= 400:
|
2016-09-02 17:40:36 +02:00
|
|
|
log.error('Answer from PMS is not as expected. Retrying')
|
2016-03-04 13:34:30 +01:00
|
|
|
return False
|
2015-12-24 14:07:00 -06:00
|
|
|
|
|
|
|
# Set to windows property
|
2017-05-17 16:15:16 +02:00
|
|
|
state.PLEX_USER_ID = userId or None
|
2017-05-17 16:14:17 +02:00
|
|
|
state.PLEX_USERNAME = username
|
2016-03-10 16:02:46 +01:00
|
|
|
# This is the token for the current PMS (might also be '')
|
|
|
|
window('pms_token', value=self.currToken)
|
|
|
|
# This is the token for plex.tv for the current user
|
|
|
|
# Is only '' if user is not signed in to plex.tv
|
2016-03-17 12:45:38 +01:00
|
|
|
window('plex_token', value=settings('plexToken'))
|
2017-05-17 10:09:50 +02:00
|
|
|
state.PLEX_TOKEN = settings('plexToken') or None
|
2016-10-23 19:38:21 +02:00
|
|
|
window('plex_restricteduser', value=settings('plex_restricteduser'))
|
2017-05-17 10:09:50 +02:00
|
|
|
state.RESTRICTED_USER = True \
|
|
|
|
if settings('plex_restricteduser') == 'true' else False
|
2016-03-10 16:02:46 +01:00
|
|
|
window('pms_server', value=self.currServer)
|
2016-02-19 20:03:06 +01:00
|
|
|
window('plex_machineIdentifier', value=self.machineIdentifier)
|
2016-03-09 15:37:27 +01:00
|
|
|
window('plex_servername', value=self.servername)
|
2016-03-14 10:40:49 +01:00
|
|
|
window('plex_authenticated', value='true')
|
2017-05-17 10:10:14 +02:00
|
|
|
state.AUTHENTICATED = True
|
2016-03-16 12:26:31 +01:00
|
|
|
|
2016-03-15 20:26:45 +01:00
|
|
|
window('useDirectPaths', value='true'
|
2016-09-02 17:40:36 +02:00
|
|
|
if settings('useDirectPaths') == "1" else 'false')
|
2017-05-17 15:42:12 +02:00
|
|
|
state.DIRECT_PATHS = True if settings('useDirectPaths') == "1" \
|
|
|
|
else False
|
2017-05-31 14:13:45 +02:00
|
|
|
state.INDICATE_MEDIA_VERSIONS = True \
|
|
|
|
if settings('indicate_media_versions') == "true" else False
|
2017-01-15 18:01:27 +01:00
|
|
|
window('plex_force_transcode_pix', value='true'
|
|
|
|
if settings('force_transcode_pix') == "1" else 'false')
|
2016-03-04 13:34:30 +01:00
|
|
|
|
2015-12-24 14:07:00 -06:00
|
|
|
# Start DownloadUtils session
|
2016-04-13 14:34:58 +02:00
|
|
|
doUtils.startSession(reset=True)
|
2016-03-03 15:28:44 +01:00
|
|
|
# self.getAdditionalUsers()
|
2015-12-24 14:07:00 -06:00
|
|
|
# Set user preferences in settings
|
|
|
|
self.currUser = username
|
|
|
|
self.setUserPref()
|
2016-03-09 15:37:27 +01:00
|
|
|
|
|
|
|
# Writing values to settings file
|
|
|
|
settings('username', value=username)
|
|
|
|
settings('userid', value=userId)
|
|
|
|
settings('accessToken', value=usertoken)
|
2015-12-28 11:04:28 +01:00
|
|
|
return True
|
2015-12-24 14:07:00 -06:00
|
|
|
|
|
|
|
def authenticate(self):
|
2016-12-20 16:13:19 +01:00
|
|
|
log.debug('Authenticating user')
|
2016-02-17 02:13:37 -06:00
|
|
|
dialog = xbmcgui.Dialog()
|
|
|
|
|
2016-03-09 15:37:27 +01:00
|
|
|
# Give attempts at entering password / selecting user
|
|
|
|
if self.retry >= 2:
|
2016-09-02 17:40:36 +02:00
|
|
|
log.error("Too many retries to login.")
|
2017-05-17 10:09:50 +02:00
|
|
|
state.PMS_STATUS = 'Stop'
|
2016-03-09 15:37:27 +01:00
|
|
|
dialog.ok(lang(33001),
|
|
|
|
lang(39023))
|
|
|
|
xbmc.executebuiltin(
|
|
|
|
'Addon.OpenSettings(plugin.video.plexkodiconnect)')
|
2016-04-07 16:10:07 +02:00
|
|
|
return False
|
2016-03-09 15:37:27 +01:00
|
|
|
|
2015-12-24 14:07:00 -06:00
|
|
|
# Get /profile/addon_data
|
2017-05-03 20:30:33 +02:00
|
|
|
addondir = xbmc.translatePath(self.addon.getAddonInfo('profile'))
|
2015-12-24 14:07:00 -06:00
|
|
|
|
|
|
|
# If there's no settings.xml
|
2017-05-11 19:29:57 +02:00
|
|
|
if not exists("%ssettings.xml" % addondir):
|
2016-09-02 17:40:36 +02:00
|
|
|
log.error("Error, no settings.xml found.")
|
2015-12-24 14:07:00 -06:00
|
|
|
self.auth = False
|
2016-03-09 15:37:27 +01:00
|
|
|
return False
|
2016-03-04 13:34:30 +01:00
|
|
|
server = self.getServer()
|
2016-03-09 15:37:27 +01:00
|
|
|
# If there is no server we can connect to
|
2016-03-04 13:34:30 +01:00
|
|
|
if not server:
|
2016-09-02 17:40:36 +02:00
|
|
|
log.info("Missing server information.")
|
2015-12-24 14:07:00 -06:00
|
|
|
self.auth = False
|
2016-03-09 15:37:27 +01:00
|
|
|
return False
|
|
|
|
|
|
|
|
# If there is a username in the settings, try authenticating
|
|
|
|
username = settings('username')
|
|
|
|
userId = settings('userid')
|
|
|
|
usertoken = settings('accessToken')
|
|
|
|
enforceLogin = settings('enforceUserLogin')
|
|
|
|
# Found a user in the settings, try to authenticate
|
|
|
|
if username and enforceLogin == 'false':
|
2016-12-20 16:13:19 +01:00
|
|
|
log.debug('Trying to authenticate with old settings')
|
|
|
|
answ = self.loadCurrUser(username,
|
|
|
|
userId,
|
|
|
|
usertoken,
|
|
|
|
authenticated=False)
|
|
|
|
if answ is True:
|
2016-03-09 15:37:27 +01:00
|
|
|
# SUCCESS: loaded a user from the settings
|
|
|
|
return True
|
2016-12-20 16:13:19 +01:00
|
|
|
elif answ == 401:
|
|
|
|
log.error("User token no longer valid. Sign user out")
|
2016-03-09 15:37:27 +01:00
|
|
|
settings('username', value='')
|
|
|
|
settings('userid', value='')
|
|
|
|
settings('accessToken', value='')
|
2016-12-20 16:13:19 +01:00
|
|
|
else:
|
|
|
|
log.debug("Could not yet authenticate user")
|
|
|
|
return False
|
2015-12-24 14:07:00 -06:00
|
|
|
|
2016-03-04 13:34:30 +01:00
|
|
|
plx = PlexAPI.PlexAPI()
|
|
|
|
|
2016-03-09 15:37:27 +01:00
|
|
|
# Could not use settings - try to get Plex user list from plex.tv
|
|
|
|
plextoken = settings('plexToken')
|
|
|
|
if plextoken:
|
2016-09-02 17:40:36 +02:00
|
|
|
log.info("Trying to connect to plex.tv to get a user list")
|
2016-03-09 15:37:27 +01:00
|
|
|
userInfo = plx.ChoosePlexHomeUser(plextoken)
|
|
|
|
if userInfo is False:
|
|
|
|
# FAILURE: Something went wrong, try again
|
2016-03-04 13:34:30 +01:00
|
|
|
self.auth = True
|
2016-03-09 15:37:27 +01:00
|
|
|
self.retry += 1
|
|
|
|
return False
|
|
|
|
username = userInfo['username']
|
|
|
|
userId = userInfo['userid']
|
|
|
|
usertoken = userInfo['token']
|
2015-12-24 14:07:00 -06:00
|
|
|
else:
|
2016-09-02 17:40:36 +02:00
|
|
|
log.info("Trying to authenticate without a token")
|
2016-03-09 15:37:27 +01:00
|
|
|
username = ''
|
|
|
|
userId = ''
|
|
|
|
usertoken = ''
|
2016-02-19 18:47:09 +01:00
|
|
|
|
2016-03-09 15:37:27 +01:00
|
|
|
if self.loadCurrUser(username, userId, usertoken, authenticated=False):
|
|
|
|
# SUCCESS: loaded a user from the settings
|
|
|
|
return True
|
|
|
|
else:
|
|
|
|
# FAILUR: Something went wrong, try again
|
|
|
|
self.auth = True
|
2016-01-13 14:56:44 +01:00
|
|
|
self.retry += 1
|
2016-03-09 15:37:27 +01:00
|
|
|
return False
|
2015-12-24 14:07:00 -06:00
|
|
|
|
|
|
|
def resetClient(self):
|
2016-12-20 16:13:19 +01:00
|
|
|
log.debug("Reset UserClient authentication.")
|
2016-03-10 16:02:46 +01:00
|
|
|
self.doUtils.stopSession()
|
|
|
|
|
2016-03-14 10:40:49 +01:00
|
|
|
window('plex_authenticated', clear=True)
|
2017-05-17 10:10:14 +02:00
|
|
|
state.AUTHENTICATED = False
|
2016-03-10 16:02:46 +01:00
|
|
|
window('pms_token', clear=True)
|
2017-05-17 10:09:50 +02:00
|
|
|
state.PLEX_TOKEN = None
|
2016-03-10 16:02:46 +01:00
|
|
|
window('plex_token', clear=True)
|
|
|
|
window('pms_server', clear=True)
|
|
|
|
window('plex_machineIdentifier', clear=True)
|
|
|
|
window('plex_servername', clear=True)
|
2017-05-17 16:15:16 +02:00
|
|
|
state.PLEX_USER_ID = None
|
2017-05-17 16:14:17 +02:00
|
|
|
state.PLEX_USERNAME = None
|
2016-10-23 19:38:21 +02:00
|
|
|
window('plex_restricteduser', clear=True)
|
2017-05-17 10:09:50 +02:00
|
|
|
state.RESTRICTED_USER = False
|
2016-01-12 17:23:55 +01:00
|
|
|
|
2016-03-09 15:37:27 +01:00
|
|
|
settings('username', value='')
|
|
|
|
settings('userid', value='')
|
|
|
|
settings('accessToken', value='')
|
|
|
|
|
|
|
|
# Reset token in downloads
|
|
|
|
self.doUtils.setToken('')
|
|
|
|
|
|
|
|
self.currToken = None
|
2015-12-24 14:07:00 -06:00
|
|
|
self.auth = True
|
|
|
|
self.currUser = None
|
2016-01-12 17:23:55 +01:00
|
|
|
|
2016-03-09 15:37:27 +01:00
|
|
|
self.retry = 0
|
|
|
|
|
2015-12-24 14:07:00 -06:00
|
|
|
def run(self):
|
2016-09-02 17:40:36 +02:00
|
|
|
log.info("----===## Starting UserClient ##===----")
|
2017-05-17 10:09:50 +02:00
|
|
|
thread_stopped = self.thread_stopped
|
|
|
|
thread_suspended = self.thread_suspended
|
|
|
|
while not thread_stopped():
|
|
|
|
while thread_suspended():
|
|
|
|
if thread_stopped():
|
2016-01-26 15:13:03 +01:00
|
|
|
break
|
2016-03-08 11:20:11 +01:00
|
|
|
xbmc.sleep(1000)
|
2015-12-24 14:07:00 -06:00
|
|
|
|
2017-05-17 10:09:50 +02:00
|
|
|
if state.PMS_STATUS == "Stop":
|
2016-03-10 16:02:46 +01:00
|
|
|
xbmc.sleep(500)
|
|
|
|
continue
|
|
|
|
|
|
|
|
# Verify the connection status to server
|
2017-05-17 10:09:50 +02:00
|
|
|
elif state.PMS_STATUS == "restricted":
|
2016-03-10 16:02:46 +01:00
|
|
|
# Parental control is restricting access
|
|
|
|
self.HasAccess = False
|
|
|
|
|
2017-05-17 10:09:50 +02:00
|
|
|
elif state.PMS_STATUS == "401":
|
2016-03-10 16:02:46 +01:00
|
|
|
# Unauthorized access, revoke token
|
2017-05-17 10:09:50 +02:00
|
|
|
state.PMS_STATUS = 'Auth'
|
2017-05-17 14:02:52 +02:00
|
|
|
window('plex_serverStatus', value='Auth')
|
2016-03-10 16:02:46 +01:00
|
|
|
self.resetClient()
|
2017-05-12 15:32:25 +02:00
|
|
|
xbmc.sleep(3000)
|
2015-12-24 14:07:00 -06:00
|
|
|
|
|
|
|
if self.auth and (self.currUser is None):
|
|
|
|
# Try to authenticate user
|
2017-05-17 10:09:50 +02:00
|
|
|
if not state.PMS_STATUS or state.PMS_STATUS == "Auth":
|
2015-12-24 14:07:00 -06:00
|
|
|
# Set auth flag because we no longer need
|
|
|
|
# to authenticate the user
|
|
|
|
self.auth = False
|
2016-03-09 15:37:27 +01:00
|
|
|
if self.authenticate():
|
2016-03-09 15:53:46 +01:00
|
|
|
# Successfully authenticated and loaded a user
|
2016-09-02 17:40:36 +02:00
|
|
|
log.info("Successfully authenticated!")
|
|
|
|
log.info("Current user: %s" % self.currUser)
|
2017-05-17 16:15:16 +02:00
|
|
|
log.info("Current userId: %s" % state.PLEX_USER_ID)
|
2016-03-09 15:37:27 +01:00
|
|
|
self.retry = 0
|
2017-05-17 10:09:50 +02:00
|
|
|
state.SUSPEND_LIBRARY_THREAD = False
|
2016-05-31 08:06:42 +02:00
|
|
|
window('plex_serverStatus', clear=True)
|
2017-05-17 10:09:50 +02:00
|
|
|
state.PMS_STATUS = False
|
2015-12-24 14:07:00 -06:00
|
|
|
|
|
|
|
if not self.auth and (self.currUser is None):
|
2016-03-04 13:34:30 +01:00
|
|
|
# Loop if no server found
|
2015-12-24 14:07:00 -06:00
|
|
|
server = self.getServer()
|
2016-02-19 20:03:06 +01:00
|
|
|
|
2015-12-24 14:07:00 -06:00
|
|
|
# The status Stop is for when user cancelled password dialog.
|
2016-03-10 16:02:46 +01:00
|
|
|
# Or retried too many times
|
2017-05-17 10:09:50 +02:00
|
|
|
if server and state.PMS_STATUS != "Stop":
|
2015-12-24 14:07:00 -06:00
|
|
|
# Only if there's information found to login
|
2016-12-20 16:13:19 +01:00
|
|
|
log.debug("Server found: %s" % server)
|
2015-12-24 14:07:00 -06:00
|
|
|
self.auth = True
|
|
|
|
|
2016-03-08 08:43:12 +01:00
|
|
|
# Minimize CPU load
|
2016-03-14 10:40:49 +01:00
|
|
|
xbmc.sleep(100)
|
2016-03-08 08:43:12 +01:00
|
|
|
|
2016-09-02 17:40:36 +02:00
|
|
|
log.info("##===---- UserClient Stopped ----===##")
|