Skip channel addition if no site_id was found

This commit is contained in:
Mahfud Harun 2024-09-03 21:24:22 +07:00
parent 270e85cfae
commit e3ae8f4292

View file

@ -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',