mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 16:40:07 -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 channelsTags = siteTag.elements.filter(el => el.name === 'channels')
|
||||
|
||||
let output = []
|
||||
const output = {
|
||||
site: siteTag.attributes.site,
|
||||
groups: []
|
||||
}
|
||||
|
||||
channelsTags.forEach(channelsTag => {
|
||||
const channels = channelsTag.elements
|
||||
|
@ -21,7 +24,11 @@ parser.parseChannels = function (xml) {
|
|||
|
||||
return channel
|
||||
})
|
||||
output = output.concat(channels)
|
||||
|
||||
output.groups.push({
|
||||
country: channelsTag.attributes.country,
|
||||
channels
|
||||
})
|
||||
})
|
||||
|
||||
return output
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue