From 25538ffc3d119c0608dc207a1c0cc7212ca53a79 Mon Sep 17 00:00:00 2001 From: Aman Karmani Date: Thu, 21 Oct 2021 09:18:26 -0700 Subject: [PATCH] skip duplicate channel numbers --- PlutoIPTV/index.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/PlutoIPTV/index.js b/PlutoIPTV/index.js index 5c004ed..211d705 100755 --- a/PlutoIPTV/index.js +++ b/PlutoIPTV/index.js @@ -305,7 +305,17 @@ const plutoIPTV = { module.exports = plutoIPTV; -function processChannels(version, channels) { +function processChannels(version, list) { + let seenChannels = {}; + let channels = []; + list.forEach(channel => { + if (seenChannels[channel.number]) { + return + } + seenChannels[channel.number] = true + channels.push(channel) + }) + /////////////////// // M3U8 Playlist // ///////////////////