This repository was archived by the owner on Nov 3, 2023. It is now read-only.
This repository was archived by the owner on Nov 3, 2023. It is now read-only.
Script Profile for ChatGPT | Scripts Sharing #520
Closed
Description
分享一段针对ChatGPT的分组规则,可以根据自己的需求更改regex
和rules
。regex
是匹配出能访问ChatGPT节点的正则,rules
是clash rules,分组名为ChatGPT
。
// New Proxy Group for ChatGPT
function main(params) {
// TODO modify this regex to what you want
const regex = /美国|新加坡|日本/;
// TODO modify this rules to what you want
const rules = [
"DOMAIN-KEYWORD,openai,ChatGPT",
"DOMAIN-KEYWORD,cloudfare,ChatGPT"
];
const proxies = params.proxies
.filter((e) => regex.test(e.name))
.map((e) => e.name);
const groups = params["proxy-groups"];
const newGroup = {
name: "ChatGPT",
type: "select",
proxies,
};
if (groups.length > 1) {
groups.splice(1, 0, newGroup);
params.rules = rules.concat(params.rules);
}
return params;
}
Metadata
Metadata
Assignees
Labels
No labels