mirror of
https://github.com/shanmiteko/LotteryAutoScript.git
synced 2026-07-22 21:13:47 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
922dd989bc | ||
|
|
c486abf0ed | ||
|
|
4bbbfc89a7 | ||
|
|
aba17ed0ad | ||
|
|
5a23043466 | ||
|
|
76f715248d | ||
|
|
0d4185d02a | ||
|
|
2ff4ec812b | ||
|
|
20c423fc09 | ||
|
|
6851f29f75 |
@@ -37,5 +37,5 @@ jobs:
|
||||
with:
|
||||
file: "dist/*.zip"
|
||||
delete_file: "dist/*.zip"
|
||||
tag_name: "v*.*.*"
|
||||
tag_name: "v2"
|
||||
overwrite: true
|
||||
|
||||
@@ -1,5 +1,24 @@
|
||||
<!-- markdownlint-disable MD036 MD024-->
|
||||
# CHANGELOG
|
||||
## 主要变化(2.4.4)
|
||||
* c486abf fix: 黑名单不起作用(#92)
|
||||
|
||||
_如果之前版本小于上一版本,请查看[CHANGELOG](CHANGELOG.md)变更说明_
|
||||
|
||||
## 主要变化(2.4.3)
|
||||
* aba17ed feat: 提示关键词修改建议
|
||||
* 5a23043 feat: 只通过是否点赞判断时点赞
|
||||
* 76f7152 fix: 黑名单匹配(#90)
|
||||
* 0d4185d fix(Searcher): getLotteryInfoByUID(#89)
|
||||
|
||||
_如果之前版本小于上一版本,请查看[CHANGELOG](CHANGELOG.md)变更说明_
|
||||
|
||||
## 主要变化(2.4.2)
|
||||
* 20c423f fix: "公共黑名单"显示错误(#87)
|
||||
* 6851f29 fix: 描述中出现undefined(#88)
|
||||
|
||||
_如果之前版本小于上一版本,请查看[CHANGELOG](CHANGELOG.md)变更说明_
|
||||
|
||||
## 主要变化(2.4.1)
|
||||
* 0ba6ace feat: check_if_duplicated可同时使用多种方式
|
||||
* dd99426 fix: 只转已关注功能失效
|
||||
|
||||
+30
-17
@@ -338,10 +338,28 @@ class Monitor extends Searcher {
|
||||
isSendChat =
|
||||
(is_imitator && lottery_info_type === 'uid' && chatmodel !== '00')
|
||||
|| (hasOfficialLottery && chatmodel[0] === '1')
|
||||
|| (!hasOfficialLottery && chatmodel[1] === '1');
|
||||
|| (!hasOfficialLottery && chatmodel[1] === '1'),
|
||||
{ blacklist: remote_blacklist } = use_public_blacklist === false
|
||||
? { blacklist: "" }
|
||||
: global_var.get("remoteconfig"),
|
||||
/**
|
||||
* 获取黑名单并去重合并
|
||||
* @type {string[]}
|
||||
*/
|
||||
new_blacklist = remote_blacklist
|
||||
? [
|
||||
...new Set([...blacklist.split(','),
|
||||
...remote_blacklist.split(',')])
|
||||
]
|
||||
: blacklist.split(','),
|
||||
keys = [dyid, m_uid, ori_uid];
|
||||
|
||||
log.debug("筛选动态", { real_uid, mIsFollowed, oriIsFollowed, realIsFollowed, needAt, needTopic, isRelayDynamic, key_words, has_key_words, blockword, isBlock, isLottery, isSendChat })
|
||||
|
||||
if (!has_key_words && description) {
|
||||
log.warn("筛选动态", `无关键词动态的描述: ${description}\n\n考虑是否修改设置key_words:\n${key_words.join('\n')}`)
|
||||
}
|
||||
|
||||
/**屏蔽词 */
|
||||
if (isBlock) {
|
||||
log.info("筛选动态", `包含屏蔽词(https://t.bilibili.com/${dyid})`)
|
||||
@@ -356,24 +374,19 @@ class Monitor extends Searcher {
|
||||
return false
|
||||
}
|
||||
|
||||
const
|
||||
{ blacklist: remote_blacklist } = use_public_blacklist === false
|
||||
? { blacklist: "" }
|
||||
: global_var.get("remoteconfig"),
|
||||
/* 获取黑名单并去重合并 */
|
||||
new_blacklist = remote_blacklist
|
||||
? [
|
||||
...new Set([...blacklist.split(','),
|
||||
...remote_blacklist.split(',')])
|
||||
].join()
|
||||
: blacklist;
|
||||
|
||||
if ((new RegExp(dyid + '|' + m_uid + '|' + ori_uid)).test(new_blacklist)) {
|
||||
log.info("筛选动态", `公共黑名单用户(https://t.bilibili.com/${dyid})`)
|
||||
if (
|
||||
new_blacklist.some(id => keys.some(key => {
|
||||
if (key + '' === id) {
|
||||
log.info("筛选动态", `黑名单匹配(${id})(https://t.bilibili.com/${dyid})`)
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}))
|
||||
) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
if (isLottery) {
|
||||
let onelotteryinfo = {};
|
||||
|
||||
@@ -530,7 +543,7 @@ class Monitor extends Searcher {
|
||||
}
|
||||
|
||||
/* 点赞 */
|
||||
if (!check_if_duplicated || check_if_duplicated === 2) {
|
||||
if (!check_if_duplicated) {
|
||||
status = await retryfn(
|
||||
5,
|
||||
[1, 2, 3],
|
||||
|
||||
+28
-31
@@ -75,10 +75,10 @@ function parseDynamicCard(dynamic_detail_card) {
|
||||
obj.ctrl = (extend_json && strToJson(extend_json).ctrl) || [];
|
||||
/* 是否有官方抽奖 */
|
||||
obj.hasOfficialLottery = extension && extension.lott && true;
|
||||
/* 转发者的描述 后两个分别是视频动态的描述和视频本身的描述*/
|
||||
/* 转发者的描述 纯文字内容 图片动态描述 后两个分别是视频动态的描述和视频本身的描述*/
|
||||
obj.description =
|
||||
(item && (item.content + item.description))
|
||||
|| (cardToJson.dynamic + cardToJson.desc)
|
||||
(item && (item.content || '' + item.description || ''))
|
||||
|| (cardToJson.dynamic || '' + cardToJson.desc || '')
|
||||
|| '';
|
||||
if (obj.type === 1) {
|
||||
const { origin_extension, origin } = cardToJson
|
||||
@@ -98,8 +98,8 @@ function parseDynamicCard(dynamic_detail_card) {
|
||||
obj.origin_uname = (user && (user.name || user.uname)) || '';
|
||||
/* 被转发者的描述 */
|
||||
obj.origin_description =
|
||||
(item && (item.content + item.description))
|
||||
|| (originToJson.dynamic + originToJson.desc)
|
||||
(item && (item.content || '' + item.description || ''))
|
||||
|| (originToJson.dynamic || '' + originToJson.desc || '')
|
||||
|| '';
|
||||
}
|
||||
|
||||
@@ -241,38 +241,35 @@ class Searcher {
|
||||
}
|
||||
})
|
||||
.reduce(async (pre, cur) => {
|
||||
const results = await pre
|
||||
, { origin_dynamic_id } = cur;
|
||||
|
||||
const card = await bili.getOneDynamicByDyid(origin_dynamic_id)
|
||||
|
||||
if (card) {
|
||||
await utils.delay(get_dynamic_detail_wait)
|
||||
|
||||
const { is_liked } = parseDynamicCard(card)
|
||||
let
|
||||
results = await pre,
|
||||
{ origin_dynamic_id } = cur,
|
||||
is_liked = false;
|
||||
|
||||
if (!check_if_duplicated || check_if_duplicated === 2) {
|
||||
const card = await bili.getOneDynamicByDyid(origin_dynamic_id)
|
||||
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
|
||||
}]
|
||||
if (card) {
|
||||
({ is_liked } = parseDynamicCard(card))
|
||||
}
|
||||
await utils.delay(get_dynamic_detail_wait)
|
||||
}
|
||||
|
||||
return results
|
||||
results.push({
|
||||
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
|
||||
}, Promise.resolve([]))
|
||||
|
||||
log.info('获取动态', `成功获取用户${UID}的动态信息`);
|
||||
|
||||
+2
-2
@@ -49,8 +49,8 @@ const config = {
|
||||
* 符合js正则表达式的字符串
|
||||
*/
|
||||
key_words: [
|
||||
"[抽奖送]",
|
||||
"[转关评]"
|
||||
"[抽奖送揪]|福利",
|
||||
"[转关评粉]|参与"
|
||||
],
|
||||
|
||||
/**
|
||||
|
||||
@@ -63,8 +63,8 @@ module.exports = Object.freeze({
|
||||
* 符合js正则表达式的字符串
|
||||
*/
|
||||
key_words: [
|
||||
"[抽奖送]",
|
||||
"[转关评]"
|
||||
"[抽奖送揪]|福利",
|
||||
"[转关评粉]|参与"
|
||||
],
|
||||
|
||||
/**
|
||||
@@ -244,6 +244,7 @@ module.exports = Object.freeze({
|
||||
at_users: [['转发抽奖娘', 294887687], ['你的工具人老公', 100680137]],
|
||||
|
||||
/**
|
||||
* - 动态dyid或UID
|
||||
* - 英文逗号分隔 如: 1,2,3
|
||||
*/
|
||||
blacklist: '',
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lottery-auto-script",
|
||||
"version": "2.4.1",
|
||||
"version": "2.4.4",
|
||||
"description": "自动参与B站动态抽奖",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user