mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update parser.js
This commit is contained in:
parent
356b63bc63
commit
b814897c84
1 changed files with 9 additions and 2 deletions
|
@ -7,7 +7,10 @@ parser.parseChannels = function (xml) {
|
||||||
const siteTag = result.elements.find(el => el.name === 'site')
|
const siteTag = result.elements.find(el => el.name === 'site')
|
||||||
const channelsTags = siteTag.elements.filter(el => el.name === 'channels')
|
const channelsTags = siteTag.elements.filter(el => el.name === 'channels')
|
||||||
|
|
||||||
let output = []
|
const output = {
|
||||||
|
site: siteTag.attributes.site,
|
||||||
|
groups: []
|
||||||
|
}
|
||||||
|
|
||||||
channelsTags.forEach(channelsTag => {
|
channelsTags.forEach(channelsTag => {
|
||||||
const channels = channelsTag.elements
|
const channels = channelsTag.elements
|
||||||
|
@ -21,7 +24,11 @@ parser.parseChannels = function (xml) {
|
||||||
|
|
||||||
return channel
|
return channel
|
||||||
})
|
})
|
||||||
output = output.concat(channels)
|
|
||||||
|
output.groups.push({
|
||||||
|
country: channelsTag.attributes.country,
|
||||||
|
channels
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
return output
|
return output
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue