mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update grab.js
This commit is contained in:
parent
eef60a1b9d
commit
9e61fec007
1 changed files with 5 additions and 1 deletions
|
@ -16,6 +16,7 @@ const options = program.opts()
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
console.log('Starting...')
|
console.log('Starting...')
|
||||||
|
console.time('Done in')
|
||||||
|
|
||||||
const buffer = {}
|
const buffer = {}
|
||||||
const channels = parseChannels(options.channels).filter(channel => {
|
const channels = parseChannels(options.channels).filter(channel => {
|
||||||
|
@ -46,13 +47,16 @@ async function main() {
|
||||||
.then(results => {
|
.then(results => {
|
||||||
programs = programs.concat(results)
|
programs = programs.concat(results)
|
||||||
})
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.log(` Error: ${err.message}`)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const xml = grabber.convertToXMLTV({ channels, programs })
|
const xml = grabber.convertToXMLTV({ channels, programs })
|
||||||
writeToFile(options.output, xml)
|
writeToFile(options.output, xml)
|
||||||
|
|
||||||
console.log(`File '${options.output}' successfully saved`)
|
console.log(`File '${options.output}' successfully saved`)
|
||||||
console.log('Finish')
|
console.timeEnd(`Done in`)
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue