Chore: update luminati / global domain tools
Some checks failed
Build / Build (push) Has been cancelled
Build / Diff output (push) Has been cancelled
Build / Deploy to Cloudflare Pages (3.114.6) (push) Has been cancelled
Build / Deploy to GitHub and GitLab (push) Has been cancelled

This commit is contained in:
SukkaW
2025-04-23 16:33:39 +08:00
parent 80e2087497
commit 0d6b295b1f
2 changed files with 16 additions and 5 deletions

View File

@@ -37,6 +37,17 @@ import { processLine } from './lib/process-line';
trie.whitelist(l); trie.whitelist(l);
} }
} }
for await (const line of readFileByLine(path.join(SOURCE_DIR, 'non_ip', 'reject.conf'))) {
const l = processLine(line);
if (l) {
const [type, domain] = l.split(',', 3);
if (type === 'DOMAIN') {
trie.whitelist(domain, false);
} else if (type === 'DOMAIN-SUFFIX') {
trie.whitelist(domain, true);
}
}
}
console.log(trie.dump().map(i => '.' + i).join('\n')); console.log(trie.dump().map(i => '.' + i).join('\n'));
})(); })();

View File

@@ -67,13 +67,13 @@ export async function parseGfwList() {
trie.add(l); trie.add(l);
} }
const res = await (await $$fetch('https://litter.catbox.moe/gv0bw6.csv', { const topDomainsRes = await (await $$fetch('https://downloads.majestic.com/majestic_million.csv', {
headers: { headers: {
accept: '*/*', accept: '*/*',
'user-agent': 'curl/8.12.1' 'user-agent': 'curl/8.12.1'
} }
})).text(); })).text();
const topDomains = parse(res); const topDomains = parse(topDomainsRes);
const keywordSet = new Set<string>(); const keywordSet = new Set<string>();
@@ -115,6 +115,7 @@ export async function parseGfwList() {
runAgainstRuleset(path.resolve(OUTPUT_SURGE_DIR, 'non_ip/ai.conf')), runAgainstRuleset(path.resolve(OUTPUT_SURGE_DIR, 'non_ip/ai.conf')),
runAgainstRuleset(path.resolve(OUTPUT_SURGE_DIR, 'non_ip/microsoft.conf')), runAgainstRuleset(path.resolve(OUTPUT_SURGE_DIR, 'non_ip/microsoft.conf')),
runAgainstDomainset(path.resolve(OUTPUT_SURGE_DIR, 'domainset/reject.conf')), runAgainstDomainset(path.resolve(OUTPUT_SURGE_DIR, 'domainset/reject.conf')),
runAgainstDomainset(path.resolve(OUTPUT_SURGE_DIR, 'domainset/reject_extra.conf')),
runAgainstDomainset(path.resolve(OUTPUT_SURGE_DIR, 'domainset/cdn.conf')) runAgainstDomainset(path.resolve(OUTPUT_SURGE_DIR, 'domainset/cdn.conf'))
]); ]);
@@ -124,15 +125,14 @@ export async function parseGfwList() {
const missingTop10000Gfwed = new Set<string>(); const missingTop10000Gfwed = new Set<string>();
console.log(trie.has('.mojim.com'));
for await (const [domain] of topDomains) { for await (const [domain] of topDomains) {
if (trie.has(domain) && !kwfilter(domain)) { if (trie.has(domain) && !kwfilter(domain)) {
missingTop10000Gfwed.add(domain); missingTop10000Gfwed.add(domain);
} }
} }
console.log(JSON.stringify(Array.from(missingTop10000Gfwed), null, 2)); console.log(missingTop10000Gfwed.size, '');
console.log(Array.from(missingTop10000Gfwed).join('\n'));
return [ return [
whiteSet, whiteSet,