mirror of
https://github.com/shanmiteko/LotteryAutoScript.git
synced 2026-06-04 21:01:17 +08:00
feat: check_if_duplicated可同时使用多种方式
This commit is contained in:
parent
dd994263b9
commit
0ba6acec31
@ -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],
|
||||
|
||||
@ -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)
|
||||
|
||||
|
||||
@ -74,8 +74,9 @@ const config = {
|
||||
* - 不检查 -1
|
||||
* - 通过是否点赞判断 0
|
||||
* - 检索本地dyids文件 1
|
||||
* - 通过是否点赞判断+检索本地dyids文件 2
|
||||
*/
|
||||
check_if_duplicated: 0,
|
||||
check_if_duplicated: 1,
|
||||
|
||||
/**
|
||||
* - 动态创建时间
|
||||
|
||||
@ -88,8 +88,9 @@ module.exports = Object.freeze({
|
||||
* - 不检查 -1
|
||||
* - 通过是否点赞判断 0
|
||||
* - 检索本地dyids文件 1
|
||||
* - 通过是否点赞判断+检索本地dyids文件 2
|
||||
*/
|
||||
check_if_duplicated: 0,
|
||||
check_if_duplicated: 1,
|
||||
|
||||
/**
|
||||
* - 动态创建时间
|
||||
|
||||
Loading…
Reference in New Issue
Block a user