mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update load.js
This commit is contained in:
parent
79393806a6
commit
f88f5cce97
1 changed files with 4 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
const _ = require('lodash')
|
const _ = require('lodash')
|
||||||
const { EPGGrabber } = require('epg-grabber')
|
const { EPGGrabber, Channel } = require('epg-grabber')
|
||||||
const { program } = require('commander')
|
const { program } = require('commander')
|
||||||
const { db, logger, timer, file, parser } = require('../../core')
|
const { db, logger, timer, file, parser } = require('../../core')
|
||||||
const dayjs = require('dayjs')
|
const dayjs = require('dayjs')
|
||||||
|
@ -47,9 +47,10 @@ async function main() {
|
||||||
})
|
})
|
||||||
const grabber = new EPGGrabber(config)
|
const grabber = new EPGGrabber(config)
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
await grabber.grab(item.channel, item.date, async (data, err) => {
|
const channel = new Channel(item.channel)
|
||||||
|
await grabber.grab(channel, item.date, async (data, err) => {
|
||||||
logger.info(
|
logger.info(
|
||||||
`[${i}/${total}] ${item.channel.site} (${item.channel.lang}) - ${item.channel.id} - ${dayjs
|
`[${i}/${total}] ${channel.site} (${channel.lang}) - ${channel.id} - ${dayjs
|
||||||
.utc(data.date)
|
.utc(data.date)
|
||||||
.format('MMM D, YYYY')} (${data.programs.length} programs)`
|
.format('MMM D, YYYY')} (${data.programs.length} programs)`
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue