mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 16:40:07 -04:00
Update create-matrix.js
This commit is contained in:
parent
b6e5da0bcb
commit
faaa83c3ce
1 changed files with 2 additions and 8 deletions
|
@ -1,6 +1,5 @@
|
|||
const { Command } = require('commander')
|
||||
const file = require('./file')
|
||||
const grabber = require('epg-grabber')
|
||||
|
||||
const program = new Command()
|
||||
program
|
||||
|
@ -16,14 +15,9 @@ file.list('sites/*/*.channels.xml', options.include, options.exclude).then(files
|
|||
}
|
||||
|
||||
files.forEach(filename => {
|
||||
const country = filename.match(/sites\/.*\/.*_(.*)\.channels\.xml/i)[1]
|
||||
const [_, site, country] = filename.match(/sites\/.*\/(.*)_(.*)\.channels\.xml/i)
|
||||
|
||||
const channelsFile = file.read(filename)
|
||||
const parsed = grabber.parseChannels(channelsFile)
|
||||
matrix.guide.push({
|
||||
site: parsed.site,
|
||||
country
|
||||
})
|
||||
matrix.guide.push({ site, country })
|
||||
})
|
||||
|
||||
const output = `::set-output name=matrix::${JSON.stringify(matrix)}`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue