From a3ae264cf780fb211ed48e5d377d0a05572e1022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= Date: Fri, 10 May 2019 20:36:34 +0200 Subject: [PATCH] Always use plaintext login Fixes #22 --- resources/lib/dialogs/loginmanual.py | 2 +- resources/lib/jellyfin/core/connection_manager.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/resources/lib/dialogs/loginmanual.py b/resources/lib/dialogs/loginmanual.py index 0ddc44b9..b649d936 100644 --- a/resources/lib/dialogs/loginmanual.py +++ b/resources/lib/dialogs/loginmanual.py @@ -120,7 +120,7 @@ class LoginManual(xbmcgui.WindowXMLDialog): mode = self.connect_manager['server-mode'] server = self.connect_manager['server-address'] - result = self.connect_manager['login'](server, username, password, False if mode == 1 and server.startswith('http://') else True) + result = self.connect_manager['login'](server, username, password) if not result: self._error(ERROR['Invalid'], _('invalid_auth')) diff --git a/resources/lib/jellyfin/core/connection_manager.py b/resources/lib/jellyfin/core/connection_manager.py index 176ccedd..516d4f51 100644 --- a/resources/lib/jellyfin/core/connection_manager.py +++ b/resources/lib/jellyfin/core/connection_manager.py @@ -157,12 +157,10 @@ class ConnectionManager(object): 'type': "POST", 'url': self.get_jellyfin_url(server, "Users/AuthenticateByName"), 'json': { - 'username': username, - 'password': hashlib.sha1(password or "").hexdigest(), + 'Username': username, + 'Pw': password or "" } } - if clear: - request['json']['pw'] = password or "" result = self._request_url(request, False) except Exception as error: # Failed to login