yz-yuki-plugin 2.0.7-9 → 2.0.8-1
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 +10 -1
- package/README.md +28 -27
- package/defaultConfig/bilibili/config.yaml +11 -3
- package/defaultConfig/weibo/config.yaml +11 -3
- package/lib/apps/bilibili.js +61 -29
- package/lib/apps/weibo.js +42 -14
- package/lib/components/dynamic/Content.js +2 -2
- package/lib/components/dynamic/Footer.js +2 -2
- package/lib/components/help/Help.js +2 -2
- package/lib/components/version/Version.js +2 -2
- package/lib/models/bilibili/bilibili.main.models.js +3 -0
- package/lib/models/bilibili/bilibili.main.query.js +152 -90
- package/lib/models/bilibili/bilibili.main.task.js +173 -104
- package/lib/models/weibo/weibo.main.query.js +84 -37
- package/lib/models/weibo/weibo.main.task.js +155 -87
- package/lib/utils/puppeteer.render.js +3 -1
- package/package.json +6 -6
- package/resources/css/dynamic/Content.css +108 -0
- package/resources/img/icon/dynamic/bili-dyn-card-vote__cover.svg +1 -0
- package/resources/img/icon/dynamic/bili-rich-text-link-video.svg +1 -0
|
@@ -40,6 +40,7 @@ class WeiboTask {
|
|
|
40
40
|
*/
|
|
41
41
|
async processWeiboData(weiboPushData, uidMap, dynamicList) {
|
|
42
42
|
const requestedDataOfUids = new Map(); // 存放已请求的 uid 映射
|
|
43
|
+
const printedList = new Set(); // 已打印的动态列表
|
|
43
44
|
for (let chatType in weiboPushData) {
|
|
44
45
|
// 遍历 group 和 private
|
|
45
46
|
if (!uidMap.has(chatType)) {
|
|
@@ -51,30 +52,36 @@ class WeiboTask {
|
|
|
51
52
|
for (let chatId in weiboPushData[chatType]) {
|
|
52
53
|
const subUpsOfChat = Array.prototype.slice.call(weiboPushData[chatType][chatId] || []);
|
|
53
54
|
for (let subInfoOfup of subUpsOfChat) {
|
|
55
|
+
const { uid, bot_id, name, type } = subInfoOfup;
|
|
54
56
|
let resp;
|
|
55
57
|
// 检查是否已经请求过该 uid
|
|
56
|
-
if (requestedDataOfUids.has(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
resp = await new WeiboWebDataFetcher().getBloggerDynamicList(subInfoOfup.uid); // 获取指定 uid 的动态列表
|
|
58
|
+
if (!requestedDataOfUids.has(uid)) {
|
|
59
|
+
if (!printedList.has(uid)) {
|
|
60
|
+
logger.info(`正在检测微博动态 [ ${name} : ${uid} ]`);
|
|
61
|
+
printedList.add(uid);
|
|
62
|
+
}
|
|
63
|
+
resp = await new WeiboWebDataFetcher().getBloggerDynamicList(uid); // 获取指定 uid 的动态列表
|
|
63
64
|
if (resp) {
|
|
64
|
-
requestedDataOfUids.set(
|
|
65
|
+
requestedDataOfUids.set(uid, resp); // 将响应数据存储到映射中
|
|
65
66
|
const dynamicData = resp || [];
|
|
66
|
-
dynamicList[
|
|
67
|
+
dynamicList[uid] = dynamicData;
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
chatTypeMap.
|
|
70
|
+
if (!chatTypeMap.has(uid)) {
|
|
71
|
+
chatTypeMap.set(uid, new Map());
|
|
72
|
+
}
|
|
73
|
+
const botChatMap = chatTypeMap.get(uid);
|
|
74
|
+
if (!botChatMap?.has(bot_id)) {
|
|
75
|
+
botChatMap?.set(bot_id, new Map());
|
|
76
|
+
}
|
|
77
|
+
const chatMap = botChatMap?.get(bot_id);
|
|
78
|
+
chatMap?.set(chatId, { upName: name, types: type });
|
|
73
79
|
await this.randomDelay(1000, 4000); // 随机延时1-4秒
|
|
74
80
|
}
|
|
75
81
|
}
|
|
76
82
|
}
|
|
77
83
|
requestedDataOfUids.clear(); // 清空已请求的映射
|
|
84
|
+
printedList.clear(); // 清空已打印的动态列表
|
|
78
85
|
}
|
|
79
86
|
/**
|
|
80
87
|
* 构建uid对应动态数据映射
|
|
@@ -86,36 +93,31 @@ class WeiboTask {
|
|
|
86
93
|
*/
|
|
87
94
|
async makeUidDynamicDataMap(uidMap, dynamicList, now, dynamicTimeRange, weiboConfigData, messageMap) {
|
|
88
95
|
for (let [chatType, chatTypeMap] of uidMap) {
|
|
89
|
-
for (let [
|
|
90
|
-
const tempDynamicList = dynamicList[
|
|
96
|
+
for (let [upUid, bot_idMap] of chatTypeMap) {
|
|
97
|
+
const tempDynamicList = dynamicList[upUid] || [];
|
|
91
98
|
const willPushDynamicList = [];
|
|
92
|
-
const printedList = new Set(); // 已打印的动态列表
|
|
93
99
|
for (let dynamicItem of tempDynamicList) {
|
|
94
100
|
let raw_post = dynamicItem || {};
|
|
95
101
|
let user = raw_post?.mblog?.user || {};
|
|
96
|
-
if (!printedList.has(user?.id)) {
|
|
97
|
-
logger.info(`正在检测微博动态 [ ${user?.screen_name} : ${user?.id} ]`);
|
|
98
|
-
printedList.add(user?.id);
|
|
99
|
-
}
|
|
100
102
|
if (!raw_post?.mblog?.created_at)
|
|
101
103
|
continue;
|
|
102
104
|
if (Number(now - WeiboQuery.getDynamicCreatetDate(raw_post) / 1000) > dynamicTimeRange) {
|
|
103
105
|
logger.debug(`超过间隔,跳过 [ ${user?.screen_name} : ${user?.id} ] ${raw_post?.mblog?.created_at} 的动态`);
|
|
104
106
|
continue;
|
|
105
107
|
} // 如果超过推送时间间隔,跳过当前循环
|
|
106
|
-
if (dynamicItem
|
|
107
|
-
continue;
|
|
108
|
+
if (dynamicItem?.type === 'DYNAMIC_TYPE_FORWARD' && !weiboConfigData.pushTransmit) {
|
|
109
|
+
continue;
|
|
110
|
+
} // 如果关闭了转发动态的推送,跳过当前循环
|
|
108
111
|
willPushDynamicList.push(dynamicItem);
|
|
109
112
|
}
|
|
110
|
-
printedList.clear();
|
|
111
|
-
const pushMapInfo = value || {}; // 获取当前 uid 对应的推送信息
|
|
112
|
-
const { chatIds, bot_id, upName, type } = pushMapInfo;
|
|
113
113
|
// 遍历待推送的动态数组,发送动态消息
|
|
114
|
-
for (let
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
for (let [bot_id, chatIdMap] of bot_idMap) {
|
|
115
|
+
for (let [chatId, subUpInfo] of chatIdMap) {
|
|
116
|
+
const { upName, types } = subUpInfo;
|
|
117
|
+
for (let pushDynamicData of willPushDynamicList) {
|
|
118
|
+
if (types && types.length > 0 && !types.includes(pushDynamicData.type)) {
|
|
119
|
+
continue;
|
|
120
|
+
} // 如果禁用了某类型的动态推送,跳过当前循环
|
|
119
121
|
await this.makeDynamicMessageMap(chatId, bot_id, upName, pushDynamicData, weiboConfigData, chatType, messageMap); // 发送动态消息
|
|
120
122
|
await this.randomDelay(1000, 2000); // 随机延时1-2秒
|
|
121
123
|
}
|
|
@@ -175,6 +177,7 @@ class WeiboTask {
|
|
|
175
177
|
let isSplit = !!weiboConfigData.isSplit === false ? false : true; // 是否启用分片截图,默认为 true
|
|
176
178
|
let style = isSplit ? '' : `.unfold { max-height: ${weiboConfigData?.noSplitHeight ?? 7500}px; }`; // 不启用分片截图模式的样式
|
|
177
179
|
let splitHeight = weiboConfigData?.splitHeight ?? 8000; // 分片截图高度,默认 8000, 单位 px,启用分片截图时生效
|
|
180
|
+
let isPauseGif = !!weiboConfigData?.isPauseGif === true ? true : false; // 是否暂停 GIF 动图,默认为 false
|
|
178
181
|
const extentData = { ...data };
|
|
179
182
|
const urlQrcodeData = await QRCode.toDataURL(extentData?.url);
|
|
180
183
|
let renderData = this.buildRenderData(extentData, urlQrcodeData, boxGrid);
|
|
@@ -188,7 +191,8 @@ class WeiboTask {
|
|
|
188
191
|
quality: 98
|
|
189
192
|
},
|
|
190
193
|
saveHtmlfile: false,
|
|
191
|
-
pageSplitHeight: splitHeight
|
|
194
|
+
pageSplitHeight: splitHeight,
|
|
195
|
+
isPauseGif: isPauseGif
|
|
192
196
|
};
|
|
193
197
|
let imgs = await this.renderDynamicCard(uid, renderData, ScreenshotOptionsData);
|
|
194
198
|
if (!imgs)
|
|
@@ -243,22 +247,25 @@ class WeiboTask {
|
|
|
243
247
|
* @returns 渲染数据
|
|
244
248
|
*/
|
|
245
249
|
buildRenderData(extentData, urlQrcodeData, boxGrid) {
|
|
250
|
+
const baseData = {
|
|
251
|
+
appName: 'weibo',
|
|
252
|
+
boxGrid: boxGrid,
|
|
253
|
+
type: extentData?.type,
|
|
254
|
+
face: extentData?.face,
|
|
255
|
+
pendant: extentData?.pendant,
|
|
256
|
+
name: extentData?.name,
|
|
257
|
+
pubTs: extentData?.pubTs,
|
|
258
|
+
title: extentData?.title,
|
|
259
|
+
content: extentData?.content,
|
|
260
|
+
urlImgData: urlQrcodeData,
|
|
261
|
+
created: extentData?.created,
|
|
262
|
+
pics: extentData?.pics,
|
|
263
|
+
category: extentData?.category
|
|
264
|
+
};
|
|
246
265
|
if (extentData.orig && extentData.orig.length !== 0) {
|
|
247
266
|
return {
|
|
248
267
|
data: {
|
|
249
|
-
|
|
250
|
-
boxGrid: boxGrid,
|
|
251
|
-
type: extentData?.type,
|
|
252
|
-
face: extentData?.face,
|
|
253
|
-
pendant: extentData?.pendant,
|
|
254
|
-
name: extentData?.name,
|
|
255
|
-
pubTs: extentData?.pubTs,
|
|
256
|
-
title: extentData?.title,
|
|
257
|
-
content: extentData?.content,
|
|
258
|
-
urlImgData: urlQrcodeData,
|
|
259
|
-
created: extentData?.created,
|
|
260
|
-
pics: extentData?.pics,
|
|
261
|
-
category: extentData?.category,
|
|
268
|
+
...baseData,
|
|
262
269
|
orig: {
|
|
263
270
|
data: {
|
|
264
271
|
type: extentData?.orig?.data?.type,
|
|
@@ -276,23 +283,7 @@ class WeiboTask {
|
|
|
276
283
|
};
|
|
277
284
|
}
|
|
278
285
|
else {
|
|
279
|
-
return {
|
|
280
|
-
data: {
|
|
281
|
-
appName: 'weibo',
|
|
282
|
-
boxGrid: boxGrid,
|
|
283
|
-
type: extentData?.type,
|
|
284
|
-
face: extentData?.face,
|
|
285
|
-
pendant: extentData?.pendant,
|
|
286
|
-
name: extentData?.name,
|
|
287
|
-
pubTs: extentData?.pubTs,
|
|
288
|
-
title: extentData?.title,
|
|
289
|
-
content: extentData?.content,
|
|
290
|
-
urlImgData: urlQrcodeData,
|
|
291
|
-
created: extentData?.created,
|
|
292
|
-
pics: extentData?.pics,
|
|
293
|
-
category: extentData?.category
|
|
294
|
-
}
|
|
295
|
-
};
|
|
286
|
+
return { data: baseData };
|
|
296
287
|
}
|
|
297
288
|
}
|
|
298
289
|
/**
|
|
@@ -342,48 +333,101 @@ class WeiboTask {
|
|
|
342
333
|
* @param biliConfigData 微博配置数据
|
|
343
334
|
*/
|
|
344
335
|
async sendDynamicMessage(messageMap, weiboConfigData) {
|
|
336
|
+
let forwardSendDynamic = weiboConfigData.forwardSendDynamic === 0 || weiboConfigData.forwardSendDynamic === false ? false : true; // 转发动态是否合并发送,默认 true
|
|
345
337
|
const LogMark = new Set(); // 日志mark
|
|
346
338
|
for (const [chatType, botMap] of messageMap) {
|
|
347
339
|
for (const [bot_id, chatMap] of botMap) {
|
|
348
340
|
for (const [chatId, messageCombinationList] of chatMap) {
|
|
349
|
-
//
|
|
341
|
+
// 区分群聊和私聊
|
|
342
|
+
let markKey = chatType === 'group' ? this.groupKey : this.privateKey;
|
|
343
|
+
if (!LogMark.has('1')) {
|
|
344
|
+
global?.logger?.mark('优纪插件: 微博动态执行推送');
|
|
345
|
+
LogMark.add('1');
|
|
346
|
+
}
|
|
347
|
+
// 统计图片数量和文字长度
|
|
348
|
+
let imageCount = 0;
|
|
349
|
+
let textLength = 0;
|
|
350
350
|
for (const messageCombination of messageCombinationList) {
|
|
351
|
-
const {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
351
|
+
const { messages } = messageCombination;
|
|
352
|
+
for (const msg of messages) {
|
|
353
|
+
if (typeof msg === 'object' && msg.type === 'image') {
|
|
354
|
+
imageCount++;
|
|
355
|
+
}
|
|
356
|
+
else if (typeof msg === 'string') {
|
|
357
|
+
textLength += msg.length;
|
|
358
|
+
}
|
|
357
359
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
360
|
+
}
|
|
361
|
+
// 满足条件才使用合并转发
|
|
362
|
+
const useForward = imageCount > (weiboConfigData?.maxPicsForSingleMsg ?? 2) || textLength > (weiboConfigData?.maxTextLengthForSingleMsg ?? 300);
|
|
363
|
+
if (forwardSendDynamic && useForward) {
|
|
364
|
+
const forwardNodes = [];
|
|
365
|
+
// 合并所有消息
|
|
366
|
+
const forwardSendMardKeyList = [];
|
|
367
|
+
forwardNodes.push({
|
|
368
|
+
nickname: '优纪酱',
|
|
369
|
+
user_id: String(80000000),
|
|
370
|
+
message: ['有新的微博动态了~'],
|
|
371
|
+
time: Date.now()
|
|
372
|
+
});
|
|
373
|
+
for (const messageCombination of messageCombinationList) {
|
|
374
|
+
const { sendMode, dynamicUUid_str, dynamicType, messages } = messageCombination;
|
|
375
|
+
const sendMarkKey = `${markKey}${chatId}:${dynamicUUid_str}`;
|
|
376
|
+
// 原子性设置标记,防止并发重复
|
|
377
|
+
const setResult = await Redis.set(sendMarkKey, '1', { NX: true, EX: 3600 * 72 });
|
|
378
|
+
if (!setResult) {
|
|
379
|
+
continue; // 已有标记,跳过
|
|
380
|
+
}
|
|
381
|
+
forwardSendMardKeyList.push(sendMarkKey); // 收集合并转发的标记键
|
|
382
|
+
// 每条动态一个 node
|
|
383
|
+
forwardNodes.push({
|
|
384
|
+
nickname: '匿名消息',
|
|
385
|
+
user_id: String(80000000),
|
|
386
|
+
message: messages,
|
|
387
|
+
time: Date.now()
|
|
388
|
+
});
|
|
361
389
|
}
|
|
362
|
-
|
|
363
|
-
if (
|
|
364
|
-
|
|
390
|
+
// 尝试合并转发动态
|
|
391
|
+
if ((await this.sendMsgApi(chatId, bot_id, chatType, '优纪酱微博动态通知~')) &&
|
|
392
|
+
(await this.sendForwardMsgApi(chatId, bot_id, chatType, forwardNodes))) {
|
|
393
|
+
await this.randomDelay(1000, 2000);
|
|
394
|
+
continue; // 合并转发成功,跳过后续单条发送逻辑
|
|
365
395
|
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
396
|
+
else {
|
|
397
|
+
for (const sendMarkKey of forwardSendMardKeyList) {
|
|
398
|
+
await Redis.del(sendMarkKey); // 发送消息失败,删除合并转发成功标记
|
|
399
|
+
}
|
|
369
400
|
}
|
|
401
|
+
}
|
|
402
|
+
// 合并转发失败,回退为原有方式
|
|
403
|
+
for (const messageCombination of messageCombinationList) {
|
|
404
|
+
const { sendMode, dynamicUUid_str, dynamicType, messages } = messageCombination;
|
|
405
|
+
const sendMarkKey = `${markKey}${chatId}:${dynamicUUid_str}`;
|
|
406
|
+
// 原子性设置标记,防止并发重复
|
|
407
|
+
const setResult = await Redis.set(sendMarkKey, '1', { NX: true, EX: 3600 * 72 });
|
|
408
|
+
if (!setResult) {
|
|
409
|
+
continue; // 已有标记,跳过
|
|
410
|
+
}
|
|
411
|
+
let sendSuccess = true;
|
|
370
412
|
if (sendMode === 'SINGLE') {
|
|
371
|
-
let allSent = true;
|
|
372
413
|
for (let i = 0; i < messages.length; i++) {
|
|
373
|
-
if (!(await this.
|
|
374
|
-
|
|
375
|
-
break;
|
|
414
|
+
if (!(await this.sendMsgApi(chatId, bot_id, chatType, messages[i]))) {
|
|
415
|
+
sendSuccess = false;
|
|
416
|
+
break;
|
|
376
417
|
}
|
|
377
418
|
}
|
|
378
|
-
if (
|
|
379
|
-
await Redis.
|
|
380
|
-
|
|
419
|
+
if (!sendSuccess) {
|
|
420
|
+
await Redis.del(sendMarkKey); // 失败删除标记
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
await this.randomDelay(1000, 2000);
|
|
381
424
|
}
|
|
382
425
|
}
|
|
383
426
|
else if (sendMode === 'MERGE') {
|
|
384
|
-
if (await this.
|
|
385
|
-
await Redis.
|
|
427
|
+
if (!(await this.sendMsgApi(chatId, bot_id, chatType, messages))) {
|
|
428
|
+
await Redis.del(sendMarkKey); // 失败删除标记
|
|
386
429
|
}
|
|
430
|
+
await this.randomDelay(1000, 2000);
|
|
387
431
|
}
|
|
388
432
|
}
|
|
389
433
|
}
|
|
@@ -398,7 +442,7 @@ class WeiboTask {
|
|
|
398
442
|
* @param chatType 聊天类型
|
|
399
443
|
* @param message 消息内容
|
|
400
444
|
*/
|
|
401
|
-
async
|
|
445
|
+
async sendMsgApi(chatId, bot_id, chatType, message) {
|
|
402
446
|
try {
|
|
403
447
|
if (chatType === 'group') {
|
|
404
448
|
await (Bot[bot_id] ?? Bot)?.pickGroup(String(chatId)).sendMsg(message); // 发送群聊
|
|
@@ -413,6 +457,30 @@ class WeiboTask {
|
|
|
413
457
|
return false; // 发送失败
|
|
414
458
|
}
|
|
415
459
|
}
|
|
460
|
+
/**
|
|
461
|
+
* 发送合并转发消息
|
|
462
|
+
* @param chatId 聊天 ID
|
|
463
|
+
* @param bot_id 机器人 ID
|
|
464
|
+
* @param chatType 聊天类型
|
|
465
|
+
* @param message 消息内容
|
|
466
|
+
* @returns 是否发送成功
|
|
467
|
+
*/
|
|
468
|
+
async sendForwardMsgApi(chatId, bot_id, chatType, forwardNodes) {
|
|
469
|
+
const forwardMsg = await Bot.makeForwardMsg(forwardNodes);
|
|
470
|
+
try {
|
|
471
|
+
if (chatType === 'group') {
|
|
472
|
+
await (Bot[bot_id] ?? Bot)?.pickGroup(String(chatId)).sendMsg(forwardMsg); // 发送群聊合并转发
|
|
473
|
+
}
|
|
474
|
+
else if (chatType === 'private') {
|
|
475
|
+
await (Bot[bot_id] ?? Bot)?.pickFriend(String(chatId)).sendMsg(forwardMsg); // 发送好友私聊合并转发
|
|
476
|
+
}
|
|
477
|
+
return true; // 发送成功
|
|
478
|
+
}
|
|
479
|
+
catch (error) {
|
|
480
|
+
global?.logger?.error(`${chatType === 'group' ? '群聊' : '私聊'} ${chatId} 合并转发消息发送失败:${JSON.stringify(error)}`);
|
|
481
|
+
return false; // 发送失败
|
|
482
|
+
}
|
|
483
|
+
}
|
|
416
484
|
/**
|
|
417
485
|
* 随机延时
|
|
418
486
|
* @param min 最小延时时间
|
|
@@ -53,7 +53,9 @@ class YukiPuppeteerRender {
|
|
|
53
53
|
pageHeight = Math.round(boundingBox.height / num); //动态调整分片高度,防止过短影响观感。
|
|
54
54
|
await page.setViewport({ width: boundingBox.width + 50, height: pageHeight + 100 });
|
|
55
55
|
// 禁止 GIF 动图播放
|
|
56
|
-
|
|
56
|
+
if (Options?.isPauseGif === true) {
|
|
57
|
+
await page.addStyleTag({ content: `img[src$=".gif"] {animation-play-state: paused !important;}` });
|
|
58
|
+
}
|
|
57
59
|
// 是否保存 html 文件
|
|
58
60
|
if (Options?.saveHtmlfile === true) {
|
|
59
61
|
const htmlContent = await page.content();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yz-yuki-plugin",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8-1",
|
|
4
4
|
"description": "优纪插件,yunzaijs 关于 微博推送、B站推送 等功能的拓展插件",
|
|
5
5
|
"author": "snowtafir",
|
|
6
6
|
"type": "module",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"debug": "^4.3.6",
|
|
32
32
|
"jsdom": "^25.0.1",
|
|
33
33
|
"json5": "^2.2.3",
|
|
34
|
-
"jsxp": "^1.1
|
|
34
|
+
"jsxp": "^1.2.1",
|
|
35
35
|
"lodash": "^4.17.21",
|
|
36
36
|
"md5": "^2.3.0",
|
|
37
37
|
"moment": "^2.30.1",
|
|
38
38
|
"node-fetch": "^3.3.2",
|
|
39
|
-
"puppeteer": "^24.
|
|
39
|
+
"puppeteer": "^24.8.2",
|
|
40
40
|
"qrcode": "^1.5.4",
|
|
41
41
|
"react": "^18.3.1",
|
|
42
42
|
"react-dom": "^18.3.1",
|
|
@@ -63,14 +63,14 @@
|
|
|
63
63
|
"icqq": "^0.6.10",
|
|
64
64
|
"jsdom": "^24.1.1",
|
|
65
65
|
"json5": "^2.2.3",
|
|
66
|
-
"jsxp": "^1.1
|
|
66
|
+
"jsxp": "^1.2.1",
|
|
67
67
|
"lodash": "^4.17.21",
|
|
68
|
-
"lvyjs": "^0.2.
|
|
68
|
+
"lvyjs": "^0.2.19",
|
|
69
69
|
"md5": "^2.3.0",
|
|
70
70
|
"node-fetch": "^3.3.2",
|
|
71
71
|
"postcss": "^8.4.47",
|
|
72
72
|
"prettier": "^3.4.2",
|
|
73
|
-
"puppeteer": "^24.
|
|
73
|
+
"puppeteer": "^24.8.2",
|
|
74
74
|
"qrcode": "^1.5.4",
|
|
75
75
|
"react": "^18.3.1",
|
|
76
76
|
"react-dom": "^18.3.1",
|
|
@@ -78,3 +78,111 @@
|
|
|
78
78
|
background-image: url('./../../img/icon/dynamic/bili-rich-text-module-goods-taobao.svg');
|
|
79
79
|
/* 引入SVG图标 */
|
|
80
80
|
}
|
|
81
|
+
|
|
82
|
+
/* 定义B站投票标签样式 */
|
|
83
|
+
.bili-dyn-content__orig__additional {
|
|
84
|
+
margin-top: 12px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.bili-dyn-card-vote {
|
|
88
|
+
background-color: rgba(246, 247, 248, 0.8);
|
|
89
|
+
border-radius: 6px;
|
|
90
|
+
box-sizing: border-box;
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
display: flex;
|
|
93
|
+
height: 78px;
|
|
94
|
+
height: 100%;
|
|
95
|
+
overflow: hidden;
|
|
96
|
+
border: 1px solid #ff69b4;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.bili-dyn-card-vote__header {
|
|
100
|
+
flex-shrink: 0;
|
|
101
|
+
padding: 25px;
|
|
102
|
+
width: 78px;
|
|
103
|
+
background-color: rgb(255, 255, 255);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.bili-dyn-card-vote__cover {
|
|
107
|
+
align-items: center;
|
|
108
|
+
background-color: #ffffff;
|
|
109
|
+
border-radius: 4px;
|
|
110
|
+
color: #008ac5;
|
|
111
|
+
display: flex;
|
|
112
|
+
height: 100%;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
width: 100%;
|
|
115
|
+
/* 引入SVG图标 */
|
|
116
|
+
background-image: url('./../../img/icon/dynamic/bili-dyn-card-vote__cover.svg');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.bili-dyn-card-vote__body,
|
|
120
|
+
.bili-dyn-card-vote__detail {
|
|
121
|
+
display: flex;
|
|
122
|
+
flex: 1;
|
|
123
|
+
overflow: hidden;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.bili-dyn-card-vote__detail {
|
|
127
|
+
box-sizing: border-box;
|
|
128
|
+
flex-direction: column;
|
|
129
|
+
padding: 19px 16px 15px 20px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.bili-dyn-card-vote__detail__title {
|
|
133
|
+
color: #18191c;
|
|
134
|
+
font-size: 14px;
|
|
135
|
+
line-height: 20px;
|
|
136
|
+
overflow: hidden;
|
|
137
|
+
text-overflow: ellipsis;
|
|
138
|
+
transition: all 0.2s;
|
|
139
|
+
white-space: nowrap;
|
|
140
|
+
width: 100%;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.bili-dyn-card-vote__detail__desc {
|
|
144
|
+
color: #9499a0;
|
|
145
|
+
font-size: 12px;
|
|
146
|
+
line-height: 17px;
|
|
147
|
+
margin-top: 4px;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.bili-dyn-card-vote__action {
|
|
151
|
+
align-items: center;
|
|
152
|
+
display: flex;
|
|
153
|
+
flex-shrink: 0;
|
|
154
|
+
justify-content: center;
|
|
155
|
+
margin-right: 16px;
|
|
156
|
+
padding-right: 15px;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.bili-dyn-card-vote__action__btn_normal {
|
|
160
|
+
background-color: #ff69b4;
|
|
161
|
+
color: #ffffff;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.bili-dyn-card-vote__action button {
|
|
165
|
+
border: none;
|
|
166
|
+
border-radius: 6px;
|
|
167
|
+
box-sizing: border-box;
|
|
168
|
+
cursor: pointer;
|
|
169
|
+
font-size: 12.8px;
|
|
170
|
+
height: 30px;
|
|
171
|
+
min-width: 72px;
|
|
172
|
+
outline: none;
|
|
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: 28px; height: 28px;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 28 28" width="28" height="28"><path d="M2.4583333333333335 16.626283333333333C2.4583333333333335 15.084516666666667 3.7082066666666664 13.834616666666667 5.25 13.834616666666667L6.416666666666667 13.834616666666667C7.95846 13.834616666666667 9.208333333333334 15.084516666666667 9.208333333333334 16.626283333333333L9.208333333333334 20.70961666666667C9.208333333333334 22.251383333333333 7.95846 23.501283333333337 6.416666666666667 23.501283333333337L5.25 23.501283333333337C3.7082066666666664 23.501283333333337 2.4583333333333335 22.251383333333333 2.4583333333333335 20.70961666666667L2.4583333333333335 16.626283333333333zM5.25 15.334616666666665C4.5366333333333335 15.334616666666665 3.9583333333333335 15.912883333333335 3.9583333333333335 16.626283333333333L3.9583333333333335 20.70961666666667C3.9583333333333335 21.42301666666667 4.5366333333333335 22.001283333333337 5.25 22.001283333333337L6.416666666666667 22.001283333333337C7.130040000000001 22.001283333333337 7.708333333333335 21.42301666666667 7.708333333333335 20.70961666666667L7.708333333333335 16.626283333333333C7.708333333333335 15.912883333333335 7.130040000000001 15.334616666666665 6.416666666666667 15.334616666666665L5.25 15.334616666666665z" fill="currentColor" style="--darkreader-inline-fill: currentColor;" data-darkreader-inline-fill=""></path><path d="M10.625000000000002 6.709476666666667C10.625000000000002 5.167683333333334 11.874906666666668 3.9178100000000007 13.416666666666668 3.9178100000000007L14.583333333333334 3.9178100000000007C16.1251 3.9178100000000007 17.375 5.167683333333334 17.375 6.709476666666667L17.375 20.709500000000002C17.375 22.251266666666666 16.1251 23.50116666666667 14.583333333333334 23.50116666666667L13.416666666666668 23.50116666666667C11.874906666666668 23.50116666666667 10.625000000000002 22.251266666666666 10.625000000000002 20.709500000000002L10.625000000000002 6.709476666666667zM13.416666666666668 5.41781C12.703266666666666 5.41781 12.125 5.996103333333333 12.125 6.709476666666667L12.125 20.709500000000002C12.125 21.422816666666666 12.703266666666666 22.00116666666667 13.416666666666668 22.00116666666667L14.583333333333334 22.00116666666667C15.296733333333336 22.00116666666667 15.875000000000002 21.422816666666666 15.875000000000002 20.709500000000002L15.875000000000002 6.709476666666667C15.875000000000002 5.996103333333333 15.296733333333336 5.41781 14.583333333333334 5.41781L13.416666666666668 5.41781z" fill="currentColor" style="--darkreader-inline-fill: currentColor;" data-darkreader-inline-fill=""></path><path d="M18.791666666666668 12.8345C18.791666666666668 11.292683333333335 20.041566666666668 10.042810000000001 21.583333333333336 10.042810000000001L22.75 10.042810000000001C24.291766666666668 10.042810000000001 25.541666666666668 11.292683333333335 25.541666666666668 12.8345L25.541666666666668 20.709500000000002C25.541666666666668 22.251266666666666 24.291766666666668 23.50116666666667 22.75 23.50116666666667L21.583333333333336 23.50116666666667C20.041566666666668 23.50116666666667 18.791666666666668 22.251266666666666 18.791666666666668 20.709500000000002L18.791666666666668 12.8345zM21.583333333333336 11.542816666666667C20.869933333333336 11.542816666666667 20.291666666666668 12.121100000000002 20.291666666666668 12.8345L20.291666666666668 20.709500000000002C20.291666666666668 21.422816666666666 20.869933333333336 22.00116666666667 21.583333333333336 22.00116666666667L22.75 22.00116666666667C23.4634 22.00116666666667 24.041666666666668 21.422816666666666 24.041666666666668 20.709500000000002L24.041666666666668 12.8345C24.041666666666668 12.121100000000002 23.4634 11.542816666666667 22.75 11.542816666666667L21.583333333333336 11.542816666666667z" fill="currentColor" style="--darkreader-inline-fill: currentColor;" data-darkreader-inline-fill=""></path></svg>
|
|
@@ -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>
|