From e3ae8f4292c9131d5ecb0c49be097f0cb170db62 Mon Sep 17 00:00:00 2001 From: Mahfud Harun Date: Tue, 3 Sep 2024 21:24:22 +0700 Subject: [PATCH] Skip channel addition if no `site_id` was found --- sites/mewatch.sg/mewatch.sg.config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sites/mewatch.sg/mewatch.sg.config.js b/sites/mewatch.sg/mewatch.sg.config.js index 4c945609..6401fc7a 100644 --- a/sites/mewatch.sg/mewatch.sg.config.js +++ b/sites/mewatch.sg/mewatch.sg.config.js @@ -40,7 +40,11 @@ module.exports = { $('#side-nav > div > div > div > nav:nth-child(1) > ul > li > ul > li').each((i, el) => { const name = $(el).find('a > span').text() const url = $(el).find('a').attr('href') - const [, site_id] = url.match(/\/(\d+)\?player-fullscreen/) + const [, site_id = null] = url.match(/\/(\d+)\?player-fullscreen/) ?? [] + + if (!site_id) { + return + } channels.push({ lang: 'en',