mirror of
https://github.com/iptv-org/epg
synced 2025-12-16 10:26:41 -05:00
@@ -6,16 +6,28 @@ export class ConfigLoader {
|
||||
async load(filepath: string): Promise<SiteConfig> {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user