mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-24 09:46:11 +00:00
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:
parent
8adfa7a911
commit
65be0b6262
2 changed files with 4 additions and 4 deletions
|
@ -44,7 +44,7 @@ class ClientInfo():
|
||||||
|
|
||||||
if utils.settings('deviceNameOpt') == "false":
|
if utils.settings('deviceNameOpt') == "false":
|
||||||
# Use Kodi's deviceName
|
# Use Kodi's deviceName
|
||||||
deviceName = xbmc.getInfoLabel('System.FriendlyName').decode('utf-8')
|
deviceName = xbmc.getInfoLabel('System.FriendlyName')
|
||||||
else:
|
else:
|
||||||
deviceName = utils.settings('deviceName')
|
deviceName = utils.settings('deviceName')
|
||||||
deviceName = deviceName.replace("\"", "_")
|
deviceName = deviceName.replace("\"", "_")
|
||||||
|
|
|
@ -189,7 +189,7 @@ class DownloadUtils():
|
||||||
# If user is not authenticated
|
# If user is not authenticated
|
||||||
auth = (
|
auth = (
|
||||||
'MediaBrowser Client="Kodi", Device="%s", DeviceId="%s", Version="%s"'
|
'MediaBrowser Client="Kodi", Device="%s", DeviceId="%s", Version="%s"'
|
||||||
% (deviceName, deviceId, version))
|
% (deviceName, deviceId.encode('utf-8'), version.encode('utf-8')))
|
||||||
header = {
|
header = {
|
||||||
|
|
||||||
'Content-type': 'application/json',
|
'Content-type': 'application/json',
|
||||||
|
@ -205,7 +205,8 @@ class DownloadUtils():
|
||||||
# Attached to the requests session
|
# Attached to the requests session
|
||||||
auth = (
|
auth = (
|
||||||
'MediaBrowser UserId="%s", Client="Kodi", Device="%s", DeviceId="%s", Version="%s"'
|
'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 = {
|
header = {
|
||||||
|
|
||||||
'Content-type': 'application/json',
|
'Content-type': 'application/json',
|
||||||
|
@ -274,7 +275,6 @@ class DownloadUtils():
|
||||||
verify=verifyssl)
|
verify=verifyssl)
|
||||||
|
|
||||||
elif type == "POST":
|
elif type == "POST":
|
||||||
print url
|
|
||||||
r = requests.post(url,
|
r = requests.post(url,
|
||||||
json=postBody,
|
json=postBody,
|
||||||
headers=header,
|
headers=header,
|
||||||
|
|
Loading…
Reference in a new issue