mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update create-matrix.js
This commit is contained in:
parent
a3a0bf0854
commit
781e093d46
1 changed files with 7 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
||||||
const { Command } = require('commander')
|
const { Command } = require('commander')
|
||||||
const file = require('./file')
|
const file = require('./file')
|
||||||
const parser = require('./parser')
|
const grabber = require('epg-grabber')
|
||||||
|
|
||||||
const program = new Command()
|
const program = new Command()
|
||||||
program
|
program
|
||||||
|
@ -16,13 +16,13 @@ file.list('sites/*.channels.xml', options.include, options.exclude).then(files =
|
||||||
}
|
}
|
||||||
|
|
||||||
files.forEach(filename => {
|
files.forEach(filename => {
|
||||||
|
const country = filename.match(/sites\/.*_(.*)\.channels\.xml/i)[1]
|
||||||
|
|
||||||
const channelsFile = file.read(filename)
|
const channelsFile = file.read(filename)
|
||||||
const parsed = parser.parseChannels(channelsFile)
|
const parsed = grabber.parseChannels(channelsFile)
|
||||||
parsed.groups.forEach(group => {
|
|
||||||
matrix.guide.push({
|
matrix.guide.push({
|
||||||
site: parsed.site,
|
site: parsed.site,
|
||||||
country: group.country.toLowerCase()
|
country
|
||||||
})
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue