From 77e01b50eb2e02537440ac880c95270a27357622 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Wed, 11 Mar 2026 07:08:31 +0300 Subject: [PATCH] Update validate.ts --- scripts/commands/playlist/validate.ts | 9 +++++++++ 1 file changed, 9 insertions(+) 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)