mirror of
https://github.com/iptv-org/epg
synced 2025-12-16 10:26:41 -05:00
Update grab.js
This commit is contained in:
@@ -31,8 +31,10 @@ async function main() {
|
|||||||
for (let channel of channels) {
|
for (let channel of channels) {
|
||||||
const configPath = `sites/${channel.site}.config.js`
|
const configPath = `sites/${channel.site}.config.js`
|
||||||
const config = require(path.resolve(configPath))
|
const config = require(path.resolve(configPath))
|
||||||
await grabber.grab(channel, config, result => {
|
await grabber.grab(channel, config, (item, err) => {
|
||||||
result.on('data', function (item) {
|
if (err) {
|
||||||
|
console.log(` Error: ${err.message}`)
|
||||||
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
` ${item.channel.site} - ${item.channel.xmltv_id} - ${item.date.format(
|
` ${item.channel.site} - ${item.channel.xmltv_id} - ${item.date.format(
|
||||||
'MMM D, YYYY'
|
'MMM D, YYYY'
|
||||||
@@ -40,11 +42,7 @@ async function main() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
programs = programs.concat(item.programs)
|
programs = programs.concat(item.programs)
|
||||||
})
|
}
|
||||||
|
|
||||||
result.on('error', function (err) {
|
|
||||||
console.log(` Error: ${err.message}`)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user