deploy: 1e56021d84295ad231900616f25913aebd85cb86

This commit is contained in:
SukkaBot
2022-10-31 18:36:01 +00:00
parent fdebcaa9ca
commit 64de4ba977
6 changed files with 170 additions and 145 deletions

View File

@@ -1,5 +1,7 @@
const psl = require('psl');
const { processFilterRules } = require('./lib/parse-filter.js');
const fs = require('fs');
const path = require('path');
(async () => {
const domainSet = Array.from(
@@ -20,18 +22,21 @@ const { processFilterRules } = require('./lib/parse-filter.js');
}
const domain = line.charCodeAt(0) === 46 ? line.slice(1) : line;
const parsed = psl.parse(domain);
if (parsed.input === parsed.tld) {
continue;
}
if (line.length > 25) {
const parsed = psl.parse(domain);
if (parsed.input === parsed.tld) {
continue;
}
domainCountMap[parsed.domain] ||= 0;
domainCountMap[parsed.domain] += 1;
}
}
const results = [];
Object.entries(domainCountMap).forEach(([domain, count]) => {
if (
count > 10
@@ -44,7 +49,10 @@ const { processFilterRules } = require('./lib/parse-filter.js');
|| domain.endsWith('.cyou')
)
) {
console.log('.'+ domain);
results.push('.' + domain);
}
});
const filePath = path.resolve(__dirname, '../List/domainset/reject_phishing.conf');
await fs.promises.writeFile(filePath, results.join('\n'), 'utf-8');
})();