mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update epg.iptvx.one.config.js
This commit is contained in:
parent
0563d75e5d
commit
1b3a4d3bd4
1 changed files with 10 additions and 12 deletions
|
@ -32,22 +32,20 @@ module.exports = {
|
||||||
return programs
|
return programs
|
||||||
},
|
},
|
||||||
async channels() {
|
async channels() {
|
||||||
const buffer = await axios
|
const data = await axios
|
||||||
.get('https://iptvx.one/epg/epg_noarch.xml.gz', {
|
.get('https://epg.iptvx.one/api/channels.json')
|
||||||
responseType: 'arraybuffer'
|
|
||||||
})
|
|
||||||
.then(r => r.data)
|
.then(r => r.data)
|
||||||
.catch(console.log)
|
.catch(console.log)
|
||||||
|
|
||||||
const data = ungzip(buffer)
|
return data.channels.map(channel => {
|
||||||
const decoded = iconv.decode(data, 'utf8')
|
const [name] = channel.chan_names.split(' • ')
|
||||||
const { channels } = parser.parse(decoded)
|
|
||||||
|
|
||||||
return channels.map(channel => ({
|
return {
|
||||||
lang: 'ru',
|
lang: 'ru',
|
||||||
site_id: channel.id,
|
site_id: channel.chan_id,
|
||||||
name: channel.displayName[0].value
|
name
|
||||||
}))
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue