Update format.js

This commit is contained in:
freearhey 2021-05-06 16:05:29 +03:00
parent b4f46f0bf0
commit af6e6ada81

View File

@ -12,14 +12,14 @@ program
.option('-c, --country <country>', 'Comma-separated list of country codes', '') .option('-c, --country <country>', 'Comma-separated list of country codes', '')
.option('-e, --exclude <exclude>', 'Comma-separated list of country codes to be excluded', '') .option('-e, --exclude <exclude>', 'Comma-separated list of country codes to be excluded', '')
.option('--delay <delay>', 'Delay between parser requests', 1000) .option('--delay <delay>', 'Delay between parser requests', 1000)
.option('--timeout <timeout>', 'Set timeout for each request', 3000) .option('--timeout <timeout>', 'Set timeout for each request', 5000)
.parse(process.argv) .parse(process.argv)
const config = program.opts() const config = program.opts()
const instance = axios.create({ const instance = axios.create({
timeout: config.timeout, timeout: config.timeout,
maxContentLength: 20000, maxContentLength: 200000,
httpsAgent: new https.Agent({ httpsAgent: new https.Agent({
rejectUnauthorized: false rejectUnauthorized: false
}) })
@ -41,14 +41,14 @@ async function main() {
.then(done) .then(done)
} }
if (playlists.length) { // if (playlists.length) {
await loadPlaylist('channels/unsorted.m3u') // await loadPlaylist('channels/unsorted.m3u')
.then(removeUnsortedDuplicates) // .then(removeUnsortedDuplicates)
.then(filterChannels) // .then(filterChannels)
.then(sortChannels) // .then(sortChannels)
.then(savePlaylist) // .then(savePlaylist)
.then(done) // .then(done)
} // }
finish() finish()
} }