fix(ids): skip invalid url

This commit is contained in:
MDLeom 2025-03-22 06:59:49 +00:00
parent b8c5378e1c
commit 476b8628e0
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
1 changed files with 5 additions and 0 deletions

View File

@ -35,6 +35,11 @@ for await (const domain of domains.readLines()) {
}
for await (const line of urls.readLines()) {
if (!URL.canParse(`http://${line}`)) {
console.error(`Invalid URL: ${line}`)
continue
}
const url = new URL(`http://${line}`)
const { hostname, pathname, search } = url
const pathEscape = pathname.replaceAll(';', '\\;') + search