From 01f483304259abd070b4a54a81673315cdd5dbdf Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Sun, 27 Dec 2015 13:56:07 +0100 Subject: [PATCH] Allow for http type "OPTIONS" --- resources/lib/downloadutils.py | 10 ++++++++++ resources/lib/initialsetup.py | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/resources/lib/downloadutils.py b/resources/lib/downloadutils.py index f0d2526c..f3e68c10 100644 --- a/resources/lib/downloadutils.py +++ b/resources/lib/downloadutils.py @@ -213,6 +213,8 @@ class DownloadUtils(): r = s.post(url, json=postBody, timeout=timeout) elif type == "DELETE": r = s.delete(url, json=postBody, timeout=timeout) + elif type == "OPTIONS": + r = s.options(url, json=postBody, timeout=timeout) except AttributeError: # request session does not exists @@ -260,6 +262,14 @@ class DownloadUtils(): cert=cert, verify=verifyssl) + elif type == "OPTIONS": + r = requests.options(url, + json=postBody, + headers=header, + timeout=timeout, + cert=cert, + verify=verifyssl) + # If user is not authenticated elif not authenticate: diff --git a/resources/lib/initialsetup.py b/resources/lib/initialsetup.py index 49ba9978..3c01eef3 100644 --- a/resources/lib/initialsetup.py +++ b/resources/lib/initialsetup.py @@ -182,7 +182,10 @@ class InitialSetup(): ##### USER INFO ##### self.logMsg("Getting user list.", 1) - + # If not multiple users, set username to Plex login name. + # If multiple users, get user list. + + url = "%s/emby/Users/Public?format=json" % server result = self.doUtils.downloadUrl(url, authenticate=False) if result == "":