Add `--timeout` parameter

This commit is contained in:
freearhey 2021-01-19 00:01:25 +03:00
parent 5751506340
commit 5a378b8c42
1 changed files with 3 additions and 1 deletions

View File

@ -2,7 +2,6 @@ const { program } = require('commander')
const helper = require('./helper')
const axios = require('axios')
const ProgressBar = require('progress')
const instance = axios.create({ timeout: 1000, maxContentLength: 1000 })
program
.version('1.0.0', '-v, --version')
@ -13,10 +12,13 @@ program
.option('--epg', 'Turn on EPG parser')
.option('--resolution', 'Turn on resolution parser')
.option('--delay <delay>', 'Delay between parser requests', 0)
.option('--timeout <timeout>', 'Set timeout for each request', 5000)
.parse(process.argv)
const config = program.opts()
const instance = axios.create({ timeout: config.timeout, maxContentLength: 1000 })
let globalBuffer = []
let bar