Рефакторинг

This commit is contained in:
Book Pauk
2022-10-15 18:59:13 +07:00
parent f519bf3f67
commit 0894a38978
2 changed files with 6 additions and 10 deletions

View File

@@ -9,10 +9,10 @@ class FileDownloader {
this.limitDownloadSize = limitDownloadSize;
}
async load(url, callback, abort) {
async load(url, opts, callback, abort) {
let errMes = '';
const options = {
let options = {
headers: {
'user-agent': userAgent,
timeout: 300*1000,
@@ -22,6 +22,8 @@ class FileDownloader {
}),
responseType: 'stream',
};
if (opts)
options = Object.assign({}, opts, options);
try {
const res = await axios.get(url, options);