From f22a9c52280c01df21497483a198e93e7f120105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E5=B0=8F=E5=A2=A8?= <2291200076@qq.com> Date: Wed, 9 Nov 2022 13:23:35 +0800 Subject: [PATCH] =?UTF-8?q?comment=20=E6=89=93=E5=8D=B0=20current=5Ftime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- netease_music/src/getInfo/commentUtils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/netease_music/src/getInfo/commentUtils.js b/netease_music/src/getInfo/commentUtils.js index e219fb2..ef47b9e 100644 --- a/netease_music/src/getInfo/commentUtils.js +++ b/netease_music/src/getInfo/commentUtils.js @@ -64,7 +64,7 @@ async function fetch({ songId, debug = false }) { let isFinish = false; let pageCount = 0; while (!isFinish) { await global.checkIsExit(); - console.log(`comment: ${songId}, page: ${++pageCount}`); + console.log(`comment: ${songId}, page: ${++pageCount}, currentTime: ${progress.currentTime}`); // 是否是第一页 let isFirstPage = progress.currentStatus === 0; @@ -74,8 +74,8 @@ async function fetch({ songId, debug = false }) { var commentResult = await comment_music(queryParams); // fs.writeFileSync(path.join(__dirname, "../../temp", `comment-${songId}-${pageCount}.json`), JSON.stringify(commentResult)); } catch (errors) { - console.error(errors); - await sleepUtils.sleep(1000); + console.error("error", errors); + await sleepUtils.sleep(3000); continue; } @@ -129,7 +129,7 @@ async function fetch({ songId, debug = false }) { progress.total = commentResult.body.total; } else { isFinish = true; - console.log(`comment: ${songId} 结束了`); + console.log(`comment: ${songId} done`); progress.currentStatus = 2; // 0-等待爬取/增量爬取 1-爬取中 2-完成 if (progress.maxTime == 0) { // 第一次爬取 且 没有分页的情况 progress.maxTime = comments[0] ? (comments[0].time || 0) : 0;