|
@@ -57,6 +57,8 @@ export async function parseGfwList() {
|
|
|
const whiteSet = new Set<string>();
|
|
const whiteSet = new Set<string>();
|
|
|
const gfwListTrie = new HostnameSmolTrie();
|
|
const gfwListTrie = new HostnameSmolTrie();
|
|
|
|
|
|
|
|
|
|
+ let totalGfwSize = 0;
|
|
|
|
|
+
|
|
|
const gfwlistIgnoreLineKwfilter = createKeywordFilter([
|
|
const gfwlistIgnoreLineKwfilter = createKeywordFilter([
|
|
|
'.*',
|
|
'.*',
|
|
|
'*',
|
|
'*',
|
|
@@ -100,14 +102,17 @@ export async function parseGfwList() {
|
|
|
}
|
|
}
|
|
|
const d = fastNormalizeDomain(line);
|
|
const d = fastNormalizeDomain(line);
|
|
|
if (d) {
|
|
if (d) {
|
|
|
|
|
+ totalGfwSize++;
|
|
|
gfwListTrie.add(d);
|
|
gfwListTrie.add(d);
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
for await (const l of await fetchRemoteTextByLine('https://raw.githubusercontent.com/Loyalsoldier/cn-blocked-domain/release/domains.txt', true)) {
|
|
for await (const l of await fetchRemoteTextByLine('https://raw.githubusercontent.com/Loyalsoldier/cn-blocked-domain/release/domains.txt', true)) {
|
|
|
|
|
+ totalGfwSize++;
|
|
|
gfwListTrie.add(l);
|
|
gfwListTrie.add(l);
|
|
|
}
|
|
}
|
|
|
for await (const l of await fetchRemoteTextByLine('https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/gfw.txt', true)) {
|
|
for await (const l of await fetchRemoteTextByLine('https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/gfw.txt', true)) {
|
|
|
|
|
+ totalGfwSize++;
|
|
|
gfwListTrie.add(l);
|
|
gfwListTrie.add(l);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -147,6 +152,9 @@ export async function parseGfwList() {
|
|
|
|
|
|
|
|
whiteSet.forEach(domain => gfwListTrie.whitelist(domain, true));
|
|
whiteSet.forEach(domain => gfwListTrie.whitelist(domain, true));
|
|
|
|
|
|
|
|
|
|
+ let gfwListSize = 0;
|
|
|
|
|
+ gfwListTrie.dump(() => gfwListSize++);
|
|
|
|
|
+
|
|
|
const kwfilter = createKeywordFilter([...keywordSet]);
|
|
const kwfilter = createKeywordFilter([...keywordSet]);
|
|
|
|
|
|
|
|
const missingTop10000Gfwed = new Set<string>();
|
|
const missingTop10000Gfwed = new Set<string>();
|
|
@@ -158,7 +166,7 @@ export async function parseGfwList() {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
console.log(Array.from(missingTop10000Gfwed).join('\n'));
|
|
console.log(Array.from(missingTop10000Gfwed).join('\n'));
|
|
|
- console.log('', missingTop10000Gfwed.size);
|
|
|
|
|
|
|
+ console.log({ totalGfwSize, gfwListSize, missingSize: missingTop10000Gfwed.size });
|
|
|
|
|
|
|
|
return [
|
|
return [
|
|
|
whiteSet,
|
|
whiteSet,
|
|
@@ -170,3 +178,5 @@ export async function parseGfwList() {
|
|
|
if (require.main === module) {
|
|
if (require.main === module) {
|
|
|
parseGfwList().catch(console.error);
|
|
parseGfwList().catch(console.error);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// python.com waiting-for-sell
|