Don't sign out on checking connections
This commit is contained in:
parent
621fd3ad4a
commit
be71912496
2 changed files with 7 additions and 2 deletions
|
@ -291,7 +291,8 @@ class PlexAPI():
|
||||||
answer = self.doUtils(url,
|
answer = self.doUtils(url,
|
||||||
authenticate=False,
|
authenticate=False,
|
||||||
headerOptions=headerOptions,
|
headerOptions=headerOptions,
|
||||||
verifySSL=verifySSL)
|
verifySSL=verifySSL,
|
||||||
|
dontSignout=True)
|
||||||
if answer is False:
|
if answer is False:
|
||||||
self.logMsg("Could not connect to %s" % url, 0)
|
self.logMsg("Could not connect to %s" % url, 0)
|
||||||
count += 1
|
count += 1
|
||||||
|
|
|
@ -145,7 +145,8 @@ class DownloadUtils():
|
||||||
return r
|
return r
|
||||||
|
|
||||||
def downloadUrl(self, url, type="GET", postBody=None, parameters=None,
|
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
|
Override SSL check with verifySSL=False
|
||||||
|
|
||||||
|
@ -248,6 +249,9 @@ class DownloadUtils():
|
||||||
return True
|
return True
|
||||||
|
|
||||||
elif r.status_code == 401:
|
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'
|
r.encoding = 'utf-8'
|
||||||
self.logMsg('HTTP error 401 from PMS. Message received:', -1)
|
self.logMsg('HTTP error 401 from PMS. Message received:', -1)
|
||||||
self.logMsg(r.text, -1)
|
self.logMsg(r.text, -1)
|
||||||
|
|
Loading…
Reference in a new issue