mirror of
https://github.com/iptv-org/epg
synced 2025-12-18 11:27:06 -05:00
Update update.js
This commit is contained in:
@@ -10,25 +10,30 @@ const options = program
|
|||||||
.opts()
|
.opts()
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
await api.countries.load()
|
|
||||||
const files = await file.list(CHANNELS_PATH)
|
|
||||||
const items = []
|
const items = []
|
||||||
for (const filepath of files) {
|
|
||||||
const { site, channels } = await parser.parseChannels(filepath)
|
|
||||||
const dir = file.dirname(filepath)
|
|
||||||
const config = require(file.resolve(`${dir}/${site}.config.js`))
|
|
||||||
if (config.ignore) continue
|
|
||||||
|
|
||||||
const filename = file.basename(filepath)
|
try {
|
||||||
const [__, suffix] = filename.match(/\_(.*)\.channels\.xml$/) || [null, null]
|
await api.countries.load()
|
||||||
const [code] = suffix.split('-')
|
const files = await file.list(CHANNELS_PATH)
|
||||||
|
for (const filepath of files) {
|
||||||
|
const { site, channels } = await parser.parseChannels(filepath)
|
||||||
|
const dir = file.dirname(filepath)
|
||||||
|
const config = require(file.resolve(`${dir}/${site}.config.js`))
|
||||||
|
if (config.ignore) continue
|
||||||
|
|
||||||
items.push({
|
const filename = file.basename(filepath)
|
||||||
code,
|
const [__, suffix] = filename.match(/\_(.*)\.channels\.xml$/) || [null, null]
|
||||||
site,
|
const [code] = suffix.split('-')
|
||||||
count: channels.length,
|
|
||||||
group: `${suffix}/${site}`
|
items.push({
|
||||||
})
|
code,
|
||||||
|
site,
|
||||||
|
count: channels.length,
|
||||||
|
group: `${suffix}/${site}`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
await generateCountriesTable(items)
|
await generateCountriesTable(items)
|
||||||
|
|||||||
Reference in New Issue
Block a user