fix:unzip error
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import pMap from "p-map";
|
||||
import pRetry from "p-retry";
|
||||
import fs from "node:fs"
|
||||
import fse from "fs-extra"
|
||||
import yauzl from "yauzl";
|
||||
import got from "got";
|
||||
@@ -35,7 +36,7 @@ export async function fastdownload(data:[string,string]){
|
||||
const bar = multibar.create(size, 0, {filename: e[1]})
|
||||
try{
|
||||
await pRetry(async()=>{
|
||||
if(!fse.existsSync(e[1])){
|
||||
if(!fs.existsSync(e[1])){
|
||||
await got.get(e[0],{
|
||||
responseType:"buffer",
|
||||
}).on('downloadProgress',(progress)=>{
|
||||
@@ -105,7 +106,7 @@ export async function xfastdownload(
|
||||
url !== null &&
|
||||
url !== "" &&
|
||||
path !== null &&
|
||||
!fse.existsSync(e[1])
|
||||
!fs.existsSync(e[1])
|
||||
) {
|
||||
const res = (await got.get(e[0])).rawBody; //下载文件
|
||||
await fse.outputFile(e[1], res); //保存文件
|
||||
|
||||
Reference in New Issue
Block a user