From be71912496a97eb3e5bd70498808d82101f684f4 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Thu, 7 Apr 2016 16:46:12 +0200 Subject: [PATCH] Don't sign out on checking connections --- resources/lib/PlexAPI.py | 3 ++- resources/lib/downloadutils.py | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/resources/lib/PlexAPI.py b/resources/lib/PlexAPI.py index 31803e3c..acddc93e 100644 --- a/resources/lib/PlexAPI.py +++ b/resources/lib/PlexAPI.py @@ -291,7 +291,8 @@ class PlexAPI(): answer = self.doUtils(url, authenticate=False, headerOptions=headerOptions, - verifySSL=verifySSL) + verifySSL=verifySSL, + dontSignout=True) if answer is False: self.logMsg("Could not connect to %s" % url, 0) count += 1 diff --git a/resources/lib/downloadutils.py b/resources/lib/downloadutils.py index 74ee0e82..2dd0be33 100644 --- a/resources/lib/downloadutils.py +++ b/resources/lib/downloadutils.py @@ -145,7 +145,8 @@ class DownloadUtils(): return r def downloadUrl(self, url, type="GET", postBody=None, parameters=None, - authenticate=True, headerOptions=None, verifySSL=True): + authenticate=True, headerOptions=None, verifySSL=True, + dontSignout=False): """ Override SSL check with verifySSL=False @@ -248,6 +249,9 @@ class DownloadUtils(): return True elif r.status_code == 401: + if dontSignout is True: + # Called when checking a connect - no need for rash action + return 401 r.encoding = 'utf-8' self.logMsg('HTTP error 401 from PMS. Message received:', -1) self.logMsg(r.text, -1)