From 5a88a2b13aff62212103c210755768c5264c3428 Mon Sep 17 00:00:00 2001 From: blackmatrix7 <27717518+blackmatrix7@users.noreply.github.com> Date: Wed, 12 Oct 2022 09:42:10 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BB=80=E4=B9=88=E5=80=BC=E5=BE=97=E4=B9=B0]?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E4=B8=8D=E8=83=BD=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=94=B6=E8=97=8F=E6=96=87=E7=AB=A0=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/smzdm/smzdm_daily.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/script/smzdm/smzdm_daily.js b/script/smzdm/smzdm_daily.js index 7cbb2511a..0deb68efa 100644 --- a/script/smzdm/smzdm_daily.js +++ b/script/smzdm/smzdm_daily.js @@ -374,10 +374,10 @@ function clickFavArticle(articleId) { .then((resp) => { const obj = resp.body; if (obj.error_code == 0) { - $.logger.debug(`好文${articleId}收藏成功`); + $.logger.info(`好文${articleId}收藏成功`); resolve(true); } else if (obj.error_code == 2) { - $.logger.debug(`好文${articleId}取消收藏成功`); + $.logger.info(`好文${articleId}取消收藏成功`); resolve(true); } else { $.logger.error(`好文${articleId}收藏失败,${JSON.stringify(obj)}`); @@ -425,7 +425,7 @@ function favArticles() { }); let favArticlesId = articlesId.splice(0, clickFavArticleMaxTimes); if (favArticlesId.length > 0) { - // 加入收藏 + // 加入收藏与取消收藏 for (let articleId of favArticlesId) { await $.utils .retry( @@ -441,10 +441,7 @@ function favArticles() { .catch((err) => { $.logger.error(`文章加入收藏失败,${err}`); }); - await $.utils.sleep(500); - } - // 取消收藏 - for (let articleId of articlesId) { + await $.utils.sleep(1000); await $.utils .retry( clickFavArticle, @@ -454,6 +451,7 @@ function favArticles() { .catch((err) => { $.logger.error(`文章取消收藏失败,${err}`); }); + await $.utils.sleep(1000); } } resolve(success);