diff --git a/lib/core/monitor.js b/lib/core/monitor.js index 61551f3..58ef109 100644 --- a/lib/core/monitor.js +++ b/lib/core/monitor.js @@ -256,13 +256,16 @@ class Monitor extends Searcher { log.info('筛选动态', `去重后(${protoLotteryInfo.length})`); /**并发查询dyid */ - await Promise.all( - [...dyids_map.keys()] - .map(it => d_storage - .searchDyid(it) - .then(hasIt => dyids_map.set(it, hasIt)) - ) - ) + if (check_if_duplicated === 1 || check_if_duplicated === 2) { + await Promise.all( + [...dyids_map.keys()] + .map(it => d_storage + .searchDyid(it) + .then(hasIt => dyids_map.set(it, hasIt)) + ) + ) + log.info('筛选动态', `并发查询本地dyid完毕`); + } if (lottery_param[0] !== "APIs" && set_lottery_info_url && protoLotteryInfo.length) { log.info("上传抽奖信息", "开始") @@ -299,9 +302,9 @@ class Monitor extends Searcher { /* 遇到转发过就退出 */ if ( - (!check_if_duplicated + ((!check_if_duplicated || check_if_duplicated === 2) && is_liked) - || (check_if_duplicated === 1 + || ((check_if_duplicated === 1 || check_if_duplicated === 2) && dyids_map.get(dyid)) ) { log.info("筛选动态", `已转发(https://t.bilibili.com/${dyid})`) @@ -527,7 +530,7 @@ class Monitor extends Searcher { } /* 点赞 */ - if (!check_if_duplicated) { + if (!check_if_duplicated || check_if_duplicated === 2) { status = await retryfn( 5, [1, 2, 3], diff --git a/lib/core/searcher.js b/lib/core/searcher.js index c6bb306..0cf0e5a 100644 --- a/lib/core/searcher.js +++ b/lib/core/searcher.js @@ -380,9 +380,9 @@ class Searcher { , { is_liked } = parsed_card; if ( - (!check_if_duplicated + ((!check_if_duplicated || check_if_duplicated === 2) && is_liked) - || (check_if_duplicated === 1 + || ((check_if_duplicated === 1 || check_if_duplicated === 2) && await d_storage.searchDyid(dyid)) ) { log.info('获取动态', `动态(${dyid})已转发过`) @@ -454,7 +454,7 @@ class Searcher { let results = await pre , { dyid } = cur; - if (!check_if_duplicated) { + if (!check_if_duplicated || check_if_duplicated === 2) { log.info('获取动态', `查看动态(${dyid})是否点赞 (${length--})`) const card = await bili.getOneDynamicByDyid(dyid) diff --git a/lib/data/config.js b/lib/data/config.js index 3b0cc5e..8954948 100644 --- a/lib/data/config.js +++ b/lib/data/config.js @@ -74,8 +74,9 @@ const config = { * - 不检查 -1 * - 通过是否点赞判断 0 * - 检索本地dyids文件 1 + * - 通过是否点赞判断+检索本地dyids文件 2 */ - check_if_duplicated: 0, + check_if_duplicated: 1, /** * - 动态创建时间 diff --git a/my_config.example.js b/my_config.example.js index c371dbe..ba3312b 100644 --- a/my_config.example.js +++ b/my_config.example.js @@ -88,8 +88,9 @@ module.exports = Object.freeze({ * - 不检查 -1 * - 通过是否点赞判断 0 * - 检索本地dyids文件 1 + * - 通过是否点赞判断+检索本地dyids文件 2 */ - check_if_duplicated: 0, + check_if_duplicated: 1, /** * - 动态创建时间