From 412f39f78e22434152ef882c0df6c742b2a39ad7 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: Sat, 17 Dec 2022 16:26:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- netease_music/src/getInfo/commentUtils.js | 2 +- netease_music/src/getInfo/songInfoUtils.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/netease_music/src/getInfo/commentUtils.js b/netease_music/src/getInfo/commentUtils.js index bd9cf25..aaaeca6 100644 --- a/netease_music/src/getInfo/commentUtils.js +++ b/netease_music/src/getInfo/commentUtils.js @@ -157,7 +157,7 @@ function getCommitInfoForInsert(songId, comment, commentType) { parent_comment_id: comment.parentCommentId, user_id: comment.user ? comment.user.userId : null, song_id: songId, - content: comment.content, + content: comment.content || "", // 有些 comment 的 content 为 null time: comment.time, like_count: comment.likedCount, comment_type: commentType, // 评论类型 0-comments 1-hotComments 2-topComments diff --git a/netease_music/src/getInfo/songInfoUtils.js b/netease_music/src/getInfo/songInfoUtils.js index a3858b0..39487bf 100644 --- a/netease_music/src/getInfo/songInfoUtils.js +++ b/netease_music/src/getInfo/songInfoUtils.js @@ -24,10 +24,10 @@ async function fetchAll({ args = {} }) { await global.checkIsExit(); var subArray = songIds.slice(i * step, (i + 1) * step); console.log(`${i + 1}/${count} | song: ${fill(subArray[0], 10)}-${fill(subArray.slice(-1)[0], 10)} ${fill(`(${subArray.length})`, 6, ' ', true)} | ${args.min || "?"}-${args.max || "?"}`); - if (subArray.length < 800) { - console.log("小于800首歌,等待凑够800首歌下次一起爬取"); - return; - } + // if (subArray.length < 800) { + // console.log("小于800首歌,等待凑够800首歌下次一起爬取"); + // return; + // } try { await fetch({ songIdArray: subArray }); } catch (err) {