This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Script Profile for ChatGPT | Scripts Sharing #520
Comments
Open
脚本的入参 params 是不是和profile配置文件的结构一致? |
@together-ds 是的,已经将yaml转成json结构 |
由于一些原因可能导致Chat GPT的封号,所以希望补充一条规则
|
sentry.io直接REJECT就不用担心了 |
你看看我发的原因这个推特用户的其他推文呢?有提到使用一些技术手段阻止Open AI追踪也会导致封号 |
我这样子用了很久,亲测没问题 |
改动了一下这个函数 function main(params) {
// 下方两个数组的每一项均为正则,忽略大小写
const mustHaveKeywords = ['美国', 'United States', '新加坡', 'sg'];
// 过滤掉美国节点中,包含以下关键字的节点(过滤低质量节点,要过滤哪些根据自己的订阅来)
const mustNotHaveKeywords = ['实验性', '0\\.', 'b'];
const regexParts = [];
mustHaveKeywords.forEach(keyword => {
const mustNotHavePart = mustNotHaveKeywords.map(k => `(?!.*${k})`).join('');
regexParts.push(`(?=.*${keyword}${mustNotHavePart}).*`);
});
const regex = new RegExp(`^(${regexParts.join('|')})$`, 'i');
const rules = [
"DOMAIN-KEYWORD,cloudfare,ChatGPT",
"DOMAIN-KEYWORD,openai,ChatGPT",
"DOMAIN-KEYWORD,sentry,ChatGPT",
"DOMAIN-SUFFIX,ai.com,ChatGPT",
"DOMAIN-SUFFIX,auth0.com,ChatGPT",
"DOMAIN-SUFFIX,challenges.cloudflare.com,ChatGPT",
"DOMAIN-SUFFIX,client-api.arkoselabs.com,ChatGPT",
"DOMAIN-SUFFIX,events.statsigapi.net,ChatGPT",
"DOMAIN-SUFFIX,featuregates.org,ChatGPT",
"DOMAIN-SUFFIX,identrust.com,ChatGPT",
"DOMAIN-SUFFIX,ingest.sentry.io,ChatGPT",
"DOMAIN-SUFFIX,intercom.io,ChatGPT",
"DOMAIN-SUFFIX,intercomcdn.com,ChatGPT",
"DOMAIN-SUFFIX,openai.com,ChatGPT",
"DOMAIN-SUFFIX,openaiapi-site.azureedge.net,ChatGPT",
"DOMAIN-SUFFIX,stripe.com,ChatGPT"
];
const proxies = params.proxies
.filter(i => regex.test(i.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;
} |
Closed
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
分享一段针对ChatGPT的分组规则,可以根据自己的需求更改
regex
和rules
。regex
是匹配出能访问ChatGPT节点的正则,rules
是clash rules,分组名为ChatGPT
。The text was updated successfully, but these errors were encountered: