diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index ace02e1..e517512 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -60,7 +60,7 @@ body: attributes: label: "运行日志" description: | - 控制台日志。 + 控制台日志,请用md代码格式上传,日志内容过多时请上传文件 placeholder: | ``` 请在此黏贴运行日志。 diff --git a/lib/core/monitor.js b/lib/core/monitor.js index 6498667..312f3b5 100644 --- a/lib/core/monitor.js +++ b/lib/core/monitor.js @@ -210,6 +210,8 @@ class Monitor extends Searcher { return true }); + log.info('筛选动态', `去重后(${protoLotteryInfo.length})`); + if (lottery_param[0] !== "APIs" && set_lottery_info_url && protoLotteryInfo.length) { log.info("上传抽奖信息", "开始") await new Promise((resolve) => { @@ -240,10 +242,16 @@ class Monitor extends Searcher { hasOfficialLottery }) { /* 遇到转发过就退出 */ - if (is_liked) return false; + if (is_liked) { + log.info("筛选动态", `已转发(${dyid})`) + return false + } /* 超过指定时间退出 */ - if (now_ts - create_time > max_create_time * 86400) return false; + if (now_ts - create_time > max_create_time * 86400) { + log.info("筛选动态", `过时动态(${dyid})`) + return false + } const /**判断是转发源动态还是现动态 */ @@ -266,17 +274,26 @@ class Monitor extends Searcher { || (!hasOfficialLottery && chatmodel[1] === '1'); /**屏蔽词 */ - if (isBlock) return false; + if (isBlock) { + log.info("筛选动态", `包含屏蔽词(${dyid})`) + return false + } /**若勾选只转已关注 */ - if (only_followed && !isFollowed) return false; + if (only_followed && !isFollowed) { + log.info("筛选动态", `只转已关注(${dyid})`) + return false + } /* 获取黑名单并去重合并 */ const { blacklist: remote_blacklist } = global_var.get("remoteconfig") , new_blacklist = remote_blacklist ? [...new Set([...blacklist.split(','), ...remote_blacklist.split(',')])].join() : blacklist; - if ((new RegExp(dyid + '|' + uid)).test(new_blacklist)) return false; + if ((new RegExp(dyid + '|' + uid)).test(new_blacklist)) { + log.info("筛选动态", `黑名单用户(${dyid})`) + return false + } if (isLottery) { @@ -354,6 +371,8 @@ class Monitor extends Searcher { if (isSendChat) onelotteryinfo.rid = rid; alllotteryinfo.push(onelotteryinfo); + } else { + log.info("筛选动态", `非抽奖动态(${dyid})`) } }) diff --git a/lib/core/searcher.js b/lib/core/searcher.js index 66a99ae..2ac3f98 100644 --- a/lib/core/searcher.js +++ b/lib/core/searcher.js @@ -247,21 +247,21 @@ class Searcher { log.info('获取动态', `查看源动态(${origin_dynamic_id})是否点赞 (${length--})`) if (is_liked) { log.info('获取动态', `动态(${origin_dynamic_id})已转发过`) + } else { + return [...results, { + lottery_info_type: 'uid', + create_time: cur.origin_create_time, + is_liked, + uids: [cur.uid, cur.origin_uid], + uname: cur.origin_uname, + ctrl: [], + dyid: cur.origin_dynamic_id, + rid: cur.origin_rid_str, + des: cur.origin_description, + type: cur.orig_type, + hasOfficialLottery: cur.origin_hasOfficialLottery + }] } - - return [...results, { - lottery_info_type: 'uid', - create_time: cur.origin_create_time, - is_liked, - uids: [cur.uid, cur.origin_uid], - uname: cur.origin_uname, - ctrl: [], - dyid: cur.origin_dynamic_id, - rid: cur.origin_rid_str, - des: cur.origin_description, - type: cur.orig_type, - hasOfficialLottery: cur.origin_hasOfficialLottery - }] } return results @@ -452,11 +452,10 @@ class Searcher { log.info('获取动态', `查看动态(${dyid})是否点赞 (${length--})`) if (is_liked) { log.info('获取动态', `动态(${dyid})已转发过`) + } else { + cur.is_liked = is_liked + return [...results, cur] } - - cur.is_liked = is_liked - - return [...results, cur] } return results