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() {
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue