code: def discover(timeout=1, retries=1):
      
      locations = []
  
      group = ('239.255.255.250', 1900)
      service = 'ssdp:urn:schemas-upnp-org:device:MediaRenderer:1'  # 'ssdp:all'
      message = '\r\n'.join(['M-SEARCH * HTTP/1.1',
                             'HOST: {group[0]}:{group[1]}',
                             'MAN: "ssdp:discover"',
                             'ST: {st}',
                             'MX: 1', '', '']).format(group=group, st=service)
  
      socket.setdefaulttimeout(timeout)
      for _ in range(retries):
          sock = socket.socket(socket.AF_INET,
                               socket.SOCK_DGRAM,
                               socket.IPPROTO_UDP)
          # socket options
          sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
          sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 2)
  
          # send group multicast
          sock.sendto(message.encode('utf-8'), group)
  
          while True:
              try:
                  response = sock.recv(2048).decode('utf-8')
                  for line in response.split('\r\n'):
                      if line.startswith('Location: '):
                          location = line.split(' ')[1].strip()
                          if not location in locations:
                              locations.append(location)
              except socket.timeout:
                  break
      devices = [RaumfeldDevice(location) for location in locations]
  
      # only return 'Virtual Media Player' and sort the list
      return sorted([device for device in devices
                     if device.model_description == 'Virtual Media Player'],
                    key=lambda device: device.friendly_name)
docs: Discover Raumfeld devices in the network
  
      :param timeout: The timeout in seconds
      :param retries: How often the search should be retried
      :returns:       A list of raumfeld devices, sorted by name