def METHOD_NAME(self, tags: Dict[str, str]) -> Dict[str, str]:
    try:
        urls: Dict[str, str] = {}
        for rule in self.rules:
            valid = True
            id = {}
            for condition in rule["conditions"]:
                match = False
                for key in tags.keys():
                    kmatch = condition["k"].match(key)
                    if kmatch:
                        id[condition["id"]] = {"k": kmatch}
                        if condition["v"] is None:
                            vmatch = self.all.match(tags[key])
                            id[condition["id"]]["v"] = vmatch
                            match = True
                            break
                        else:
                            vmatch = condition["v"].match(tags[key])
                            if vmatch:
                                id[condition["id"]]["v"] = vmatch
                                match = True
                                break
                if not match:
                    valid = False
                    break
            if valid:
                replace = []
                for sub in rule["link"]["subs"]:
                    for v in sub:
                        if isinstance(v, str):
                            replace.append(v)
                            break
                        else:
                            val = id[v[0]][v[1]].group(v[2])
                            if val:
                                replace.append(val)
                                break
                ret = rule["link"]["url"] % tuple(replace)
                if "://" not in ret:
                    ret = "http://" + ret
                urls[id[rule["link"]["subs"][0][0][0]]["k"].group(0)] = ret
        return urls
    except Exception:
        return {}