From 56f568a5b8e6f5277058b09362e55d565d2a91b1 Mon Sep 17 00:00:00 2001 From: Shaun Date: Mon, 1 Jan 2018 10:24:25 +1100 Subject: [PATCH] utf-8 encode name and strip none utf-8 chards form device name --- resources/lib/downloadutils.py | 3 +++ resources/lib/server_detect.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/lib/downloadutils.py b/resources/lib/downloadutils.py index f9a5536..6d04435 100644 --- a/resources/lib/downloadutils.py +++ b/resources/lib/downloadutils.py @@ -256,6 +256,9 @@ class DownloadUtils(): settings = xbmcaddon.Addon('plugin.video.embycon') deviceName = settings.getSetting('deviceName') + # remove none ascii chars + deviceName = deviceName.decode("ascii", errors='ignore') + # remove some chars not valid for names deviceName = deviceName.replace("\"", "_") headers = {} diff --git a/resources/lib/server_detect.py b/resources/lib/server_detect.py index e0ee992..8aa3eb0 100644 --- a/resources/lib/server_detect.py +++ b/resources/lib/server_detect.py @@ -128,7 +128,7 @@ def checkServer(force=False, change_user=False, notify=False): config = user.get("Configuration") if (config != None): if (config.get("IsHidden") is None) or (config.get("IsHidden") is False): - name = user.get("Name") + name = user.get("Name").encode("utf-8") user_list.append(name) if (user.get("HasPassword") is True): secured.append(True)