I am trying to write a Plex Status Plugin. The first thing i tried was to establish an HTTP connection to Plex Server.
Code: Select all
self.plexConn = Domoticz.Connection(Name="PlexConn", Transport="TCP/IP", Protocol="HTTP", Address=Parameters["Address"], Port=Parameters["Port"])
Code: Select all
<MediaContainer size="0">
</MediaContainer>
Code: Select all
statusData = { 'Verb' : 'GET',
'URL' : '/status/sessions',
'Headers' : { 'Content-Type': 'text/xml; charset=utf-8', \
'Connection': 'keep-alive', \
'Accept': 'Content-Type: text/html; charset=UTF-8', \
'Host': Parameters["Address"]+":"+Parameters["Port"], \
'User-Agent':'Domoticz/1.0' }
}
self.plexConn.Send(statusData)
Code: Select all
2018-01-10 17:58:13.100 (Plex) Received 263 bytes of data:
2018-01-10 17:58:13.101 (Plex) 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d 0a 43 6f 6e HTTP/1.1.200.OK..Con
2018-01-10 17:58:13.101 (Plex) 74 65 6e 74 2d 54 79 70 65 3a 20 74 65 78 74 2f 78 6d 6c 3b tent-Type:.text/xml;
2018-01-10 17:58:13.101 (Plex) 63 68 61 72 73 65 74 3d 75 74 66 2d 38 0d 0a 43 6f 6e 74 65 charset=utf-8..Conte
2018-01-10 17:58:13.101 (Plex) 6e 74 2d 4c 65 6e 67 74 68 3a 20 38 33 0d 0a 43 6f 6e 6e 65 nt-Length:.83..Conne
2018-01-10 17:58:13.101 (Plex) 63 74 69 6f 6e 3a 20 63 6c 6f 73 65 0d 0a 58 2d 50 6c 65 78 ction:.close..X-Plex
2018-01-10 17:58:13.101 (Plex) 2d 50 72 6f 74 6f 63 6f 6c 3a 20 31 2e 30 0d 0a 43 61 63 68 -Protocol:.1.0..Cach
2018-01-10 17:58:13.101 (Plex) 65 2d 43 6f 6e 74 72 6f 6c 3a 20 6e 6f 2d 63 61 63 68 65 0d e-Control:.no-cache.
2018-01-10 17:58:13.101 (Plex) 0a 44 61 74 65 3a 20 57 65 64 2c 20 31 30 20 4a 61 6e 20 32 .Date:.Wed,.10.Jan.2
2018-01-10 17:58:13.101 (Plex) 30 31 38 20 31 34 3a 35 38 3a 31 32 20 47 4d 54 0d 0a 0d 0a 018.14:58:12.GMT....
2018-01-10 17:58:13.101 (Plex) 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 20
2018-01-10 17:58:13.101 (Plex) 65 6e 63 6f 64 69 6e 67 3d 22 55 54 46 2d 38 22 3f 3e 0a 3c encoding="UTF-8"?>.<
2018-01-10 17:58:13.101 (Plex) 4d 65 64 69 61 43 6f 6e 74 61 69 6e 65 72 20 73 69 7a 65 3d MediaContainer.size=
2018-01-10 17:58:13.101 (Plex) 22 30 22 3e 0a 3c 2f 4d 65 64 69 61 43 6f 6e 74 61 69 6e 65 "0">.
2018-01-10 17:58:13.102 (Plex) 72 3e 0a .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. r>.
2018-01-10 17:58:13.102 (Plex) Calling message handler 'onMessage'.
2018-01-10 17:58:13.102 (Plex) HTTP Details (3):
2018-01-10 17:58:13.102 (Plex) --->'Status':'200'
2018-01-10 17:58:13.102 (Plex) --->'Headers (6):
2018-01-10 17:58:13.102 (Plex) ------->'Content-Type':'text/xml;charset=utf-8'
2018-01-10 17:58:13.102 (Plex) ------->'Content-Length':'83'
2018-01-10 17:58:13.102 (Plex) ------->'Connection':'close'
2018-01-10 17:58:13.103 (Plex) ------->'X-Plex-Protocol':'1.0'
2018-01-10 17:58:13.103 (Plex) ------->'Cache-Control':'no-cache'
2018-01-10 17:58:13.103 (Plex) ------->'Date':'Wed, 10 Jan 2018 14:58:12 GMT'
2018-01-10 17:58:13.103 (Plex) --->'Data':'b'\n\n\n''
So i tried the same thing with 'None' connection instead of 'HTTP'. Still the same:
Code: Select all
2018-01-10 17:49:04.626 PluginSystem: Restarting I/O service thread.
2018-01-10 17:49:04.626 (Plex) Received 263 bytes of data:
2018-01-10 17:49:04.626 (Plex) 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d 0a 43 6f 6e HTTP/1.1.200.OK..Con
2018-01-10 17:49:04.626 (Plex) 74 65 6e 74 2d 54 79 70 65 3a 20 74 65 78 74 2f 78 6d 6c 3b tent-Type:.text/xml;
2018-01-10 17:49:04.626 (Plex) 63 68 61 72 73 65 74 3d 75 74 66 2d 38 0d 0a 43 6f 6e 74 65 charset=utf-8..Conte
2018-01-10 17:49:04.626 (Plex) 6e 74 2d 4c 65 6e 67 74 68 3a 20 38 33 0d 0a 43 6f 6e 6e 65 nt-Length:.83..Conne
2018-01-10 17:49:04.626 (Plex) 63 74 69 6f 6e 3a 20 63 6c 6f 73 65 0d 0a 58 2d 50 6c 65 78 ction:.close..X-Plex
2018-01-10 17:49:04.626 (Plex) 2d 50 72 6f 74 6f 63 6f 6c 3a 20 31 2e 30 0d 0a 43 61 63 68 -Protocol:.1.0..Cach
2018-01-10 17:49:04.626 (Plex) 65 2d 43 6f 6e 74 72 6f 6c 3a 20 6e 6f 2d 63 61 63 68 65 0d e-Control:.no-cache.
2018-01-10 17:49:04.626 (Plex) 0a 44 61 74 65 3a 20 57 65 64 2c 20 31 30 20 4a 61 6e 20 32 .Date:.Wed,.10.Jan.2
2018-01-10 17:49:04.627 (Plex) 30 31 38 20 31 34 3a 34 39 3a 30 33 20 47 4d 54 0d 0a 0d 0a 018.14:49:03.GMT....
2018-01-10 17:49:04.627 (Plex) 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 20
2018-01-10 17:49:04.627 (Plex) 65 6e 63 6f 64 69 6e 67 3d 22 55 54 46 2d 38 22 3f 3e 0a 3c encoding="UTF-8"?>.<
2018-01-10 17:49:04.627 (Plex) 4d 65 64 69 61 43 6f 6e 74 61 69 6e 65 72 20 73 69 7a 65 3d MediaContainer.size=
2018-01-10 17:49:04.627 (Plex) 22 30 22 3e 0a 3c 2f 4d 65 64 69 61 43 6f 6e 74 61 69 6e 65 "0">.
2018-01-10 17:49:04.628 (Plex) 72 3e 0a .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. r>.
2018-01-10 17:49:04.628 (Plex) Calling message handler 'onMessage'.
2018-01-10 17:49:04.630 (Plex) onMessage called with Data: 'HTTP/1.1 200 OK
Content-Type: text/xml;charset=utf-8
Content-Length: 83
Connection: close
X-Plex-Protocol: 1.0
Cache-Control: no-cache
Date: Wed, 10 Jan 2018 14:49:03 GMT
'
@Dnpwwo, is this a bug?
What am i doing wrong???