mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 08:30:06 -04:00
Merge pull request #2734 from iptv-org/freearhey-patch-6
Update tv24.co.uk
This commit is contained in:
commit
b14ff83f13
2 changed files with 1019 additions and 68 deletions
File diff suppressed because it is too large
Load diff
|
@ -40,35 +40,33 @@ module.exports = {
|
|||
},
|
||||
async channels() {
|
||||
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)
|
||||
.catch(console.log)
|
||||
let $ = cheerio.load(html)
|
||||
const nums = $('li')
|
||||
|
||||
let channels = []
|
||||
$('li')
|
||||
.toArray()
|
||||
.map(item => $(item).data('channel'))
|
||||
html = await axios
|
||||
.get('https://tv24.co.uk', {
|
||||
headers: {
|
||||
Cookie: `selectedChannels=${nums.join(',')}`
|
||||
}
|
||||
})
|
||||
.then(r => r.data)
|
||||
.catch(console.log)
|
||||
$ = cheerio.load(html)
|
||||
const items = $('li.c').toArray()
|
||||
|
||||
return items.map(item => {
|
||||
.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()
|
||||
const link = $(item).find('.channel').attr('href')
|
||||
const [, site_id] = link.match(/\/channel\/(.*)/) || [null, null]
|
||||
|
||||
return {
|
||||
channels.push({
|
||||
lang: 'en',
|
||||
site_id,
|
||||
name
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
return channels
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue