feat: remove blacklistlinks source
This commit is contained in:
parent
e9f7ed696e
commit
6ea8f197fe
|
@ -12,12 +12,9 @@ const f = async () => {
|
|||
const outputFile = join(__dirname, '../tmp/domains-raw.txt')
|
||||
await rm(outputFile, { force: true })
|
||||
const domainsPath = join(__dirname, '../tmp/blacklistdomains.json')
|
||||
const linksPath = join(__dirname, '../tmp/blacklistlinks.json')
|
||||
|
||||
const domainsStr = await readFile(domainsPath)
|
||||
const domainsArray = parse(domainsStr)
|
||||
const linksStr = await readFile(linksPath)
|
||||
const linksArray = parse(linksStr)
|
||||
|
||||
const domains = new Set()
|
||||
|
||||
|
@ -31,16 +28,6 @@ const f = async () => {
|
|||
const domain = parsedUrl.hostname.replace(/\\/g, '').replace(/^www\./, '')
|
||||
domains.add(domain)
|
||||
}
|
||||
for (const { url } of linksArray) {
|
||||
let parsedUrl = new URL('http://example.com')
|
||||
try {
|
||||
parsedUrl = new URL(url)
|
||||
} catch {
|
||||
continue
|
||||
}
|
||||
const domain = parsedUrl.hostname.replace(/\\/g, '').replace(/^www\./, '')
|
||||
domains.add(domain)
|
||||
}
|
||||
|
||||
await writeFile(outputFile, Array.from(domains).join('\n'))
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@ cd "tmp/"
|
|||
|
||||
# Prepare datasets
|
||||
curl -L "https://api.chongluadao.vn/v2/blacklistdomains" -o "blacklistdomains.json"
|
||||
curl -L "https://api.chongluadao.vn/v2/blacklistlinks" -o "blacklistlinks.json"
|
||||
|
||||
# Extract tracking links
|
||||
node "../src/script.js"
|
||||
|
@ -67,7 +66,7 @@ SECOND_LINE="! Updated: $CURRENT_TIME"
|
|||
THIRD_LINE="! Expires: 1 day (update frequency)"
|
||||
FOURTH_LINE="! Homepage: https://gitlab.com/malware-filter/vn-badsite-filter"
|
||||
FIFTH_LINE="! License: https://gitlab.com/malware-filter/vn-badsite-filter#license"
|
||||
SIXTH_LINE="! Source: https://api.chongluadao.vn/v2/blacklistdomains & https://api.chongluadao.vn/v2/blacklistlinks"
|
||||
SIXTH_LINE="! Source: https://api.chongluadao.vn/v2/blacklistdomains"
|
||||
COMMENT_UBO="$FIRST_LINE\n$SECOND_LINE\n$THIRD_LINE\n$FOURTH_LINE\n$FIFTH_LINE\n$SIXTH_LINE"
|
||||
|
||||
mkdir -p "../public/"
|
||||
|
|
Loading…
Reference in New Issue