From d55be900df02bac5935d1e4ba582eed7e3ae24dd Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Tue, 10 Jan 2023 11:20:36 +0300 Subject: [PATCH] Update epg-grabber.js --- bin/epg-grabber.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/epg-grabber.js b/bin/epg-grabber.js index 7072457..e84a1cd 100755 --- a/bin/epg-grabber.js +++ b/bin/epg-grabber.js @@ -23,7 +23,7 @@ program .option('-o, --output ', 'Path to output file') .option('--channels ', 'Path to channels.xml file') .option('--lang ', 'Set default language for all programs') - .option('--days ', 'Number of days for which to grab the program', parseNumber, 1) + .option('--days ', 'Number of days for which to grab the program', parseNumber) .option('--delay ', 'Delay between requests (in mileseconds)', parseNumber) .option('--timeout ', 'Set a timeout for each request (in mileseconds)', parseNumber) .option( @@ -72,10 +72,11 @@ async function main() { let programs = [] let i = 1 - let days = options.days || 1 + let days = config.days || 1 const total = channels.length * days const utcDate = getUTCDate() - const dates = Array.from({ length: config.days }, (_, i) => utcDate.add(i, 'd')) + const dates = Array.from({ length: days }, (_, i) => utcDate.add(i, 'd')) + console.log(dates) for (let channel of channels) { if (!channel.logo && config.logo) { channel.logo = await grabber.loadLogo(channel)