yz-yuki-plugin 1.0.1-rc.0
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/.puppeteerrc.cjs +4 -0
- package/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +195 -0
- package/defaultConfig/bilibili/config.yaml +41 -0
- package/defaultConfig/bilibili/push.yaml +0 -0
- package/defaultConfig/help/help.yaml +86 -0
- package/defaultConfig/weibo/config.yaml +41 -0
- package/defaultConfig/weibo/push.yaml +0 -0
- package/lib/apps/bilibili.js +402 -0
- package/lib/apps/help.js +37 -0
- package/lib/apps/index.js +4 -0
- package/lib/apps/version.js +34 -0
- package/lib/apps/weibo.js +252 -0
- package/lib/components/dynamic/Account.js +26 -0
- package/lib/components/dynamic/Content.js +118 -0
- package/lib/components/dynamic/Footer.js +36 -0
- package/lib/components/dynamic/ForwardContent.js +15 -0
- package/lib/components/dynamic/LogoText.js +10 -0
- package/lib/components/dynamic/MainPage.js +22 -0
- package/lib/components/help/Help.js +33 -0
- package/lib/components/index.js +6 -0
- package/lib/components/loginQrcode/Page.js +21 -0
- package/lib/components/version/Version.js +27 -0
- package/lib/index.js +29 -0
- package/lib/models/bilibili/bilibili.api.js +49 -0
- package/lib/models/bilibili/bilibili.get.web.data.js +80 -0
- package/lib/models/bilibili/bilibili.models.js +484 -0
- package/lib/models/bilibili/bilibili.query.js +393 -0
- package/lib/models/bilibili/bilibili.task.js +256 -0
- package/lib/models/bilibili/bilibili.wbi.js +49 -0
- package/lib/models/help/help.js +20 -0
- package/lib/models/version/version.js +62 -0
- package/lib/models/weibo/weibo.api.js +19 -0
- package/lib/models/weibo/weibo.get.web.data.js +55 -0
- package/lib/models/weibo/weibo.query.js +323 -0
- package/lib/models/weibo/weibo.task.js +215 -0
- package/lib/types/apps/bilibili.d.ts +6 -0
- package/lib/types/apps/help.d.ts +6 -0
- package/lib/types/apps/index.d.ts +4 -0
- package/lib/types/apps/version.d.ts +6 -0
- package/lib/types/apps/weibo.d.ts +6 -0
- package/lib/types/components/dynamic/Account.d.ts +13 -0
- package/lib/types/components/dynamic/Content.d.ts +12 -0
- package/lib/types/components/dynamic/Footer.d.ts +11 -0
- package/lib/types/components/dynamic/ForwardContent.d.ts +6 -0
- package/lib/types/components/dynamic/LogoText.d.ts +9 -0
- package/lib/types/components/dynamic/MainPage.d.ts +34 -0
- package/lib/types/components/help/Help.d.ts +12 -0
- package/lib/types/components/index.d.ts +5 -0
- package/lib/types/components/loginQrcode/Page.d.ts +7 -0
- package/lib/types/components/version/Version.d.ts +8 -0
- package/lib/types/index.d.ts +5 -0
- package/lib/types/models/bilibili/bilibili.api.d.ts +47 -0
- package/lib/types/models/bilibili/bilibili.buid.fp.d.ts +2 -0
- package/lib/types/models/bilibili/bilibili.get.web.data.d.ts +6 -0
- package/lib/types/models/bilibili/bilibili.models.d.ts +20 -0
- package/lib/types/models/bilibili/bilibili.query.d.ts +13 -0
- package/lib/types/models/bilibili/bilibili.task.d.ts +18 -0
- package/lib/types/models/bilibili/bilibili.wbi.d.ts +5 -0
- package/lib/types/models/help/help.d.ts +8 -0
- package/lib/types/models/version/version.d.ts +7 -0
- package/lib/types/models/weibo/weibo.api.d.ts +17 -0
- package/lib/types/models/weibo/weibo.get.web.data.d.ts +8 -0
- package/lib/types/models/weibo/weibo.query.d.ts +18 -0
- package/lib/types/models/weibo/weibo.task.d.ts +17 -0
- package/lib/types/utils/config.d.ts +21 -0
- package/lib/types/utils/image.d.ts +10 -0
- package/lib/types/utils/paths.d.ts +10 -0
- package/lib/types/utils/puppeteer.render.d.ts +23 -0
- package/lib/utils/config.js +108 -0
- package/lib/utils/image.js +26 -0
- package/lib/utils/paths.js +18 -0
- package/lib/utils/puppeteer.render.js +102 -0
- package/package.json +110 -0
- package/public/output.css +1 -0
- package/resources/css/dynamic/Account.css +68 -0
- package/resources/css/dynamic/Content.box.grid.4.css +4 -0
- package/resources/css/dynamic/Content.box.grid.9.css +4 -0
- package/resources/css/dynamic/Content.css +87 -0
- package/resources/css/dynamic/Footer.css +44 -0
- package/resources/css/dynamic/ForwardContent.css +11 -0
- package/resources/css/dynamic/LogoText.css +15 -0
- package/resources/css/dynamic/MainPage.css +93 -0
- package/resources/css/help/help.css +182 -0
- package/resources/css/loginQrcode/Page.css +55 -0
- package/resources/css/version/version.css +116 -0
- package/resources/fonts/iconfont.16acc2.ttf +0 -0
- package/resources/img/background/Girl.png +0 -0
- package/resources/img/icon/dynamic/bili-rich-text-module-goods-taobao.svg +1 -0
- package/resources/img/icon/dynamic/bili-rich-text-module-lottery.svg +1 -0
- package/resources/img/icon/dynamic/bilibili.svg +6 -0
- package/resources/img/icon/dynamic/weibo.svg +43 -0
- package/resources/img/icon/puplic/archaic_stone.png +0 -0
- package/resources/img/icon/puplic/condessence_crystal.png +0 -0
- package/resources/img/icon/puplic/delightful_encounter.png +0 -0
- package/resources/img/icon/puplic/diagram.png +0 -0
- package/resources/img/icon/puplic/essence_of_pure_sacred_dewdrop.png +0 -0
- package/resources/img/icon/puplic/everamber.png +0 -0
- package/resources/img/icon/puplic/flower_1.png +0 -0
- package/resources/img/icon/puplic/flower_2.png +0 -0
- package/resources/img/icon/puplic/kamera.png +0 -0
- package/resources/img/icon/puplic/lumidouce_bell.png +0 -0
- package/resources/img/icon/puplic/mora.png +0 -0
- package/resources/img/icon/puplic/pluie_lotus.png +0 -0
- package/resources/img/icon/puplic/restaurant_smoothie.png +0 -0
- package/resources/img/icon/puplic/romaritime_flower.png +0 -0
- package/resources/img/icon/puplic/shell.png +0 -0
- package/resources/img/icon/puplic/spring_of_pure_sacred_dewdrop.png +0 -0
- package/resources/img/icon/puplic/surging_sacred_chalice.png +0 -0
- package/resources/img/icon/puplic/tourbillon_device.png +0 -0
- package/resources/img/icon/puplic/unfading_silky_grace.png +0 -0
- package/resources/img/icon/puplic/wisdom.png +0 -0
- package/resources/img/icon/puplic/wondrous_lovely_flower.png +0 -0
- package/resources/img/icon/puplic//345/262/251/347/245/236/347/236/263/345/205/261/351/270/243/347/237/263.png +0 -0
- package/resources/img/icon/puplic//346/260/264/347/245/236/347/236/263/345/205/261/351/270/243/347/237/263.png +0 -0
- package/resources/img/icon/puplic//350/215/211/347/245/236/347/236/263/345/205/261/351/270/243/347/237/263.png +0 -0
- package/resources/img/icon/puplic//351/222/223/351/261/274.png +0 -0
- package/resources/img/icon/puplic//351/233/267/347/245/236/347/236/263/345/205/261/351/270/243/347/237/263.png +0 -0
- package/resources/img/icon/puplic//351/243/216/347/245/236/347/236/263/345/205/261/351/270/243/347/237/263.png +0 -0
- package/resources/img/icon/puplic//351/243/216/350/275/246.png +0 -0
- package/resources/img/readme/girl.png +0 -0
- package/resources/img/readme/min-Girl.png +0 -0
- package/resources/img/readme/mini-help.jpg +0 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import QRCode from 'qrcode';
|
|
2
|
+
import { Redis, Bot, Segment } from 'yunzai';
|
|
3
|
+
import Config from '../../utils/config.js';
|
|
4
|
+
import Image from '../../utils/image.js';
|
|
5
|
+
import { WeiboGetWebData } from './weibo.get.web.data.js';
|
|
6
|
+
import { WeiboQuery } from './weibo.query.js';
|
|
7
|
+
|
|
8
|
+
class WeiboTask {
|
|
9
|
+
taskName;
|
|
10
|
+
key;
|
|
11
|
+
e;
|
|
12
|
+
constructor(e) {
|
|
13
|
+
this.taskName = "weiboTask";
|
|
14
|
+
this.key = "Yz:yuki:weibo:upPush:";
|
|
15
|
+
}
|
|
16
|
+
async runTask() {
|
|
17
|
+
let weiboConfigData = await Config.getUserConfig("weibo", "config");
|
|
18
|
+
let weiboPushData = await Config.getUserConfig("weibo", "push");
|
|
19
|
+
let interval = weiboConfigData.interval || 7200;
|
|
20
|
+
const uidMap = new Map();
|
|
21
|
+
const dynamicList = {};
|
|
22
|
+
await this.processWeiboData(weiboPushData, uidMap, dynamicList);
|
|
23
|
+
let now = Date.now() / 1000;
|
|
24
|
+
await this.pushDynamicMessages(uidMap, dynamicList, now, interval, weiboConfigData);
|
|
25
|
+
}
|
|
26
|
+
async processWeiboData(weiboPushData, uidMap, dynamicList) {
|
|
27
|
+
for (let chatType in weiboPushData) {
|
|
28
|
+
for (let chatId in weiboPushData[chatType]) {
|
|
29
|
+
const subUpsOfChat = weiboPushData[chatType][chatId] || [];
|
|
30
|
+
for (let subInfoOfup of subUpsOfChat) {
|
|
31
|
+
const resp = await new WeiboGetWebData().getBloggerDynamicList(subInfoOfup.uid);
|
|
32
|
+
if (resp) {
|
|
33
|
+
const dynamicData = resp || [];
|
|
34
|
+
dynamicList[subInfoOfup.uid] = dynamicData;
|
|
35
|
+
}
|
|
36
|
+
const chatIds = Array.from(new Set([...Object((uidMap.get(subInfoOfup.uid) && uidMap.get(subInfoOfup.uid).chatIds) || []), chatId]));
|
|
37
|
+
const bot_id = subInfoOfup.bot_id || [];
|
|
38
|
+
const { name, type } = subInfoOfup;
|
|
39
|
+
uidMap.set(subInfoOfup.uid, { chatIds, bot_id, upName: name, type, chatType });
|
|
40
|
+
await this.randomDelay(1000, 4000);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async pushDynamicMessages(uidMap, dynamicList, now, interval, weiboConfigData) {
|
|
46
|
+
for (let [key, value] of uidMap) {
|
|
47
|
+
const tempDynamicList = dynamicList[key] || [];
|
|
48
|
+
const willPushDynamicList = [];
|
|
49
|
+
for (let dynamicItem of tempDynamicList) {
|
|
50
|
+
let raw_post = dynamicItem || {};
|
|
51
|
+
let user = raw_post?.mblog?.user || {};
|
|
52
|
+
logger.info(`正在检测微博动态 [ ${user?.screen_name} : ${user?.id} ]`);
|
|
53
|
+
if (!raw_post?.mblog?.created_at)
|
|
54
|
+
continue;
|
|
55
|
+
if (Number(now - (WeiboQuery.getDynamicCreatetDate(raw_post) / 1000)) > interval) {
|
|
56
|
+
logger.info(`超过间隔时间,跳过该博主 [ ${user?.screen_name} : ${user?.id} ] ${raw_post?.mblog?.created_at} 的动态`);
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (dynamicItem.type === "DYNAMIC_TYPE_FORWARD" && !weiboConfigData.pushTransmit)
|
|
60
|
+
continue;
|
|
61
|
+
willPushDynamicList.push(dynamicItem);
|
|
62
|
+
}
|
|
63
|
+
const pushMapInfo = value || {};
|
|
64
|
+
const { chatIds, bot_id, upName, type, chatType } = pushMapInfo;
|
|
65
|
+
for (let pushDynamicData of willPushDynamicList) {
|
|
66
|
+
if (chatIds && chatIds.length) {
|
|
67
|
+
for (let chatId of chatIds) {
|
|
68
|
+
if (type && type.length && !type.includes(pushDynamicData.type))
|
|
69
|
+
continue;
|
|
70
|
+
await this.sendDynamic(chatId, bot_id, upName, pushDynamicData, weiboConfigData, chatType);
|
|
71
|
+
await this.randomDelay(2000, 10500);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async sendDynamic(chatId, bot_id, upName, pushDynamicData, weiboConfigData, chatType) {
|
|
78
|
+
const id_str = WeiboQuery.getDynamicId(pushDynamicData);
|
|
79
|
+
let sended = await Redis.get(`${this.key}${chatId}:${id_str}`);
|
|
80
|
+
if (sended)
|
|
81
|
+
return;
|
|
82
|
+
if (!!weiboConfigData.pushMsgMode) {
|
|
83
|
+
const { data, uid } = await WeiboQuery.formatDynamicData(pushDynamicData);
|
|
84
|
+
const eval2 = eval;
|
|
85
|
+
let banWords = eval2(`/${weiboConfigData.banWords.join("|")}/g`);
|
|
86
|
+
if (new RegExp(banWords).test(`${data?.title}${data?.content}`)) {
|
|
87
|
+
return "return";
|
|
88
|
+
}
|
|
89
|
+
let boxGrid = !!weiboConfigData.boxGrid === false ? false : true;
|
|
90
|
+
let isSplit = !!weiboConfigData.isSplit === false ? false : true;
|
|
91
|
+
let style = isSplit ? '' : '.unfold { height: 7500px; }';
|
|
92
|
+
const extentData = { ...data };
|
|
93
|
+
const urlQrcodeData = await QRCode.toDataURL(extentData?.url);
|
|
94
|
+
let renderData = this.buildRenderData(extentData, urlQrcodeData, boxGrid);
|
|
95
|
+
const ScreenshotOptionsData = {
|
|
96
|
+
addStyle: style,
|
|
97
|
+
header: { 'Referer': 'https://weibo.com' },
|
|
98
|
+
isSplit: isSplit,
|
|
99
|
+
modelName: 'weibo',
|
|
100
|
+
SOptions: {
|
|
101
|
+
type: 'jpeg',
|
|
102
|
+
quality: 98,
|
|
103
|
+
},
|
|
104
|
+
saveHtmlfile: false,
|
|
105
|
+
};
|
|
106
|
+
let imgs = await this.renderDynamicCard(uid, renderData, ScreenshotOptionsData);
|
|
107
|
+
if (!imgs)
|
|
108
|
+
return;
|
|
109
|
+
Redis.set(`${this.key}${chatId}:${id_str}`, "1", { EX: 3600 * 10 });
|
|
110
|
+
(logger ?? Bot.logger)?.mark("优纪插件:B站动态执行推送");
|
|
111
|
+
for (let i = 0; i < imgs.length; i++) {
|
|
112
|
+
const image = imgs[i];
|
|
113
|
+
await this.sendMessage(chatId, bot_id, chatType, Segment.image(image));
|
|
114
|
+
await this.randomDelay(2000, 6500);
|
|
115
|
+
}
|
|
116
|
+
await this.randomDelay(1000, 2000);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
const dynamicMsg = await WeiboQuery.formatTextDynamicData(upName, pushDynamicData, false, weiboConfigData);
|
|
120
|
+
Redis.set(`${this.key}${chatId}:${id_str}`, "1", { EX: 3600 * 10 });
|
|
121
|
+
if (dynamicMsg == "continue" || dynamicMsg == false) {
|
|
122
|
+
return "return";
|
|
123
|
+
}
|
|
124
|
+
if (weiboConfigData.banWords.length > 0) {
|
|
125
|
+
const banWords = new RegExp(weiboConfigData.banWords.join("|"), "g");
|
|
126
|
+
if (banWords.test(dynamicMsg.join(""))) {
|
|
127
|
+
return "return";
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
await this.sendMessage(chatId, bot_id, chatType, dynamicMsg);
|
|
131
|
+
await this.randomDelay(1000, 2000);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
buildRenderData(extentData, urlQrcodeData, boxGrid) {
|
|
135
|
+
if (extentData.orig && (extentData.orig).length !== 0) {
|
|
136
|
+
return {
|
|
137
|
+
data: {
|
|
138
|
+
appName: "weibo",
|
|
139
|
+
boxGrid: boxGrid,
|
|
140
|
+
type: extentData?.type,
|
|
141
|
+
face: extentData?.face,
|
|
142
|
+
pendant: extentData?.pendant,
|
|
143
|
+
name: extentData?.name,
|
|
144
|
+
pubTs: extentData?.pubTs,
|
|
145
|
+
title: extentData?.title,
|
|
146
|
+
content: extentData?.content,
|
|
147
|
+
urlImgData: urlQrcodeData,
|
|
148
|
+
created: extentData?.created,
|
|
149
|
+
pics: extentData?.pics,
|
|
150
|
+
category: extentData?.category,
|
|
151
|
+
orig: {
|
|
152
|
+
data: {
|
|
153
|
+
type: extentData?.orig?.data?.type,
|
|
154
|
+
face: extentData?.orig?.data?.face,
|
|
155
|
+
pendant: extentData?.orig?.data?.pendant,
|
|
156
|
+
name: extentData?.orig?.data?.name,
|
|
157
|
+
pubTs: extentData?.orig?.data?.pubTs,
|
|
158
|
+
title: extentData?.orig?.data?.title,
|
|
159
|
+
content: extentData?.orig?.data?.content,
|
|
160
|
+
pics: extentData?.orig?.data?.pics,
|
|
161
|
+
category: extentData?.orig?.data?.category,
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
return {
|
|
169
|
+
data: {
|
|
170
|
+
appName: "weibo",
|
|
171
|
+
boxGrid: boxGrid,
|
|
172
|
+
type: extentData?.type,
|
|
173
|
+
face: extentData?.face,
|
|
174
|
+
pendant: extentData?.pendant,
|
|
175
|
+
name: extentData?.name,
|
|
176
|
+
pubTs: extentData?.pubTs,
|
|
177
|
+
title: extentData?.title,
|
|
178
|
+
content: extentData?.content,
|
|
179
|
+
urlImgData: urlQrcodeData,
|
|
180
|
+
created: extentData?.created,
|
|
181
|
+
pics: extentData?.pics,
|
|
182
|
+
category: extentData?.category,
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
async renderDynamicCard(uid, renderData, ScreenshotOptionsData) {
|
|
188
|
+
const dynamicMsg = await Image.renderPage(uid, "MainPage", renderData, ScreenshotOptionsData);
|
|
189
|
+
if (dynamicMsg !== false) {
|
|
190
|
+
return dynamicMsg.img;
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
async sendMessage(chatId, bot_id, chatType, message) {
|
|
197
|
+
if (chatType === "group") {
|
|
198
|
+
await (Bot[bot_id] ?? Bot)?.pickGroup(String(chatId)).sendMsg(message)
|
|
199
|
+
.catch((error) => {
|
|
200
|
+
(logger ?? Bot.logger)?.error(`群组[${chatId}]推送失败:${JSON.stringify(error)}`);
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
else if (chatType === "private") {
|
|
204
|
+
await (Bot[bot_id] ?? Bot)?.pickUser(String(chatId)).sendMsg(message)
|
|
205
|
+
.catch((error) => {
|
|
206
|
+
(logger ?? Bot.logger)?.error(`用户[${chatId}]推送失败:${JSON.stringify(error)}`);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
async randomDelay(min, max) {
|
|
211
|
+
await new Promise((resolve) => setTimeout(resolve, Math.floor(Math.random() * (max - min + 1) + min)));
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export { WeiboTask };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type AccountProps = {
|
|
3
|
+
data: {
|
|
4
|
+
appName: string;
|
|
5
|
+
face?: string;
|
|
6
|
+
pendant?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
pubTs?: any;
|
|
9
|
+
category?: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
declare const Account: React.FC<AccountProps>;
|
|
13
|
+
export default Account;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type MainProps = {
|
|
3
|
+
data: {
|
|
4
|
+
appName: string;
|
|
5
|
+
boxGrid?: boolean;
|
|
6
|
+
type?: string;
|
|
7
|
+
face?: string;
|
|
8
|
+
pendant?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
pubTs: any;
|
|
11
|
+
title?: string;
|
|
12
|
+
content?: string;
|
|
13
|
+
urlImgData?: string;
|
|
14
|
+
created?: any;
|
|
15
|
+
pics?: Array<any>;
|
|
16
|
+
category?: string;
|
|
17
|
+
orig?: {
|
|
18
|
+
data?: {
|
|
19
|
+
type?: string;
|
|
20
|
+
face?: string;
|
|
21
|
+
pendant?: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
pubTs?: any;
|
|
24
|
+
title?: string;
|
|
25
|
+
content?: string;
|
|
26
|
+
urlImgData?: string;
|
|
27
|
+
created?: any;
|
|
28
|
+
pics?: string[];
|
|
29
|
+
category?: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export default function App({ data }: MainProps): React.JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare const MainPage: typeof import("./dynamic/MainPage").default;
|
|
2
|
+
declare const Help: typeof import("./help/Help").default;
|
|
3
|
+
declare const LoginQrcodePage: typeof import("./loginQrcode/Page").default;
|
|
4
|
+
declare const Version: typeof import("./version/Version").default;
|
|
5
|
+
export { Help, LoginQrcodePage, MainPage, Version };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare class BiliApi {
|
|
2
|
+
static BILIBIL_API: {
|
|
3
|
+
biliDynamicInfoList: string;
|
|
4
|
+
biliUpFollowFans: string;
|
|
5
|
+
biliSpaceUserInfo: string;
|
|
6
|
+
biliSpaceUserInfoWbi: string;
|
|
7
|
+
biliSearchUp: string;
|
|
8
|
+
biliLiveStatus: string;
|
|
9
|
+
biliCard: string;
|
|
10
|
+
biliStat: string;
|
|
11
|
+
biliLiveUserInfo: string;
|
|
12
|
+
biliOpusDetail: string;
|
|
13
|
+
};
|
|
14
|
+
static BILIBILI_HEADERS: {
|
|
15
|
+
Accept: string;
|
|
16
|
+
'Accept-Language': string;
|
|
17
|
+
'Accept-Encoding': string;
|
|
18
|
+
'Content-type': string;
|
|
19
|
+
Cookie: string;
|
|
20
|
+
pragma: string;
|
|
21
|
+
"Cache-control": string;
|
|
22
|
+
DNT: string;
|
|
23
|
+
'Sec-GPC': string;
|
|
24
|
+
'sec-ch-ua-platform': string;
|
|
25
|
+
'sec-ch-ua-mobile': string;
|
|
26
|
+
'Sec-Fetch-Dest': string;
|
|
27
|
+
'Sec-Fetch-Mode': string;
|
|
28
|
+
'Sec-Fetch-Site': string;
|
|
29
|
+
'Sec-Fetch-User': string;
|
|
30
|
+
TE: string;
|
|
31
|
+
"Upgrade-Insecure-Requests": string;
|
|
32
|
+
'User-Agent': string;
|
|
33
|
+
};
|
|
34
|
+
static BIlIBILI_LOGIN_HEADERS: {
|
|
35
|
+
Accept: string;
|
|
36
|
+
'Accept-Language': string;
|
|
37
|
+
'Accept-Encoding': string;
|
|
38
|
+
DNT: string;
|
|
39
|
+
'Sec-GPC': string;
|
|
40
|
+
'Upgrade-Insecure-Requests': string;
|
|
41
|
+
'Sec-Fetch-Dest': string;
|
|
42
|
+
'Sec-Fetch-Mode': string;
|
|
43
|
+
'Sec-Fetch-Site': string;
|
|
44
|
+
'Sec-Fetch-User': string;
|
|
45
|
+
TE: string;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare class BiliGetWebData {
|
|
2
|
+
constructor(e?: any);
|
|
3
|
+
getBiliDynamicListDataByUid(uid: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
4
|
+
getBilibiUserInfoByUid(uid: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
5
|
+
searchBiliUserInfoByKeyword(keyword: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { EventType } from 'yunzai';
|
|
2
|
+
export declare function applyLoginQRCode(e: EventType): Promise<any>;
|
|
3
|
+
export declare function pollLoginQRCode(e: EventType, qrcodeKey: string): Promise<string>;
|
|
4
|
+
export declare function checkBiliLogin(e: EventType): Promise<void>;
|
|
5
|
+
export declare function exitBiliLogin(e: EventType): Promise<void>;
|
|
6
|
+
export declare function saveLoginCookie(e: EventType, biliLoginCk: string): Promise<void>;
|
|
7
|
+
export declare function saveLocalBiliCk(data: any): Promise<void>;
|
|
8
|
+
export declare function readTempCk(): Promise<string>;
|
|
9
|
+
export declare function saveTempCk(newTempCk: any): Promise<void>;
|
|
10
|
+
export declare function readSyncCookie(): Promise<{
|
|
11
|
+
cookie: any;
|
|
12
|
+
mark: string;
|
|
13
|
+
}>;
|
|
14
|
+
export declare function readSavedCookieItems(mark: string, items: Array<string>, isInverted?: boolean): Promise<string>;
|
|
15
|
+
export declare function readSavedCookieOtherItems(mark: string, items: Array<string>): Promise<string>;
|
|
16
|
+
export declare function genUUID(): Promise<string>;
|
|
17
|
+
export declare function gen_b_lsid(): Promise<string>;
|
|
18
|
+
export declare function getNewTempCk(): Promise<void>;
|
|
19
|
+
export declare function postGateway(cookie: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
20
|
+
export declare function get_buvid_fp(cookie: string): Promise<string>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class BiliQuery {
|
|
2
|
+
static formatDynamicData(data: any): {
|
|
3
|
+
uid: any;
|
|
4
|
+
data: {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
static parseRichTextNodes: (nodes: any[] | string | any) => any;
|
|
9
|
+
static formatUrl(url: string): string;
|
|
10
|
+
static formatTextDynamicData(upName: string, data: any, isForward: boolean, setData: any): Promise<any>;
|
|
11
|
+
static dynamicContentLimit(content: string, setData: any): string;
|
|
12
|
+
static typeHandle(up: any, msg: string, type: string): unknown[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EventType } from 'yunzai';
|
|
2
|
+
import { MainProps } from "../../components/dynamic/MainPage";
|
|
3
|
+
import { ScreenshotOptions } from './../../utils/puppeteer.render';
|
|
4
|
+
export declare class BiliTask {
|
|
5
|
+
taskName: string;
|
|
6
|
+
key: string;
|
|
7
|
+
e?: EventType;
|
|
8
|
+
constructor(e?: EventType);
|
|
9
|
+
hendleEventDynamicData(uid: string | number, count?: number): Promise<any>;
|
|
10
|
+
runTask(): Promise<void>;
|
|
11
|
+
processBiliData(biliPushData: any, uidMap: Map<any, any>, dynamicList: any, lastLiveStatus: any): Promise<void>;
|
|
12
|
+
pushDynamicMessages(uidMap: Map<any, any>, dynamicList: any, now: number, interval: number, biliConfigData: any): Promise<void>;
|
|
13
|
+
sendDynamic(chatId: string | number, bot_id: string | number, upName: string, pushDynamicData: any, biliConfigData: any, chatType: string): Promise<string>;
|
|
14
|
+
buildRenderData(extentData: any, urlQrcodeData: string, boxGrid: boolean): MainProps;
|
|
15
|
+
renderDynamicCard(uid: string, renderData: MainProps, ScreenshotOptionsData: ScreenshotOptions): Promise<Buffer[] | null>;
|
|
16
|
+
sendMessage(chatId: string | number, bot_id: string | number, chatType: string, message: any): Promise<void>;
|
|
17
|
+
randomDelay(min: number, max: number): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class WeiboApi {
|
|
2
|
+
static WEIBO_API: {
|
|
3
|
+
weiboGetIndex: string;
|
|
4
|
+
weiboAjaxSearch: string;
|
|
5
|
+
};
|
|
6
|
+
static WEIBO_HEADERS: {
|
|
7
|
+
Accept: string;
|
|
8
|
+
'Accept-language': string;
|
|
9
|
+
Authority: string;
|
|
10
|
+
'Cache-control': string;
|
|
11
|
+
'Sec-fetch-dest': string;
|
|
12
|
+
'Sec-fetch-mode': string;
|
|
13
|
+
'Sec-fetch-site': string;
|
|
14
|
+
'Upgrade-insecure-requests': string;
|
|
15
|
+
'User-agent': string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EventType } from 'yunzai';
|
|
2
|
+
export declare class WeiboGetWebData {
|
|
3
|
+
e?: EventType;
|
|
4
|
+
constructor(e?: EventType);
|
|
5
|
+
getBloggerInfo(target: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
6
|
+
searchBloggerInfo(keyword: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
7
|
+
getBloggerDynamicList(target: any): Promise<any>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare class WeiboQuery {
|
|
2
|
+
static getDynamicId(post: any): any;
|
|
3
|
+
static filterCardTypeCustom(raw_post: any): boolean;
|
|
4
|
+
static getDynamicCreatetDate(raw_post: any): number;
|
|
5
|
+
static MakeCategory(raw_post: any): "DYNAMIC_TYPE_AV" | "DYNAMIC_TYPE_DRAW" | "DYNAMIC_TYPE_ARTICLE" | "DYNAMIC_TYPE_FORWARD";
|
|
6
|
+
static filterText(raw_text: string): string;
|
|
7
|
+
static formatDynamicData(raw_post: any): Promise<{
|
|
8
|
+
uid: any;
|
|
9
|
+
data: {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
13
|
+
static parseRichTextNodes: (nodes: any[] | string | any) => any;
|
|
14
|
+
static formatTextDynamicData(upName: string, raw_post: any, isForward?: boolean, setData?: any): Promise<false | any[] | "continue">;
|
|
15
|
+
static dynamicContentLimit(content: string, setData: any): string;
|
|
16
|
+
static formatUrl(url: string): string;
|
|
17
|
+
static typeHandle(up: any, msg: string, type: string): unknown[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EventType } from 'yunzai';
|
|
2
|
+
import { MainProps } from "../../components/dynamic/MainPage";
|
|
3
|
+
import { ScreenshotOptions } from '../../utils/puppeteer.render';
|
|
4
|
+
export declare class WeiboTask {
|
|
5
|
+
taskName: string;
|
|
6
|
+
key: string;
|
|
7
|
+
e?: EventType;
|
|
8
|
+
constructor(e?: any);
|
|
9
|
+
runTask(): Promise<void>;
|
|
10
|
+
processWeiboData(weiboPushData: any, uidMap: Map<any, any>, dynamicList: any): Promise<void>;
|
|
11
|
+
pushDynamicMessages(uidMap: Map<any, any>, dynamicList: any, now: number, interval: number, weiboConfigData: any): Promise<void>;
|
|
12
|
+
sendDynamic(chatId: string | number, bot_id: string | number, upName: string, pushDynamicData: any, weiboConfigData: any, chatType: string): Promise<string>;
|
|
13
|
+
buildRenderData(extentData: any, urlQrcodeData: string, boxGrid: boolean): MainProps;
|
|
14
|
+
renderDynamicCard(uid: string | number, renderData: MainProps, ScreenshotOptionsData: ScreenshotOptions): Promise<Buffer[] | null>;
|
|
15
|
+
sendMessage(chatId: string | number, bot_id: string | number, chatType: string, message: any): Promise<void>;
|
|
16
|
+
randomDelay(min: number, max: number): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import chokidar from "chokidar";
|
|
2
|
+
declare class Config {
|
|
3
|
+
readonly versionPath: string;
|
|
4
|
+
readonly defaultConfigPath: string;
|
|
5
|
+
readonly userConfigPath: string;
|
|
6
|
+
defaultConfig: Record<string, any>;
|
|
7
|
+
userConfig: Record<string, any>;
|
|
8
|
+
watcher: Record<string, chokidar.FSWatcher>;
|
|
9
|
+
constructor();
|
|
10
|
+
initConfigFiles(): void;
|
|
11
|
+
getConfigData(typeDir: string, appDir: string, functionName: string): any;
|
|
12
|
+
getConfigFilePath(typeDir: string, appDir: string, functionName: string): string;
|
|
13
|
+
watch(configFilePath: string, typeDir: string, appDir: string, functionName: string): void;
|
|
14
|
+
getDefaultConfig(appDir: string, functionName: string): any;
|
|
15
|
+
getUserConfig(appDir: string, functionName: string): any;
|
|
16
|
+
saveConfig(typeDir: string, appDir: string, functionName: string, data: any): void;
|
|
17
|
+
updateConfigItem(appDir: string, functionName: string, key: string, value: any): void;
|
|
18
|
+
getLatestVersion(): string | null;
|
|
19
|
+
}
|
|
20
|
+
declare const _default: Config;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Picture, ComponentCreateOpsionType } from 'react-puppeteer';
|
|
2
|
+
import { ScreenshotOptions } from './puppeteer.render';
|
|
3
|
+
export declare class Image extends Picture {
|
|
4
|
+
constructor();
|
|
5
|
+
renderPage<T = any>(uid: number | string, page: string, props?: T, ScreenshotOptions?: ScreenshotOptions, ComponentCreateOpsion?: ComponentCreateOpsionType): Promise<false | {
|
|
6
|
+
img: Buffer[];
|
|
7
|
+
}>;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: Image;
|
|
10
|
+
export default _default;
|