yz-yuki-plugin 2.0.7-22 → 2.0.7-24
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/defaultConfig/bilibili/config.yaml +3 -3
- package/defaultConfig/weibo/config.yaml +3 -3
- package/lib/models/bilibili/bilibili.main.query.js +10 -4
- package/lib/models/weibo/weibo.main.query.js +4 -4
- package/package.json +1 -1
- package/resources/css/dynamic/Content.css +15 -0
- package/resources/img/icon/dynamic/bili-rich-text-link-video.svg +1 -0
|
@@ -32,13 +32,13 @@ getDataRandomDelay: 8000
|
|
|
32
32
|
pushTransmit: 1
|
|
33
33
|
|
|
34
34
|
# 推送文字和图文动态时,限制发送多少张图片
|
|
35
|
-
pushPicCountLimit:
|
|
35
|
+
pushPicCountLimit: 9
|
|
36
36
|
|
|
37
37
|
# 推送文字和图文动态时,限制字数是多少
|
|
38
|
-
pushContentLenLimit:
|
|
38
|
+
pushContentLenLimit: 1000
|
|
39
39
|
|
|
40
40
|
# 推送文字和图文动态时,限制多少行文本
|
|
41
|
-
pushContentLineLimit:
|
|
41
|
+
pushContentLineLimit: 100
|
|
42
42
|
|
|
43
43
|
# 是否展示定时任务的日志,0 不显示 1 显示
|
|
44
44
|
pushTaskLog: 1
|
|
@@ -27,13 +27,13 @@ dynamicTimeRange: 7200
|
|
|
27
27
|
pushTransmit: 1
|
|
28
28
|
|
|
29
29
|
# 推送动态时,限制发送多少张图片
|
|
30
|
-
pushPicCountLimit:
|
|
30
|
+
pushPicCountLimit: 9
|
|
31
31
|
|
|
32
32
|
# 推送文字和图文动态时,限制字数是多少
|
|
33
|
-
pushContentLenLimit:
|
|
33
|
+
pushContentLenLimit: 1000
|
|
34
34
|
|
|
35
35
|
# 推送文字和图文动态时,限制多少行文本
|
|
36
|
-
pushContentLineLimit:
|
|
36
|
+
pushContentLineLimit: 100
|
|
37
37
|
|
|
38
38
|
# 是否展示定时任务的日志,0 不显示 1 显示
|
|
39
39
|
pushTaskLog: 1
|
|
@@ -217,6 +217,9 @@ class BiliQuery {
|
|
|
217
217
|
// 处理表情类型,使用 img 标签显示表情
|
|
218
218
|
const emoji = node.emoji;
|
|
219
219
|
return `<img src="${emoji?.icon_url}" alt="${emoji?.text}" title="${emoji?.text}" style="vertical-align: middle; width: ${emoji?.size ? Number(emoji?.size) * 1.5 : 1.5}em; height: ${emoji?.size ? Number(emoji?.size) * 1.5 : 1.5}em;">`;
|
|
220
|
+
case 'RICH_TEXT_NODE_TYPE_BV':
|
|
221
|
+
// 处理视频类型,使用官方的HTML标签写法
|
|
222
|
+
return `<span class="bili-rich-text-link video">${node?.text}</span>`;
|
|
220
223
|
case 'RICH_TEXT_NODE_TYPE_GOODS':
|
|
221
224
|
// 处理商品推广类型,使用官方的HTML标签写法
|
|
222
225
|
const goods_url = node?.jump_url;
|
|
@@ -337,6 +340,9 @@ class BiliQuery {
|
|
|
337
340
|
// 处理表情类型,使用 img 标签显示表情
|
|
338
341
|
const emoji = node?.rich?.emoji;
|
|
339
342
|
return `<img src="${emoji?.icon_url}" alt="${emoji?.text}" title="${emoji?.text}" style="vertical-align: middle; width: ${emoji?.size ? Number(emoji?.size) * 1.5 : 1.5}em; height: ${emoji?.size ? Number(emoji?.size) * 1.5 : 1.5}em;">`;
|
|
343
|
+
case 'RICH_TEXT_NODE_TYPE_BV':
|
|
344
|
+
// 处理视频类型,使用官方的HTML标签写法
|
|
345
|
+
return `<span class="bili-rich-text-link video">${node?.rich?.text}</span>`;
|
|
340
346
|
case 'RICH_TEXT_NODE_TYPE_GOODS':
|
|
341
347
|
// 处理商品推广类型,使用官方的HTML标签写法
|
|
342
348
|
const goods_url = node?.rich?.jump_url;
|
|
@@ -492,7 +498,7 @@ class BiliQuery {
|
|
|
492
498
|
if (!desc && !pics && !author)
|
|
493
499
|
return;
|
|
494
500
|
module_stat = data?.modules?.module_stat;
|
|
495
|
-
const dynamicPicCountLimit = setData.pushPicCountLimit ||
|
|
501
|
+
const dynamicPicCountLimit = setData.pushPicCountLimit || 9;
|
|
496
502
|
if (pics.length > dynamicPicCountLimit) {
|
|
497
503
|
pics.length = dynamicPicCountLimit;
|
|
498
504
|
}
|
|
@@ -640,9 +646,9 @@ class BiliQuery {
|
|
|
640
646
|
}
|
|
641
647
|
// 限制文字模式下动态内容的字数和行数
|
|
642
648
|
static dynamicContentLimit(content, setData) {
|
|
643
|
-
const lines = content.split('\n');
|
|
644
|
-
const lengthLimit = setData.pushContentLenLimit ||
|
|
645
|
-
const lineLimit = setData.pushContentLineLimit ||
|
|
649
|
+
const lines = String(content).split('\n');
|
|
650
|
+
const lengthLimit = setData.pushContentLenLimit || 1000;
|
|
651
|
+
const lineLimit = setData.pushContentLineLimit || 100;
|
|
646
652
|
// 限制行数
|
|
647
653
|
if (lines.length > lineLimit) {
|
|
648
654
|
lines.length = lineLimit;
|
|
@@ -211,7 +211,7 @@ class WeiboQuery {
|
|
|
211
211
|
let created_time = this.getDynamicCreatetDate(raw_post);
|
|
212
212
|
let detail_url = `https://weibo.com/${info?.user?.id}/${info?.bid}`;
|
|
213
213
|
let msg_meta = `微博【${upName}】动态推送:`;
|
|
214
|
-
const dynamicPicCountLimit = setData.pushPicCountLimit ||
|
|
214
|
+
const dynamicPicCountLimit = setData.pushPicCountLimit || 9;
|
|
215
215
|
function formatNumber(num) {
|
|
216
216
|
if (num >= 10000) {
|
|
217
217
|
return `${(num / 10000).toFixed(1)}万`;
|
|
@@ -345,9 +345,9 @@ class WeiboQuery {
|
|
|
345
345
|
}
|
|
346
346
|
// 限制文字模式下动态内容的字数和行数
|
|
347
347
|
static dynamicContentLimit(content, setData) {
|
|
348
|
-
const lines = content.split('\n');
|
|
349
|
-
const lengthLimit = setData.pushContentLenLimit ||
|
|
350
|
-
const lineLimit = setData.pushContentLineLimit ||
|
|
348
|
+
const lines = String(content).split('\n');
|
|
349
|
+
const lengthLimit = setData.pushContentLenLimit || 1000;
|
|
350
|
+
const lineLimit = setData.pushContentLineLimit || 100;
|
|
351
351
|
// 限制行数
|
|
352
352
|
if (lines.length > lineLimit) {
|
|
353
353
|
lines.length = lineLimit;
|
package/package.json
CHANGED
|
@@ -171,3 +171,18 @@
|
|
|
171
171
|
min-width: 72px;
|
|
172
172
|
outline: none;
|
|
173
173
|
}
|
|
174
|
+
|
|
175
|
+
/* 定义B站图文内视频链接标签样式 */
|
|
176
|
+
.bili-rich-text-link.video {
|
|
177
|
+
display: inline-block;
|
|
178
|
+
padding-left: 20px;
|
|
179
|
+
color: #008ac5;
|
|
180
|
+
/* 为图标留出空间 */
|
|
181
|
+
position: relative;
|
|
182
|
+
background-repeat: no-repeat;
|
|
183
|
+
background-position: left center;
|
|
184
|
+
background-size: 20px 20px;
|
|
185
|
+
/* 根据你的SVG图标大小调整 */
|
|
186
|
+
background-image: url('./../../img/icon/dynamic/bili-rich-text-link-video.svg');
|
|
187
|
+
/* 引入SVG图标 */
|
|
188
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg style="width: 22px; height: 22px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 22 22" width="22" height="22"> <path d="M11 3.019045833333333C6.593229166666666 3.019045833333333 3.020833333333333 6.591441666666666 3.020833333333333 10.998166666666666C3.020833333333333 15.404950000000001 6.593229166666666 18.977333333333334 11 18.977333333333334C15.406775 18.977333333333334 18.979166666666664 15.404950000000001 18.979166666666664 10.998166666666666C18.979166666666664 6.591441666666666 15.406775 3.019045833333333 11 3.019045833333333zM2.0208333333333335 10.998166666666666C2.0208333333333335 6.0391525 6.04094 2.019045833333333 11 2.019045833333333C15.959074999999997 2.019045833333333 19.979166666666668 6.0391525 19.979166666666668 10.998166666666666C19.979166666666668 15.957249999999998 15.959074999999997 19.977333333333334 11 19.977333333333334C6.04094 19.977333333333334 2.0208333333333335 15.957249999999998 2.0208333333333335 10.998166666666666z" fill="#008ac5"></path> <path d="M13.850841666666668 10.240291666666668C14.435649999999999 10.577883333333332 14.435649999999999 11.421958333333334 13.850841666666668 11.759641666666665L10.2325 13.848716666666666C9.647683333333333 14.186316666666666 8.916668333333332 13.764275 8.916668333333332 13.089083333333333L8.916668333333332 8.910848333333334C8.916668333333332 8.235588333333332 9.647683333333333 7.813549999999998 10.2325 8.15118L13.850841666666668 10.240291666666668z" fill="#008ac5"></path> </svg>
|