mirror of
https://github.com/shanmiteko/LotteryAutoScript.git
synced 2026-06-04 21:01:17 +08:00
pref: 增加筛选时日志输出(#79)
This commit is contained in:
parent
07ef8dfb2e
commit
608b1fb83e
2
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
2
.github/ISSUE_TEMPLATE/bug_report.yaml
vendored
@ -60,7 +60,7 @@ body:
|
|||||||
attributes:
|
attributes:
|
||||||
label: "运行日志"
|
label: "运行日志"
|
||||||
description: |
|
description: |
|
||||||
控制台日志。
|
控制台日志,请用md代码格式上传,日志内容过多时请上传文件
|
||||||
placeholder: |
|
placeholder: |
|
||||||
```
|
```
|
||||||
请在此黏贴运行日志。
|
请在此黏贴运行日志。
|
||||||
|
|||||||
@ -210,6 +210,8 @@ class Monitor extends Searcher {
|
|||||||
return true
|
return true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
log.info('筛选动态', `去重后(${protoLotteryInfo.length})`);
|
||||||
|
|
||||||
if (lottery_param[0] !== "APIs" && set_lottery_info_url && protoLotteryInfo.length) {
|
if (lottery_param[0] !== "APIs" && set_lottery_info_url && protoLotteryInfo.length) {
|
||||||
log.info("上传抽奖信息", "开始")
|
log.info("上传抽奖信息", "开始")
|
||||||
await new Promise((resolve) => {
|
await new Promise((resolve) => {
|
||||||
@ -240,10 +242,16 @@ class Monitor extends Searcher {
|
|||||||
hasOfficialLottery
|
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
|
const
|
||||||
/**判断是转发源动态还是现动态 */
|
/**判断是转发源动态还是现动态 */
|
||||||
@ -266,17 +274,26 @@ class Monitor extends Searcher {
|
|||||||
|| (!hasOfficialLottery && chatmodel[1] === '1');
|
|| (!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")
|
const { blacklist: remote_blacklist } = global_var.get("remoteconfig")
|
||||||
, new_blacklist = remote_blacklist
|
, new_blacklist = remote_blacklist
|
||||||
? [...new Set([...blacklist.split(','), ...remote_blacklist.split(',')])].join()
|
? [...new Set([...blacklist.split(','), ...remote_blacklist.split(',')])].join()
|
||||||
: blacklist;
|
: 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) {
|
if (isLottery) {
|
||||||
@ -354,6 +371,8 @@ class Monitor extends Searcher {
|
|||||||
if (isSendChat) onelotteryinfo.rid = rid;
|
if (isSendChat) onelotteryinfo.rid = rid;
|
||||||
|
|
||||||
alllotteryinfo.push(onelotteryinfo);
|
alllotteryinfo.push(onelotteryinfo);
|
||||||
|
} else {
|
||||||
|
log.info("筛选动态", `非抽奖动态(${dyid})`)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -247,21 +247,21 @@ class Searcher {
|
|||||||
log.info('获取动态', `查看源动态(${origin_dynamic_id})是否点赞 (${length--})`)
|
log.info('获取动态', `查看源动态(${origin_dynamic_id})是否点赞 (${length--})`)
|
||||||
if (is_liked) {
|
if (is_liked) {
|
||||||
log.info('获取动态', `动态(${origin_dynamic_id})已转发过`)
|
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
|
return results
|
||||||
@ -452,11 +452,10 @@ class Searcher {
|
|||||||
log.info('获取动态', `查看动态(${dyid})是否点赞 (${length--})`)
|
log.info('获取动态', `查看动态(${dyid})是否点赞 (${length--})`)
|
||||||
if (is_liked) {
|
if (is_liked) {
|
||||||
log.info('获取动态', `动态(${dyid})已转发过`)
|
log.info('获取动态', `动态(${dyid})已转发过`)
|
||||||
|
} else {
|
||||||
|
cur.is_liked = is_liked
|
||||||
|
return [...results, cur]
|
||||||
}
|
}
|
||||||
|
|
||||||
cur.is_liked = is_liked
|
|
||||||
|
|
||||||
return [...results, cur]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user