def get_services_from_location(location):
try:
(xml_headers, xml_data) = UpnpSoap.get(location)
if xml_data is not False:
xml_root = minidom.parseString(xml_data)
services_list = list()
for service in xml_root.getElementsByTagName("service"):
service_dict = XmlHelper.xml_extract_dict(service, ['serviceType',
'controlURL',
'eventSubURL',
'SCPDURL',
'serviceId'])
services_list.append(service_dict)
return services_list
except Exception as e:
print("Error get_subscription_urls:{0}".format(e))
return None
评论列表
文章目录