mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 16:40:07 -04:00
parent
c3d6368b04
commit
fbc05ef6d1
1 changed files with 22 additions and 10 deletions
|
@ -6,16 +6,28 @@ export class ConfigLoader {
|
||||||
async load(filepath: string): Promise<SiteConfig> {
|
async load(filepath: string): Promise<SiteConfig> {
|
||||||
const fileUrl = pathToFileURL(filepath).toString()
|
const fileUrl = pathToFileURL(filepath).toString()
|
||||||
const config = (await import(fileUrl)).default
|
const config = (await import(fileUrl)).default
|
||||||
|
const defaultConfig = {
|
||||||
return _.merge(
|
days: 2,
|
||||||
{
|
delay: 0,
|
||||||
delay: 0,
|
output: 'guide.xml',
|
||||||
maxConnections: 1,
|
request: {
|
||||||
request: {
|
method: 'GET',
|
||||||
timeout: 30000
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue