From 5dbaecf180e016db9e74b0a248cfba148f9fb7ad Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Fri, 20 Dec 2024 05:48:00 +0300 Subject: [PATCH] Update update.ts Fixes https://github.com/iptv-org/iptv/issues/16856 --- scripts/commands/playlist/update.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/commands/playlist/update.ts b/scripts/commands/playlist/update.ts index e33e0c9c8..97e461ee7 100644 --- a/scripts/commands/playlist/update.ts +++ b/scripts/commands/playlist/update.ts @@ -2,6 +2,7 @@ import { Logger, Storage, Collection, Dictionary } from '@freearhey/core' import { DATA_DIR, STREAMS_DIR } from '../../constants' import { IssueLoader, PlaylistParser } from '../../core' import { Stream, Playlist, Channel, Issue } from '../../models' +import validUrl from 'valid-url' let processedIssues = new Collection() let streams: Collection @@ -105,6 +106,7 @@ async function addStreams(loader: IssueLoader) { const data = issue.data if (data.missing('channel_id') || data.missing('stream_url')) return if (streams.includes((_stream: Stream) => _stream.url === data.get('stream_url'))) return + if (!validUrl.isUri(data.get('stream_url'))) return const channel = groupedChannels.get(data.get('channel_id'))