Don't sign out on checking connections

This commit is contained in:
tomkat83 2016-04-07 16:46:12 +02:00
parent 621fd3ad4a
commit be71912496
2 changed files with 7 additions and 2 deletions

View file

@ -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

View file

@ -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)