Merge pull request #2734 from iptv-org/freearhey-patch-6

Update tv24.co.uk
This commit is contained in:
PopeyeTheSai10r 2025-03-30 13:42:02 -07:00 committed by GitHub
commit b14ff83f13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 1019 additions and 68 deletions

File diff suppressed because it is too large Load diff

View file

@ -40,35 +40,33 @@ module.exports = {
}, },
async channels() { async channels() {
let html = await axios let html = await axios
.get('https://tv24.co.uk/x/settings/addremove') .get('https://tv24.co.uk/x/settings/addremove', {
headers: {
Cookie: 'selectedPostcode=-; selectedProvider=1000193'
}
})
.then(r => r.data) .then(r => r.data)
.catch(console.log) .catch(console.log)
let $ = cheerio.load(html) let $ = cheerio.load(html)
const nums = $('li')
let channels = []
$('li')
.toArray() .toArray()
.map(item => $(item).data('channel')) .forEach(item => {
html = await axios const link = $(item).find('img').attr('src')
.get('https://tv24.co.uk', { if (!link || link.includes('ic_channel_default')) return
headers: { const [, filename] = link.match(/channels\/(.*)\./)
Cookie: `selectedChannels=${nums.join(',')}` const site_id = filename.replace('-l', '')
}
})
.then(r => r.data)
.catch(console.log)
$ = cheerio.load(html)
const items = $('li.c').toArray()
return items.map(item => {
const name = $(item).find('h3').text().trim() const name = $(item).find('h3').text().trim()
const link = $(item).find('.channel').attr('href')
const [, site_id] = link.match(/\/channel\/(.*)/) || [null, null]
return { channels.push({
lang: 'en', lang: 'en',
site_id, site_id,
name name
}
}) })
})
return channels
} }
} }