module.exports.parse = async ({ content, name, url }, { yaml, axios, notify }) => {
const proxyName = "🚀 节点选择"
const extendedRules = {
direct: {
processes: [
"MAA.exe",
"RayLinkService.exe",
"wireguard.exe",
"firefox.exe",
"syncthing.exe",
"tailscaled.exe",
"tailscale-ipn.exe",
"EpicWebHelper.exe",
"EpicGamesLauncher.exe",
],
domainSuffixes: [
"steamcontent.com",
"cpu-monkey.com",
"rec.114514.plus",
"test-ipv6.com",
"ipv6-test.com",
],
ips: [
"111.123.56.92/32",
],
},
reject: {
processes: [
"xshell.exe",
],
domainSuffixes: [
"activity.windows.com",
"server.events.data.microsoft.com",
"assets.msn.cn",
"applicationinsights.azure.com",
"aeventlog.beacon.qq.com",
"amplitude.com",
"mcdn.bilivideo.cn",
],
domains: [
"otheve.beacon.qq.com",
"oth.eve.mdt.qq.com",
"mumu.nie.netease.com",
],
keywords: [
"tpstelemetry",
"galileotelemetry",
"log-upload.mihoyo.com",
"h5collector.mihoyo.com",
"google-analytics",
],
},
proxy: {
domainSuffixes: [
"notion.site",
"claude.ai",
"hfyrw.com",
"jsdelivr.net",
],
domains: [
"challenges.cloudflare.com",
"www.k8dm.com",
"hfyrw.com",
],
},
}
const ruleTypes = {
processes: "PROCESS-NAME",
domainSuffixes: "DOMAIN-SUFFIX",
domains: "DOMAIN",
ips: "IP-CIDR",
keywords: "DOMAIN-KEYWORD",
}
const rules = []
for (const [type, values] of Object.entries(extendedRules.direct)) {
for (const value of values) {
rules.push(`${ruleTypes[type]},${value},${type === "ips" ? "DIRECT" : "DIRECT,no-resolve"}`)
}
}
for (const [type, values] of Object.entries(extendedRules.reject)) {
for (const value of values) {
rules.push(`${ruleTypes[type]},${value},REJECT`)
}
}
for (const [type, values] of Object.entries(extendedRules.proxy)) {
for (const value of values) {
rules.push(`${ruleTypes[type]},${value},${proxyName}`)
}
}
content['rules'] = rules.concat(content['rules'])
return content;
}