diff --git a/scripts/commands/playlist/validate.ts b/scripts/commands/playlist/validate.ts index c05964f562..f4292e62f2 100644 --- a/scripts/commands/playlist/validate.ts +++ b/scripts/commands/playlist/validate.ts @@ -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)