mirror of
https://github.com/iptv-org/epg
synced 2025-12-17 02:47:02 -05:00
Update create-matrix.js
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
const { Command } = require('commander')
|
const { Command } = require('commander')
|
||||||
const file = require('./file')
|
const file = require('./file')
|
||||||
const grabber = require('epg-grabber')
|
|
||||||
|
|
||||||
const program = new Command()
|
const program = new Command()
|
||||||
program
|
program
|
||||||
@@ -16,14 +15,9 @@ 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 [_, site, country] = filename.match(/sites\/.*\/(.*)_(.*)\.channels\.xml/i)
|
||||||
|
|
||||||
const channelsFile = file.read(filename)
|
matrix.guide.push({ site, country })
|
||||||
const parsed = grabber.parseChannels(channelsFile)
|
|
||||||
matrix.guide.push({
|
|
||||||
site: parsed.site,
|
|
||||||
country
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const output = `::set-output name=matrix::${JSON.stringify(matrix)}`
|
const output = `::set-output name=matrix::${JSON.stringify(matrix)}`
|
||||||
|
|||||||
Reference in New Issue
Block a user