yz-yuki-plugin 2.0.8-8 → 2.0.8-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -191,7 +191,9 @@ class BiliTask {
|
|
|
191
191
|
if (getWhiteWords && Array.isArray(getWhiteWords) && getWhiteWords.length > 0) {
|
|
192
192
|
// 构建白名单关键字正则表达式,转义特殊字符
|
|
193
193
|
const whiteWords = new RegExp(getWhiteWords.map(word => word.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|'), 'g');
|
|
194
|
-
|
|
194
|
+
const content = `${extentData?.title}${extentData?.content}`;
|
|
195
|
+
if (!whiteWords.test(content)) {
|
|
196
|
+
logger.info(`UP主 "${upName}" B站动态:白名单关键词已开启,但动态消息未匹配,已跳过推送`);
|
|
195
197
|
return; // 如果动态消息不在白名单中,则直接返回
|
|
196
198
|
}
|
|
197
199
|
}
|
|
@@ -201,7 +203,10 @@ class BiliTask {
|
|
|
201
203
|
if (getBanWords && Array.isArray(getBanWords) && getBanWords.length > 0) {
|
|
202
204
|
// 构建屏蔽关键字正则表达式,转义特殊字符
|
|
203
205
|
const banWords = new RegExp(getBanWords.map(word => word.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|'), 'g');
|
|
204
|
-
|
|
206
|
+
const content = `${extentData?.title}${extentData?.content}`;
|
|
207
|
+
const matched = content.match(banWords);
|
|
208
|
+
if (matched) {
|
|
209
|
+
logger.info(`UP主 "${upName}" B站动态:触发屏蔽关键词 "${matched.join(', ')}" ,已跳过推送`);
|
|
205
210
|
return; // 如果动态消息包含屏蔽关键字,则直接返回
|
|
206
211
|
}
|
|
207
212
|
}
|
|
@@ -244,6 +249,7 @@ class BiliTask {
|
|
|
244
249
|
// 构建白名单关键字正则表达式,转义特殊字符
|
|
245
250
|
const whiteWords = new RegExp(getWhiteWords.map(word => word.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|'), 'g');
|
|
246
251
|
if (!whiteWords.test(dynamicMsg.msg.join(''))) {
|
|
252
|
+
logger.info(`UP主 "${upName}" B站动态:白名单关键词已开启,但动态消息未匹配,已跳过推送`);
|
|
247
253
|
return; // 如果动态消息不在白名单中,则直接返回
|
|
248
254
|
}
|
|
249
255
|
}
|
|
@@ -253,8 +259,11 @@ class BiliTask {
|
|
|
253
259
|
if (getBanWords && Array.isArray(getBanWords) && getBanWords.length > 0) {
|
|
254
260
|
// 构建屏蔽关键字正则表达式,转义特殊字符
|
|
255
261
|
const banWords = new RegExp(getBanWords.map(word => word.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|'), 'g');
|
|
256
|
-
|
|
257
|
-
|
|
262
|
+
const content = dynamicMsg.msg.join('');
|
|
263
|
+
const matched = content.match(banWords);
|
|
264
|
+
if (matched) {
|
|
265
|
+
logger.info(`UP主 "${upName}" B站动态:触发屏蔽关键词 "${matched.join(', ')}" ,已跳过推送`);
|
|
266
|
+
return; // 如果动态消息包含屏蔽关键字,则直接返回
|
|
258
267
|
}
|
|
259
268
|
}
|
|
260
269
|
else if (getBanWords && !Array.isArray(getBanWords)) {
|
|
@@ -156,7 +156,9 @@ class WeiboTask {
|
|
|
156
156
|
if (getWhiteWords && Array.isArray(getWhiteWords) && getWhiteWords.length > 0) {
|
|
157
157
|
// 构建白名单关键字正则表达式,转义特殊字符
|
|
158
158
|
const whiteWords = new RegExp(getWhiteWords.map(word => word.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|'), 'g');
|
|
159
|
-
|
|
159
|
+
const content = `${data?.title}${data?.content}`;
|
|
160
|
+
if (!whiteWords.test(content)) {
|
|
161
|
+
logger.info(`博主 "${upName}" 微博动态:白名单关键词已开启,但动态消息未匹配,已跳过推送`);
|
|
160
162
|
return; // 如果动态消息不在白名单中,则直接返回
|
|
161
163
|
}
|
|
162
164
|
}
|
|
@@ -166,8 +168,11 @@ class WeiboTask {
|
|
|
166
168
|
if (getBanWords && Array.isArray(getBanWords) && getBanWords.length > 0) {
|
|
167
169
|
// 构建屏蔽关键字正则表达式,转义特殊字符
|
|
168
170
|
const banWords = new RegExp(getBanWords.map(word => word.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|'), 'g');
|
|
169
|
-
|
|
170
|
-
|
|
171
|
+
const content = `${data?.title}${data?.content}`;
|
|
172
|
+
const matched = content.match(banWords);
|
|
173
|
+
if (matched) {
|
|
174
|
+
logger.info(`博主 "${upName}" 微博动态:触发屏蔽关键词 "${matched.join(', ')}" ,已跳过推送`);
|
|
175
|
+
return; // 如果动态消息包含屏蔽关键字,则直接返回
|
|
171
176
|
}
|
|
172
177
|
}
|
|
173
178
|
else if (getBanWords && !Array.isArray(getBanWords)) {
|
|
@@ -210,6 +215,7 @@ class WeiboTask {
|
|
|
210
215
|
// 构建白名单关键字正则表达式,转义特殊字符
|
|
211
216
|
const whiteWords = new RegExp(getWhiteWords.map(word => word.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|'), 'g');
|
|
212
217
|
if (!whiteWords.test(dynamicMsg.msg.join(''))) {
|
|
218
|
+
logger.info(`博主 "${upName}" 微博动态:白名单关键词已开启,但动态消息未匹配,已跳过推送`);
|
|
213
219
|
return; // 如果动态消息不在白名单中,则直接返回
|
|
214
220
|
}
|
|
215
221
|
}
|
|
@@ -219,8 +225,11 @@ class WeiboTask {
|
|
|
219
225
|
if (getBanWords && Array.isArray(getBanWords) && getBanWords.length > 0) {
|
|
220
226
|
// 构建屏蔽关键字正则表达式,转义特殊字符
|
|
221
227
|
const banWords = new RegExp(getBanWords.map(word => word.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|'), 'g');
|
|
222
|
-
|
|
223
|
-
|
|
228
|
+
const content = dynamicMsg.msg.join('');
|
|
229
|
+
const matched = content.match(banWords);
|
|
230
|
+
if (matched) {
|
|
231
|
+
logger.info(`博主 "${upName}" 微博动态:触发屏蔽关键词 "${matched.join(', ')}" ,已跳过推送`);
|
|
232
|
+
return; // 如果动态消息包含屏蔽关键字,则直接返回
|
|
224
233
|
}
|
|
225
234
|
}
|
|
226
235
|
else if (getBanWords && !Array.isArray(getBanWords)) {
|