Add check for Plex external port down

This commit is contained in:
Jonathan Wong
2015-11-17 21:54:54 -08:00
parent 4fffbf8a0c
commit ca91adbd53
3 changed files with 75 additions and 22 deletions

View File

@@ -463,3 +463,22 @@ class PlexTV(object):
break
return server_times
def get_server_response(self):
response = self.get_plextv_server_list(output_format='xml')
server_url = []
try:
xml_head = response.getElementsByTagName('Server')
except:
return False
for a in xml_head:
if helpers.get_xml_attr(a, 'machineIdentifier') == plexpy.CONFIG.PMS_IDENTIFIER:
server_url.append({"host": helpers.get_xml_attr(a, 'host'),
"port": helpers.get_xml_attr(a, 'port')
})
break
return server_url