From 4b9cae3f2f0685cf03fec023cf73170be222aeda Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Sun, 3 May 2015 02:24:23 -0500 Subject: [PATCH] Handle revoked token --- resources/lib/DownloadUtils.py | 1 + resources/lib/PlaybackUtils.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/lib/DownloadUtils.py b/resources/lib/DownloadUtils.py index 0cc5f497..390a9d2d 100644 --- a/resources/lib/DownloadUtils.py +++ b/resources/lib/DownloadUtils.py @@ -268,6 +268,7 @@ class DownloadUtils(): # Tell UserClient token has been revoked. WINDOW.setProperty("Server_status", "401") self.logMsg("HTTP Error: %s" % e, 0) + xbmcgui.Dialog().notification("Error connecting", "Unauthorized.", xbmcgui.NOTIFICATION_ERROR) elif (r.status_code == 301) or (r.status_code == 302): # Redirects diff --git a/resources/lib/PlaybackUtils.py b/resources/lib/PlaybackUtils.py index 796b8c3e..000b5c91 100644 --- a/resources/lib/PlaybackUtils.py +++ b/resources/lib/PlaybackUtils.py @@ -43,7 +43,10 @@ class PlaybackUtils(): userid = WINDOW.getProperty('userId%s' % username) server = WINDOW.getProperty('server%s' % username) - id = result["Id"] + try: + id = result["Id"] + except: + return userData = result['UserData'] resume_result = 0