@iflyrpa/actions 1.2.16 → 1.2.18-beta.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/dist/actions/common/FansTool/index.d.ts +3 -9
- package/dist/actions/common/sessionCheck/index.d.ts +16 -0
- package/dist/actions/getBaijiaohaoConfig/index.d.ts +1 -0
- package/dist/actions/getWeixinConfig/index.d.ts +16 -0
- package/dist/actions/searchAccountInfo/getBjhInfo.d.ts +3 -0
- package/dist/actions/searchAccountInfo/getTTInfo.d.ts +3 -0
- package/dist/actions/searchAccountInfo/getWxInfo.d.ts +3 -0
- package/dist/actions/searchAccountInfo/getXhsInfo.d.ts +3 -0
- package/dist/actions/searchAccountInfo/index.d.ts +8 -0
- package/dist/actions/searchAccountInfo/types.d.ts +44 -0
- package/dist/actions/searchPublishInfo/handleBjhData.d.ts +3 -0
- package/dist/actions/searchPublishInfo/handleTTData.d.ts +3 -0
- package/dist/actions/searchPublishInfo/handleWXData.d.ts +3 -0
- package/dist/actions/searchPublishInfo/handleXhsData.d.ts +3 -0
- package/dist/actions/searchPublishInfo/index.d.ts +15 -0
- package/dist/actions/searchPublishInfo/types.d.ts +52 -0
- package/dist/bundle.js +1523 -19
- package/dist/bundle.js.map +1 -1
- package/dist/index.d.ts +16 -6
- package/dist/index.js +1509 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1509 -17
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -10,6 +10,672 @@ import * as __WEBPACK_EXTERNAL_MODULE_form_data_cf000082__ from "form-data";
|
|
|
10
10
|
import * as __WEBPACK_EXTERNAL_MODULE_node_buffer_fb286294__ from "node:buffer";
|
|
11
11
|
import * as __WEBPACK_EXTERNAL_MODULE_node_crypto_9ba42079__ from "node:crypto";
|
|
12
12
|
var __webpack_modules__ = {
|
|
13
|
+
"./src/utils/XhsXsCommonEnc.js": function(module) {
|
|
14
|
+
var encrypt_lookup = [
|
|
15
|
+
"Z",
|
|
16
|
+
"m",
|
|
17
|
+
"s",
|
|
18
|
+
"e",
|
|
19
|
+
"r",
|
|
20
|
+
"b",
|
|
21
|
+
"B",
|
|
22
|
+
"o",
|
|
23
|
+
"H",
|
|
24
|
+
"Q",
|
|
25
|
+
"t",
|
|
26
|
+
"N",
|
|
27
|
+
"P",
|
|
28
|
+
"+",
|
|
29
|
+
"w",
|
|
30
|
+
"O",
|
|
31
|
+
"c",
|
|
32
|
+
"z",
|
|
33
|
+
"a",
|
|
34
|
+
"/",
|
|
35
|
+
"L",
|
|
36
|
+
"p",
|
|
37
|
+
"n",
|
|
38
|
+
"g",
|
|
39
|
+
"G",
|
|
40
|
+
"8",
|
|
41
|
+
"y",
|
|
42
|
+
"J",
|
|
43
|
+
"q",
|
|
44
|
+
"4",
|
|
45
|
+
"2",
|
|
46
|
+
"K",
|
|
47
|
+
"W",
|
|
48
|
+
"Y",
|
|
49
|
+
"j",
|
|
50
|
+
"0",
|
|
51
|
+
"D",
|
|
52
|
+
"S",
|
|
53
|
+
"f",
|
|
54
|
+
"d",
|
|
55
|
+
"i",
|
|
56
|
+
"k",
|
|
57
|
+
"x",
|
|
58
|
+
"3",
|
|
59
|
+
"V",
|
|
60
|
+
"T",
|
|
61
|
+
"1",
|
|
62
|
+
"6",
|
|
63
|
+
"I",
|
|
64
|
+
"l",
|
|
65
|
+
"U",
|
|
66
|
+
"A",
|
|
67
|
+
"F",
|
|
68
|
+
"M",
|
|
69
|
+
"9",
|
|
70
|
+
"7",
|
|
71
|
+
"h",
|
|
72
|
+
"E",
|
|
73
|
+
"C",
|
|
74
|
+
"v",
|
|
75
|
+
"u",
|
|
76
|
+
"R",
|
|
77
|
+
"X",
|
|
78
|
+
"5"
|
|
79
|
+
];
|
|
80
|
+
let esm_typeof = {};
|
|
81
|
+
esm_typeof.A = function(t) {
|
|
82
|
+
return typeof t;
|
|
83
|
+
};
|
|
84
|
+
function encrypt_b64Encode(t) {
|
|
85
|
+
var e = 664, r = 634, n = 448, o = 599, i = 315, a = 416, u = 512, s = 361, c = 406, l = 487, f = 496, p = 333, h = 630, d = 639, v = 548, g = 582, m = 447, y = 468, w = 375, b = 331, _ = 149, E = 382, x = 265, k = 625, T = 570, S = 551, A = 582, L = 581, I = 638, R = 618, O = 606, C = 429, N = 651, P = 667, B = 817, M = 333, j = 567, F = 747, D = 561, q = 570, U = 676, G = 840, H = 240, V = {
|
|
86
|
+
udFrB: function(t, e) {
|
|
87
|
+
return t % e;
|
|
88
|
+
},
|
|
89
|
+
cCZFe: function(t, e) {
|
|
90
|
+
return t === e;
|
|
91
|
+
},
|
|
92
|
+
jevwl: function(t, e) {
|
|
93
|
+
return t - e;
|
|
94
|
+
},
|
|
95
|
+
aqlTy: function(t, e) {
|
|
96
|
+
return t + e;
|
|
97
|
+
},
|
|
98
|
+
rceYY: function(t, e) {
|
|
99
|
+
return t >> e;
|
|
100
|
+
},
|
|
101
|
+
OwjMq: function(t, e) {
|
|
102
|
+
return t & e;
|
|
103
|
+
},
|
|
104
|
+
kSGXO: function(t, e) {
|
|
105
|
+
return t << e;
|
|
106
|
+
},
|
|
107
|
+
veNiI: function(t, e) {
|
|
108
|
+
return t === e;
|
|
109
|
+
},
|
|
110
|
+
QLthP: function(t, e) {
|
|
111
|
+
return t + e;
|
|
112
|
+
},
|
|
113
|
+
wDtJz: function(t, e) {
|
|
114
|
+
return t + e;
|
|
115
|
+
},
|
|
116
|
+
nYqUQ: function(t, e) {
|
|
117
|
+
return t & e;
|
|
118
|
+
},
|
|
119
|
+
TCArD: function(t, e) {
|
|
120
|
+
return t << e;
|
|
121
|
+
},
|
|
122
|
+
RHteb: function(t, e) {
|
|
123
|
+
return t - e;
|
|
124
|
+
},
|
|
125
|
+
mZPJZ: function(t, e) {
|
|
126
|
+
return t < e;
|
|
127
|
+
},
|
|
128
|
+
zDETq: function(t, e, r, n) {
|
|
129
|
+
return t(e, r, n);
|
|
130
|
+
},
|
|
131
|
+
YlZGp: function(t, e) {
|
|
132
|
+
return t > e;
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
function W(t, e) {
|
|
136
|
+
return a0_0x10f4ac(e, t - -H);
|
|
137
|
+
}
|
|
138
|
+
for(var X = (W(-413, -442) + W(-e, -r) + "7")[W(-n, -o)]("|"), z = 0;;){
|
|
139
|
+
switch(X[z++]){
|
|
140
|
+
case "0":
|
|
141
|
+
var Y;
|
|
142
|
+
continue;
|
|
143
|
+
case "1":
|
|
144
|
+
var K = [];
|
|
145
|
+
continue;
|
|
146
|
+
case "2":
|
|
147
|
+
var J = V[W(-i, -a)]($, 3);
|
|
148
|
+
continue;
|
|
149
|
+
case "3":
|
|
150
|
+
var $ = t[W(-350, -u)];
|
|
151
|
+
continue;
|
|
152
|
+
case "4":
|
|
153
|
+
V[W(-s, -c)](J, 1) ? (Y = t[V[W(-l, -f)]($, 1)], K[W(-p, -346)](V[W(-h, -d)](encrypt_lookup[V[W(-503, -v)](Y, 2)] + encrypt_lookup[V[W(-g, -741)](V[W(-331, -m)](Y, 4), 63)], "=="))) : V[W(-y, -w)](J, 2) && (Y = V[W(-b, -_)](t[$ - 2], 8) + t[V[W(-l, -E)]($, 1)], K[W(-333, -x)](V[W(-k, -505)](V[W(-T, -S)](encrypt_lookup[Y >> 10], encrypt_lookup[V[W(-A, -L)](Y >> 4, 63)]) + encrypt_lookup[V[W(-I, -R)](V[W(-O, -C)](Y, 2), 63)], "=")));
|
|
154
|
+
continue;
|
|
155
|
+
case "5":
|
|
156
|
+
var Q = 16383;
|
|
157
|
+
continue;
|
|
158
|
+
case "6":
|
|
159
|
+
for(var Z = 0, tt = V[W(-509, -N)]($, J); V[W(-P, -B)](Z, tt); Z += Q)K[W(-M, -153)](V[W(-j, -F)](encrypt_encodeChunk, t, Z, V[W(-D, -413)](Z + Q, tt) ? tt : V[W(-q, -501)](Z, Q)));
|
|
160
|
+
continue;
|
|
161
|
+
case "7":
|
|
162
|
+
return K[W(-U, -G)]("");
|
|
163
|
+
}
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function encrypt_encodeUtf8(t) {
|
|
168
|
+
var e = 185, r = 410, n = 480, o = 222, i = 194, a = 165, u = 147, s = 290, c = 460, l = 472, f = 497, p = 462, h = 286, d = 209, v = 223, g = 590, m = {
|
|
169
|
+
bIGxm: function(t, e) {
|
|
170
|
+
return t(e);
|
|
171
|
+
},
|
|
172
|
+
MahgM: function(t, e) {
|
|
173
|
+
return t < e;
|
|
174
|
+
},
|
|
175
|
+
czxKn: function(t, e) {
|
|
176
|
+
return t === e;
|
|
177
|
+
},
|
|
178
|
+
clYIu: function(t, e) {
|
|
179
|
+
return t + e;
|
|
180
|
+
}
|
|
181
|
+
}, y = m[b(477, 488)](encodeURIComponent, t), w = [];
|
|
182
|
+
function b(t, e) {
|
|
183
|
+
return a0_0x10f4ac(t, e - g);
|
|
184
|
+
}
|
|
185
|
+
for(var _ = 0; m[b(333, e)](_, y[b(r, n)]); _++){
|
|
186
|
+
var E = y[b(o, 290)](_);
|
|
187
|
+
if (m[b(i, a)](E, "%")) {
|
|
188
|
+
var x = y[b(u, s)](m[b(574, 472)](_, 1)) + y[b(c, 290)](m[b(605, l)](_, 2)), k = parseInt(x, 16);
|
|
189
|
+
w[b(592, f)](k), _ += 2;
|
|
190
|
+
} else w[b(p, f)](E[b(217, h) + b(d, v)](0));
|
|
191
|
+
}
|
|
192
|
+
return w;
|
|
193
|
+
}
|
|
194
|
+
function sign_common(h) {
|
|
195
|
+
return encrypt_b64Encode(encrypt_encodeUtf8(JSON.stringify(h)));
|
|
196
|
+
}
|
|
197
|
+
function encrypt_tripletToBase64(t) {
|
|
198
|
+
var e = 11, r = 15, n = 199, o = 34, i = 4, a = 102, u = 276, s = 205, c = 218, l = 11, f = 115, p = 34, h = 161, d = 123, v = 335, g = {};
|
|
199
|
+
function m(t, e) {
|
|
200
|
+
return a0_0x10f4ac(e, t - v);
|
|
201
|
+
}
|
|
202
|
+
g[m(205, 328)] = function(t, e) {
|
|
203
|
+
return t + e;
|
|
204
|
+
}, g[m(e, 53)] = function(t, e) {
|
|
205
|
+
return t >> e;
|
|
206
|
+
}, g[m(r, n)] = function(t, e) {
|
|
207
|
+
return t & e;
|
|
208
|
+
}, g[m(o, i)] = function(t, e) {
|
|
209
|
+
return t >> e;
|
|
210
|
+
}, g[m(-a, -u)] = function(t, e) {
|
|
211
|
+
return t & e;
|
|
212
|
+
};
|
|
213
|
+
var y = g;
|
|
214
|
+
return y[m(s, c)](encrypt_lookup[63 & y[m(l, -75)](t, 18)], encrypt_lookup[y[m(r, f)](y[m(p, h)](t, 12), 63)]) + encrypt_lookup[t >> 6 & 63] + encrypt_lookup[y[m(-a, -d)](t, 63)];
|
|
215
|
+
}
|
|
216
|
+
function encrypt_encodeChunk(t, e, r) {
|
|
217
|
+
var n, o = 165, i = 246, a = 205, u = 353, s = 162, c = 17, l = 351, f = 191, p = 139, h = 79, d = 86, v = 233, g = 270, m = 166, y = {
|
|
218
|
+
hwomB: function(t, e) {
|
|
219
|
+
return t < e;
|
|
220
|
+
},
|
|
221
|
+
iHUeL: function(t, e) {
|
|
222
|
+
return t & e;
|
|
223
|
+
},
|
|
224
|
+
ELxEv: function(t, e) {
|
|
225
|
+
return t << e;
|
|
226
|
+
},
|
|
227
|
+
lBuRH: function(t, e) {
|
|
228
|
+
return t << e;
|
|
229
|
+
},
|
|
230
|
+
SkIJl: function(t, e) {
|
|
231
|
+
return t & e;
|
|
232
|
+
},
|
|
233
|
+
JYxWY: function(t, e) {
|
|
234
|
+
return t + e;
|
|
235
|
+
},
|
|
236
|
+
CxjtF: function(t, e) {
|
|
237
|
+
return t(e);
|
|
238
|
+
}
|
|
239
|
+
}, w = [];
|
|
240
|
+
function b(t, e) {
|
|
241
|
+
return a0_0x10f4ac(t, e - m);
|
|
242
|
+
}
|
|
243
|
+
for(var _ = e; y[b(-63, -o)](_, r); _ += 3)n = y[b(-i, -a)](y[b(-166, -124)](t[_], 16), 16711680) + y[b(-u, -205)](y[b(s, -c)](t[_ + 1], 8), 65280) + y[b(-l, -208)](t[y[b(-350, -f)](_, 2)], 255), w[b(p, 73)](y[b(h, d)](encrypt_tripletToBase64, n));
|
|
244
|
+
return w[b(-v, -g)]("");
|
|
245
|
+
}
|
|
246
|
+
function a0_0x3693(t, e) {
|
|
247
|
+
var r = [
|
|
248
|
+
"xUKNL",
|
|
249
|
+
"jUrZI",
|
|
250
|
+
"rviFu",
|
|
251
|
+
"join",
|
|
252
|
+
"get",
|
|
253
|
+
"LjDtD",
|
|
254
|
+
"ZJHyP",
|
|
255
|
+
"wOmGY",
|
|
256
|
+
"enumera",
|
|
257
|
+
"aONWR",
|
|
258
|
+
"string",
|
|
259
|
+
"kQpMi",
|
|
260
|
+
"mZPJZ",
|
|
261
|
+
"Ysiay",
|
|
262
|
+
"czxKn",
|
|
263
|
+
"|5|6|4|",
|
|
264
|
+
"prototy",
|
|
265
|
+
"jklmnop",
|
|
266
|
+
"MuYbw",
|
|
267
|
+
"diDwk",
|
|
268
|
+
"TRFtx",
|
|
269
|
+
"drDHI",
|
|
270
|
+
"WLARA",
|
|
271
|
+
"xyz0123",
|
|
272
|
+
"asBytes",
|
|
273
|
+
"|6|0|1|",
|
|
274
|
+
"JOtEi",
|
|
275
|
+
"Oialn",
|
|
276
|
+
"OQrEi",
|
|
277
|
+
"uPnXq",
|
|
278
|
+
"VWXYZab",
|
|
279
|
+
"cIbFa",
|
|
280
|
+
"qYuta",
|
|
281
|
+
"QDOZZ",
|
|
282
|
+
"MahgM",
|
|
283
|
+
"iRXZq",
|
|
284
|
+
"22098XlFGYn",
|
|
285
|
+
"mmLKn",
|
|
286
|
+
"jMcIE",
|
|
287
|
+
"stringi",
|
|
288
|
+
"[object",
|
|
289
|
+
"nYqUQ",
|
|
290
|
+
"jSgjk",
|
|
291
|
+
"ucyEo",
|
|
292
|
+
"iewJI",
|
|
293
|
+
"vgTwl",
|
|
294
|
+
"DnNGR",
|
|
295
|
+
"oBytes",
|
|
296
|
+
"Xtwzk",
|
|
297
|
+
"aqlTy",
|
|
298
|
+
"JWnPK",
|
|
299
|
+
"1|0|2|4",
|
|
300
|
+
"qrstuvw",
|
|
301
|
+
"_gg",
|
|
302
|
+
"QLthP",
|
|
303
|
+
"FJIWy",
|
|
304
|
+
"yRnhISG",
|
|
305
|
+
"pjUsr",
|
|
306
|
+
"KAwuh",
|
|
307
|
+
"Thhoa",
|
|
308
|
+
"jarkJ",
|
|
309
|
+
"WjRNN",
|
|
310
|
+
"asStrin",
|
|
311
|
+
"x3VT16I",
|
|
312
|
+
"357835LaQWjW",
|
|
313
|
+
"SkIJl",
|
|
314
|
+
"size",
|
|
315
|
+
"iyorr",
|
|
316
|
+
"iHUeL",
|
|
317
|
+
"tTanW",
|
|
318
|
+
"tNusJ",
|
|
319
|
+
"NiSrP",
|
|
320
|
+
"eAt",
|
|
321
|
+
"TCArD",
|
|
322
|
+
"a2r1ZQo",
|
|
323
|
+
"iamspam",
|
|
324
|
+
"bOnfu",
|
|
325
|
+
"UNSKg",
|
|
326
|
+
"HIJKLMN",
|
|
327
|
+
"ZfMKC",
|
|
328
|
+
"bJhXU",
|
|
329
|
+
"zwAAc",
|
|
330
|
+
"JYxWY",
|
|
331
|
+
"lUAFM97",
|
|
332
|
+
"mwaRe",
|
|
333
|
+
"EzYWD",
|
|
334
|
+
"replace",
|
|
335
|
+
"uOtUJ",
|
|
336
|
+
"__esMod",
|
|
337
|
+
"ViQWI",
|
|
338
|
+
"aCMFL",
|
|
339
|
+
"EAKSd",
|
|
340
|
+
"ule",
|
|
341
|
+
"pqnFP",
|
|
342
|
+
"qYDsL",
|
|
343
|
+
"270726pnaYfG",
|
|
344
|
+
"glBZG",
|
|
345
|
+
"OwjMq",
|
|
346
|
+
"YGrjc",
|
|
347
|
+
"ZhAcd",
|
|
348
|
+
"JDqFL",
|
|
349
|
+
"456789+",
|
|
350
|
+
"kEjQs",
|
|
351
|
+
"lWhbD",
|
|
352
|
+
"OaLTI",
|
|
353
|
+
"dXlgm",
|
|
354
|
+
"cVte9UJ",
|
|
355
|
+
"ctor",
|
|
356
|
+
"hwomB",
|
|
357
|
+
"wDtJz",
|
|
358
|
+
"constru",
|
|
359
|
+
"ABHuC",
|
|
360
|
+
"zDETq",
|
|
361
|
+
"SYNeA",
|
|
362
|
+
"BGbij",
|
|
363
|
+
"ionFq",
|
|
364
|
+
"QzaNS",
|
|
365
|
+
"7|3|5|4",
|
|
366
|
+
"YlZGp",
|
|
367
|
+
"Bjniw",
|
|
368
|
+
"ZITuN",
|
|
369
|
+
"KPTzH",
|
|
370
|
+
"HrBeq",
|
|
371
|
+
"xobsT",
|
|
372
|
+
"kXJkC",
|
|
373
|
+
"QSrEZ",
|
|
374
|
+
"ENXtO",
|
|
375
|
+
"FYbRJ",
|
|
376
|
+
"wOcza/L",
|
|
377
|
+
"_hh",
|
|
378
|
+
"dVXMb",
|
|
379
|
+
"ppkua",
|
|
380
|
+
"WgamZ",
|
|
381
|
+
"HuwCW",
|
|
382
|
+
"362424fnLCuh",
|
|
383
|
+
"charCod",
|
|
384
|
+
"HhPqg",
|
|
385
|
+
"ODunI",
|
|
386
|
+
"eJzqq",
|
|
387
|
+
"charAt",
|
|
388
|
+
"JGAgI",
|
|
389
|
+
"ZmserbB",
|
|
390
|
+
"TURcG",
|
|
391
|
+
"WyrqF",
|
|
392
|
+
"iYJzH",
|
|
393
|
+
"VIwfH",
|
|
394
|
+
"tzzOB",
|
|
395
|
+
"YgiCH",
|
|
396
|
+
"byyMQ",
|
|
397
|
+
"ELxEv",
|
|
398
|
+
"0DSfdik",
|
|
399
|
+
"HRihr",
|
|
400
|
+
"_ii",
|
|
401
|
+
"aDsrp",
|
|
402
|
+
"ble",
|
|
403
|
+
"jTGtW",
|
|
404
|
+
"configu",
|
|
405
|
+
"cXiYW",
|
|
406
|
+
"56kSpAsC",
|
|
407
|
+
"158KIldlA",
|
|
408
|
+
"oHQtNP+",
|
|
409
|
+
"BHavO",
|
|
410
|
+
"PCIlh",
|
|
411
|
+
"QatIf",
|
|
412
|
+
"IKyqh",
|
|
413
|
+
"Words",
|
|
414
|
+
"Qwnrg",
|
|
415
|
+
"44lQAgNu",
|
|
416
|
+
"cdefghi",
|
|
417
|
+
"nTwxD",
|
|
418
|
+
"RHteb",
|
|
419
|
+
"coqPr",
|
|
420
|
+
"rJwmI",
|
|
421
|
+
"aBoeK",
|
|
422
|
+
"default",
|
|
423
|
+
"exports",
|
|
424
|
+
"rceYY",
|
|
425
|
+
"isArray",
|
|
426
|
+
"mdKKO",
|
|
427
|
+
"kzxWE",
|
|
428
|
+
"DeBtm",
|
|
429
|
+
"tjjUn",
|
|
430
|
+
"vJEcD",
|
|
431
|
+
"LpfE8xz",
|
|
432
|
+
"bin",
|
|
433
|
+
"HKazo",
|
|
434
|
+
"rable",
|
|
435
|
+
"call",
|
|
436
|
+
"wordsTo",
|
|
437
|
+
"zBiyt",
|
|
438
|
+
"GrsGL",
|
|
439
|
+
"fqulF",
|
|
440
|
+
"jevwl",
|
|
441
|
+
"mxfLj",
|
|
442
|
+
"xlUnt",
|
|
443
|
+
"q42KWYj",
|
|
444
|
+
"endian",
|
|
445
|
+
"eEqDc",
|
|
446
|
+
"oyGAZ",
|
|
447
|
+
"bytesTo",
|
|
448
|
+
"OzjuJ",
|
|
449
|
+
"IfwWq",
|
|
450
|
+
"ize",
|
|
451
|
+
"6648810piiNEz",
|
|
452
|
+
"lTHdy",
|
|
453
|
+
"vDLZJ",
|
|
454
|
+
"stringT",
|
|
455
|
+
"A4NjFqY",
|
|
456
|
+
"GkjTz",
|
|
457
|
+
"eooJA",
|
|
458
|
+
"substr",
|
|
459
|
+
"veNiI",
|
|
460
|
+
"LYfDp",
|
|
461
|
+
"ljKsP",
|
|
462
|
+
"jJYWG",
|
|
463
|
+
"bcYAf",
|
|
464
|
+
"srikB",
|
|
465
|
+
"utf8",
|
|
466
|
+
"qTbeY",
|
|
467
|
+
"yqRzd",
|
|
468
|
+
"|3|5",
|
|
469
|
+
"bjbAy",
|
|
470
|
+
" Array]",
|
|
471
|
+
"rMbXP",
|
|
472
|
+
"u5wPHsO",
|
|
473
|
+
"test",
|
|
474
|
+
"gMIMC",
|
|
475
|
+
"Deyqv",
|
|
476
|
+
" argume",
|
|
477
|
+
"ABCDEFG",
|
|
478
|
+
"undefin",
|
|
479
|
+
"split",
|
|
480
|
+
"QTlsj",
|
|
481
|
+
"_isBuff",
|
|
482
|
+
"OPQRSTU",
|
|
483
|
+
"Illegal",
|
|
484
|
+
"loSen",
|
|
485
|
+
"navigat",
|
|
486
|
+
"ObwNo",
|
|
487
|
+
"qPbcq",
|
|
488
|
+
"7182692QogvXX",
|
|
489
|
+
"tvqSn",
|
|
490
|
+
"DGptJ",
|
|
491
|
+
"HhTfW",
|
|
492
|
+
"avIYx",
|
|
493
|
+
"defineP",
|
|
494
|
+
"PFQbW",
|
|
495
|
+
"CjFyM",
|
|
496
|
+
"toStrin",
|
|
497
|
+
"yMWXS",
|
|
498
|
+
"yMyOy",
|
|
499
|
+
"0XTdDgM",
|
|
500
|
+
"eXkru",
|
|
501
|
+
"_blocks",
|
|
502
|
+
"indexOf",
|
|
503
|
+
"mbBQr",
|
|
504
|
+
"lBuRH",
|
|
505
|
+
"HzGjH",
|
|
506
|
+
"HNErV",
|
|
507
|
+
"mEokX",
|
|
508
|
+
"userAge",
|
|
509
|
+
"UpmtD",
|
|
510
|
+
"sgomx",
|
|
511
|
+
"KDfKS",
|
|
512
|
+
"OTbSq",
|
|
513
|
+
"lxMGW",
|
|
514
|
+
"0|3|2|1",
|
|
515
|
+
"dfWyB",
|
|
516
|
+
"lWzAd",
|
|
517
|
+
"eyXTL",
|
|
518
|
+
"5624qreyZK",
|
|
519
|
+
"pow",
|
|
520
|
+
"IJstz",
|
|
521
|
+
"LMlMB",
|
|
522
|
+
"INlwI",
|
|
523
|
+
"lRulU",
|
|
524
|
+
"TCgZh",
|
|
525
|
+
"_digest",
|
|
526
|
+
"UBhIl",
|
|
527
|
+
"fLtZZ",
|
|
528
|
+
"FYSKq",
|
|
529
|
+
"2|8|0",
|
|
530
|
+
"IoCeZ",
|
|
531
|
+
" Object",
|
|
532
|
+
"UuTvI",
|
|
533
|
+
"lNKLD",
|
|
534
|
+
"String",
|
|
535
|
+
"Bytes",
|
|
536
|
+
"rBVvW",
|
|
537
|
+
"KblCWi+",
|
|
538
|
+
"pRaIH",
|
|
539
|
+
"roperty",
|
|
540
|
+
"vTINI",
|
|
541
|
+
"atLE",
|
|
542
|
+
"functio",
|
|
543
|
+
"Udqoy",
|
|
544
|
+
"nt ",
|
|
545
|
+
"htSWx",
|
|
546
|
+
"hEwRK",
|
|
547
|
+
"encodin",
|
|
548
|
+
"sCSVK",
|
|
549
|
+
"VuAZF",
|
|
550
|
+
"xeIIy",
|
|
551
|
+
"RBjMb",
|
|
552
|
+
"taTrq",
|
|
553
|
+
"vDLFJ",
|
|
554
|
+
"bPkya",
|
|
555
|
+
"HzimH",
|
|
556
|
+
"nCffO",
|
|
557
|
+
"BWbtU",
|
|
558
|
+
"2|8",
|
|
559
|
+
"slice",
|
|
560
|
+
"lxMGQ",
|
|
561
|
+
"tTiwe",
|
|
562
|
+
"JDhJB",
|
|
563
|
+
"rCode",
|
|
564
|
+
"gNDzY",
|
|
565
|
+
"wJkyu",
|
|
566
|
+
"cCZFe",
|
|
567
|
+
"RNGSl",
|
|
568
|
+
"floor",
|
|
569
|
+
"clYIu",
|
|
570
|
+
"vLiwz",
|
|
571
|
+
"BiNSE",
|
|
572
|
+
"MtYWB",
|
|
573
|
+
"fromCha",
|
|
574
|
+
"StNOc",
|
|
575
|
+
"|7|5|3|",
|
|
576
|
+
"9|1|4|6",
|
|
577
|
+
"length",
|
|
578
|
+
"UNYAE",
|
|
579
|
+
"pngG8yJ",
|
|
580
|
+
"hasOwnP",
|
|
581
|
+
"pYeWu",
|
|
582
|
+
"wTjkk",
|
|
583
|
+
"Bvk6/7=",
|
|
584
|
+
"KTmgk",
|
|
585
|
+
"bIGxm",
|
|
586
|
+
"readFlo",
|
|
587
|
+
"LFZch",
|
|
588
|
+
"_ff",
|
|
589
|
+
"1|3|4|2",
|
|
590
|
+
"binary",
|
|
591
|
+
"LLdJZ",
|
|
592
|
+
"ZofOU",
|
|
593
|
+
"6399uFPxTQ",
|
|
594
|
+
"push",
|
|
595
|
+
"YntPT",
|
|
596
|
+
"kSGXO",
|
|
597
|
+
"random",
|
|
598
|
+
"HfpCU",
|
|
599
|
+
"hECvuRX",
|
|
600
|
+
"getTime",
|
|
601
|
+
"iwSyV",
|
|
602
|
+
"alert",
|
|
603
|
+
"LKMcb",
|
|
604
|
+
"DJVdg",
|
|
605
|
+
"Hex",
|
|
606
|
+
"URzKO",
|
|
607
|
+
"CxjtF",
|
|
608
|
+
"ZVOCs",
|
|
609
|
+
"isBuffe",
|
|
610
|
+
"vGpbT",
|
|
611
|
+
"rotl",
|
|
612
|
+
"udFrB",
|
|
613
|
+
"CnbsH",
|
|
614
|
+
"crLST"
|
|
615
|
+
];
|
|
616
|
+
return r[t -= 131];
|
|
617
|
+
}
|
|
618
|
+
function a0_0x10f4ac(t, e) {
|
|
619
|
+
return a0_0x3693(e - -570, t);
|
|
620
|
+
}
|
|
621
|
+
var encrypt_mcr = function(t) {
|
|
622
|
+
var e = 67, r = 15, n = 164, o = 126, i = 137, a = 39, u = 176, s = 72, c = 56, l = 21, f = 35, p = 34, h = 35, d = 18, v = 25, g = 185, m = 1149, y = 744, w = 1295, b = 1248, _ = 1310, E = 1096, x = 1166, k = 1095, T = 1196, S = 1180, A = 1039, L = 976, R = 1347, I = 1117, O = 1168, C = 1233, N = 1157, P = 1006, B = 1122, M = 1277, j = 1288, F = 1271, D = 986, q = 162, U = {};
|
|
623
|
+
function H(t, e) {
|
|
624
|
+
return a0_0x10f4ac(e, t - q);
|
|
625
|
+
}
|
|
626
|
+
U[H(-73, -66)] = function(t, e) {
|
|
627
|
+
return t === e;
|
|
628
|
+
}, U[H(e, 186)] = function(t, e) {
|
|
629
|
+
return t < e;
|
|
630
|
+
}, U[H(-r, -n)] = function(t, e) {
|
|
631
|
+
return t ^ e;
|
|
632
|
+
}, U[H(r, -o)] = function(t, e) {
|
|
633
|
+
return t & e;
|
|
634
|
+
}, U[H(-i, -a)] = function(t, e) {
|
|
635
|
+
return t < e;
|
|
636
|
+
}, U[H(-175, -u)] = function(t, e) {
|
|
637
|
+
return t ^ e;
|
|
638
|
+
}, U[H(-59, s)] = function(t, e) {
|
|
639
|
+
return t ^ e;
|
|
640
|
+
}, U[H(-c, -l)] = function(t, e) {
|
|
641
|
+
return t >>> e;
|
|
642
|
+
}, U[H(f, p)] = function(t, e) {
|
|
643
|
+
return t >>> e;
|
|
644
|
+
};
|
|
645
|
+
for(var G, V, W = U, z = 3988292384, X = 256, Y = []; X--; Y[X] = W[H(h, -66)](G, 0))for(V = 8, G = X; V--;)G = W[H(r, d)](G, 1) ? W[H(35, v)](G, 1) ^ z : W[H(h, g)](G, 1);
|
|
646
|
+
return function(t) {
|
|
647
|
+
function e(t, e) {
|
|
648
|
+
return H(e - 1181, t);
|
|
649
|
+
}
|
|
650
|
+
if (W[e(m, 1108)]((0, esm_typeof.A)(t), e(y, 914))) {
|
|
651
|
+
for(var r = 0, n = -1; W[e(w, b)](r, t[e(_, 1233)]); ++r)n = W[e(E, x)](Y[W[e(k, T)](n, 255) ^ t[e(S, A) + e(1022, L)](r)], n >>> 8);
|
|
652
|
+
return W[e(R, 1166)](n, -1) ^ z;
|
|
653
|
+
}
|
|
654
|
+
for(r = 0, n = -1; W[e(I, 1044)](r, t[e(O, C)]); ++r)n = W[e(N, P)](Y[W[e(1229, B)](W[e(M, T)](n, 255), t[r])], W[e(j, 1125)](n, 8));
|
|
655
|
+
return W[e(F, B)](W[e(D, 1122)](n, -1), z);
|
|
656
|
+
};
|
|
657
|
+
}();
|
|
658
|
+
function GenXSCommon(a1cookie, x_t, x_s) {
|
|
659
|
+
let b1 = 'I38rHdgsjopgIvesdVwgIC+oIELmBZ5e3VwXLgFTIxS3bqwErFeexd0ekncAzMFYnqthIhJeSnMDKutRI3KsYorWHPtGrbV0P9WfIi/eWc6eYqtyQApPI37ekmR1QL+5Ii6sdnoeSfqYHqwl2qt5B0DoIvMzOZQqZVw7IxOeTqwr4qtiIkrOIi/skccxICLdI3Oe0utl2ADZsLveDSKsSPw5IEvsiutJOqw8BVwfPpdeTDWOIx4VIiu6ZPwbPut5IvlaLbgs3qtxIxes1VwHIkumIkIyejgsY/WTge7sjutKrZgedWI9gfKeYWZGI36eWPwyIEJefut0ocVAPBLLI3Aeiqt3cZ7sVom4IESyIhEqQd4AICY24F4gIiifpVwAICZVJo3sWWJs1qwiIvdef97e0ekKIi/e1piS8qwUIE7s1fds6WAeiVwqed5sdut3IxILbd6sdqtDbgKs0PwgIv8aI3z5rqwGBVtwzfTsKD7sdBdskut+Iioed/As1SiiIkKs0F6s3nVuIkge1Pt0IkVkwPwwNVtMI3/e1qtdIkKs1VwVIEesdutA+qwKsuw7IvrRIxDgJfIj2IJexVtVIhiKIi6eDVw/bz4zLadsYjmfIkWo4VtPmVw5IvAe3qtk+LJeTl5sTSEyIEJekdgs3PtsnPwqI35sSPt0Ih/sV04TIk0ejjNsfqw7Iv3sVut04B8qIkWyIvKsxFOekzNsdAKsYPtKIiMFI3MurVtKIvzjIh6s6lFut//sWqtaI3IYbuwl';
|
|
660
|
+
let h = {
|
|
661
|
+
s0: 3,
|
|
662
|
+
s1: "",
|
|
663
|
+
x0: "1",
|
|
664
|
+
x1: "3.6.8",
|
|
665
|
+
x2: "Mac OS",
|
|
666
|
+
x3: "xhs-pc-web",
|
|
667
|
+
x4: "4.20.1",
|
|
668
|
+
x5: a1cookie,
|
|
669
|
+
x6: x_t,
|
|
670
|
+
x7: x_s,
|
|
671
|
+
x8: b1,
|
|
672
|
+
x9: encrypt_mcr(x_t + x_s + b1),
|
|
673
|
+
x10: 1
|
|
674
|
+
};
|
|
675
|
+
return sign_common(h);
|
|
676
|
+
}
|
|
677
|
+
module.exports = GenXSCommon;
|
|
678
|
+
},
|
|
13
679
|
"./src/utils/ttABEncrypt.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
14
680
|
module = __webpack_require__.nmd(module);
|
|
15
681
|
const a0_0x45db08 = a0_0x4b0d;
|
|
@@ -1123,7 +1789,9 @@ class Http {
|
|
|
1123
1789
|
};
|
|
1124
1790
|
}
|
|
1125
1791
|
constructor(config){
|
|
1126
|
-
this.apiClient = __WEBPACK_EXTERNAL_MODULE_axios__["default"].create(
|
|
1792
|
+
this.apiClient = __WEBPACK_EXTERNAL_MODULE_axios__["default"].create({
|
|
1793
|
+
...config
|
|
1794
|
+
});
|
|
1127
1795
|
}
|
|
1128
1796
|
addResponseInterceptor(findError) {
|
|
1129
1797
|
this.apiClient.interceptors.response.use((response)=>{
|
|
@@ -1378,7 +2046,9 @@ const errnoMap = {
|
|
|
1378
2046
|
401100032: "异常,请检查图片(如:格式、版权、合规性等)。",
|
|
1379
2047
|
20040034: "封面图片推荐jpg、png格式,不支持gif格式。",
|
|
1380
2048
|
20040124: "服务器异常,请稍后重试!",
|
|
1381
|
-
20040001: "当前用户未登录,请登陆后重试!"
|
|
2049
|
+
20040001: "当前用户未登录,请登陆后重试!",
|
|
2050
|
+
401100025: "该应用不支持此媒资类型",
|
|
2051
|
+
401100033: "图片宽高不满足要求"
|
|
1382
2052
|
};
|
|
1383
2053
|
const mockAction = async (task, params)=>{
|
|
1384
2054
|
const { baijiahaoSingleCover, baijiahaoMultCover, baijiahaoCoverType } = params.settingInfo;
|
|
@@ -1503,6 +2173,7 @@ const mockAction = async (task, params)=>{
|
|
|
1503
2173
|
};
|
|
1504
2174
|
const isDraft = "draft" === params.saveType;
|
|
1505
2175
|
const saveUrl = isDraft ? "https://baijiahao.baidu.com/pcui/article/save?callback=bjhdraft" : "https://baijiahao.baidu.com/pcui/article/publish?callback=bjhpublish";
|
|
2176
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
1506
2177
|
const res = await http.api({
|
|
1507
2178
|
method: "post",
|
|
1508
2179
|
url: saveUrl,
|
|
@@ -1624,7 +2295,7 @@ const rpaAction = async (task, params)=>{
|
|
|
1624
2295
|
const findActivity = activityFormItem.locator(".cheetah-form-item-control").getByText(name, {
|
|
1625
2296
|
exact: true
|
|
1626
2297
|
});
|
|
1627
|
-
if (await findActivity.count() > 0) findActivity.first().locator("..").click();
|
|
2298
|
+
if (await findActivity.count() > 0) await findActivity.first().locator("..").click();
|
|
1628
2299
|
}
|
|
1629
2300
|
}
|
|
1630
2301
|
const { articleId, message } = await new Promise(async (resolve)=>{
|
|
@@ -1640,8 +2311,9 @@ const rpaAction = async (task, params)=>{
|
|
|
1640
2311
|
}
|
|
1641
2312
|
};
|
|
1642
2313
|
page.on("response", handleResponse);
|
|
2314
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
1643
2315
|
const operatorContainer = page.locator(".editor-component-operator");
|
|
1644
|
-
if ("draft" === params.saveType) operatorContainer.locator(".op-btn-outter-content").filter({
|
|
2316
|
+
if ("draft" === params.saveType) await operatorContainer.locator(".op-btn-outter-content").filter({
|
|
1645
2317
|
hasText: "存草稿"
|
|
1646
2318
|
}).locator("button").click();
|
|
1647
2319
|
else if (params.settingInfo.timer) {
|
|
@@ -1706,7 +2378,7 @@ const rpaAction = async (task, params)=>{
|
|
|
1706
2378
|
await page.locator(".cheetah-modal-confirm-btns button").filter({
|
|
1707
2379
|
hasText: "定时发布"
|
|
1708
2380
|
}).click();
|
|
1709
|
-
} else operatorContainer.locator(".op-btn-outter-content").filter({
|
|
2381
|
+
} else await operatorContainer.locator(".op-btn-outter-content").filter({
|
|
1710
2382
|
hasText: /^发布/
|
|
1711
2383
|
}).locator("button").click();
|
|
1712
2384
|
});
|
|
@@ -1811,12 +2483,20 @@ const getBaijiahaoConfig = async (_task, params)=>{
|
|
|
1811
2483
|
type: "news"
|
|
1812
2484
|
}
|
|
1813
2485
|
});
|
|
1814
|
-
|
|
2486
|
+
const data = res?.data?.article.activity_list.map((_item)=>({
|
|
1815
2487
|
id: _item.id,
|
|
1816
2488
|
name: _item.name,
|
|
1817
2489
|
detail: _item.detail,
|
|
1818
2490
|
is_enable: _item.is_enable
|
|
1819
|
-
})) ?? []
|
|
2491
|
+
})) ?? [];
|
|
2492
|
+
data.push({
|
|
2493
|
+
id: "bjh_publish_num_left",
|
|
2494
|
+
name: "账号剩余发文数",
|
|
2495
|
+
detail: "",
|
|
2496
|
+
is_enable: 1,
|
|
2497
|
+
publish_num_left: res.data.ability.publish_num_left
|
|
2498
|
+
});
|
|
2499
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(data, "获取百家号配置项成功!");
|
|
1820
2500
|
};
|
|
1821
2501
|
const searchToutiaoTopicList = async (_task, params)=>{
|
|
1822
2502
|
const http = new Http({
|
|
@@ -1983,7 +2663,7 @@ class XsEncrypt {
|
|
|
1983
2663
|
this.iv = __WEBPACK_EXTERNAL_MODULE_node_buffer_fb286294__.Buffer.from("4uzjr7mbsibcaldp", "utf8");
|
|
1984
2664
|
}
|
|
1985
2665
|
}
|
|
1986
|
-
const
|
|
2666
|
+
const searchXiaohongshuTopicList_xsEncrypt = new XsEncrypt();
|
|
1987
2667
|
const searchXiaohongshuTopicList = async (_task, params)=>{
|
|
1988
2668
|
const http = new Http({
|
|
1989
2669
|
headers: {
|
|
@@ -2011,9 +2691,9 @@ const searchXiaohongshuTopicList = async (_task, params)=>{
|
|
|
2011
2691
|
page: 1
|
|
2012
2692
|
}
|
|
2013
2693
|
};
|
|
2014
|
-
const topicDataStr =
|
|
2694
|
+
const topicDataStr = searchXiaohongshuTopicList_xsEncrypt.dumps(topicData);
|
|
2015
2695
|
const fatchTopic = `/web_api/sns/v1/search/topic${topicDataStr}`;
|
|
2016
|
-
const xs = await
|
|
2696
|
+
const xs = await searchXiaohongshuTopicList_xsEncrypt.encryptXs(fatchTopic, a1Cookie, xt);
|
|
2017
2697
|
const result = await http.api({
|
|
2018
2698
|
method: "post",
|
|
2019
2699
|
url: "https://edith.xiaohongshu.com/web_api/sns/v1/search/topic",
|
|
@@ -2194,6 +2874,7 @@ const mock_mockAction = async (task, params)=>{
|
|
|
2194
2874
|
article_ad_type: getAddTypeValue(params.settingInfo.toutiaoAd),
|
|
2195
2875
|
claim_exclusive: toutiaoExclusive ? toutiaoExclusive : toutiaoOriginal?.includes("exclusive") ? 1 : 0
|
|
2196
2876
|
};
|
|
2877
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
2197
2878
|
const msToken = params.cookies.find((it)=>"msToken" === it.name)?.value;
|
|
2198
2879
|
let publishOption = {};
|
|
2199
2880
|
if (msToken) {
|
|
@@ -2438,6 +3119,7 @@ const rpa_rpaAction = async (task, params)=>{
|
|
|
2438
3119
|
const confirmBtn = page.locator('div.byte-modal-footer button.byte-btn-primary:has-text("确定")');
|
|
2439
3120
|
if (await confirmBtn.isVisible()) await confirmBtn.click();
|
|
2440
3121
|
}
|
|
3122
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
2441
3123
|
if ("publish" === params.saveType) {
|
|
2442
3124
|
await page.locator(".publish-footer button").filter({
|
|
2443
3125
|
hasText: params.settingInfo.timer ? "定时发布" : "确认发布"
|
|
@@ -2563,6 +3245,770 @@ const BjhFansExport = async (_task, params)=>{
|
|
|
2563
3245
|
}, "获取粉丝数失败,请检查登陆有效性!");
|
|
2564
3246
|
}
|
|
2565
3247
|
};
|
|
3248
|
+
const TTSessionCheck = async (_task, params)=>{
|
|
3249
|
+
const http = new Http({
|
|
3250
|
+
headers: {
|
|
3251
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3252
|
+
referer: "https://mp.toutiao.com/profile_v4/graphic/publish"
|
|
3253
|
+
}
|
|
3254
|
+
});
|
|
3255
|
+
try {
|
|
3256
|
+
const res = await http.api({
|
|
3257
|
+
method: "get",
|
|
3258
|
+
url: "https://mp.toutiao.com/mp/agw/creator_center/user_info",
|
|
3259
|
+
defaultErrorMsg: `头条号登录状态失效。`
|
|
3260
|
+
});
|
|
3261
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(0 === res.code ? {
|
|
3262
|
+
isValidSession: true
|
|
3263
|
+
} : {
|
|
3264
|
+
isValidSession: false
|
|
3265
|
+
}, "头条账号有效性检测完成!");
|
|
3266
|
+
} catch (error) {
|
|
3267
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)({
|
|
3268
|
+
isValidSession: false
|
|
3269
|
+
}, "头条账号有效性检测失败!");
|
|
3270
|
+
}
|
|
3271
|
+
};
|
|
3272
|
+
const WxSessionCheck = async (_task, params)=>{
|
|
3273
|
+
const http = new Http({
|
|
3274
|
+
headers: {
|
|
3275
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";")
|
|
3276
|
+
}
|
|
3277
|
+
});
|
|
3278
|
+
const fingerprint = "4695500bc93ab4ce8fb2692da6564e04";
|
|
3279
|
+
try {
|
|
3280
|
+
const res = await http.api({
|
|
3281
|
+
method: "get",
|
|
3282
|
+
url: "https://mp.weixin.qq.com/cgi-bin/appmsgpublish",
|
|
3283
|
+
params: {
|
|
3284
|
+
fingerprint,
|
|
3285
|
+
sub: "list",
|
|
3286
|
+
begin: 0,
|
|
3287
|
+
count: 10,
|
|
3288
|
+
query: "",
|
|
3289
|
+
type: 1011102103,
|
|
3290
|
+
show_type: "",
|
|
3291
|
+
free_publish_type: 1102103,
|
|
3292
|
+
sub_action: "list_ex",
|
|
3293
|
+
search_card: 0,
|
|
3294
|
+
token: params.token,
|
|
3295
|
+
lang: "zh_CN",
|
|
3296
|
+
f: "json",
|
|
3297
|
+
ajax: 1
|
|
3298
|
+
}
|
|
3299
|
+
});
|
|
3300
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(0 === res.base_resp.ret ? {
|
|
3301
|
+
isValidSession: true
|
|
3302
|
+
} : {
|
|
3303
|
+
isValidSession: false
|
|
3304
|
+
}, "微信账号有效性检测完成!");
|
|
3305
|
+
} catch (error) {
|
|
3306
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)({
|
|
3307
|
+
isValidSession: false
|
|
3308
|
+
}, "微信账号有效性检测失败!");
|
|
3309
|
+
}
|
|
3310
|
+
};
|
|
3311
|
+
const XhsSessionCheck = async (_task, params)=>{
|
|
3312
|
+
const http = new Http({
|
|
3313
|
+
headers: {
|
|
3314
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3315
|
+
referer: "https://creator.xiaohongshu.com/new/home?source=official"
|
|
3316
|
+
}
|
|
3317
|
+
});
|
|
3318
|
+
try {
|
|
3319
|
+
const res = await http.api({
|
|
3320
|
+
method: "get",
|
|
3321
|
+
url: "https://creator.xiaohongshu.com/api/galaxy/user/info"
|
|
3322
|
+
});
|
|
3323
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(0 === res.result ? {
|
|
3324
|
+
isValidSession: true
|
|
3325
|
+
} : {
|
|
3326
|
+
isValidSession: false
|
|
3327
|
+
}, "小红书账号有效性检测完成!");
|
|
3328
|
+
} catch (error) {
|
|
3329
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)({
|
|
3330
|
+
isValidSession: false
|
|
3331
|
+
}, "小红书账号有效性检测完成!");
|
|
3332
|
+
}
|
|
3333
|
+
};
|
|
3334
|
+
const BjhSessionCheck = async (_task, params)=>{
|
|
3335
|
+
const http = new Http({
|
|
3336
|
+
headers: {
|
|
3337
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3338
|
+
referer: "https://baijiahao.baidu.com/builder/rc/home"
|
|
3339
|
+
}
|
|
3340
|
+
});
|
|
3341
|
+
try {
|
|
3342
|
+
const res = await http.api({
|
|
3343
|
+
method: "get",
|
|
3344
|
+
url: "https://baijiahao.baidu.com/pcui/home/index",
|
|
3345
|
+
defaultErrorMsg: `百家号登录状态失效。`
|
|
3346
|
+
});
|
|
3347
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(0 === res.errno ? {
|
|
3348
|
+
isValidSession: true
|
|
3349
|
+
} : {
|
|
3350
|
+
isValidSession: false
|
|
3351
|
+
}, "百家号账号有效性检测完成!");
|
|
3352
|
+
} catch (error) {
|
|
3353
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)({
|
|
3354
|
+
isValidSession: false
|
|
3355
|
+
}, "百家号账号有效性检测失败!");
|
|
3356
|
+
}
|
|
3357
|
+
};
|
|
3358
|
+
const types_errorResponse = (message, code = 500)=>({
|
|
3359
|
+
code,
|
|
3360
|
+
message,
|
|
3361
|
+
data: null
|
|
3362
|
+
});
|
|
3363
|
+
async function getBaijiahaoData(params) {
|
|
3364
|
+
try {
|
|
3365
|
+
const { token } = params;
|
|
3366
|
+
if (!token) return types_errorResponse("缺少token", 200);
|
|
3367
|
+
const http = new Http({
|
|
3368
|
+
headers: {
|
|
3369
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3370
|
+
token: String(token),
|
|
3371
|
+
Referer: "https://baijiahao.baidu.com/builder/rc/home"
|
|
3372
|
+
}
|
|
3373
|
+
});
|
|
3374
|
+
const yesterday = TimeFormatter.format(new Date().setDate(new Date().getDate() - 1), "yyyyMMdd");
|
|
3375
|
+
const [fansData, readData, incomeData, yesterdayData] = await Promise.all([
|
|
3376
|
+
http.api({
|
|
3377
|
+
method: "get",
|
|
3378
|
+
url: "https://baijiahao.baidu.com/pcui/home/index"
|
|
3379
|
+
}),
|
|
3380
|
+
http.api({
|
|
3381
|
+
method: "get",
|
|
3382
|
+
url: "https://baijiahao.baidu.com/author/eco/statistic/getauthorhistory"
|
|
3383
|
+
}),
|
|
3384
|
+
http.api({
|
|
3385
|
+
method: "get",
|
|
3386
|
+
url: "https://baijiahao.baidu.com/author/eco/income4/homepageincome"
|
|
3387
|
+
}),
|
|
3388
|
+
http.api({
|
|
3389
|
+
method: "get",
|
|
3390
|
+
url: "https://baijiahao.baidu.com/author/eco/statistics/appStatistic",
|
|
3391
|
+
params: {
|
|
3392
|
+
type: "all",
|
|
3393
|
+
is_yesterday: false,
|
|
3394
|
+
start_day: yesterday,
|
|
3395
|
+
end_day: yesterday,
|
|
3396
|
+
stat: 0
|
|
3397
|
+
}
|
|
3398
|
+
})
|
|
3399
|
+
]);
|
|
3400
|
+
const bjhData = {
|
|
3401
|
+
fansNum: fansData.data.coreData.fansCount,
|
|
3402
|
+
fansNumYesterday: -1 == yesterdayData.data.data.fans_increase ? null : yesterdayData.data.data.fans_increase,
|
|
3403
|
+
readNum: readData.data.total.view_count,
|
|
3404
|
+
incomeNum: incomeData.data.all_income.total_income,
|
|
3405
|
+
incomeNumYesterday: -1 == incomeData.data.all_income.yesterday_income ? null : incomeData.data.all_income.yesterday_income,
|
|
3406
|
+
recommendNumYesterday: -1 == yesterdayData.data.data.recommend_count ? null : yesterdayData.data.data.recommend_count,
|
|
3407
|
+
readNumYesterday: -1 == yesterdayData.data.data.view_count ? null : yesterdayData.data.data.view_count,
|
|
3408
|
+
likeNumYesterday: -1 == yesterdayData.data.data.likes_count ? null : yesterdayData.data.data.likes_count,
|
|
3409
|
+
commentNumYesterday: -1 == yesterdayData.data.data.comment_count ? null : yesterdayData.data.data.comment_count
|
|
3410
|
+
};
|
|
3411
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(bjhData, "百家号平台数据获取成功!");
|
|
3412
|
+
} catch (error) {
|
|
3413
|
+
return types_errorResponse(error instanceof Error ? error.message : "百家号平台数据获取失败");
|
|
3414
|
+
}
|
|
3415
|
+
}
|
|
3416
|
+
async function getToutiaoData(params) {
|
|
3417
|
+
const { cookies } = params;
|
|
3418
|
+
try {
|
|
3419
|
+
const http = new Http({
|
|
3420
|
+
headers: {
|
|
3421
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3422
|
+
referer: "https://mp.toutiao.com/profile_v4/graphic/publish"
|
|
3423
|
+
}
|
|
3424
|
+
});
|
|
3425
|
+
const [totalData, contentDataYesterday] = await Promise.all([
|
|
3426
|
+
http.api({
|
|
3427
|
+
method: "get",
|
|
3428
|
+
url: "https://mp.toutiao.com/mp/fe_api/home/merge_v2",
|
|
3429
|
+
params: {
|
|
3430
|
+
app_id: 1231
|
|
3431
|
+
}
|
|
3432
|
+
}),
|
|
3433
|
+
http.api({
|
|
3434
|
+
method: "get",
|
|
3435
|
+
url: "https://mp.toutiao.com/mp/agw/statistic/v2/content_stat",
|
|
3436
|
+
params: {
|
|
3437
|
+
type: 0,
|
|
3438
|
+
app_id: 1231
|
|
3439
|
+
}
|
|
3440
|
+
})
|
|
3441
|
+
]);
|
|
3442
|
+
const isReday = void 0 !== totalData.data.statistic.data.yesterday_read_count;
|
|
3443
|
+
const ttData = {
|
|
3444
|
+
fansNum: Number(totalData.data.statistic.data.total_subscribe_count),
|
|
3445
|
+
fansNumYesterday: void 0 !== totalData.data.statistic.data.yesterday_fans ? Number(totalData.data.statistic.data.yesterday_fans) : null,
|
|
3446
|
+
readNum: Number(totalData.data.statistic.data.total_read_play_count),
|
|
3447
|
+
incomeNum: totalData.data.statistic.data.total_income,
|
|
3448
|
+
incomeNumYesterday: totalData.data.statistic.data.is_yesterday_income_ready ? totalData.data.statistic.data.yesterday_income : null,
|
|
3449
|
+
showNumYesterday: isReday ? contentDataYesterday.author_stat.consume_data.impression_count : null,
|
|
3450
|
+
readNumYesterday: isReday ? contentDataYesterday.author_stat.consume_data.go_detail_count : null,
|
|
3451
|
+
likeNumYesterday: isReday ? contentDataYesterday.author_stat.interaction_data.digg_count : null,
|
|
3452
|
+
commentNumYesterday: isReday ? contentDataYesterday.author_stat.interaction_data.comment_count : null
|
|
3453
|
+
};
|
|
3454
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(ttData, "头条号粉丝数据获取成功!");
|
|
3455
|
+
} catch (error) {
|
|
3456
|
+
return types_errorResponse(error instanceof Error ? error.message : "头条号数据获取失败");
|
|
3457
|
+
}
|
|
3458
|
+
}
|
|
3459
|
+
async function getWeixinData(params) {
|
|
3460
|
+
const { token } = params;
|
|
3461
|
+
if (!token) return {
|
|
3462
|
+
code: 200,
|
|
3463
|
+
message: "缺少token",
|
|
3464
|
+
data: null
|
|
3465
|
+
};
|
|
3466
|
+
try {
|
|
3467
|
+
const { token } = params;
|
|
3468
|
+
if (!token) return types_errorResponse("缺少token", 200);
|
|
3469
|
+
const http = new Http({
|
|
3470
|
+
headers: {
|
|
3471
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";")
|
|
3472
|
+
}
|
|
3473
|
+
});
|
|
3474
|
+
const userInfo = {
|
|
3475
|
+
originalCount: 0,
|
|
3476
|
+
totalUsers: 0,
|
|
3477
|
+
userIncrease: 0,
|
|
3478
|
+
yesterday: {
|
|
3479
|
+
read: 0,
|
|
3480
|
+
share: 0,
|
|
3481
|
+
subscribe: 0
|
|
3482
|
+
}
|
|
3483
|
+
};
|
|
3484
|
+
const userInfoHtml = await http.api({
|
|
3485
|
+
method: "get",
|
|
3486
|
+
url: "https://mp.weixin.qq.com/cgi-bin/home",
|
|
3487
|
+
params: {
|
|
3488
|
+
t: "home/index",
|
|
3489
|
+
token,
|
|
3490
|
+
lang: "zh_CN"
|
|
3491
|
+
}
|
|
3492
|
+
});
|
|
3493
|
+
const originalMatch = userInfoHtml.trim().match(/原创内容[\s\S]*?<mp-thousandth[^>]*>([\d,]+)<\/mp-thousandth>/i);
|
|
3494
|
+
if (originalMatch) userInfo.originalCount = parseInt(originalMatch[1].replace(/,/g, ''), 10);
|
|
3495
|
+
const totalUsersMatch = userInfoHtml.match(/总用户数[\s\S]*?<div[^>]*class=["']weui-desktop-user_sum["'][^>]*>[\s\S]*?<mp-thousandth[^>]*>([\d,]+)<\/mp-thousandth>/i);
|
|
3496
|
+
if (totalUsersMatch) userInfo.totalUsers = parseInt(totalUsersMatch[1].replace(/,/g, ''), 10);
|
|
3497
|
+
const increaseMatch = userInfoHtml.match(/weui-desktop-user_increase_num[^>]*>\s*([+-]?)\s*<mp-thousandth[^>]*>([\d,]+)<\/mp-thousandth>/i);
|
|
3498
|
+
if (increaseMatch) {
|
|
3499
|
+
const sign = '-' === increaseMatch[1] ? -1 : 1;
|
|
3500
|
+
userInfo.userIncrease = sign * parseInt(increaseMatch[2].replace(/,/g, ''), 10);
|
|
3501
|
+
}
|
|
3502
|
+
const readMatch = userInfoHtml.match(/昨日阅读[\s\S]*?<mp-thousandth[^>]*>([\d,]+)<\/mp-thousandth>/i);
|
|
3503
|
+
if (readMatch) userInfo.yesterday.read = parseInt(readMatch[1].replace(/,/g, ''), 10);
|
|
3504
|
+
const shareMatch = userInfoHtml.match(/昨日分享[\s\S]*?<mp-thousandth[^>]*>([\d,]+)<\/mp-thousandth>/i);
|
|
3505
|
+
if (shareMatch) userInfo.yesterday.share = parseInt(shareMatch[1].replace(/,/g, ''), 10);
|
|
3506
|
+
const subscribeMatch = userInfoHtml.match(/昨日新增关注[\s\S]*?<mp-thousandth[^>]*>([\d,]+)<\/mp-thousandth>/i);
|
|
3507
|
+
if (subscribeMatch) userInfo.yesterday.subscribe = parseInt(subscribeMatch[1].replace(/,/g, ''), 10);
|
|
3508
|
+
const wxData = {
|
|
3509
|
+
fansNum: userInfo.totalUsers,
|
|
3510
|
+
fansNumYesterday: userInfo.yesterday.subscribe,
|
|
3511
|
+
readNumYesterday: userInfo.yesterday.read,
|
|
3512
|
+
shareNumYesterday: userInfo.yesterday.share
|
|
3513
|
+
};
|
|
3514
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(wxData, "微信平台数据获取成功!");
|
|
3515
|
+
} catch (error) {
|
|
3516
|
+
return types_errorResponse(error instanceof Error ? error.message : "微信平台数据获取失败");
|
|
3517
|
+
}
|
|
3518
|
+
}
|
|
3519
|
+
async function getXiaohongshuData(params) {
|
|
3520
|
+
try {
|
|
3521
|
+
const a1Cookie = params.cookies.find((it)=>"a1" === it.name)?.value;
|
|
3522
|
+
if (!a1Cookie) return types_errorResponse("账号数据异常,请重新绑定账号后重试。", 200);
|
|
3523
|
+
const http = new Http({
|
|
3524
|
+
headers: {
|
|
3525
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3526
|
+
referer: "https://creator.xiaohongshu.com",
|
|
3527
|
+
origin: "https://creator.xiaohongshu.com"
|
|
3528
|
+
}
|
|
3529
|
+
});
|
|
3530
|
+
const xsEncrypt = new XsEncrypt();
|
|
3531
|
+
const xt = Date.now().toString();
|
|
3532
|
+
const sevenDataUrl = "/api/galaxy/v2/creator/datacenter/account/base";
|
|
3533
|
+
const xs = await xsEncrypt.encryptXs(sevenDataUrl, a1Cookie, xt);
|
|
3534
|
+
const [overAllData, sevenData] = await Promise.all([
|
|
3535
|
+
http.api({
|
|
3536
|
+
method: "get",
|
|
3537
|
+
url: "https://creator.xiaohongshu.com/api/galaxy/creator/home/personal_info"
|
|
3538
|
+
}),
|
|
3539
|
+
http.api({
|
|
3540
|
+
method: "get",
|
|
3541
|
+
baseURL: "https://creator.xiaohongshu.com",
|
|
3542
|
+
url: sevenDataUrl,
|
|
3543
|
+
headers: {
|
|
3544
|
+
"x-s": xs,
|
|
3545
|
+
"x-t": xt
|
|
3546
|
+
}
|
|
3547
|
+
})
|
|
3548
|
+
]);
|
|
3549
|
+
const xhsData = {
|
|
3550
|
+
fansNum: overAllData.data.fans_count,
|
|
3551
|
+
favedNum: overAllData.data.faved_count,
|
|
3552
|
+
watchNumLastWeek: sevenData.data.seven.view_count,
|
|
3553
|
+
likeNumLastWeek: sevenData.data.seven.like_count,
|
|
3554
|
+
collectNumLastWeek: sevenData.data.seven.collect_count,
|
|
3555
|
+
commentNumLastWeek: sevenData.data.seven.comment_count,
|
|
3556
|
+
fansNumLastWeek: sevenData.data.seven.rise_fans_count,
|
|
3557
|
+
fansNumYesterday: sevenData.data.seven.rise_fans_list[0].count
|
|
3558
|
+
};
|
|
3559
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(xhsData, "小红书平台数据获取成功!");
|
|
3560
|
+
} catch (error) {
|
|
3561
|
+
return types_errorResponse(error instanceof Error ? error.message : "小红书平台数据获取失败");
|
|
3562
|
+
}
|
|
3563
|
+
}
|
|
3564
|
+
const SearchAccountInfo = async (_task, params)=>{
|
|
3565
|
+
const { platform } = params;
|
|
3566
|
+
switch(platform){
|
|
3567
|
+
case "toutiao":
|
|
3568
|
+
return getToutiaoData(params);
|
|
3569
|
+
case "xiaohongshu":
|
|
3570
|
+
return getXiaohongshuData(params);
|
|
3571
|
+
case "weixin":
|
|
3572
|
+
return getWeixinData(params);
|
|
3573
|
+
case "baijiahao":
|
|
3574
|
+
return getBaijiahaoData(params);
|
|
3575
|
+
default:
|
|
3576
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(null, "暂不支持该平台");
|
|
3577
|
+
}
|
|
3578
|
+
};
|
|
3579
|
+
const searchPublishInfo_types_errorResponse = (message, code = 500)=>({
|
|
3580
|
+
code,
|
|
3581
|
+
message,
|
|
3582
|
+
data: null
|
|
3583
|
+
});
|
|
3584
|
+
async function handleToutiaoData(params) {
|
|
3585
|
+
try {
|
|
3586
|
+
const { cookies, pageNum = 1, pageSize = 10, showOriginalData = false, onlySuccess = false } = params;
|
|
3587
|
+
const http = new Http({
|
|
3588
|
+
headers: {
|
|
3589
|
+
cookie: cookies.map((it)=>`${it.name}=${it.value}`).join(";")
|
|
3590
|
+
}
|
|
3591
|
+
});
|
|
3592
|
+
const visitedUid = await http.api({
|
|
3593
|
+
url: "https://mp.toutiao.com/mp/agw/creator_center/user_info?",
|
|
3594
|
+
method: "get",
|
|
3595
|
+
params: {
|
|
3596
|
+
app_id: 1231
|
|
3597
|
+
}
|
|
3598
|
+
});
|
|
3599
|
+
const articleInfo = await http.api({
|
|
3600
|
+
method: "get",
|
|
3601
|
+
url: "https://mp.toutiao.com/api/feed/mp_provider/v1/",
|
|
3602
|
+
params: {
|
|
3603
|
+
provider_type: "mp_provider",
|
|
3604
|
+
aid: "13",
|
|
3605
|
+
app_name: "news_article",
|
|
3606
|
+
category: "mp_all",
|
|
3607
|
+
channel: "",
|
|
3608
|
+
stream_api_version: "88",
|
|
3609
|
+
genre_type_switch: '{"repost":1,"small_video":1,"toutiao_graphic":1,"weitoutiao":1,"xigua_video":1}',
|
|
3610
|
+
device_platform: "pc",
|
|
3611
|
+
platform_id: "0",
|
|
3612
|
+
visited_uid: visitedUid.user_id_str,
|
|
3613
|
+
offset: (pageNum - 1) * pageSize,
|
|
3614
|
+
count: pageSize,
|
|
3615
|
+
keyword: "",
|
|
3616
|
+
client_extra_params: `{"category":"mp_all","real_app_id":"1231","need_forward":"true","offset_mode":"1","page_index":"1","status":${onlySuccess ? "2" : "8"},"source":"0"}`,
|
|
3617
|
+
app_id: "1231"
|
|
3618
|
+
}
|
|
3619
|
+
});
|
|
3620
|
+
const articleCell = articleInfo.data.map((item)=>({
|
|
3621
|
+
title: item.assembleCell.itemCell.articleBase.title,
|
|
3622
|
+
imageUrl: item.assembleCell.itemCell.imageList.staggerFeedCover[0].url,
|
|
3623
|
+
createTime: item.assembleCell.itemCell.articleBase.publishTime,
|
|
3624
|
+
redirectUrl: item.assembleCell.itemCell.articleBase.articleURL,
|
|
3625
|
+
showNum: item.assembleCell.itemCell.itemCounter.showCount,
|
|
3626
|
+
readNum: item.assembleCell.itemCell.itemCounter.readCount,
|
|
3627
|
+
likeNum: item.assembleCell.itemCell.itemCounter.diggCount,
|
|
3628
|
+
commentNum: item.assembleCell.itemCell.itemCounter.commentCount,
|
|
3629
|
+
...showOriginalData ? {
|
|
3630
|
+
originalData: item
|
|
3631
|
+
} : {}
|
|
3632
|
+
}));
|
|
3633
|
+
const api_base_info_json = JSON.parse(articleInfo.api_base_info.app_extra_params);
|
|
3634
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)({
|
|
3635
|
+
articleCell,
|
|
3636
|
+
...onlySuccess ? {
|
|
3637
|
+
pagination: {
|
|
3638
|
+
total: api_base_info_json.total_count,
|
|
3639
|
+
pageNum,
|
|
3640
|
+
pageSize
|
|
3641
|
+
}
|
|
3642
|
+
} : null
|
|
3643
|
+
}, "头条号文章文章获取成功");
|
|
3644
|
+
} catch (error) {
|
|
3645
|
+
return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "头条号文章数据获取失败");
|
|
3646
|
+
}
|
|
3647
|
+
}
|
|
3648
|
+
async function handleWeixinData(params) {
|
|
3649
|
+
try {
|
|
3650
|
+
const { cookies, token, pageNum = 1, pageSize = 10, showOriginalData = false, onlySuccess = false, cursor, lastPage } = params;
|
|
3651
|
+
if (!token) return {
|
|
3652
|
+
code: 200,
|
|
3653
|
+
message: "缺少token",
|
|
3654
|
+
data: null
|
|
3655
|
+
};
|
|
3656
|
+
const http = new Http({
|
|
3657
|
+
headers: {
|
|
3658
|
+
cookie: cookies.map((it)=>`${it.name}=${it.value}`).join(";")
|
|
3659
|
+
}
|
|
3660
|
+
});
|
|
3661
|
+
const ParsePublishPage = (body)=>{
|
|
3662
|
+
const match = body.match(/publish_page\s*=\s*({[\s\S]*?});/);
|
|
3663
|
+
if (!match) throw new Error('无法提取 publish_page 字段');
|
|
3664
|
+
let parsedData = JSON.parse(match[1]);
|
|
3665
|
+
const decodeEntities = function(str, decode = false) {
|
|
3666
|
+
const encodeMap = [
|
|
3667
|
+
"&",
|
|
3668
|
+
"&",
|
|
3669
|
+
"<",
|
|
3670
|
+
"<",
|
|
3671
|
+
">",
|
|
3672
|
+
">",
|
|
3673
|
+
" ",
|
|
3674
|
+
" ",
|
|
3675
|
+
'"',
|
|
3676
|
+
""",
|
|
3677
|
+
"'",
|
|
3678
|
+
"'"
|
|
3679
|
+
];
|
|
3680
|
+
const decodeMap = [
|
|
3681
|
+
"'",
|
|
3682
|
+
"'",
|
|
3683
|
+
""",
|
|
3684
|
+
'"',
|
|
3685
|
+
" ",
|
|
3686
|
+
" ",
|
|
3687
|
+
">",
|
|
3688
|
+
">",
|
|
3689
|
+
"<",
|
|
3690
|
+
"<",
|
|
3691
|
+
"&",
|
|
3692
|
+
"&",
|
|
3693
|
+
"<",
|
|
3694
|
+
"<",
|
|
3695
|
+
">",
|
|
3696
|
+
">"
|
|
3697
|
+
];
|
|
3698
|
+
const map = decode ? decodeMap : encodeMap;
|
|
3699
|
+
let result = str;
|
|
3700
|
+
for(let i = 0; i < map.length; i += 2)result = result.replace(new RegExp(map[i], "g"), map[i + 1]);
|
|
3701
|
+
return result;
|
|
3702
|
+
};
|
|
3703
|
+
const finalData = {
|
|
3704
|
+
...parsedData,
|
|
3705
|
+
publish_list: parsedData.publish_list.map((item)=>{
|
|
3706
|
+
const decoded = decodeEntities(item.publish_info, true);
|
|
3707
|
+
const parsedInfo = JSON.parse(decoded);
|
|
3708
|
+
return {
|
|
3709
|
+
publish_type: item.publish_type,
|
|
3710
|
+
publish_info: parsedInfo
|
|
3711
|
+
};
|
|
3712
|
+
})
|
|
3713
|
+
};
|
|
3714
|
+
return finalData;
|
|
3715
|
+
};
|
|
3716
|
+
async function fetchArticles(begin, pageSize, token) {
|
|
3717
|
+
return http.api({
|
|
3718
|
+
method: "get",
|
|
3719
|
+
url: 'https://mp.weixin.qq.com/cgi-bin/appmsgpublish',
|
|
3720
|
+
params: {
|
|
3721
|
+
sub: "list",
|
|
3722
|
+
begin: begin,
|
|
3723
|
+
count: pageSize,
|
|
3724
|
+
token: token,
|
|
3725
|
+
lang: "zh_CN"
|
|
3726
|
+
}
|
|
3727
|
+
});
|
|
3728
|
+
}
|
|
3729
|
+
let size = onlySuccess ? 10 : pageSize > 20 ? 20 : pageSize;
|
|
3730
|
+
let begin = (lastPage ?? pageNum) - 1;
|
|
3731
|
+
let rawArticlesInfo = await fetchArticles(begin * size, size, token);
|
|
3732
|
+
let articlesInfo = ParsePublishPage(rawArticlesInfo);
|
|
3733
|
+
let articleCell = [];
|
|
3734
|
+
if (!onlySuccess && pageSize > 20) {
|
|
3735
|
+
let totalFetched = articlesInfo.publish_list.length;
|
|
3736
|
+
let nextPage = pageNum + 1;
|
|
3737
|
+
while(totalFetched < pageSize){
|
|
3738
|
+
const remaining = pageSize - totalFetched;
|
|
3739
|
+
const currentPageSize = remaining > 20 ? 20 : remaining;
|
|
3740
|
+
let _rawArticlesInfo = await fetchArticles((nextPage - 1) * 20, currentPageSize, token);
|
|
3741
|
+
let parsed = ParsePublishPage(_rawArticlesInfo);
|
|
3742
|
+
articlesInfo.publish_list = articlesInfo.publish_list.concat(parsed.publish_list);
|
|
3743
|
+
totalFetched = articlesInfo.publish_list.length;
|
|
3744
|
+
if (parsed.publish_list.length < currentPageSize) break;
|
|
3745
|
+
nextPage++;
|
|
3746
|
+
}
|
|
3747
|
+
}
|
|
3748
|
+
let nextPage = false;
|
|
3749
|
+
if (onlySuccess) {
|
|
3750
|
+
let filteredList = articlesInfo.publish_list.filter((item)=>-1 == item.publish_info.appmsg_info[0].content_url.indexOf("tempkey")).map((item)=>item.publish_info);
|
|
3751
|
+
if (cursor) {
|
|
3752
|
+
const cursorIndex = filteredList.findIndex((item)=>item.msgid === cursor);
|
|
3753
|
+
if (-1 !== cursorIndex) filteredList = filteredList.slice(cursorIndex + 1);
|
|
3754
|
+
}
|
|
3755
|
+
let totalFetched = filteredList.length;
|
|
3756
|
+
while(totalFetched < pageSize && begin * size < articlesInfo.total_count){
|
|
3757
|
+
begin += 1;
|
|
3758
|
+
let nextRawArticlesInfo = await fetchArticles(begin * size, size, token);
|
|
3759
|
+
let nextArticlesInfo = ParsePublishPage(nextRawArticlesInfo);
|
|
3760
|
+
const newFiltered = nextArticlesInfo.publish_list.filter((item)=>-1 == item.publish_info.appmsg_info[0].content_url.indexOf("tempkey")).map((item)=>item.publish_info);
|
|
3761
|
+
filteredList = filteredList.concat(newFiltered);
|
|
3762
|
+
totalFetched = filteredList.length;
|
|
3763
|
+
}
|
|
3764
|
+
filteredList = filteredList.slice(0, pageSize);
|
|
3765
|
+
totalFetched = filteredList.length;
|
|
3766
|
+
if (totalFetched >= pageSize && begin * size < articlesInfo.total_count) {
|
|
3767
|
+
let nextRawArticlesInfo = await fetchArticles((begin + 1) * size, size, token);
|
|
3768
|
+
let nextArticlesInfo = ParsePublishPage(nextRawArticlesInfo);
|
|
3769
|
+
nextPage = nextArticlesInfo.publish_list.length > 0 && nextArticlesInfo.publish_list.some((item)=>-1 == item.publish_info.appmsg_info[0].content_url.indexOf("tempkey"));
|
|
3770
|
+
}
|
|
3771
|
+
const lastMsgId = filteredList.length > 0 ? filteredList[filteredList.length - 1].msgid : void 0;
|
|
3772
|
+
articleCell = filteredList.map((item)=>({
|
|
3773
|
+
title: item.appmsg_info[0].title,
|
|
3774
|
+
imageUrl: item.appmsg_info[0].cover,
|
|
3775
|
+
createTime: item.appmsg_info[0].line_info.send_time,
|
|
3776
|
+
redirectUrl: item.appmsg_info[0].content_url,
|
|
3777
|
+
readNum: item.appmsg_info[0].read_num,
|
|
3778
|
+
likeNum: item.appmsg_info[0].old_like_num,
|
|
3779
|
+
shareNum: item.appmsg_info[0].share_num,
|
|
3780
|
+
recommendNum: item.appmsg_info[0].like_num,
|
|
3781
|
+
...showOriginalData ? {
|
|
3782
|
+
originalData: item
|
|
3783
|
+
} : {}
|
|
3784
|
+
}));
|
|
3785
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)({
|
|
3786
|
+
articleCell,
|
|
3787
|
+
pagination: {
|
|
3788
|
+
nextPage,
|
|
3789
|
+
pageNum,
|
|
3790
|
+
pageSize,
|
|
3791
|
+
lastPage: begin + 1,
|
|
3792
|
+
cursor: lastMsgId
|
|
3793
|
+
}
|
|
3794
|
+
}, "微信文章文章获取成功");
|
|
3795
|
+
}
|
|
3796
|
+
articleCell = articlesInfo.publish_list.map((item)=>({
|
|
3797
|
+
title: item.publish_info.appmsg_info[0].title,
|
|
3798
|
+
imageUrl: item.publish_info.appmsg_info[0].cover,
|
|
3799
|
+
createTime: item.publish_info.appmsg_info[0].line_info.send_time,
|
|
3800
|
+
redirectUrl: item.publish_info.appmsg_info[0].content_url,
|
|
3801
|
+
readNum: item.publish_info.appmsg_info[0].read_num,
|
|
3802
|
+
likeNum: item.publish_info.appmsg_info[0].old_like_num,
|
|
3803
|
+
shareNum: item.publish_info.appmsg_info[0].share_num,
|
|
3804
|
+
recommendNum: item.publish_info.appmsg_info[0].like_num,
|
|
3805
|
+
...showOriginalData ? {
|
|
3806
|
+
originalData: item
|
|
3807
|
+
} : {}
|
|
3808
|
+
}));
|
|
3809
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)({
|
|
3810
|
+
articleCell
|
|
3811
|
+
}, "微信文章文章获取成功");
|
|
3812
|
+
} catch (error) {
|
|
3813
|
+
return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "微信文章数据获取失败");
|
|
3814
|
+
}
|
|
3815
|
+
}
|
|
3816
|
+
async function handleBaijiahaoData(params) {
|
|
3817
|
+
try {
|
|
3818
|
+
const { cookies, token, pageNum = 1, pageSize = 10, showOriginalData = false, onlySuccess = false } = params;
|
|
3819
|
+
if (!token) return {
|
|
3820
|
+
code: 200,
|
|
3821
|
+
message: "缺少token",
|
|
3822
|
+
data: null
|
|
3823
|
+
};
|
|
3824
|
+
const http = new Http({
|
|
3825
|
+
headers: {
|
|
3826
|
+
cookie: cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3827
|
+
token: token
|
|
3828
|
+
}
|
|
3829
|
+
});
|
|
3830
|
+
async function fetchArticles(pageNum, pageSize, onlySuccess = false) {
|
|
3831
|
+
return await http.api({
|
|
3832
|
+
method: "get",
|
|
3833
|
+
url: "https://baijiahao.baidu.com/pcui/article/lists",
|
|
3834
|
+
params: {
|
|
3835
|
+
currentPage: pageNum,
|
|
3836
|
+
pageSize: pageSize,
|
|
3837
|
+
search: "",
|
|
3838
|
+
type: "",
|
|
3839
|
+
collection: onlySuccess ? "publish" : "",
|
|
3840
|
+
clearBeforeFetch: false,
|
|
3841
|
+
dynamic: 1
|
|
3842
|
+
}
|
|
3843
|
+
});
|
|
3844
|
+
}
|
|
3845
|
+
const articleInfo = await fetchArticles(pageNum, pageSize, onlySuccess);
|
|
3846
|
+
let filtered = articleInfo.data.list.filter((item)=>"draft" !== item.status);
|
|
3847
|
+
const totalPage = articleInfo.data.page?.totalPage || 1;
|
|
3848
|
+
let currentPage = pageNum + 1;
|
|
3849
|
+
const usedPages = new Set();
|
|
3850
|
+
while(filtered.length < pageSize && currentPage <= totalPage){
|
|
3851
|
+
if (usedPages.has(currentPage)) {
|
|
3852
|
+
currentPage++;
|
|
3853
|
+
continue;
|
|
3854
|
+
}
|
|
3855
|
+
const res = await fetchArticles(currentPage, pageSize, onlySuccess);
|
|
3856
|
+
usedPages.add(currentPage);
|
|
3857
|
+
const validItems = res.data.list.filter((item)=>"draft" !== item.status);
|
|
3858
|
+
filtered.push(...validItems);
|
|
3859
|
+
currentPage++;
|
|
3860
|
+
}
|
|
3861
|
+
const final = filtered.slice(0, pageSize);
|
|
3862
|
+
const articleCell = final.map((item)=>({
|
|
3863
|
+
title: item.title,
|
|
3864
|
+
imageUrl: JSON.parse(item.cover_images)[0].src,
|
|
3865
|
+
createTime: Math.floor(new Date(item.publish_at.replace(/-/g, "/")).getTime() / 1000),
|
|
3866
|
+
redirectUrl: item.url,
|
|
3867
|
+
recommendNum: item.rec_amount | item.forward_num,
|
|
3868
|
+
collectNum: item.collection_amount,
|
|
3869
|
+
readNum: item.read_amount | item.read_num,
|
|
3870
|
+
likeNum: item.like_amount | item.praise_num,
|
|
3871
|
+
commentNum: item.comment_amount | item.comment_num,
|
|
3872
|
+
shareNum: item.share_amount,
|
|
3873
|
+
...showOriginalData ? {
|
|
3874
|
+
originalData: item
|
|
3875
|
+
} : {}
|
|
3876
|
+
}));
|
|
3877
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)({
|
|
3878
|
+
articleCell,
|
|
3879
|
+
...onlySuccess ? {
|
|
3880
|
+
pagination: {
|
|
3881
|
+
total: articleInfo.data.page?.totalCount,
|
|
3882
|
+
pageNum,
|
|
3883
|
+
pageSize
|
|
3884
|
+
}
|
|
3885
|
+
} : null
|
|
3886
|
+
}, "百家号文章数据获取成功");
|
|
3887
|
+
} catch (error) {
|
|
3888
|
+
return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "百家号文章数据获取失败");
|
|
3889
|
+
}
|
|
3890
|
+
}
|
|
3891
|
+
async function handleXiaohongshuData(params) {
|
|
3892
|
+
try {
|
|
3893
|
+
const { cookies, pageNum = 1, pageSize = 10, showOriginalData = false, onlySuccess = false } = params;
|
|
3894
|
+
const xsEncrypt = new XsEncrypt();
|
|
3895
|
+
const a1Cookie = cookies.find((it)=>"a1" === it.name)?.value;
|
|
3896
|
+
if (!a1Cookie) return {
|
|
3897
|
+
code: 200,
|
|
3898
|
+
message: "账号数据异常",
|
|
3899
|
+
data: null
|
|
3900
|
+
};
|
|
3901
|
+
if (onlySuccess && 10 != pageSize) return {
|
|
3902
|
+
code: 200,
|
|
3903
|
+
message: "小红书pageSize不可修改",
|
|
3904
|
+
data: null
|
|
3905
|
+
};
|
|
3906
|
+
const http = new Http({
|
|
3907
|
+
headers: {
|
|
3908
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3909
|
+
referer: "https://creator.xiaohongshu.com",
|
|
3910
|
+
origin: "https://creator.xiaohongshu.com"
|
|
3911
|
+
}
|
|
3912
|
+
});
|
|
3913
|
+
async function fetchArticles(pageNum, a1Cookie, onlySuccess = false) {
|
|
3914
|
+
const xt = Date.now().toString();
|
|
3915
|
+
const serveUrl = `/web_api/sns/v5/creator/note/user/posted?tab=${onlySuccess ? 1 : 0}&page=${pageNum - 1}`;
|
|
3916
|
+
const xs = await xsEncrypt.encryptXs(serveUrl, a1Cookie, xt);
|
|
3917
|
+
return await http.api({
|
|
3918
|
+
method: "get",
|
|
3919
|
+
baseURL: "https://edith.xiaohongshu.com",
|
|
3920
|
+
url: serveUrl,
|
|
3921
|
+
headers: {
|
|
3922
|
+
"x-s": xs,
|
|
3923
|
+
"x-t": xt
|
|
3924
|
+
}
|
|
3925
|
+
});
|
|
3926
|
+
}
|
|
3927
|
+
const articleInfo = await fetchArticles(pageNum, a1Cookie, onlySuccess);
|
|
3928
|
+
let hasNextpage = -1 != articleInfo.data.page;
|
|
3929
|
+
let filtered = articleInfo.data.notes;
|
|
3930
|
+
let currentPage = pageNum + 1;
|
|
3931
|
+
const usedPages = new Set();
|
|
3932
|
+
while(filtered.length < pageSize && hasNextpage){
|
|
3933
|
+
if (usedPages.has(currentPage)) {
|
|
3934
|
+
currentPage++;
|
|
3935
|
+
continue;
|
|
3936
|
+
}
|
|
3937
|
+
const res = await fetchArticles(currentPage, a1Cookie, onlySuccess);
|
|
3938
|
+
usedPages.add(currentPage);
|
|
3939
|
+
const validItems = res.data.notes;
|
|
3940
|
+
filtered.push(...validItems);
|
|
3941
|
+
currentPage++;
|
|
3942
|
+
hasNextpage = -1 != res.data.page;
|
|
3943
|
+
}
|
|
3944
|
+
const final = filtered.slice(0, pageSize);
|
|
3945
|
+
const articleCell = final.map((item)=>({
|
|
3946
|
+
title: item.display_title,
|
|
3947
|
+
imageUrl: item.images_list[0].url,
|
|
3948
|
+
createTime: Math.floor(new Date(item.time.replace(/-/g, "/")).getTime() / 1000),
|
|
3949
|
+
redirectUrl: `https://www.xiaohongshu.com/explore/${item.id}?xsec_token=${item.xsec_token}&xsec_source=pc_creatormng`,
|
|
3950
|
+
readNum: item.view_count,
|
|
3951
|
+
likeNum: item.likes,
|
|
3952
|
+
commentNum: item.comments_count,
|
|
3953
|
+
collectNum: item.collected_count,
|
|
3954
|
+
shareNum: item.shared_count,
|
|
3955
|
+
...showOriginalData ? {
|
|
3956
|
+
originalData: item
|
|
3957
|
+
} : {}
|
|
3958
|
+
}));
|
|
3959
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)({
|
|
3960
|
+
articleCell,
|
|
3961
|
+
...onlySuccess ? {
|
|
3962
|
+
pagination: {
|
|
3963
|
+
nextPage: hasNextpage,
|
|
3964
|
+
pageNum,
|
|
3965
|
+
pageSize
|
|
3966
|
+
}
|
|
3967
|
+
} : null
|
|
3968
|
+
}, "小红书文章数据获取成功");
|
|
3969
|
+
} catch (error) {
|
|
3970
|
+
return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "小红书文章数据获取失败");
|
|
3971
|
+
}
|
|
3972
|
+
}
|
|
3973
|
+
const FetchArticles = async (_task, params)=>{
|
|
3974
|
+
const { platform } = params;
|
|
3975
|
+
switch(platform){
|
|
3976
|
+
case "toutiao":
|
|
3977
|
+
return handleToutiaoData(params);
|
|
3978
|
+
case "weixin":
|
|
3979
|
+
return handleWeixinData(params);
|
|
3980
|
+
case "baijiahao":
|
|
3981
|
+
return handleBaijiahaoData(params);
|
|
3982
|
+
case "xiaohongshu":
|
|
3983
|
+
return handleXiaohongshuData(params);
|
|
3984
|
+
default:
|
|
3985
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(null, "暂不支持该平台");
|
|
3986
|
+
}
|
|
3987
|
+
};
|
|
3988
|
+
const getWeixinConfig = async (_task, params)=>{
|
|
3989
|
+
const http = new Http({
|
|
3990
|
+
headers: {
|
|
3991
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";")
|
|
3992
|
+
}
|
|
3993
|
+
});
|
|
3994
|
+
const fingerprint = "4695500bc93ab4ce8fb2692da6564e04";
|
|
3995
|
+
const res = await http.api({
|
|
3996
|
+
method: "get",
|
|
3997
|
+
url: "https://mp.weixin.qq.com/cgi-bin/masssendpage",
|
|
3998
|
+
params: {
|
|
3999
|
+
f: 'json',
|
|
4000
|
+
token: params.token,
|
|
4001
|
+
lang: 'zh_CN',
|
|
4002
|
+
ajax: 1,
|
|
4003
|
+
fingerprint: fingerprint,
|
|
4004
|
+
random: Math.random().toString()
|
|
4005
|
+
}
|
|
4006
|
+
});
|
|
4007
|
+
const filtered = {
|
|
4008
|
+
publishQuota: 0 === res.base_resp.ret ? res.quota_detail_list.filter((item)=>"kQuotaTypeMassSendNormal" === item.quota_type).map((item)=>item.quota_item_list) : []
|
|
4009
|
+
};
|
|
4010
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(filtered, 0 === res.base_resp.ret ? "微信配置信息获取成功!" : "微信配置信息获取失败!");
|
|
4011
|
+
};
|
|
2566
4012
|
const weitoutiaoPublish_mock_mockAction = async (task, params)=>{
|
|
2567
4013
|
const tmpCachePath = task.getTmpPath();
|
|
2568
4014
|
const http = new Http({
|
|
@@ -2720,6 +4166,7 @@ const weixinPublish_mock_errnoMap = {
|
|
|
2720
4166
|
64703: "摘要超出120字长度限制,请修改摘要后重试。",
|
|
2721
4167
|
"-4": "不支持发布审核中或转码中的视频",
|
|
2722
4168
|
"-2": "不支持发布审核中或转码中的视频",
|
|
4169
|
+
"-1": "系统错误,请注意备份内容后重试",
|
|
2723
4170
|
770001: "不支持发布审核中或转码中的视频",
|
|
2724
4171
|
200074: "系统繁忙,请稍后重试!",
|
|
2725
4172
|
64702: "标题超出64字长度限制,请修改标题后重试。"
|
|
@@ -2802,7 +4249,9 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
2802
4249
|
const uploadImages = async (images)=>{
|
|
2803
4250
|
const cloudImages = [];
|
|
2804
4251
|
const localImages = await Promise.all(images.map((url)=>{
|
|
2805
|
-
|
|
4252
|
+
let fileName = (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.getFilenameFromUrl)(url);
|
|
4253
|
+
let ext = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].extname(fileName);
|
|
4254
|
+
fileName = ext ? fileName : `${fileName}.png`;
|
|
2806
4255
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.downloadImage)(url, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(tmpCachePath, fileName));
|
|
2807
4256
|
}));
|
|
2808
4257
|
for(let index = 0; index < images.length; index++){
|
|
@@ -3103,6 +4552,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
3103
4552
|
masssend_check: 1,
|
|
3104
4553
|
is_masssend: 1
|
|
3105
4554
|
};
|
|
4555
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
3106
4556
|
const { appMsgId } = await http.api({
|
|
3107
4557
|
method: "post",
|
|
3108
4558
|
url: "https://mp.weixin.qq.com/cgi-bin/operate_appmsg",
|
|
@@ -3575,7 +5025,9 @@ const weixinPublish_rpa_rpaAction = async (task, params)=>{
|
|
|
3575
5025
|
await titleInstance.fill(params.settingInfo.wxAbstract);
|
|
3576
5026
|
}
|
|
3577
5027
|
if (params.settingInfo.wxCover) {
|
|
3578
|
-
|
|
5028
|
+
let fileName = (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.getFilenameFromUrl)(params.settingInfo.wxCover);
|
|
5029
|
+
let ext = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].extname(fileName);
|
|
5030
|
+
fileName = ext ? fileName : `${fileName}.png`;
|
|
3579
5031
|
const cover = await (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.downloadImage)(params.settingInfo.wxCover, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(tmpCachePath, fileName));
|
|
3580
5032
|
await page.locator("#article_setting_area #js_cover_area .select-cover__btn").hover();
|
|
3581
5033
|
await page.locator("#article_setting_area #js_cover_area .pop-opr__group-select-cover .pop-opr__list .pop-opr__item").filter({
|
|
@@ -3759,6 +5211,7 @@ const weixinPublish_rpa_rpaAction = async (task, params)=>{
|
|
|
3759
5211
|
await poperInstance.locator('.frm_radio_item label[for="not_recomment_0"]').click();
|
|
3760
5212
|
}
|
|
3761
5213
|
await page.waitForTimeout(1000);
|
|
5214
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
3762
5215
|
const articleId = await new Promise(async (resolve)=>{
|
|
3763
5216
|
const handleResponse = async (response)=>{
|
|
3764
5217
|
const url = response.url();
|
|
@@ -4084,6 +5537,7 @@ const weixinmpPublish = async (task, params)=>{
|
|
|
4084
5537
|
if ("mockApi" === params.actionType) return weixinmpPublish_mock_mockAction(task, params);
|
|
4085
5538
|
return executeAction(weixinmpPublish_mock_mockAction, weixinmpPublish_rpa_rpaAction)(task, params);
|
|
4086
5539
|
};
|
|
5540
|
+
const GenXSCommon = __webpack_require__("./src/utils/XhsXsCommonEnc.js");
|
|
4087
5541
|
const xiaohongshuPublish_mock_errnoMap = {
|
|
4088
5542
|
915: "所属C端账号手机号被修改,请重新登录",
|
|
4089
5543
|
914: "所属C端账号密码被修改,请重新登录",
|
|
@@ -4289,6 +5743,7 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
4289
5743
|
};
|
|
4290
5744
|
}
|
|
4291
5745
|
}
|
|
5746
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
4292
5747
|
const business_binds = {
|
|
4293
5748
|
version: 1,
|
|
4294
5749
|
bizType: "",
|
|
@@ -4308,18 +5763,21 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
4308
5763
|
const publishDataStr = mock_xsEncrypt.dumps(publishData);
|
|
4309
5764
|
const publishXt = Date.now().toString();
|
|
4310
5765
|
const publishXs = await mock_xsEncrypt.encryptXs(`/web_api/sns/v2/note${publishDataStr}`, a1Cookie, publishXt);
|
|
5766
|
+
const xscommon = GenXSCommon(a1Cookie, publishXt, publishXs);
|
|
4311
5767
|
const publishResult = await http.api({
|
|
4312
5768
|
method: "post",
|
|
4313
5769
|
url: "https://edith.xiaohongshu.com/web_api/sns/v2/note",
|
|
4314
5770
|
data: publishData,
|
|
4315
5771
|
headers: {
|
|
4316
5772
|
"x-s": publishXs,
|
|
4317
|
-
"x-t": publishXt
|
|
5773
|
+
"x-t": publishXt,
|
|
5774
|
+
"x-s-common": xscommon
|
|
4318
5775
|
},
|
|
4319
5776
|
defaultErrorMsg: "文章发布异常,请稍后重试。"
|
|
4320
5777
|
});
|
|
4321
5778
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(publishResult.data?.id);
|
|
4322
5779
|
};
|
|
5780
|
+
const rpa_GenXSCommon = __webpack_require__("./src/utils/XhsXsCommonEnc.js");
|
|
4323
5781
|
const rpa_xsEncrypt = new XsEncrypt();
|
|
4324
5782
|
const xiaohongshuPublish_rpa_rpaAction = async (task, params)=>{
|
|
4325
5783
|
const commonCookies = {
|
|
@@ -4372,9 +5830,11 @@ const xiaohongshuPublish_rpa_rpaAction = async (task, params)=>{
|
|
|
4372
5830
|
const publishDataStr = rpa_xsEncrypt.dumps(publishData);
|
|
4373
5831
|
return rpa_xsEncrypt.encryptXs(interceptUrls[5] + publishDataStr, a1Cookie, xt);
|
|
4374
5832
|
})() : rpa_xsEncrypt.encryptXs(fetchCoverUrl, a1Cookie, xt));
|
|
5833
|
+
const xscommon = rpa_GenXSCommon(a1Cookie, xt, xs);
|
|
4375
5834
|
const newHeaders = {
|
|
4376
5835
|
...request.headers(),
|
|
4377
|
-
'x-s': xs
|
|
5836
|
+
'x-s': xs,
|
|
5837
|
+
'x-s-common': xscommon
|
|
4378
5838
|
};
|
|
4379
5839
|
await route.continue({
|
|
4380
5840
|
headers: newHeaders
|
|
@@ -4511,6 +5971,7 @@ const xiaohongshuPublish_rpa_rpaAction = async (task, params)=>{
|
|
|
4511
5971
|
hasText: "仅自己可见"
|
|
4512
5972
|
}).click();
|
|
4513
5973
|
}
|
|
5974
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
4514
5975
|
const releaseTimeInstance = page.locator("label").filter({
|
|
4515
5976
|
hasText: params.isImmediatelyPublish ? "立即发布" : "定时发布"
|
|
4516
5977
|
});
|
|
@@ -4536,21 +5997,31 @@ const xiaohongshuPublish = async (task, params)=>{
|
|
|
4536
5997
|
return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
|
|
4537
5998
|
};
|
|
4538
5999
|
var package_namespaceObject = {
|
|
4539
|
-
i8: "1.2.
|
|
6000
|
+
i8: "1.2.17"
|
|
4540
6001
|
};
|
|
6002
|
+
const BetaFlag = "HuiwenCanary";
|
|
4541
6003
|
class Action {
|
|
4542
6004
|
constructor(task){
|
|
4543
6005
|
this.task = task;
|
|
4544
6006
|
}
|
|
4545
6007
|
async bindTask(func, params) {
|
|
4546
6008
|
let responseData;
|
|
6009
|
+
this.task._timerRecord = {
|
|
6010
|
+
ActionStart: Date.now()
|
|
6011
|
+
};
|
|
6012
|
+
this.task.isBeta = this.task.isFeatOn(BetaFlag);
|
|
4547
6013
|
if (this.task.setArticleId) this.task.setArticleId(params.articleId ?? "");
|
|
4548
|
-
if (
|
|
6014
|
+
if (this.task.setSaveType) this.task.setSaveType(params.saveType ?? "");
|
|
6015
|
+
if (void 0 !== this.task.isBeta) this.task.setBetaType(this.task.isBeta);
|
|
6016
|
+
if ("object" == typeof params) params.cookies = params?.cookies ?? [];
|
|
4549
6017
|
try {
|
|
4550
6018
|
responseData = await func(this.task, params);
|
|
4551
6019
|
} catch (error) {
|
|
4552
6020
|
responseData = Http.handleApiError(error);
|
|
6021
|
+
} finally{
|
|
6022
|
+
this.task._timerRecord['ActionEnd'] = Date.now();
|
|
4553
6023
|
}
|
|
6024
|
+
if (this.task.setTimeConsuming) this.task.setTimeConsuming(this.task._timerRecord);
|
|
4554
6025
|
if (200 === responseData.code) this.task.logger.info(`${func.name} action params error`, responseData);
|
|
4555
6026
|
else if (0 !== responseData.code) {
|
|
4556
6027
|
this.task.logger.error(responseData.message || `${func.name} 执行失败`, stringifyError(responseData.data), responseData.extra);
|
|
@@ -4558,6 +6029,24 @@ class Action {
|
|
|
4558
6029
|
} else this.task.logger.info(`${func.name} action success`);
|
|
4559
6030
|
return responseData;
|
|
4560
6031
|
}
|
|
6032
|
+
FetchArticles(params) {
|
|
6033
|
+
return this.bindTask(FetchArticles, params);
|
|
6034
|
+
}
|
|
6035
|
+
SearchAccountInfo(params) {
|
|
6036
|
+
return this.bindTask(SearchAccountInfo, params);
|
|
6037
|
+
}
|
|
6038
|
+
TTSessionCheck(params) {
|
|
6039
|
+
return this.bindTask(TTSessionCheck, params);
|
|
6040
|
+
}
|
|
6041
|
+
WxSessionCheck(params) {
|
|
6042
|
+
return this.bindTask(WxSessionCheck, params);
|
|
6043
|
+
}
|
|
6044
|
+
XhsSessionCheck(params) {
|
|
6045
|
+
return this.bindTask(XhsSessionCheck, params);
|
|
6046
|
+
}
|
|
6047
|
+
BjhSessionCheck(params) {
|
|
6048
|
+
return this.bindTask(BjhSessionCheck, params);
|
|
6049
|
+
}
|
|
4561
6050
|
searchToutiaoTopicList(params) {
|
|
4562
6051
|
return this.bindTask(searchToutiaoTopicList, params);
|
|
4563
6052
|
}
|
|
@@ -4582,6 +6071,9 @@ class Action {
|
|
|
4582
6071
|
getToutiaoConfig(params) {
|
|
4583
6072
|
return this.bindTask(getToutiaoConfig, params);
|
|
4584
6073
|
}
|
|
6074
|
+
getWeixinConfig(params) {
|
|
6075
|
+
return this.bindTask(getWeixinConfig, params);
|
|
6076
|
+
}
|
|
4585
6077
|
getBaijiahaoConfig(params) {
|
|
4586
6078
|
return this.bindTask(getBaijiahaoConfig, params);
|
|
4587
6079
|
}
|
|
@@ -4614,6 +6106,6 @@ class Action {
|
|
|
4614
6106
|
}
|
|
4615
6107
|
}
|
|
4616
6108
|
var __webpack_exports__version = package_namespaceObject.i8;
|
|
4617
|
-
export { Action, __webpack_exports__version as version };
|
|
6109
|
+
export { Action, BetaFlag, __webpack_exports__version as version };
|
|
4618
6110
|
|
|
4619
6111
|
//# sourceMappingURL=index.mjs.map
|