mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 16:40:07 -04:00
Update update.js
This commit is contained in:
parent
0afc0a864a
commit
0b25372b13
1 changed files with 5 additions and 3 deletions
|
@ -32,11 +32,13 @@ async function main() {
|
||||||
channels = Object.values(channels)
|
channels = Object.values(channels)
|
||||||
channels = _.sortBy(channels, 'id')
|
channels = _.sortBy(channels, 'id')
|
||||||
|
|
||||||
const filepath = `${PUBLIC_DIR}/guides/${key}.epg.xml.gz`
|
const gzFilepath = `${PUBLIC_DIR}/guides/${key}.epg.xml.gz`
|
||||||
logger.info(`Creating "${filepath}"...`)
|
const jsonFilepath = `${PUBLIC_DIR}/guides/${key}.epg.json`
|
||||||
|
logger.info(`Creating "${gzFilepath}"...`)
|
||||||
const xmltv = generateXMLTV({ channels, programs, date: CURR_DATE })
|
const xmltv = generateXMLTV({ channels, programs, date: CURR_DATE })
|
||||||
const compressed = await zip.compress(xmltv)
|
const compressed = await zip.compress(xmltv)
|
||||||
await file.create(filepath, compressed)
|
await file.create(gzFilepath, compressed)
|
||||||
|
await file.create(jsonFilepath, JSON.stringify({ channels, programs }))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!total) {
|
if (!total) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue