code: def discover(timeout=1, retries=1):
      locations = []
      group = ('239.255.255.250', 1900)
      service = 'ssdp:urn:schemas-upnp-org:device:MediaRenderer:1'
      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)
          sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
          sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 2)
          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]
      return sorted([device for device in devices
                     if device.model_description == 'Virtual Media Player'],
                    key=lambda device: device.friendly_name)