From fbc05ef6d1ac817e4fdd4a38790a05d3f07a0dac Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Mon, 27 Nov 2023 17:23:31 +0300 Subject: [PATCH] Update configLoader.ts https://github.com/iptv-org/epg/issues/2259 --- scripts/core/configLoader.ts | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/scripts/core/configLoader.ts b/scripts/core/configLoader.ts index 31c29c76..36c93d20 100644 --- a/scripts/core/configLoader.ts +++ b/scripts/core/configLoader.ts @@ -6,16 +6,28 @@ export class ConfigLoader { async load(filepath: string): Promise { const fileUrl = pathToFileURL(filepath).toString() const config = (await import(fileUrl)).default - - return _.merge( - { - delay: 0, - maxConnections: 1, - request: { - timeout: 30000 - } + const defaultConfig = { + days: 2, + delay: 0, + output: 'guide.xml', + request: { + method: 'GET', + maxContentLength: 5242880, + timeout: 30000, + withCredentials: true, + jar: null, + responseType: 'arraybuffer', + cache: false, + headers: null, + data: null }, - config - ) + maxConnections: 1, + site: undefined, + url: undefined, + parser: undefined, + channels: undefined + } + + return _.merge(defaultConfig, config) } }