From 171f3066f239a53e57b67092abffa03c04107c30 Mon Sep 17 00:00:00 2001 From: "[redacted]" <10243554+nonPointer@users.noreply.github.com> Date: Sun, 31 Mar 2024 14:59:27 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=8A=82=E7=82=B9=E5=90=8D=E5=8E=BB?= =?UTF-8?q?=E9=87=8D=EF=BC=8C=E9=81=BF=E5=85=8D=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helper.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helper.py b/helper.py index d846314..71620c6 100644 --- a/helper.py +++ b/helper.py @@ -124,6 +124,9 @@ def from_config(config: dict) -> Site: config['proxies'] += site.nodes config['proxy-groups'][list(map(lambda x: x['name'], config['proxy-groups'])).index(site.group)]['proxies'] += site.get_titles() +# 对节点名去重 +config['proxies'] = list({x['name']: x for x in config['proxies']}.values()) + output_file = sys.argv[2] if len(sys.argv) == 3 else "out.yaml" with open(output_file, "w", encoding="utf-8") as f: f.write(yaml.dump(config, default_flow_style=False, allow_unicode=True))