Fixing unicode bug for device name

Removing decode to unicode, because we use it for the downloadutils. We
need it in utf-8, not unicode.
This commit is contained in:
angelblue05 2016-01-21 14:35:24 -06:00
parent 8adfa7a911
commit 65be0b6262
2 changed files with 4 additions and 4 deletions

View file

@ -44,7 +44,7 @@ class ClientInfo():
if utils.settings('deviceNameOpt') == "false":
# Use Kodi's deviceName
deviceName = xbmc.getInfoLabel('System.FriendlyName').decode('utf-8')
deviceName = xbmc.getInfoLabel('System.FriendlyName')
else:
deviceName = utils.settings('deviceName')
deviceName = deviceName.replace("\"", "_")

View file

@ -189,7 +189,7 @@ class DownloadUtils():
# If user is not authenticated
auth = (
'MediaBrowser Client="Kodi", Device="%s", DeviceId="%s", Version="%s"'
% (deviceName, deviceId, version))
% (deviceName, deviceId.encode('utf-8'), version.encode('utf-8')))
header = {
'Content-type': 'application/json',
@ -205,7 +205,8 @@ class DownloadUtils():
# Attached to the requests session
auth = (
'MediaBrowser UserId="%s", Client="Kodi", Device="%s", DeviceId="%s", Version="%s"'
% (userId, deviceName, deviceId, version))
% (userId.encode('utf-8'), deviceName, deviceId.encode('utf-8'),
version.encode('utf-8')))
header = {
'Content-type': 'application/json',
@ -274,7 +275,6 @@ class DownloadUtils():
verify=verifyssl)
elif type == "POST":
print url
r = requests.post(url,
json=postBody,
headers=header,