Threaded Plex Companion Timeline messages, due to PMS missing Content-Length header args in the response
This commit is contained in:
parent
39f1d0c367
commit
a64e36cf69
1 changed files with 9 additions and 3 deletions
|
@ -242,13 +242,19 @@ class Subscriber:
|
||||||
printDebug("sending xml to subscriber %s: %s" % (self.tostr(), msg))
|
printDebug("sending xml to subscriber %s: %s" % (self.tostr(), msg))
|
||||||
url = self.protocol + '://' + self.host + ':' + self.port \
|
url = self.protocol + '://' + self.host + ':' + self.port \
|
||||||
+ "/:/timeline"
|
+ "/:/timeline"
|
||||||
|
t = threading.Thread(target=self.threadedSend, args=(url, msg))
|
||||||
|
t.start()
|
||||||
|
|
||||||
|
def threadedSend(self, url, msg):
|
||||||
|
"""
|
||||||
|
Threaded POST request, because they stall due to PMS response missing
|
||||||
|
the Content-Length header :-(
|
||||||
|
"""
|
||||||
response = self.download.downloadUrl(
|
response = self.download.downloadUrl(
|
||||||
url,
|
url,
|
||||||
postBody=msg,
|
postBody=msg,
|
||||||
type="POSTXML")
|
type="POSTXML")
|
||||||
# if not requests.post(self.host, self.port, "/:/timeline", msg, getPlexHeaders(), self.protocol):
|
|
||||||
# subMgr.removeSubscriber(self.uuid)
|
|
||||||
if response in [False, None, 401]:
|
if response in [False, None, 401]:
|
||||||
subMgr.removeSubscriber(self.uuid)
|
subMgr.removeSubscriber(self.uuid)
|
||||||
|
|
||||||
subMgr = SubscriptionManager()
|
subMgr = SubscriptionManager()
|
||||||
|
|
Loading…
Reference in a new issue