Update validate.ts

This commit is contained in:
freearhey
2026-03-11 07:08:31 +03:00
parent e79445e28d
commit 77e01b50eb

View File

@@ -3,6 +3,7 @@ import { Storage } from '@freearhey/storage-js'
import { PlaylistParser } from '../../core'
import { data, loadData } from '../../api'
import { ROOT_DIR } from '../../constants'
import { isURI } from '../../utils.js'
import { Stream } from '../../models'
import * as sdk from '@iptv-org/sdk'
import { program } from 'commander'
@@ -63,6 +64,14 @@ async function main() {
buffer.set(stream.url, true)
}
if (!isURI(stream.url)) {
log.add({
type: 'error',
line: stream.getLine(),
message: `"${stream.url}" is not a valid URL`
})
}
if (stream.channel) {
const blocklistRecords = new Collection(
data.blocklistRecordsGroupedByChannel.get(stream.channel)