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