@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.js
CHANGED
|
@@ -1,4 +1,670 @@
|
|
|
1
1
|
var __webpack_modules__ = {
|
|
2
|
+
"./src/utils/XhsXsCommonEnc.js": function(module) {
|
|
3
|
+
var encrypt_lookup = [
|
|
4
|
+
"Z",
|
|
5
|
+
"m",
|
|
6
|
+
"s",
|
|
7
|
+
"e",
|
|
8
|
+
"r",
|
|
9
|
+
"b",
|
|
10
|
+
"B",
|
|
11
|
+
"o",
|
|
12
|
+
"H",
|
|
13
|
+
"Q",
|
|
14
|
+
"t",
|
|
15
|
+
"N",
|
|
16
|
+
"P",
|
|
17
|
+
"+",
|
|
18
|
+
"w",
|
|
19
|
+
"O",
|
|
20
|
+
"c",
|
|
21
|
+
"z",
|
|
22
|
+
"a",
|
|
23
|
+
"/",
|
|
24
|
+
"L",
|
|
25
|
+
"p",
|
|
26
|
+
"n",
|
|
27
|
+
"g",
|
|
28
|
+
"G",
|
|
29
|
+
"8",
|
|
30
|
+
"y",
|
|
31
|
+
"J",
|
|
32
|
+
"q",
|
|
33
|
+
"4",
|
|
34
|
+
"2",
|
|
35
|
+
"K",
|
|
36
|
+
"W",
|
|
37
|
+
"Y",
|
|
38
|
+
"j",
|
|
39
|
+
"0",
|
|
40
|
+
"D",
|
|
41
|
+
"S",
|
|
42
|
+
"f",
|
|
43
|
+
"d",
|
|
44
|
+
"i",
|
|
45
|
+
"k",
|
|
46
|
+
"x",
|
|
47
|
+
"3",
|
|
48
|
+
"V",
|
|
49
|
+
"T",
|
|
50
|
+
"1",
|
|
51
|
+
"6",
|
|
52
|
+
"I",
|
|
53
|
+
"l",
|
|
54
|
+
"U",
|
|
55
|
+
"A",
|
|
56
|
+
"F",
|
|
57
|
+
"M",
|
|
58
|
+
"9",
|
|
59
|
+
"7",
|
|
60
|
+
"h",
|
|
61
|
+
"E",
|
|
62
|
+
"C",
|
|
63
|
+
"v",
|
|
64
|
+
"u",
|
|
65
|
+
"R",
|
|
66
|
+
"X",
|
|
67
|
+
"5"
|
|
68
|
+
];
|
|
69
|
+
let esm_typeof = {};
|
|
70
|
+
esm_typeof.A = function(t) {
|
|
71
|
+
return typeof t;
|
|
72
|
+
};
|
|
73
|
+
function encrypt_b64Encode(t) {
|
|
74
|
+
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 = {
|
|
75
|
+
udFrB: function(t, e) {
|
|
76
|
+
return t % e;
|
|
77
|
+
},
|
|
78
|
+
cCZFe: function(t, e) {
|
|
79
|
+
return t === e;
|
|
80
|
+
},
|
|
81
|
+
jevwl: function(t, e) {
|
|
82
|
+
return t - e;
|
|
83
|
+
},
|
|
84
|
+
aqlTy: function(t, e) {
|
|
85
|
+
return t + e;
|
|
86
|
+
},
|
|
87
|
+
rceYY: function(t, e) {
|
|
88
|
+
return t >> e;
|
|
89
|
+
},
|
|
90
|
+
OwjMq: function(t, e) {
|
|
91
|
+
return t & e;
|
|
92
|
+
},
|
|
93
|
+
kSGXO: function(t, e) {
|
|
94
|
+
return t << e;
|
|
95
|
+
},
|
|
96
|
+
veNiI: function(t, e) {
|
|
97
|
+
return t === e;
|
|
98
|
+
},
|
|
99
|
+
QLthP: function(t, e) {
|
|
100
|
+
return t + e;
|
|
101
|
+
},
|
|
102
|
+
wDtJz: function(t, e) {
|
|
103
|
+
return t + e;
|
|
104
|
+
},
|
|
105
|
+
nYqUQ: function(t, e) {
|
|
106
|
+
return t & e;
|
|
107
|
+
},
|
|
108
|
+
TCArD: function(t, e) {
|
|
109
|
+
return t << e;
|
|
110
|
+
},
|
|
111
|
+
RHteb: function(t, e) {
|
|
112
|
+
return t - e;
|
|
113
|
+
},
|
|
114
|
+
mZPJZ: function(t, e) {
|
|
115
|
+
return t < e;
|
|
116
|
+
},
|
|
117
|
+
zDETq: function(t, e, r, n) {
|
|
118
|
+
return t(e, r, n);
|
|
119
|
+
},
|
|
120
|
+
YlZGp: function(t, e) {
|
|
121
|
+
return t > e;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
function W(t, e) {
|
|
125
|
+
return a0_0x10f4ac(e, t - -H);
|
|
126
|
+
}
|
|
127
|
+
for(var X = (W(-413, -442) + W(-e, -r) + "7")[W(-n, -o)]("|"), z = 0;;){
|
|
128
|
+
switch(X[z++]){
|
|
129
|
+
case "0":
|
|
130
|
+
var Y;
|
|
131
|
+
continue;
|
|
132
|
+
case "1":
|
|
133
|
+
var K = [];
|
|
134
|
+
continue;
|
|
135
|
+
case "2":
|
|
136
|
+
var J = V[W(-i, -a)]($, 3);
|
|
137
|
+
continue;
|
|
138
|
+
case "3":
|
|
139
|
+
var $ = t[W(-350, -u)];
|
|
140
|
+
continue;
|
|
141
|
+
case "4":
|
|
142
|
+
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)], "=")));
|
|
143
|
+
continue;
|
|
144
|
+
case "5":
|
|
145
|
+
var Q = 16383;
|
|
146
|
+
continue;
|
|
147
|
+
case "6":
|
|
148
|
+
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)));
|
|
149
|
+
continue;
|
|
150
|
+
case "7":
|
|
151
|
+
return K[W(-U, -G)]("");
|
|
152
|
+
}
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function encrypt_encodeUtf8(t) {
|
|
157
|
+
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 = {
|
|
158
|
+
bIGxm: function(t, e) {
|
|
159
|
+
return t(e);
|
|
160
|
+
},
|
|
161
|
+
MahgM: function(t, e) {
|
|
162
|
+
return t < e;
|
|
163
|
+
},
|
|
164
|
+
czxKn: function(t, e) {
|
|
165
|
+
return t === e;
|
|
166
|
+
},
|
|
167
|
+
clYIu: function(t, e) {
|
|
168
|
+
return t + e;
|
|
169
|
+
}
|
|
170
|
+
}, y = m[b(477, 488)](encodeURIComponent, t), w = [];
|
|
171
|
+
function b(t, e) {
|
|
172
|
+
return a0_0x10f4ac(t, e - g);
|
|
173
|
+
}
|
|
174
|
+
for(var _ = 0; m[b(333, e)](_, y[b(r, n)]); _++){
|
|
175
|
+
var E = y[b(o, 290)](_);
|
|
176
|
+
if (m[b(i, a)](E, "%")) {
|
|
177
|
+
var x = y[b(u, s)](m[b(574, 472)](_, 1)) + y[b(c, 290)](m[b(605, l)](_, 2)), k = parseInt(x, 16);
|
|
178
|
+
w[b(592, f)](k), _ += 2;
|
|
179
|
+
} else w[b(p, f)](E[b(217, h) + b(d, v)](0));
|
|
180
|
+
}
|
|
181
|
+
return w;
|
|
182
|
+
}
|
|
183
|
+
function sign_common(h) {
|
|
184
|
+
return encrypt_b64Encode(encrypt_encodeUtf8(JSON.stringify(h)));
|
|
185
|
+
}
|
|
186
|
+
function encrypt_tripletToBase64(t) {
|
|
187
|
+
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 = {};
|
|
188
|
+
function m(t, e) {
|
|
189
|
+
return a0_0x10f4ac(e, t - v);
|
|
190
|
+
}
|
|
191
|
+
g[m(205, 328)] = function(t, e) {
|
|
192
|
+
return t + e;
|
|
193
|
+
}, g[m(e, 53)] = function(t, e) {
|
|
194
|
+
return t >> e;
|
|
195
|
+
}, g[m(r, n)] = function(t, e) {
|
|
196
|
+
return t & e;
|
|
197
|
+
}, g[m(o, i)] = function(t, e) {
|
|
198
|
+
return t >> e;
|
|
199
|
+
}, g[m(-a, -u)] = function(t, e) {
|
|
200
|
+
return t & e;
|
|
201
|
+
};
|
|
202
|
+
var y = g;
|
|
203
|
+
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)];
|
|
204
|
+
}
|
|
205
|
+
function encrypt_encodeChunk(t, e, r) {
|
|
206
|
+
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 = {
|
|
207
|
+
hwomB: function(t, e) {
|
|
208
|
+
return t < e;
|
|
209
|
+
},
|
|
210
|
+
iHUeL: function(t, e) {
|
|
211
|
+
return t & e;
|
|
212
|
+
},
|
|
213
|
+
ELxEv: function(t, e) {
|
|
214
|
+
return t << e;
|
|
215
|
+
},
|
|
216
|
+
lBuRH: function(t, e) {
|
|
217
|
+
return t << e;
|
|
218
|
+
},
|
|
219
|
+
SkIJl: function(t, e) {
|
|
220
|
+
return t & e;
|
|
221
|
+
},
|
|
222
|
+
JYxWY: function(t, e) {
|
|
223
|
+
return t + e;
|
|
224
|
+
},
|
|
225
|
+
CxjtF: function(t, e) {
|
|
226
|
+
return t(e);
|
|
227
|
+
}
|
|
228
|
+
}, w = [];
|
|
229
|
+
function b(t, e) {
|
|
230
|
+
return a0_0x10f4ac(t, e - m);
|
|
231
|
+
}
|
|
232
|
+
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));
|
|
233
|
+
return w[b(-v, -g)]("");
|
|
234
|
+
}
|
|
235
|
+
function a0_0x3693(t, e) {
|
|
236
|
+
var r = [
|
|
237
|
+
"xUKNL",
|
|
238
|
+
"jUrZI",
|
|
239
|
+
"rviFu",
|
|
240
|
+
"join",
|
|
241
|
+
"get",
|
|
242
|
+
"LjDtD",
|
|
243
|
+
"ZJHyP",
|
|
244
|
+
"wOmGY",
|
|
245
|
+
"enumera",
|
|
246
|
+
"aONWR",
|
|
247
|
+
"string",
|
|
248
|
+
"kQpMi",
|
|
249
|
+
"mZPJZ",
|
|
250
|
+
"Ysiay",
|
|
251
|
+
"czxKn",
|
|
252
|
+
"|5|6|4|",
|
|
253
|
+
"prototy",
|
|
254
|
+
"jklmnop",
|
|
255
|
+
"MuYbw",
|
|
256
|
+
"diDwk",
|
|
257
|
+
"TRFtx",
|
|
258
|
+
"drDHI",
|
|
259
|
+
"WLARA",
|
|
260
|
+
"xyz0123",
|
|
261
|
+
"asBytes",
|
|
262
|
+
"|6|0|1|",
|
|
263
|
+
"JOtEi",
|
|
264
|
+
"Oialn",
|
|
265
|
+
"OQrEi",
|
|
266
|
+
"uPnXq",
|
|
267
|
+
"VWXYZab",
|
|
268
|
+
"cIbFa",
|
|
269
|
+
"qYuta",
|
|
270
|
+
"QDOZZ",
|
|
271
|
+
"MahgM",
|
|
272
|
+
"iRXZq",
|
|
273
|
+
"22098XlFGYn",
|
|
274
|
+
"mmLKn",
|
|
275
|
+
"jMcIE",
|
|
276
|
+
"stringi",
|
|
277
|
+
"[object",
|
|
278
|
+
"nYqUQ",
|
|
279
|
+
"jSgjk",
|
|
280
|
+
"ucyEo",
|
|
281
|
+
"iewJI",
|
|
282
|
+
"vgTwl",
|
|
283
|
+
"DnNGR",
|
|
284
|
+
"oBytes",
|
|
285
|
+
"Xtwzk",
|
|
286
|
+
"aqlTy",
|
|
287
|
+
"JWnPK",
|
|
288
|
+
"1|0|2|4",
|
|
289
|
+
"qrstuvw",
|
|
290
|
+
"_gg",
|
|
291
|
+
"QLthP",
|
|
292
|
+
"FJIWy",
|
|
293
|
+
"yRnhISG",
|
|
294
|
+
"pjUsr",
|
|
295
|
+
"KAwuh",
|
|
296
|
+
"Thhoa",
|
|
297
|
+
"jarkJ",
|
|
298
|
+
"WjRNN",
|
|
299
|
+
"asStrin",
|
|
300
|
+
"x3VT16I",
|
|
301
|
+
"357835LaQWjW",
|
|
302
|
+
"SkIJl",
|
|
303
|
+
"size",
|
|
304
|
+
"iyorr",
|
|
305
|
+
"iHUeL",
|
|
306
|
+
"tTanW",
|
|
307
|
+
"tNusJ",
|
|
308
|
+
"NiSrP",
|
|
309
|
+
"eAt",
|
|
310
|
+
"TCArD",
|
|
311
|
+
"a2r1ZQo",
|
|
312
|
+
"iamspam",
|
|
313
|
+
"bOnfu",
|
|
314
|
+
"UNSKg",
|
|
315
|
+
"HIJKLMN",
|
|
316
|
+
"ZfMKC",
|
|
317
|
+
"bJhXU",
|
|
318
|
+
"zwAAc",
|
|
319
|
+
"JYxWY",
|
|
320
|
+
"lUAFM97",
|
|
321
|
+
"mwaRe",
|
|
322
|
+
"EzYWD",
|
|
323
|
+
"replace",
|
|
324
|
+
"uOtUJ",
|
|
325
|
+
"__esMod",
|
|
326
|
+
"ViQWI",
|
|
327
|
+
"aCMFL",
|
|
328
|
+
"EAKSd",
|
|
329
|
+
"ule",
|
|
330
|
+
"pqnFP",
|
|
331
|
+
"qYDsL",
|
|
332
|
+
"270726pnaYfG",
|
|
333
|
+
"glBZG",
|
|
334
|
+
"OwjMq",
|
|
335
|
+
"YGrjc",
|
|
336
|
+
"ZhAcd",
|
|
337
|
+
"JDqFL",
|
|
338
|
+
"456789+",
|
|
339
|
+
"kEjQs",
|
|
340
|
+
"lWhbD",
|
|
341
|
+
"OaLTI",
|
|
342
|
+
"dXlgm",
|
|
343
|
+
"cVte9UJ",
|
|
344
|
+
"ctor",
|
|
345
|
+
"hwomB",
|
|
346
|
+
"wDtJz",
|
|
347
|
+
"constru",
|
|
348
|
+
"ABHuC",
|
|
349
|
+
"zDETq",
|
|
350
|
+
"SYNeA",
|
|
351
|
+
"BGbij",
|
|
352
|
+
"ionFq",
|
|
353
|
+
"QzaNS",
|
|
354
|
+
"7|3|5|4",
|
|
355
|
+
"YlZGp",
|
|
356
|
+
"Bjniw",
|
|
357
|
+
"ZITuN",
|
|
358
|
+
"KPTzH",
|
|
359
|
+
"HrBeq",
|
|
360
|
+
"xobsT",
|
|
361
|
+
"kXJkC",
|
|
362
|
+
"QSrEZ",
|
|
363
|
+
"ENXtO",
|
|
364
|
+
"FYbRJ",
|
|
365
|
+
"wOcza/L",
|
|
366
|
+
"_hh",
|
|
367
|
+
"dVXMb",
|
|
368
|
+
"ppkua",
|
|
369
|
+
"WgamZ",
|
|
370
|
+
"HuwCW",
|
|
371
|
+
"362424fnLCuh",
|
|
372
|
+
"charCod",
|
|
373
|
+
"HhPqg",
|
|
374
|
+
"ODunI",
|
|
375
|
+
"eJzqq",
|
|
376
|
+
"charAt",
|
|
377
|
+
"JGAgI",
|
|
378
|
+
"ZmserbB",
|
|
379
|
+
"TURcG",
|
|
380
|
+
"WyrqF",
|
|
381
|
+
"iYJzH",
|
|
382
|
+
"VIwfH",
|
|
383
|
+
"tzzOB",
|
|
384
|
+
"YgiCH",
|
|
385
|
+
"byyMQ",
|
|
386
|
+
"ELxEv",
|
|
387
|
+
"0DSfdik",
|
|
388
|
+
"HRihr",
|
|
389
|
+
"_ii",
|
|
390
|
+
"aDsrp",
|
|
391
|
+
"ble",
|
|
392
|
+
"jTGtW",
|
|
393
|
+
"configu",
|
|
394
|
+
"cXiYW",
|
|
395
|
+
"56kSpAsC",
|
|
396
|
+
"158KIldlA",
|
|
397
|
+
"oHQtNP+",
|
|
398
|
+
"BHavO",
|
|
399
|
+
"PCIlh",
|
|
400
|
+
"QatIf",
|
|
401
|
+
"IKyqh",
|
|
402
|
+
"Words",
|
|
403
|
+
"Qwnrg",
|
|
404
|
+
"44lQAgNu",
|
|
405
|
+
"cdefghi",
|
|
406
|
+
"nTwxD",
|
|
407
|
+
"RHteb",
|
|
408
|
+
"coqPr",
|
|
409
|
+
"rJwmI",
|
|
410
|
+
"aBoeK",
|
|
411
|
+
"default",
|
|
412
|
+
"exports",
|
|
413
|
+
"rceYY",
|
|
414
|
+
"isArray",
|
|
415
|
+
"mdKKO",
|
|
416
|
+
"kzxWE",
|
|
417
|
+
"DeBtm",
|
|
418
|
+
"tjjUn",
|
|
419
|
+
"vJEcD",
|
|
420
|
+
"LpfE8xz",
|
|
421
|
+
"bin",
|
|
422
|
+
"HKazo",
|
|
423
|
+
"rable",
|
|
424
|
+
"call",
|
|
425
|
+
"wordsTo",
|
|
426
|
+
"zBiyt",
|
|
427
|
+
"GrsGL",
|
|
428
|
+
"fqulF",
|
|
429
|
+
"jevwl",
|
|
430
|
+
"mxfLj",
|
|
431
|
+
"xlUnt",
|
|
432
|
+
"q42KWYj",
|
|
433
|
+
"endian",
|
|
434
|
+
"eEqDc",
|
|
435
|
+
"oyGAZ",
|
|
436
|
+
"bytesTo",
|
|
437
|
+
"OzjuJ",
|
|
438
|
+
"IfwWq",
|
|
439
|
+
"ize",
|
|
440
|
+
"6648810piiNEz",
|
|
441
|
+
"lTHdy",
|
|
442
|
+
"vDLZJ",
|
|
443
|
+
"stringT",
|
|
444
|
+
"A4NjFqY",
|
|
445
|
+
"GkjTz",
|
|
446
|
+
"eooJA",
|
|
447
|
+
"substr",
|
|
448
|
+
"veNiI",
|
|
449
|
+
"LYfDp",
|
|
450
|
+
"ljKsP",
|
|
451
|
+
"jJYWG",
|
|
452
|
+
"bcYAf",
|
|
453
|
+
"srikB",
|
|
454
|
+
"utf8",
|
|
455
|
+
"qTbeY",
|
|
456
|
+
"yqRzd",
|
|
457
|
+
"|3|5",
|
|
458
|
+
"bjbAy",
|
|
459
|
+
" Array]",
|
|
460
|
+
"rMbXP",
|
|
461
|
+
"u5wPHsO",
|
|
462
|
+
"test",
|
|
463
|
+
"gMIMC",
|
|
464
|
+
"Deyqv",
|
|
465
|
+
" argume",
|
|
466
|
+
"ABCDEFG",
|
|
467
|
+
"undefin",
|
|
468
|
+
"split",
|
|
469
|
+
"QTlsj",
|
|
470
|
+
"_isBuff",
|
|
471
|
+
"OPQRSTU",
|
|
472
|
+
"Illegal",
|
|
473
|
+
"loSen",
|
|
474
|
+
"navigat",
|
|
475
|
+
"ObwNo",
|
|
476
|
+
"qPbcq",
|
|
477
|
+
"7182692QogvXX",
|
|
478
|
+
"tvqSn",
|
|
479
|
+
"DGptJ",
|
|
480
|
+
"HhTfW",
|
|
481
|
+
"avIYx",
|
|
482
|
+
"defineP",
|
|
483
|
+
"PFQbW",
|
|
484
|
+
"CjFyM",
|
|
485
|
+
"toStrin",
|
|
486
|
+
"yMWXS",
|
|
487
|
+
"yMyOy",
|
|
488
|
+
"0XTdDgM",
|
|
489
|
+
"eXkru",
|
|
490
|
+
"_blocks",
|
|
491
|
+
"indexOf",
|
|
492
|
+
"mbBQr",
|
|
493
|
+
"lBuRH",
|
|
494
|
+
"HzGjH",
|
|
495
|
+
"HNErV",
|
|
496
|
+
"mEokX",
|
|
497
|
+
"userAge",
|
|
498
|
+
"UpmtD",
|
|
499
|
+
"sgomx",
|
|
500
|
+
"KDfKS",
|
|
501
|
+
"OTbSq",
|
|
502
|
+
"lxMGW",
|
|
503
|
+
"0|3|2|1",
|
|
504
|
+
"dfWyB",
|
|
505
|
+
"lWzAd",
|
|
506
|
+
"eyXTL",
|
|
507
|
+
"5624qreyZK",
|
|
508
|
+
"pow",
|
|
509
|
+
"IJstz",
|
|
510
|
+
"LMlMB",
|
|
511
|
+
"INlwI",
|
|
512
|
+
"lRulU",
|
|
513
|
+
"TCgZh",
|
|
514
|
+
"_digest",
|
|
515
|
+
"UBhIl",
|
|
516
|
+
"fLtZZ",
|
|
517
|
+
"FYSKq",
|
|
518
|
+
"2|8|0",
|
|
519
|
+
"IoCeZ",
|
|
520
|
+
" Object",
|
|
521
|
+
"UuTvI",
|
|
522
|
+
"lNKLD",
|
|
523
|
+
"String",
|
|
524
|
+
"Bytes",
|
|
525
|
+
"rBVvW",
|
|
526
|
+
"KblCWi+",
|
|
527
|
+
"pRaIH",
|
|
528
|
+
"roperty",
|
|
529
|
+
"vTINI",
|
|
530
|
+
"atLE",
|
|
531
|
+
"functio",
|
|
532
|
+
"Udqoy",
|
|
533
|
+
"nt ",
|
|
534
|
+
"htSWx",
|
|
535
|
+
"hEwRK",
|
|
536
|
+
"encodin",
|
|
537
|
+
"sCSVK",
|
|
538
|
+
"VuAZF",
|
|
539
|
+
"xeIIy",
|
|
540
|
+
"RBjMb",
|
|
541
|
+
"taTrq",
|
|
542
|
+
"vDLFJ",
|
|
543
|
+
"bPkya",
|
|
544
|
+
"HzimH",
|
|
545
|
+
"nCffO",
|
|
546
|
+
"BWbtU",
|
|
547
|
+
"2|8",
|
|
548
|
+
"slice",
|
|
549
|
+
"lxMGQ",
|
|
550
|
+
"tTiwe",
|
|
551
|
+
"JDhJB",
|
|
552
|
+
"rCode",
|
|
553
|
+
"gNDzY",
|
|
554
|
+
"wJkyu",
|
|
555
|
+
"cCZFe",
|
|
556
|
+
"RNGSl",
|
|
557
|
+
"floor",
|
|
558
|
+
"clYIu",
|
|
559
|
+
"vLiwz",
|
|
560
|
+
"BiNSE",
|
|
561
|
+
"MtYWB",
|
|
562
|
+
"fromCha",
|
|
563
|
+
"StNOc",
|
|
564
|
+
"|7|5|3|",
|
|
565
|
+
"9|1|4|6",
|
|
566
|
+
"length",
|
|
567
|
+
"UNYAE",
|
|
568
|
+
"pngG8yJ",
|
|
569
|
+
"hasOwnP",
|
|
570
|
+
"pYeWu",
|
|
571
|
+
"wTjkk",
|
|
572
|
+
"Bvk6/7=",
|
|
573
|
+
"KTmgk",
|
|
574
|
+
"bIGxm",
|
|
575
|
+
"readFlo",
|
|
576
|
+
"LFZch",
|
|
577
|
+
"_ff",
|
|
578
|
+
"1|3|4|2",
|
|
579
|
+
"binary",
|
|
580
|
+
"LLdJZ",
|
|
581
|
+
"ZofOU",
|
|
582
|
+
"6399uFPxTQ",
|
|
583
|
+
"push",
|
|
584
|
+
"YntPT",
|
|
585
|
+
"kSGXO",
|
|
586
|
+
"random",
|
|
587
|
+
"HfpCU",
|
|
588
|
+
"hECvuRX",
|
|
589
|
+
"getTime",
|
|
590
|
+
"iwSyV",
|
|
591
|
+
"alert",
|
|
592
|
+
"LKMcb",
|
|
593
|
+
"DJVdg",
|
|
594
|
+
"Hex",
|
|
595
|
+
"URzKO",
|
|
596
|
+
"CxjtF",
|
|
597
|
+
"ZVOCs",
|
|
598
|
+
"isBuffe",
|
|
599
|
+
"vGpbT",
|
|
600
|
+
"rotl",
|
|
601
|
+
"udFrB",
|
|
602
|
+
"CnbsH",
|
|
603
|
+
"crLST"
|
|
604
|
+
];
|
|
605
|
+
return r[t -= 131];
|
|
606
|
+
}
|
|
607
|
+
function a0_0x10f4ac(t, e) {
|
|
608
|
+
return a0_0x3693(e - -570, t);
|
|
609
|
+
}
|
|
610
|
+
var encrypt_mcr = function(t) {
|
|
611
|
+
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 = {};
|
|
612
|
+
function H(t, e) {
|
|
613
|
+
return a0_0x10f4ac(e, t - q);
|
|
614
|
+
}
|
|
615
|
+
U[H(-73, -66)] = function(t, e) {
|
|
616
|
+
return t === e;
|
|
617
|
+
}, U[H(e, 186)] = function(t, e) {
|
|
618
|
+
return t < e;
|
|
619
|
+
}, U[H(-r, -n)] = function(t, e) {
|
|
620
|
+
return t ^ e;
|
|
621
|
+
}, U[H(r, -o)] = function(t, e) {
|
|
622
|
+
return t & e;
|
|
623
|
+
}, U[H(-i, -a)] = function(t, e) {
|
|
624
|
+
return t < e;
|
|
625
|
+
}, U[H(-175, -u)] = function(t, e) {
|
|
626
|
+
return t ^ e;
|
|
627
|
+
}, U[H(-59, s)] = function(t, e) {
|
|
628
|
+
return t ^ e;
|
|
629
|
+
}, U[H(-c, -l)] = function(t, e) {
|
|
630
|
+
return t >>> e;
|
|
631
|
+
}, U[H(f, p)] = function(t, e) {
|
|
632
|
+
return t >>> e;
|
|
633
|
+
};
|
|
634
|
+
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);
|
|
635
|
+
return function(t) {
|
|
636
|
+
function e(t, e) {
|
|
637
|
+
return H(e - 1181, t);
|
|
638
|
+
}
|
|
639
|
+
if (W[e(m, 1108)]((0, esm_typeof.A)(t), e(y, 914))) {
|
|
640
|
+
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);
|
|
641
|
+
return W[e(R, 1166)](n, -1) ^ z;
|
|
642
|
+
}
|
|
643
|
+
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));
|
|
644
|
+
return W[e(F, B)](W[e(D, 1122)](n, -1), z);
|
|
645
|
+
};
|
|
646
|
+
}();
|
|
647
|
+
function GenXSCommon(a1cookie, x_t, x_s) {
|
|
648
|
+
let b1 = 'I38rHdgsjopgIvesdVwgIC+oIELmBZ5e3VwXLgFTIxS3bqwErFeexd0ekncAzMFYnqthIhJeSnMDKutRI3KsYorWHPtGrbV0P9WfIi/eWc6eYqtyQApPI37ekmR1QL+5Ii6sdnoeSfqYHqwl2qt5B0DoIvMzOZQqZVw7IxOeTqwr4qtiIkrOIi/skccxICLdI3Oe0utl2ADZsLveDSKsSPw5IEvsiutJOqw8BVwfPpdeTDWOIx4VIiu6ZPwbPut5IvlaLbgs3qtxIxes1VwHIkumIkIyejgsY/WTge7sjutKrZgedWI9gfKeYWZGI36eWPwyIEJefut0ocVAPBLLI3Aeiqt3cZ7sVom4IESyIhEqQd4AICY24F4gIiifpVwAICZVJo3sWWJs1qwiIvdef97e0ekKIi/e1piS8qwUIE7s1fds6WAeiVwqed5sdut3IxILbd6sdqtDbgKs0PwgIv8aI3z5rqwGBVtwzfTsKD7sdBdskut+Iioed/As1SiiIkKs0F6s3nVuIkge1Pt0IkVkwPwwNVtMI3/e1qtdIkKs1VwVIEesdutA+qwKsuw7IvrRIxDgJfIj2IJexVtVIhiKIi6eDVw/bz4zLadsYjmfIkWo4VtPmVw5IvAe3qtk+LJeTl5sTSEyIEJekdgs3PtsnPwqI35sSPt0Ih/sV04TIk0ejjNsfqw7Iv3sVut04B8qIkWyIvKsxFOekzNsdAKsYPtKIiMFI3MurVtKIvzjIh6s6lFut//sWqtaI3IYbuwl';
|
|
649
|
+
let h = {
|
|
650
|
+
s0: 3,
|
|
651
|
+
s1: "",
|
|
652
|
+
x0: "1",
|
|
653
|
+
x1: "3.6.8",
|
|
654
|
+
x2: "Mac OS",
|
|
655
|
+
x3: "xhs-pc-web",
|
|
656
|
+
x4: "4.20.1",
|
|
657
|
+
x5: a1cookie,
|
|
658
|
+
x6: x_t,
|
|
659
|
+
x7: x_s,
|
|
660
|
+
x8: b1,
|
|
661
|
+
x9: encrypt_mcr(x_t + x_s + b1),
|
|
662
|
+
x10: 1
|
|
663
|
+
};
|
|
664
|
+
return sign_common(h);
|
|
665
|
+
}
|
|
666
|
+
module.exports = GenXSCommon;
|
|
667
|
+
},
|
|
2
668
|
"./src/utils/ttABEncrypt.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
3
669
|
module = __webpack_require__.nmd(module);
|
|
4
670
|
const a0_0x45db08 = a0_0x4b0d;
|
|
@@ -1144,6 +1810,7 @@ var __webpack_exports__ = {};
|
|
|
1144
1810
|
__webpack_require__.r(__webpack_exports__);
|
|
1145
1811
|
__webpack_require__.d(__webpack_exports__, {
|
|
1146
1812
|
version: ()=>package_namespaceObject.i8,
|
|
1813
|
+
BetaFlag: ()=>BetaFlag,
|
|
1147
1814
|
Action: ()=>Action
|
|
1148
1815
|
});
|
|
1149
1816
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
@@ -1168,7 +1835,9 @@ var __webpack_exports__ = {};
|
|
|
1168
1835
|
};
|
|
1169
1836
|
}
|
|
1170
1837
|
constructor(config){
|
|
1171
|
-
this.apiClient = external_axios_default().create(
|
|
1838
|
+
this.apiClient = external_axios_default().create({
|
|
1839
|
+
...config
|
|
1840
|
+
});
|
|
1172
1841
|
}
|
|
1173
1842
|
addResponseInterceptor(findError) {
|
|
1174
1843
|
this.apiClient.interceptors.response.use((response)=>{
|
|
@@ -1426,7 +2095,9 @@ var __webpack_exports__ = {};
|
|
|
1426
2095
|
401100032: "异常,请检查图片(如:格式、版权、合规性等)。",
|
|
1427
2096
|
20040034: "封面图片推荐jpg、png格式,不支持gif格式。",
|
|
1428
2097
|
20040124: "服务器异常,请稍后重试!",
|
|
1429
|
-
20040001: "当前用户未登录,请登陆后重试!"
|
|
2098
|
+
20040001: "当前用户未登录,请登陆后重试!",
|
|
2099
|
+
401100025: "该应用不支持此媒资类型",
|
|
2100
|
+
401100033: "图片宽高不满足要求"
|
|
1430
2101
|
};
|
|
1431
2102
|
const mockAction = async (task, params)=>{
|
|
1432
2103
|
const { baijiahaoSingleCover, baijiahaoMultCover, baijiahaoCoverType } = params.settingInfo;
|
|
@@ -1551,6 +2222,7 @@ var __webpack_exports__ = {};
|
|
|
1551
2222
|
};
|
|
1552
2223
|
const isDraft = "draft" === params.saveType;
|
|
1553
2224
|
const saveUrl = isDraft ? "https://baijiahao.baidu.com/pcui/article/save?callback=bjhdraft" : "https://baijiahao.baidu.com/pcui/article/publish?callback=bjhpublish";
|
|
2225
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
1554
2226
|
const res = await http.api({
|
|
1555
2227
|
method: "post",
|
|
1556
2228
|
url: saveUrl,
|
|
@@ -1672,7 +2344,7 @@ var __webpack_exports__ = {};
|
|
|
1672
2344
|
const findActivity = activityFormItem.locator(".cheetah-form-item-control").getByText(name, {
|
|
1673
2345
|
exact: true
|
|
1674
2346
|
});
|
|
1675
|
-
if (await findActivity.count() > 0) findActivity.first().locator("..").click();
|
|
2347
|
+
if (await findActivity.count() > 0) await findActivity.first().locator("..").click();
|
|
1676
2348
|
}
|
|
1677
2349
|
}
|
|
1678
2350
|
const { articleId, message } = await new Promise(async (resolve)=>{
|
|
@@ -1688,8 +2360,9 @@ var __webpack_exports__ = {};
|
|
|
1688
2360
|
}
|
|
1689
2361
|
};
|
|
1690
2362
|
page.on("response", handleResponse);
|
|
2363
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
1691
2364
|
const operatorContainer = page.locator(".editor-component-operator");
|
|
1692
|
-
if ("draft" === params.saveType) operatorContainer.locator(".op-btn-outter-content").filter({
|
|
2365
|
+
if ("draft" === params.saveType) await operatorContainer.locator(".op-btn-outter-content").filter({
|
|
1693
2366
|
hasText: "存草稿"
|
|
1694
2367
|
}).locator("button").click();
|
|
1695
2368
|
else if (params.settingInfo.timer) {
|
|
@@ -1754,7 +2427,7 @@ var __webpack_exports__ = {};
|
|
|
1754
2427
|
await page.locator(".cheetah-modal-confirm-btns button").filter({
|
|
1755
2428
|
hasText: "定时发布"
|
|
1756
2429
|
}).click();
|
|
1757
|
-
} else operatorContainer.locator(".op-btn-outter-content").filter({
|
|
2430
|
+
} else await operatorContainer.locator(".op-btn-outter-content").filter({
|
|
1758
2431
|
hasText: /^发布/
|
|
1759
2432
|
}).locator("button").click();
|
|
1760
2433
|
});
|
|
@@ -1859,12 +2532,20 @@ var __webpack_exports__ = {};
|
|
|
1859
2532
|
type: "news"
|
|
1860
2533
|
}
|
|
1861
2534
|
});
|
|
1862
|
-
|
|
2535
|
+
const data = res?.data?.article.activity_list.map((_item)=>({
|
|
1863
2536
|
id: _item.id,
|
|
1864
2537
|
name: _item.name,
|
|
1865
2538
|
detail: _item.detail,
|
|
1866
2539
|
is_enable: _item.is_enable
|
|
1867
|
-
})) ?? []
|
|
2540
|
+
})) ?? [];
|
|
2541
|
+
data.push({
|
|
2542
|
+
id: "bjh_publish_num_left",
|
|
2543
|
+
name: "账号剩余发文数",
|
|
2544
|
+
detail: "",
|
|
2545
|
+
is_enable: 1,
|
|
2546
|
+
publish_num_left: res.data.ability.publish_num_left
|
|
2547
|
+
});
|
|
2548
|
+
return (0, share_namespaceObject.success)(data, "获取百家号配置项成功!");
|
|
1868
2549
|
};
|
|
1869
2550
|
const searchToutiaoTopicList = async (_task, params)=>{
|
|
1870
2551
|
const http = new Http({
|
|
@@ -2034,7 +2715,7 @@ var __webpack_exports__ = {};
|
|
|
2034
2715
|
this.iv = external_node_buffer_namespaceObject.Buffer.from("4uzjr7mbsibcaldp", "utf8");
|
|
2035
2716
|
}
|
|
2036
2717
|
}
|
|
2037
|
-
const
|
|
2718
|
+
const searchXiaohongshuTopicList_xsEncrypt = new XsEncrypt();
|
|
2038
2719
|
const searchXiaohongshuTopicList = async (_task, params)=>{
|
|
2039
2720
|
const http = new Http({
|
|
2040
2721
|
headers: {
|
|
@@ -2062,9 +2743,9 @@ var __webpack_exports__ = {};
|
|
|
2062
2743
|
page: 1
|
|
2063
2744
|
}
|
|
2064
2745
|
};
|
|
2065
|
-
const topicDataStr =
|
|
2746
|
+
const topicDataStr = searchXiaohongshuTopicList_xsEncrypt.dumps(topicData);
|
|
2066
2747
|
const fatchTopic = `/web_api/sns/v1/search/topic${topicDataStr}`;
|
|
2067
|
-
const xs = await
|
|
2748
|
+
const xs = await searchXiaohongshuTopicList_xsEncrypt.encryptXs(fatchTopic, a1Cookie, xt);
|
|
2068
2749
|
const result = await http.api({
|
|
2069
2750
|
method: "post",
|
|
2070
2751
|
url: "https://edith.xiaohongshu.com/web_api/sns/v1/search/topic",
|
|
@@ -2245,6 +2926,7 @@ var __webpack_exports__ = {};
|
|
|
2245
2926
|
article_ad_type: getAddTypeValue(params.settingInfo.toutiaoAd),
|
|
2246
2927
|
claim_exclusive: toutiaoExclusive ? toutiaoExclusive : toutiaoOriginal?.includes("exclusive") ? 1 : 0
|
|
2247
2928
|
};
|
|
2929
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
2248
2930
|
const msToken = params.cookies.find((it)=>"msToken" === it.name)?.value;
|
|
2249
2931
|
let publishOption = {};
|
|
2250
2932
|
if (msToken) {
|
|
@@ -2489,6 +3171,7 @@ var __webpack_exports__ = {};
|
|
|
2489
3171
|
const confirmBtn = page.locator('div.byte-modal-footer button.byte-btn-primary:has-text("确定")');
|
|
2490
3172
|
if (await confirmBtn.isVisible()) await confirmBtn.click();
|
|
2491
3173
|
}
|
|
3174
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
2492
3175
|
if ("publish" === params.saveType) {
|
|
2493
3176
|
await page.locator(".publish-footer button").filter({
|
|
2494
3177
|
hasText: params.settingInfo.timer ? "定时发布" : "确认发布"
|
|
@@ -2614,6 +3297,770 @@ var __webpack_exports__ = {};
|
|
|
2614
3297
|
}, "获取粉丝数失败,请检查登陆有效性!");
|
|
2615
3298
|
}
|
|
2616
3299
|
};
|
|
3300
|
+
const TTSessionCheck = async (_task, params)=>{
|
|
3301
|
+
const http = new Http({
|
|
3302
|
+
headers: {
|
|
3303
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3304
|
+
referer: "https://mp.toutiao.com/profile_v4/graphic/publish"
|
|
3305
|
+
}
|
|
3306
|
+
});
|
|
3307
|
+
try {
|
|
3308
|
+
const res = await http.api({
|
|
3309
|
+
method: "get",
|
|
3310
|
+
url: "https://mp.toutiao.com/mp/agw/creator_center/user_info",
|
|
3311
|
+
defaultErrorMsg: `头条号登录状态失效。`
|
|
3312
|
+
});
|
|
3313
|
+
return (0, share_namespaceObject.success)(0 === res.code ? {
|
|
3314
|
+
isValidSession: true
|
|
3315
|
+
} : {
|
|
3316
|
+
isValidSession: false
|
|
3317
|
+
}, "头条账号有效性检测完成!");
|
|
3318
|
+
} catch (error) {
|
|
3319
|
+
return (0, share_namespaceObject.success)({
|
|
3320
|
+
isValidSession: false
|
|
3321
|
+
}, "头条账号有效性检测失败!");
|
|
3322
|
+
}
|
|
3323
|
+
};
|
|
3324
|
+
const WxSessionCheck = async (_task, params)=>{
|
|
3325
|
+
const http = new Http({
|
|
3326
|
+
headers: {
|
|
3327
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";")
|
|
3328
|
+
}
|
|
3329
|
+
});
|
|
3330
|
+
const fingerprint = "4695500bc93ab4ce8fb2692da6564e04";
|
|
3331
|
+
try {
|
|
3332
|
+
const res = await http.api({
|
|
3333
|
+
method: "get",
|
|
3334
|
+
url: "https://mp.weixin.qq.com/cgi-bin/appmsgpublish",
|
|
3335
|
+
params: {
|
|
3336
|
+
fingerprint,
|
|
3337
|
+
sub: "list",
|
|
3338
|
+
begin: 0,
|
|
3339
|
+
count: 10,
|
|
3340
|
+
query: "",
|
|
3341
|
+
type: 1011102103,
|
|
3342
|
+
show_type: "",
|
|
3343
|
+
free_publish_type: 1102103,
|
|
3344
|
+
sub_action: "list_ex",
|
|
3345
|
+
search_card: 0,
|
|
3346
|
+
token: params.token,
|
|
3347
|
+
lang: "zh_CN",
|
|
3348
|
+
f: "json",
|
|
3349
|
+
ajax: 1
|
|
3350
|
+
}
|
|
3351
|
+
});
|
|
3352
|
+
return (0, share_namespaceObject.success)(0 === res.base_resp.ret ? {
|
|
3353
|
+
isValidSession: true
|
|
3354
|
+
} : {
|
|
3355
|
+
isValidSession: false
|
|
3356
|
+
}, "微信账号有效性检测完成!");
|
|
3357
|
+
} catch (error) {
|
|
3358
|
+
return (0, share_namespaceObject.success)({
|
|
3359
|
+
isValidSession: false
|
|
3360
|
+
}, "微信账号有效性检测失败!");
|
|
3361
|
+
}
|
|
3362
|
+
};
|
|
3363
|
+
const XhsSessionCheck = async (_task, params)=>{
|
|
3364
|
+
const http = new Http({
|
|
3365
|
+
headers: {
|
|
3366
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3367
|
+
referer: "https://creator.xiaohongshu.com/new/home?source=official"
|
|
3368
|
+
}
|
|
3369
|
+
});
|
|
3370
|
+
try {
|
|
3371
|
+
const res = await http.api({
|
|
3372
|
+
method: "get",
|
|
3373
|
+
url: "https://creator.xiaohongshu.com/api/galaxy/user/info"
|
|
3374
|
+
});
|
|
3375
|
+
return (0, share_namespaceObject.success)(0 === res.result ? {
|
|
3376
|
+
isValidSession: true
|
|
3377
|
+
} : {
|
|
3378
|
+
isValidSession: false
|
|
3379
|
+
}, "小红书账号有效性检测完成!");
|
|
3380
|
+
} catch (error) {
|
|
3381
|
+
return (0, share_namespaceObject.success)({
|
|
3382
|
+
isValidSession: false
|
|
3383
|
+
}, "小红书账号有效性检测完成!");
|
|
3384
|
+
}
|
|
3385
|
+
};
|
|
3386
|
+
const BjhSessionCheck = async (_task, params)=>{
|
|
3387
|
+
const http = new Http({
|
|
3388
|
+
headers: {
|
|
3389
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3390
|
+
referer: "https://baijiahao.baidu.com/builder/rc/home"
|
|
3391
|
+
}
|
|
3392
|
+
});
|
|
3393
|
+
try {
|
|
3394
|
+
const res = await http.api({
|
|
3395
|
+
method: "get",
|
|
3396
|
+
url: "https://baijiahao.baidu.com/pcui/home/index",
|
|
3397
|
+
defaultErrorMsg: `百家号登录状态失效。`
|
|
3398
|
+
});
|
|
3399
|
+
return (0, share_namespaceObject.success)(0 === res.errno ? {
|
|
3400
|
+
isValidSession: true
|
|
3401
|
+
} : {
|
|
3402
|
+
isValidSession: false
|
|
3403
|
+
}, "百家号账号有效性检测完成!");
|
|
3404
|
+
} catch (error) {
|
|
3405
|
+
return (0, share_namespaceObject.success)({
|
|
3406
|
+
isValidSession: false
|
|
3407
|
+
}, "百家号账号有效性检测失败!");
|
|
3408
|
+
}
|
|
3409
|
+
};
|
|
3410
|
+
const types_errorResponse = (message, code = 500)=>({
|
|
3411
|
+
code,
|
|
3412
|
+
message,
|
|
3413
|
+
data: null
|
|
3414
|
+
});
|
|
3415
|
+
async function getBaijiahaoData(params) {
|
|
3416
|
+
try {
|
|
3417
|
+
const { token } = params;
|
|
3418
|
+
if (!token) return types_errorResponse("缺少token", 200);
|
|
3419
|
+
const http = new Http({
|
|
3420
|
+
headers: {
|
|
3421
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3422
|
+
token: String(token),
|
|
3423
|
+
Referer: "https://baijiahao.baidu.com/builder/rc/home"
|
|
3424
|
+
}
|
|
3425
|
+
});
|
|
3426
|
+
const yesterday = TimeFormatter.format(new Date().setDate(new Date().getDate() - 1), "yyyyMMdd");
|
|
3427
|
+
const [fansData, readData, incomeData, yesterdayData] = await Promise.all([
|
|
3428
|
+
http.api({
|
|
3429
|
+
method: "get",
|
|
3430
|
+
url: "https://baijiahao.baidu.com/pcui/home/index"
|
|
3431
|
+
}),
|
|
3432
|
+
http.api({
|
|
3433
|
+
method: "get",
|
|
3434
|
+
url: "https://baijiahao.baidu.com/author/eco/statistic/getauthorhistory"
|
|
3435
|
+
}),
|
|
3436
|
+
http.api({
|
|
3437
|
+
method: "get",
|
|
3438
|
+
url: "https://baijiahao.baidu.com/author/eco/income4/homepageincome"
|
|
3439
|
+
}),
|
|
3440
|
+
http.api({
|
|
3441
|
+
method: "get",
|
|
3442
|
+
url: "https://baijiahao.baidu.com/author/eco/statistics/appStatistic",
|
|
3443
|
+
params: {
|
|
3444
|
+
type: "all",
|
|
3445
|
+
is_yesterday: false,
|
|
3446
|
+
start_day: yesterday,
|
|
3447
|
+
end_day: yesterday,
|
|
3448
|
+
stat: 0
|
|
3449
|
+
}
|
|
3450
|
+
})
|
|
3451
|
+
]);
|
|
3452
|
+
const bjhData = {
|
|
3453
|
+
fansNum: fansData.data.coreData.fansCount,
|
|
3454
|
+
fansNumYesterday: -1 == yesterdayData.data.data.fans_increase ? null : yesterdayData.data.data.fans_increase,
|
|
3455
|
+
readNum: readData.data.total.view_count,
|
|
3456
|
+
incomeNum: incomeData.data.all_income.total_income,
|
|
3457
|
+
incomeNumYesterday: -1 == incomeData.data.all_income.yesterday_income ? null : incomeData.data.all_income.yesterday_income,
|
|
3458
|
+
recommendNumYesterday: -1 == yesterdayData.data.data.recommend_count ? null : yesterdayData.data.data.recommend_count,
|
|
3459
|
+
readNumYesterday: -1 == yesterdayData.data.data.view_count ? null : yesterdayData.data.data.view_count,
|
|
3460
|
+
likeNumYesterday: -1 == yesterdayData.data.data.likes_count ? null : yesterdayData.data.data.likes_count,
|
|
3461
|
+
commentNumYesterday: -1 == yesterdayData.data.data.comment_count ? null : yesterdayData.data.data.comment_count
|
|
3462
|
+
};
|
|
3463
|
+
return (0, share_namespaceObject.success)(bjhData, "百家号平台数据获取成功!");
|
|
3464
|
+
} catch (error) {
|
|
3465
|
+
return types_errorResponse(error instanceof Error ? error.message : "百家号平台数据获取失败");
|
|
3466
|
+
}
|
|
3467
|
+
}
|
|
3468
|
+
async function getToutiaoData(params) {
|
|
3469
|
+
const { cookies } = params;
|
|
3470
|
+
try {
|
|
3471
|
+
const http = new Http({
|
|
3472
|
+
headers: {
|
|
3473
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3474
|
+
referer: "https://mp.toutiao.com/profile_v4/graphic/publish"
|
|
3475
|
+
}
|
|
3476
|
+
});
|
|
3477
|
+
const [totalData, contentDataYesterday] = await Promise.all([
|
|
3478
|
+
http.api({
|
|
3479
|
+
method: "get",
|
|
3480
|
+
url: "https://mp.toutiao.com/mp/fe_api/home/merge_v2",
|
|
3481
|
+
params: {
|
|
3482
|
+
app_id: 1231
|
|
3483
|
+
}
|
|
3484
|
+
}),
|
|
3485
|
+
http.api({
|
|
3486
|
+
method: "get",
|
|
3487
|
+
url: "https://mp.toutiao.com/mp/agw/statistic/v2/content_stat",
|
|
3488
|
+
params: {
|
|
3489
|
+
type: 0,
|
|
3490
|
+
app_id: 1231
|
|
3491
|
+
}
|
|
3492
|
+
})
|
|
3493
|
+
]);
|
|
3494
|
+
const isReday = void 0 !== totalData.data.statistic.data.yesterday_read_count;
|
|
3495
|
+
const ttData = {
|
|
3496
|
+
fansNum: Number(totalData.data.statistic.data.total_subscribe_count),
|
|
3497
|
+
fansNumYesterday: void 0 !== totalData.data.statistic.data.yesterday_fans ? Number(totalData.data.statistic.data.yesterday_fans) : null,
|
|
3498
|
+
readNum: Number(totalData.data.statistic.data.total_read_play_count),
|
|
3499
|
+
incomeNum: totalData.data.statistic.data.total_income,
|
|
3500
|
+
incomeNumYesterday: totalData.data.statistic.data.is_yesterday_income_ready ? totalData.data.statistic.data.yesterday_income : null,
|
|
3501
|
+
showNumYesterday: isReday ? contentDataYesterday.author_stat.consume_data.impression_count : null,
|
|
3502
|
+
readNumYesterday: isReday ? contentDataYesterday.author_stat.consume_data.go_detail_count : null,
|
|
3503
|
+
likeNumYesterday: isReday ? contentDataYesterday.author_stat.interaction_data.digg_count : null,
|
|
3504
|
+
commentNumYesterday: isReday ? contentDataYesterday.author_stat.interaction_data.comment_count : null
|
|
3505
|
+
};
|
|
3506
|
+
return (0, share_namespaceObject.success)(ttData, "头条号粉丝数据获取成功!");
|
|
3507
|
+
} catch (error) {
|
|
3508
|
+
return types_errorResponse(error instanceof Error ? error.message : "头条号数据获取失败");
|
|
3509
|
+
}
|
|
3510
|
+
}
|
|
3511
|
+
async function getWeixinData(params) {
|
|
3512
|
+
const { token } = params;
|
|
3513
|
+
if (!token) return {
|
|
3514
|
+
code: 200,
|
|
3515
|
+
message: "缺少token",
|
|
3516
|
+
data: null
|
|
3517
|
+
};
|
|
3518
|
+
try {
|
|
3519
|
+
const { token } = params;
|
|
3520
|
+
if (!token) return types_errorResponse("缺少token", 200);
|
|
3521
|
+
const http = new Http({
|
|
3522
|
+
headers: {
|
|
3523
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";")
|
|
3524
|
+
}
|
|
3525
|
+
});
|
|
3526
|
+
const userInfo = {
|
|
3527
|
+
originalCount: 0,
|
|
3528
|
+
totalUsers: 0,
|
|
3529
|
+
userIncrease: 0,
|
|
3530
|
+
yesterday: {
|
|
3531
|
+
read: 0,
|
|
3532
|
+
share: 0,
|
|
3533
|
+
subscribe: 0
|
|
3534
|
+
}
|
|
3535
|
+
};
|
|
3536
|
+
const userInfoHtml = await http.api({
|
|
3537
|
+
method: "get",
|
|
3538
|
+
url: "https://mp.weixin.qq.com/cgi-bin/home",
|
|
3539
|
+
params: {
|
|
3540
|
+
t: "home/index",
|
|
3541
|
+
token,
|
|
3542
|
+
lang: "zh_CN"
|
|
3543
|
+
}
|
|
3544
|
+
});
|
|
3545
|
+
const originalMatch = userInfoHtml.trim().match(/原创内容[\s\S]*?<mp-thousandth[^>]*>([\d,]+)<\/mp-thousandth>/i);
|
|
3546
|
+
if (originalMatch) userInfo.originalCount = parseInt(originalMatch[1].replace(/,/g, ''), 10);
|
|
3547
|
+
const totalUsersMatch = userInfoHtml.match(/总用户数[\s\S]*?<div[^>]*class=["']weui-desktop-user_sum["'][^>]*>[\s\S]*?<mp-thousandth[^>]*>([\d,]+)<\/mp-thousandth>/i);
|
|
3548
|
+
if (totalUsersMatch) userInfo.totalUsers = parseInt(totalUsersMatch[1].replace(/,/g, ''), 10);
|
|
3549
|
+
const increaseMatch = userInfoHtml.match(/weui-desktop-user_increase_num[^>]*>\s*([+-]?)\s*<mp-thousandth[^>]*>([\d,]+)<\/mp-thousandth>/i);
|
|
3550
|
+
if (increaseMatch) {
|
|
3551
|
+
const sign = '-' === increaseMatch[1] ? -1 : 1;
|
|
3552
|
+
userInfo.userIncrease = sign * parseInt(increaseMatch[2].replace(/,/g, ''), 10);
|
|
3553
|
+
}
|
|
3554
|
+
const readMatch = userInfoHtml.match(/昨日阅读[\s\S]*?<mp-thousandth[^>]*>([\d,]+)<\/mp-thousandth>/i);
|
|
3555
|
+
if (readMatch) userInfo.yesterday.read = parseInt(readMatch[1].replace(/,/g, ''), 10);
|
|
3556
|
+
const shareMatch = userInfoHtml.match(/昨日分享[\s\S]*?<mp-thousandth[^>]*>([\d,]+)<\/mp-thousandth>/i);
|
|
3557
|
+
if (shareMatch) userInfo.yesterday.share = parseInt(shareMatch[1].replace(/,/g, ''), 10);
|
|
3558
|
+
const subscribeMatch = userInfoHtml.match(/昨日新增关注[\s\S]*?<mp-thousandth[^>]*>([\d,]+)<\/mp-thousandth>/i);
|
|
3559
|
+
if (subscribeMatch) userInfo.yesterday.subscribe = parseInt(subscribeMatch[1].replace(/,/g, ''), 10);
|
|
3560
|
+
const wxData = {
|
|
3561
|
+
fansNum: userInfo.totalUsers,
|
|
3562
|
+
fansNumYesterday: userInfo.yesterday.subscribe,
|
|
3563
|
+
readNumYesterday: userInfo.yesterday.read,
|
|
3564
|
+
shareNumYesterday: userInfo.yesterday.share
|
|
3565
|
+
};
|
|
3566
|
+
return (0, share_namespaceObject.success)(wxData, "微信平台数据获取成功!");
|
|
3567
|
+
} catch (error) {
|
|
3568
|
+
return types_errorResponse(error instanceof Error ? error.message : "微信平台数据获取失败");
|
|
3569
|
+
}
|
|
3570
|
+
}
|
|
3571
|
+
async function getXiaohongshuData(params) {
|
|
3572
|
+
try {
|
|
3573
|
+
const a1Cookie = params.cookies.find((it)=>"a1" === it.name)?.value;
|
|
3574
|
+
if (!a1Cookie) return types_errorResponse("账号数据异常,请重新绑定账号后重试。", 200);
|
|
3575
|
+
const http = new Http({
|
|
3576
|
+
headers: {
|
|
3577
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3578
|
+
referer: "https://creator.xiaohongshu.com",
|
|
3579
|
+
origin: "https://creator.xiaohongshu.com"
|
|
3580
|
+
}
|
|
3581
|
+
});
|
|
3582
|
+
const xsEncrypt = new XsEncrypt();
|
|
3583
|
+
const xt = Date.now().toString();
|
|
3584
|
+
const sevenDataUrl = "/api/galaxy/v2/creator/datacenter/account/base";
|
|
3585
|
+
const xs = await xsEncrypt.encryptXs(sevenDataUrl, a1Cookie, xt);
|
|
3586
|
+
const [overAllData, sevenData] = await Promise.all([
|
|
3587
|
+
http.api({
|
|
3588
|
+
method: "get",
|
|
3589
|
+
url: "https://creator.xiaohongshu.com/api/galaxy/creator/home/personal_info"
|
|
3590
|
+
}),
|
|
3591
|
+
http.api({
|
|
3592
|
+
method: "get",
|
|
3593
|
+
baseURL: "https://creator.xiaohongshu.com",
|
|
3594
|
+
url: sevenDataUrl,
|
|
3595
|
+
headers: {
|
|
3596
|
+
"x-s": xs,
|
|
3597
|
+
"x-t": xt
|
|
3598
|
+
}
|
|
3599
|
+
})
|
|
3600
|
+
]);
|
|
3601
|
+
const xhsData = {
|
|
3602
|
+
fansNum: overAllData.data.fans_count,
|
|
3603
|
+
favedNum: overAllData.data.faved_count,
|
|
3604
|
+
watchNumLastWeek: sevenData.data.seven.view_count,
|
|
3605
|
+
likeNumLastWeek: sevenData.data.seven.like_count,
|
|
3606
|
+
collectNumLastWeek: sevenData.data.seven.collect_count,
|
|
3607
|
+
commentNumLastWeek: sevenData.data.seven.comment_count,
|
|
3608
|
+
fansNumLastWeek: sevenData.data.seven.rise_fans_count,
|
|
3609
|
+
fansNumYesterday: sevenData.data.seven.rise_fans_list[0].count
|
|
3610
|
+
};
|
|
3611
|
+
return (0, share_namespaceObject.success)(xhsData, "小红书平台数据获取成功!");
|
|
3612
|
+
} catch (error) {
|
|
3613
|
+
return types_errorResponse(error instanceof Error ? error.message : "小红书平台数据获取失败");
|
|
3614
|
+
}
|
|
3615
|
+
}
|
|
3616
|
+
const SearchAccountInfo = async (_task, params)=>{
|
|
3617
|
+
const { platform } = params;
|
|
3618
|
+
switch(platform){
|
|
3619
|
+
case "toutiao":
|
|
3620
|
+
return getToutiaoData(params);
|
|
3621
|
+
case "xiaohongshu":
|
|
3622
|
+
return getXiaohongshuData(params);
|
|
3623
|
+
case "weixin":
|
|
3624
|
+
return getWeixinData(params);
|
|
3625
|
+
case "baijiahao":
|
|
3626
|
+
return getBaijiahaoData(params);
|
|
3627
|
+
default:
|
|
3628
|
+
return (0, share_namespaceObject.success)(null, "暂不支持该平台");
|
|
3629
|
+
}
|
|
3630
|
+
};
|
|
3631
|
+
const searchPublishInfo_types_errorResponse = (message, code = 500)=>({
|
|
3632
|
+
code,
|
|
3633
|
+
message,
|
|
3634
|
+
data: null
|
|
3635
|
+
});
|
|
3636
|
+
async function handleToutiaoData(params) {
|
|
3637
|
+
try {
|
|
3638
|
+
const { cookies, pageNum = 1, pageSize = 10, showOriginalData = false, onlySuccess = false } = params;
|
|
3639
|
+
const http = new Http({
|
|
3640
|
+
headers: {
|
|
3641
|
+
cookie: cookies.map((it)=>`${it.name}=${it.value}`).join(";")
|
|
3642
|
+
}
|
|
3643
|
+
});
|
|
3644
|
+
const visitedUid = await http.api({
|
|
3645
|
+
url: "https://mp.toutiao.com/mp/agw/creator_center/user_info?",
|
|
3646
|
+
method: "get",
|
|
3647
|
+
params: {
|
|
3648
|
+
app_id: 1231
|
|
3649
|
+
}
|
|
3650
|
+
});
|
|
3651
|
+
const articleInfo = await http.api({
|
|
3652
|
+
method: "get",
|
|
3653
|
+
url: "https://mp.toutiao.com/api/feed/mp_provider/v1/",
|
|
3654
|
+
params: {
|
|
3655
|
+
provider_type: "mp_provider",
|
|
3656
|
+
aid: "13",
|
|
3657
|
+
app_name: "news_article",
|
|
3658
|
+
category: "mp_all",
|
|
3659
|
+
channel: "",
|
|
3660
|
+
stream_api_version: "88",
|
|
3661
|
+
genre_type_switch: '{"repost":1,"small_video":1,"toutiao_graphic":1,"weitoutiao":1,"xigua_video":1}',
|
|
3662
|
+
device_platform: "pc",
|
|
3663
|
+
platform_id: "0",
|
|
3664
|
+
visited_uid: visitedUid.user_id_str,
|
|
3665
|
+
offset: (pageNum - 1) * pageSize,
|
|
3666
|
+
count: pageSize,
|
|
3667
|
+
keyword: "",
|
|
3668
|
+
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"}`,
|
|
3669
|
+
app_id: "1231"
|
|
3670
|
+
}
|
|
3671
|
+
});
|
|
3672
|
+
const articleCell = articleInfo.data.map((item)=>({
|
|
3673
|
+
title: item.assembleCell.itemCell.articleBase.title,
|
|
3674
|
+
imageUrl: item.assembleCell.itemCell.imageList.staggerFeedCover[0].url,
|
|
3675
|
+
createTime: item.assembleCell.itemCell.articleBase.publishTime,
|
|
3676
|
+
redirectUrl: item.assembleCell.itemCell.articleBase.articleURL,
|
|
3677
|
+
showNum: item.assembleCell.itemCell.itemCounter.showCount,
|
|
3678
|
+
readNum: item.assembleCell.itemCell.itemCounter.readCount,
|
|
3679
|
+
likeNum: item.assembleCell.itemCell.itemCounter.diggCount,
|
|
3680
|
+
commentNum: item.assembleCell.itemCell.itemCounter.commentCount,
|
|
3681
|
+
...showOriginalData ? {
|
|
3682
|
+
originalData: item
|
|
3683
|
+
} : {}
|
|
3684
|
+
}));
|
|
3685
|
+
const api_base_info_json = JSON.parse(articleInfo.api_base_info.app_extra_params);
|
|
3686
|
+
return (0, share_namespaceObject.success)({
|
|
3687
|
+
articleCell,
|
|
3688
|
+
...onlySuccess ? {
|
|
3689
|
+
pagination: {
|
|
3690
|
+
total: api_base_info_json.total_count,
|
|
3691
|
+
pageNum,
|
|
3692
|
+
pageSize
|
|
3693
|
+
}
|
|
3694
|
+
} : null
|
|
3695
|
+
}, "头条号文章文章获取成功");
|
|
3696
|
+
} catch (error) {
|
|
3697
|
+
return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "头条号文章数据获取失败");
|
|
3698
|
+
}
|
|
3699
|
+
}
|
|
3700
|
+
async function handleWeixinData(params) {
|
|
3701
|
+
try {
|
|
3702
|
+
const { cookies, token, pageNum = 1, pageSize = 10, showOriginalData = false, onlySuccess = false, cursor, lastPage } = params;
|
|
3703
|
+
if (!token) return {
|
|
3704
|
+
code: 200,
|
|
3705
|
+
message: "缺少token",
|
|
3706
|
+
data: null
|
|
3707
|
+
};
|
|
3708
|
+
const http = new Http({
|
|
3709
|
+
headers: {
|
|
3710
|
+
cookie: cookies.map((it)=>`${it.name}=${it.value}`).join(";")
|
|
3711
|
+
}
|
|
3712
|
+
});
|
|
3713
|
+
const ParsePublishPage = (body)=>{
|
|
3714
|
+
const match = body.match(/publish_page\s*=\s*({[\s\S]*?});/);
|
|
3715
|
+
if (!match) throw new Error('无法提取 publish_page 字段');
|
|
3716
|
+
let parsedData = JSON.parse(match[1]);
|
|
3717
|
+
const decodeEntities = function(str, decode = false) {
|
|
3718
|
+
const encodeMap = [
|
|
3719
|
+
"&",
|
|
3720
|
+
"&",
|
|
3721
|
+
"<",
|
|
3722
|
+
"<",
|
|
3723
|
+
">",
|
|
3724
|
+
">",
|
|
3725
|
+
" ",
|
|
3726
|
+
" ",
|
|
3727
|
+
'"',
|
|
3728
|
+
""",
|
|
3729
|
+
"'",
|
|
3730
|
+
"'"
|
|
3731
|
+
];
|
|
3732
|
+
const decodeMap = [
|
|
3733
|
+
"'",
|
|
3734
|
+
"'",
|
|
3735
|
+
""",
|
|
3736
|
+
'"',
|
|
3737
|
+
" ",
|
|
3738
|
+
" ",
|
|
3739
|
+
">",
|
|
3740
|
+
">",
|
|
3741
|
+
"<",
|
|
3742
|
+
"<",
|
|
3743
|
+
"&",
|
|
3744
|
+
"&",
|
|
3745
|
+
"<",
|
|
3746
|
+
"<",
|
|
3747
|
+
">",
|
|
3748
|
+
">"
|
|
3749
|
+
];
|
|
3750
|
+
const map = decode ? decodeMap : encodeMap;
|
|
3751
|
+
let result = str;
|
|
3752
|
+
for(let i = 0; i < map.length; i += 2)result = result.replace(new RegExp(map[i], "g"), map[i + 1]);
|
|
3753
|
+
return result;
|
|
3754
|
+
};
|
|
3755
|
+
const finalData = {
|
|
3756
|
+
...parsedData,
|
|
3757
|
+
publish_list: parsedData.publish_list.map((item)=>{
|
|
3758
|
+
const decoded = decodeEntities(item.publish_info, true);
|
|
3759
|
+
const parsedInfo = JSON.parse(decoded);
|
|
3760
|
+
return {
|
|
3761
|
+
publish_type: item.publish_type,
|
|
3762
|
+
publish_info: parsedInfo
|
|
3763
|
+
};
|
|
3764
|
+
})
|
|
3765
|
+
};
|
|
3766
|
+
return finalData;
|
|
3767
|
+
};
|
|
3768
|
+
async function fetchArticles(begin, pageSize, token) {
|
|
3769
|
+
return http.api({
|
|
3770
|
+
method: "get",
|
|
3771
|
+
url: 'https://mp.weixin.qq.com/cgi-bin/appmsgpublish',
|
|
3772
|
+
params: {
|
|
3773
|
+
sub: "list",
|
|
3774
|
+
begin: begin,
|
|
3775
|
+
count: pageSize,
|
|
3776
|
+
token: token,
|
|
3777
|
+
lang: "zh_CN"
|
|
3778
|
+
}
|
|
3779
|
+
});
|
|
3780
|
+
}
|
|
3781
|
+
let size = onlySuccess ? 10 : pageSize > 20 ? 20 : pageSize;
|
|
3782
|
+
let begin = (lastPage ?? pageNum) - 1;
|
|
3783
|
+
let rawArticlesInfo = await fetchArticles(begin * size, size, token);
|
|
3784
|
+
let articlesInfo = ParsePublishPage(rawArticlesInfo);
|
|
3785
|
+
let articleCell = [];
|
|
3786
|
+
if (!onlySuccess && pageSize > 20) {
|
|
3787
|
+
let totalFetched = articlesInfo.publish_list.length;
|
|
3788
|
+
let nextPage = pageNum + 1;
|
|
3789
|
+
while(totalFetched < pageSize){
|
|
3790
|
+
const remaining = pageSize - totalFetched;
|
|
3791
|
+
const currentPageSize = remaining > 20 ? 20 : remaining;
|
|
3792
|
+
let _rawArticlesInfo = await fetchArticles((nextPage - 1) * 20, currentPageSize, token);
|
|
3793
|
+
let parsed = ParsePublishPage(_rawArticlesInfo);
|
|
3794
|
+
articlesInfo.publish_list = articlesInfo.publish_list.concat(parsed.publish_list);
|
|
3795
|
+
totalFetched = articlesInfo.publish_list.length;
|
|
3796
|
+
if (parsed.publish_list.length < currentPageSize) break;
|
|
3797
|
+
nextPage++;
|
|
3798
|
+
}
|
|
3799
|
+
}
|
|
3800
|
+
let nextPage = false;
|
|
3801
|
+
if (onlySuccess) {
|
|
3802
|
+
let filteredList = articlesInfo.publish_list.filter((item)=>-1 == item.publish_info.appmsg_info[0].content_url.indexOf("tempkey")).map((item)=>item.publish_info);
|
|
3803
|
+
if (cursor) {
|
|
3804
|
+
const cursorIndex = filteredList.findIndex((item)=>item.msgid === cursor);
|
|
3805
|
+
if (-1 !== cursorIndex) filteredList = filteredList.slice(cursorIndex + 1);
|
|
3806
|
+
}
|
|
3807
|
+
let totalFetched = filteredList.length;
|
|
3808
|
+
while(totalFetched < pageSize && begin * size < articlesInfo.total_count){
|
|
3809
|
+
begin += 1;
|
|
3810
|
+
let nextRawArticlesInfo = await fetchArticles(begin * size, size, token);
|
|
3811
|
+
let nextArticlesInfo = ParsePublishPage(nextRawArticlesInfo);
|
|
3812
|
+
const newFiltered = nextArticlesInfo.publish_list.filter((item)=>-1 == item.publish_info.appmsg_info[0].content_url.indexOf("tempkey")).map((item)=>item.publish_info);
|
|
3813
|
+
filteredList = filteredList.concat(newFiltered);
|
|
3814
|
+
totalFetched = filteredList.length;
|
|
3815
|
+
}
|
|
3816
|
+
filteredList = filteredList.slice(0, pageSize);
|
|
3817
|
+
totalFetched = filteredList.length;
|
|
3818
|
+
if (totalFetched >= pageSize && begin * size < articlesInfo.total_count) {
|
|
3819
|
+
let nextRawArticlesInfo = await fetchArticles((begin + 1) * size, size, token);
|
|
3820
|
+
let nextArticlesInfo = ParsePublishPage(nextRawArticlesInfo);
|
|
3821
|
+
nextPage = nextArticlesInfo.publish_list.length > 0 && nextArticlesInfo.publish_list.some((item)=>-1 == item.publish_info.appmsg_info[0].content_url.indexOf("tempkey"));
|
|
3822
|
+
}
|
|
3823
|
+
const lastMsgId = filteredList.length > 0 ? filteredList[filteredList.length - 1].msgid : void 0;
|
|
3824
|
+
articleCell = filteredList.map((item)=>({
|
|
3825
|
+
title: item.appmsg_info[0].title,
|
|
3826
|
+
imageUrl: item.appmsg_info[0].cover,
|
|
3827
|
+
createTime: item.appmsg_info[0].line_info.send_time,
|
|
3828
|
+
redirectUrl: item.appmsg_info[0].content_url,
|
|
3829
|
+
readNum: item.appmsg_info[0].read_num,
|
|
3830
|
+
likeNum: item.appmsg_info[0].old_like_num,
|
|
3831
|
+
shareNum: item.appmsg_info[0].share_num,
|
|
3832
|
+
recommendNum: item.appmsg_info[0].like_num,
|
|
3833
|
+
...showOriginalData ? {
|
|
3834
|
+
originalData: item
|
|
3835
|
+
} : {}
|
|
3836
|
+
}));
|
|
3837
|
+
return (0, share_namespaceObject.success)({
|
|
3838
|
+
articleCell,
|
|
3839
|
+
pagination: {
|
|
3840
|
+
nextPage,
|
|
3841
|
+
pageNum,
|
|
3842
|
+
pageSize,
|
|
3843
|
+
lastPage: begin + 1,
|
|
3844
|
+
cursor: lastMsgId
|
|
3845
|
+
}
|
|
3846
|
+
}, "微信文章文章获取成功");
|
|
3847
|
+
}
|
|
3848
|
+
articleCell = articlesInfo.publish_list.map((item)=>({
|
|
3849
|
+
title: item.publish_info.appmsg_info[0].title,
|
|
3850
|
+
imageUrl: item.publish_info.appmsg_info[0].cover,
|
|
3851
|
+
createTime: item.publish_info.appmsg_info[0].line_info.send_time,
|
|
3852
|
+
redirectUrl: item.publish_info.appmsg_info[0].content_url,
|
|
3853
|
+
readNum: item.publish_info.appmsg_info[0].read_num,
|
|
3854
|
+
likeNum: item.publish_info.appmsg_info[0].old_like_num,
|
|
3855
|
+
shareNum: item.publish_info.appmsg_info[0].share_num,
|
|
3856
|
+
recommendNum: item.publish_info.appmsg_info[0].like_num,
|
|
3857
|
+
...showOriginalData ? {
|
|
3858
|
+
originalData: item
|
|
3859
|
+
} : {}
|
|
3860
|
+
}));
|
|
3861
|
+
return (0, share_namespaceObject.success)({
|
|
3862
|
+
articleCell
|
|
3863
|
+
}, "微信文章文章获取成功");
|
|
3864
|
+
} catch (error) {
|
|
3865
|
+
return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "微信文章数据获取失败");
|
|
3866
|
+
}
|
|
3867
|
+
}
|
|
3868
|
+
async function handleBaijiahaoData(params) {
|
|
3869
|
+
try {
|
|
3870
|
+
const { cookies, token, pageNum = 1, pageSize = 10, showOriginalData = false, onlySuccess = false } = params;
|
|
3871
|
+
if (!token) return {
|
|
3872
|
+
code: 200,
|
|
3873
|
+
message: "缺少token",
|
|
3874
|
+
data: null
|
|
3875
|
+
};
|
|
3876
|
+
const http = new Http({
|
|
3877
|
+
headers: {
|
|
3878
|
+
cookie: cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3879
|
+
token: token
|
|
3880
|
+
}
|
|
3881
|
+
});
|
|
3882
|
+
async function fetchArticles(pageNum, pageSize, onlySuccess = false) {
|
|
3883
|
+
return await http.api({
|
|
3884
|
+
method: "get",
|
|
3885
|
+
url: "https://baijiahao.baidu.com/pcui/article/lists",
|
|
3886
|
+
params: {
|
|
3887
|
+
currentPage: pageNum,
|
|
3888
|
+
pageSize: pageSize,
|
|
3889
|
+
search: "",
|
|
3890
|
+
type: "",
|
|
3891
|
+
collection: onlySuccess ? "publish" : "",
|
|
3892
|
+
clearBeforeFetch: false,
|
|
3893
|
+
dynamic: 1
|
|
3894
|
+
}
|
|
3895
|
+
});
|
|
3896
|
+
}
|
|
3897
|
+
const articleInfo = await fetchArticles(pageNum, pageSize, onlySuccess);
|
|
3898
|
+
let filtered = articleInfo.data.list.filter((item)=>"draft" !== item.status);
|
|
3899
|
+
const totalPage = articleInfo.data.page?.totalPage || 1;
|
|
3900
|
+
let currentPage = pageNum + 1;
|
|
3901
|
+
const usedPages = new Set();
|
|
3902
|
+
while(filtered.length < pageSize && currentPage <= totalPage){
|
|
3903
|
+
if (usedPages.has(currentPage)) {
|
|
3904
|
+
currentPage++;
|
|
3905
|
+
continue;
|
|
3906
|
+
}
|
|
3907
|
+
const res = await fetchArticles(currentPage, pageSize, onlySuccess);
|
|
3908
|
+
usedPages.add(currentPage);
|
|
3909
|
+
const validItems = res.data.list.filter((item)=>"draft" !== item.status);
|
|
3910
|
+
filtered.push(...validItems);
|
|
3911
|
+
currentPage++;
|
|
3912
|
+
}
|
|
3913
|
+
const final = filtered.slice(0, pageSize);
|
|
3914
|
+
const articleCell = final.map((item)=>({
|
|
3915
|
+
title: item.title,
|
|
3916
|
+
imageUrl: JSON.parse(item.cover_images)[0].src,
|
|
3917
|
+
createTime: Math.floor(new Date(item.publish_at.replace(/-/g, "/")).getTime() / 1000),
|
|
3918
|
+
redirectUrl: item.url,
|
|
3919
|
+
recommendNum: item.rec_amount | item.forward_num,
|
|
3920
|
+
collectNum: item.collection_amount,
|
|
3921
|
+
readNum: item.read_amount | item.read_num,
|
|
3922
|
+
likeNum: item.like_amount | item.praise_num,
|
|
3923
|
+
commentNum: item.comment_amount | item.comment_num,
|
|
3924
|
+
shareNum: item.share_amount,
|
|
3925
|
+
...showOriginalData ? {
|
|
3926
|
+
originalData: item
|
|
3927
|
+
} : {}
|
|
3928
|
+
}));
|
|
3929
|
+
return (0, share_namespaceObject.success)({
|
|
3930
|
+
articleCell,
|
|
3931
|
+
...onlySuccess ? {
|
|
3932
|
+
pagination: {
|
|
3933
|
+
total: articleInfo.data.page?.totalCount,
|
|
3934
|
+
pageNum,
|
|
3935
|
+
pageSize
|
|
3936
|
+
}
|
|
3937
|
+
} : null
|
|
3938
|
+
}, "百家号文章数据获取成功");
|
|
3939
|
+
} catch (error) {
|
|
3940
|
+
return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "百家号文章数据获取失败");
|
|
3941
|
+
}
|
|
3942
|
+
}
|
|
3943
|
+
async function handleXiaohongshuData(params) {
|
|
3944
|
+
try {
|
|
3945
|
+
const { cookies, pageNum = 1, pageSize = 10, showOriginalData = false, onlySuccess = false } = params;
|
|
3946
|
+
const xsEncrypt = new XsEncrypt();
|
|
3947
|
+
const a1Cookie = cookies.find((it)=>"a1" === it.name)?.value;
|
|
3948
|
+
if (!a1Cookie) return {
|
|
3949
|
+
code: 200,
|
|
3950
|
+
message: "账号数据异常",
|
|
3951
|
+
data: null
|
|
3952
|
+
};
|
|
3953
|
+
if (onlySuccess && 10 != pageSize) return {
|
|
3954
|
+
code: 200,
|
|
3955
|
+
message: "小红书pageSize不可修改",
|
|
3956
|
+
data: null
|
|
3957
|
+
};
|
|
3958
|
+
const http = new Http({
|
|
3959
|
+
headers: {
|
|
3960
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3961
|
+
referer: "https://creator.xiaohongshu.com",
|
|
3962
|
+
origin: "https://creator.xiaohongshu.com"
|
|
3963
|
+
}
|
|
3964
|
+
});
|
|
3965
|
+
async function fetchArticles(pageNum, a1Cookie, onlySuccess = false) {
|
|
3966
|
+
const xt = Date.now().toString();
|
|
3967
|
+
const serveUrl = `/web_api/sns/v5/creator/note/user/posted?tab=${onlySuccess ? 1 : 0}&page=${pageNum - 1}`;
|
|
3968
|
+
const xs = await xsEncrypt.encryptXs(serveUrl, a1Cookie, xt);
|
|
3969
|
+
return await http.api({
|
|
3970
|
+
method: "get",
|
|
3971
|
+
baseURL: "https://edith.xiaohongshu.com",
|
|
3972
|
+
url: serveUrl,
|
|
3973
|
+
headers: {
|
|
3974
|
+
"x-s": xs,
|
|
3975
|
+
"x-t": xt
|
|
3976
|
+
}
|
|
3977
|
+
});
|
|
3978
|
+
}
|
|
3979
|
+
const articleInfo = await fetchArticles(pageNum, a1Cookie, onlySuccess);
|
|
3980
|
+
let hasNextpage = -1 != articleInfo.data.page;
|
|
3981
|
+
let filtered = articleInfo.data.notes;
|
|
3982
|
+
let currentPage = pageNum + 1;
|
|
3983
|
+
const usedPages = new Set();
|
|
3984
|
+
while(filtered.length < pageSize && hasNextpage){
|
|
3985
|
+
if (usedPages.has(currentPage)) {
|
|
3986
|
+
currentPage++;
|
|
3987
|
+
continue;
|
|
3988
|
+
}
|
|
3989
|
+
const res = await fetchArticles(currentPage, a1Cookie, onlySuccess);
|
|
3990
|
+
usedPages.add(currentPage);
|
|
3991
|
+
const validItems = res.data.notes;
|
|
3992
|
+
filtered.push(...validItems);
|
|
3993
|
+
currentPage++;
|
|
3994
|
+
hasNextpage = -1 != res.data.page;
|
|
3995
|
+
}
|
|
3996
|
+
const final = filtered.slice(0, pageSize);
|
|
3997
|
+
const articleCell = final.map((item)=>({
|
|
3998
|
+
title: item.display_title,
|
|
3999
|
+
imageUrl: item.images_list[0].url,
|
|
4000
|
+
createTime: Math.floor(new Date(item.time.replace(/-/g, "/")).getTime() / 1000),
|
|
4001
|
+
redirectUrl: `https://www.xiaohongshu.com/explore/${item.id}?xsec_token=${item.xsec_token}&xsec_source=pc_creatormng`,
|
|
4002
|
+
readNum: item.view_count,
|
|
4003
|
+
likeNum: item.likes,
|
|
4004
|
+
commentNum: item.comments_count,
|
|
4005
|
+
collectNum: item.collected_count,
|
|
4006
|
+
shareNum: item.shared_count,
|
|
4007
|
+
...showOriginalData ? {
|
|
4008
|
+
originalData: item
|
|
4009
|
+
} : {}
|
|
4010
|
+
}));
|
|
4011
|
+
return (0, share_namespaceObject.success)({
|
|
4012
|
+
articleCell,
|
|
4013
|
+
...onlySuccess ? {
|
|
4014
|
+
pagination: {
|
|
4015
|
+
nextPage: hasNextpage,
|
|
4016
|
+
pageNum,
|
|
4017
|
+
pageSize
|
|
4018
|
+
}
|
|
4019
|
+
} : null
|
|
4020
|
+
}, "小红书文章数据获取成功");
|
|
4021
|
+
} catch (error) {
|
|
4022
|
+
return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "小红书文章数据获取失败");
|
|
4023
|
+
}
|
|
4024
|
+
}
|
|
4025
|
+
const FetchArticles = async (_task, params)=>{
|
|
4026
|
+
const { platform } = params;
|
|
4027
|
+
switch(platform){
|
|
4028
|
+
case "toutiao":
|
|
4029
|
+
return handleToutiaoData(params);
|
|
4030
|
+
case "weixin":
|
|
4031
|
+
return handleWeixinData(params);
|
|
4032
|
+
case "baijiahao":
|
|
4033
|
+
return handleBaijiahaoData(params);
|
|
4034
|
+
case "xiaohongshu":
|
|
4035
|
+
return handleXiaohongshuData(params);
|
|
4036
|
+
default:
|
|
4037
|
+
return (0, share_namespaceObject.success)(null, "暂不支持该平台");
|
|
4038
|
+
}
|
|
4039
|
+
};
|
|
4040
|
+
const getWeixinConfig = async (_task, params)=>{
|
|
4041
|
+
const http = new Http({
|
|
4042
|
+
headers: {
|
|
4043
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";")
|
|
4044
|
+
}
|
|
4045
|
+
});
|
|
4046
|
+
const fingerprint = "4695500bc93ab4ce8fb2692da6564e04";
|
|
4047
|
+
const res = await http.api({
|
|
4048
|
+
method: "get",
|
|
4049
|
+
url: "https://mp.weixin.qq.com/cgi-bin/masssendpage",
|
|
4050
|
+
params: {
|
|
4051
|
+
f: 'json',
|
|
4052
|
+
token: params.token,
|
|
4053
|
+
lang: 'zh_CN',
|
|
4054
|
+
ajax: 1,
|
|
4055
|
+
fingerprint: fingerprint,
|
|
4056
|
+
random: Math.random().toString()
|
|
4057
|
+
}
|
|
4058
|
+
});
|
|
4059
|
+
const filtered = {
|
|
4060
|
+
publishQuota: 0 === res.base_resp.ret ? res.quota_detail_list.filter((item)=>"kQuotaTypeMassSendNormal" === item.quota_type).map((item)=>item.quota_item_list) : []
|
|
4061
|
+
};
|
|
4062
|
+
return (0, share_namespaceObject.success)(filtered, 0 === res.base_resp.ret ? "微信配置信息获取成功!" : "微信配置信息获取失败!");
|
|
4063
|
+
};
|
|
2617
4064
|
const weitoutiaoPublish_mock_mockAction = async (task, params)=>{
|
|
2618
4065
|
const tmpCachePath = task.getTmpPath();
|
|
2619
4066
|
const http = new Http({
|
|
@@ -2771,6 +4218,7 @@ var __webpack_exports__ = {};
|
|
|
2771
4218
|
64703: "摘要超出120字长度限制,请修改摘要后重试。",
|
|
2772
4219
|
"-4": "不支持发布审核中或转码中的视频",
|
|
2773
4220
|
"-2": "不支持发布审核中或转码中的视频",
|
|
4221
|
+
"-1": "系统错误,请注意备份内容后重试",
|
|
2774
4222
|
770001: "不支持发布审核中或转码中的视频",
|
|
2775
4223
|
200074: "系统繁忙,请稍后重试!",
|
|
2776
4224
|
64702: "标题超出64字长度限制,请修改标题后重试。"
|
|
@@ -2853,7 +4301,9 @@ var __webpack_exports__ = {};
|
|
|
2853
4301
|
const uploadImages = async (images)=>{
|
|
2854
4302
|
const cloudImages = [];
|
|
2855
4303
|
const localImages = await Promise.all(images.map((url)=>{
|
|
2856
|
-
|
|
4304
|
+
let fileName = (0, share_namespaceObject.getFilenameFromUrl)(url);
|
|
4305
|
+
let ext = external_node_path_default().extname(fileName);
|
|
4306
|
+
fileName = ext ? fileName : `${fileName}.png`;
|
|
2857
4307
|
return (0, share_namespaceObject.downloadImage)(url, external_node_path_default().join(tmpCachePath, fileName));
|
|
2858
4308
|
}));
|
|
2859
4309
|
for(let index = 0; index < images.length; index++){
|
|
@@ -3154,6 +4604,7 @@ var __webpack_exports__ = {};
|
|
|
3154
4604
|
masssend_check: 1,
|
|
3155
4605
|
is_masssend: 1
|
|
3156
4606
|
};
|
|
4607
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
3157
4608
|
const { appMsgId } = await http.api({
|
|
3158
4609
|
method: "post",
|
|
3159
4610
|
url: "https://mp.weixin.qq.com/cgi-bin/operate_appmsg",
|
|
@@ -3626,7 +5077,9 @@ var __webpack_exports__ = {};
|
|
|
3626
5077
|
await titleInstance.fill(params.settingInfo.wxAbstract);
|
|
3627
5078
|
}
|
|
3628
5079
|
if (params.settingInfo.wxCover) {
|
|
3629
|
-
|
|
5080
|
+
let fileName = (0, share_namespaceObject.getFilenameFromUrl)(params.settingInfo.wxCover);
|
|
5081
|
+
let ext = external_node_path_default().extname(fileName);
|
|
5082
|
+
fileName = ext ? fileName : `${fileName}.png`;
|
|
3630
5083
|
const cover = await (0, share_namespaceObject.downloadImage)(params.settingInfo.wxCover, external_node_path_default().join(tmpCachePath, fileName));
|
|
3631
5084
|
await page.locator("#article_setting_area #js_cover_area .select-cover__btn").hover();
|
|
3632
5085
|
await page.locator("#article_setting_area #js_cover_area .pop-opr__group-select-cover .pop-opr__list .pop-opr__item").filter({
|
|
@@ -3810,6 +5263,7 @@ var __webpack_exports__ = {};
|
|
|
3810
5263
|
await poperInstance.locator('.frm_radio_item label[for="not_recomment_0"]').click();
|
|
3811
5264
|
}
|
|
3812
5265
|
await page.waitForTimeout(1000);
|
|
5266
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
3813
5267
|
const articleId = await new Promise(async (resolve)=>{
|
|
3814
5268
|
const handleResponse = async (response)=>{
|
|
3815
5269
|
const url = response.url();
|
|
@@ -4135,6 +5589,7 @@ var __webpack_exports__ = {};
|
|
|
4135
5589
|
if ("mockApi" === params.actionType) return weixinmpPublish_mock_mockAction(task, params);
|
|
4136
5590
|
return executeAction(weixinmpPublish_mock_mockAction, weixinmpPublish_rpa_rpaAction)(task, params);
|
|
4137
5591
|
};
|
|
5592
|
+
const GenXSCommon = __webpack_require__("./src/utils/XhsXsCommonEnc.js");
|
|
4138
5593
|
const xiaohongshuPublish_mock_errnoMap = {
|
|
4139
5594
|
915: "所属C端账号手机号被修改,请重新登录",
|
|
4140
5595
|
914: "所属C端账号密码被修改,请重新登录",
|
|
@@ -4340,6 +5795,7 @@ var __webpack_exports__ = {};
|
|
|
4340
5795
|
};
|
|
4341
5796
|
}
|
|
4342
5797
|
}
|
|
5798
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
4343
5799
|
const business_binds = {
|
|
4344
5800
|
version: 1,
|
|
4345
5801
|
bizType: "",
|
|
@@ -4359,18 +5815,21 @@ var __webpack_exports__ = {};
|
|
|
4359
5815
|
const publishDataStr = mock_xsEncrypt.dumps(publishData);
|
|
4360
5816
|
const publishXt = Date.now().toString();
|
|
4361
5817
|
const publishXs = await mock_xsEncrypt.encryptXs(`/web_api/sns/v2/note${publishDataStr}`, a1Cookie, publishXt);
|
|
5818
|
+
const xscommon = GenXSCommon(a1Cookie, publishXt, publishXs);
|
|
4362
5819
|
const publishResult = await http.api({
|
|
4363
5820
|
method: "post",
|
|
4364
5821
|
url: "https://edith.xiaohongshu.com/web_api/sns/v2/note",
|
|
4365
5822
|
data: publishData,
|
|
4366
5823
|
headers: {
|
|
4367
5824
|
"x-s": publishXs,
|
|
4368
|
-
"x-t": publishXt
|
|
5825
|
+
"x-t": publishXt,
|
|
5826
|
+
"x-s-common": xscommon
|
|
4369
5827
|
},
|
|
4370
5828
|
defaultErrorMsg: "文章发布异常,请稍后重试。"
|
|
4371
5829
|
});
|
|
4372
5830
|
return (0, share_namespaceObject.success)(publishResult.data?.id);
|
|
4373
5831
|
};
|
|
5832
|
+
const rpa_GenXSCommon = __webpack_require__("./src/utils/XhsXsCommonEnc.js");
|
|
4374
5833
|
const rpa_xsEncrypt = new XsEncrypt();
|
|
4375
5834
|
const xiaohongshuPublish_rpa_rpaAction = async (task, params)=>{
|
|
4376
5835
|
const commonCookies = {
|
|
@@ -4423,9 +5882,11 @@ var __webpack_exports__ = {};
|
|
|
4423
5882
|
const publishDataStr = rpa_xsEncrypt.dumps(publishData);
|
|
4424
5883
|
return rpa_xsEncrypt.encryptXs(interceptUrls[5] + publishDataStr, a1Cookie, xt);
|
|
4425
5884
|
})() : rpa_xsEncrypt.encryptXs(fetchCoverUrl, a1Cookie, xt));
|
|
5885
|
+
const xscommon = rpa_GenXSCommon(a1Cookie, xt, xs);
|
|
4426
5886
|
const newHeaders = {
|
|
4427
5887
|
...request.headers(),
|
|
4428
|
-
'x-s': xs
|
|
5888
|
+
'x-s': xs,
|
|
5889
|
+
'x-s-common': xscommon
|
|
4429
5890
|
};
|
|
4430
5891
|
await route.continue({
|
|
4431
5892
|
headers: newHeaders
|
|
@@ -4562,6 +6023,7 @@ var __webpack_exports__ = {};
|
|
|
4562
6023
|
hasText: "仅自己可见"
|
|
4563
6024
|
}).click();
|
|
4564
6025
|
}
|
|
6026
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
4565
6027
|
const releaseTimeInstance = page.locator("label").filter({
|
|
4566
6028
|
hasText: params.isImmediatelyPublish ? "立即发布" : "定时发布"
|
|
4567
6029
|
});
|
|
@@ -4587,21 +6049,31 @@ var __webpack_exports__ = {};
|
|
|
4587
6049
|
return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
|
|
4588
6050
|
};
|
|
4589
6051
|
var package_namespaceObject = {
|
|
4590
|
-
i8: "1.2.
|
|
6052
|
+
i8: "1.2.17"
|
|
4591
6053
|
};
|
|
6054
|
+
const BetaFlag = "HuiwenCanary";
|
|
4592
6055
|
class Action {
|
|
4593
6056
|
constructor(task){
|
|
4594
6057
|
this.task = task;
|
|
4595
6058
|
}
|
|
4596
6059
|
async bindTask(func, params) {
|
|
4597
6060
|
let responseData;
|
|
6061
|
+
this.task._timerRecord = {
|
|
6062
|
+
ActionStart: Date.now()
|
|
6063
|
+
};
|
|
6064
|
+
this.task.isBeta = this.task.isFeatOn(BetaFlag);
|
|
4598
6065
|
if (this.task.setArticleId) this.task.setArticleId(params.articleId ?? "");
|
|
4599
|
-
if (
|
|
6066
|
+
if (this.task.setSaveType) this.task.setSaveType(params.saveType ?? "");
|
|
6067
|
+
if (void 0 !== this.task.isBeta) this.task.setBetaType(this.task.isBeta);
|
|
6068
|
+
if ("object" == typeof params) params.cookies = params?.cookies ?? [];
|
|
4600
6069
|
try {
|
|
4601
6070
|
responseData = await func(this.task, params);
|
|
4602
6071
|
} catch (error) {
|
|
4603
6072
|
responseData = Http.handleApiError(error);
|
|
6073
|
+
} finally{
|
|
6074
|
+
this.task._timerRecord['ActionEnd'] = Date.now();
|
|
4604
6075
|
}
|
|
6076
|
+
if (this.task.setTimeConsuming) this.task.setTimeConsuming(this.task._timerRecord);
|
|
4605
6077
|
if (200 === responseData.code) this.task.logger.info(`${func.name} action params error`, responseData);
|
|
4606
6078
|
else if (0 !== responseData.code) {
|
|
4607
6079
|
this.task.logger.error(responseData.message || `${func.name} 执行失败`, stringifyError(responseData.data), responseData.extra);
|
|
@@ -4609,6 +6081,24 @@ var __webpack_exports__ = {};
|
|
|
4609
6081
|
} else this.task.logger.info(`${func.name} action success`);
|
|
4610
6082
|
return responseData;
|
|
4611
6083
|
}
|
|
6084
|
+
FetchArticles(params) {
|
|
6085
|
+
return this.bindTask(FetchArticles, params);
|
|
6086
|
+
}
|
|
6087
|
+
SearchAccountInfo(params) {
|
|
6088
|
+
return this.bindTask(SearchAccountInfo, params);
|
|
6089
|
+
}
|
|
6090
|
+
TTSessionCheck(params) {
|
|
6091
|
+
return this.bindTask(TTSessionCheck, params);
|
|
6092
|
+
}
|
|
6093
|
+
WxSessionCheck(params) {
|
|
6094
|
+
return this.bindTask(WxSessionCheck, params);
|
|
6095
|
+
}
|
|
6096
|
+
XhsSessionCheck(params) {
|
|
6097
|
+
return this.bindTask(XhsSessionCheck, params);
|
|
6098
|
+
}
|
|
6099
|
+
BjhSessionCheck(params) {
|
|
6100
|
+
return this.bindTask(BjhSessionCheck, params);
|
|
6101
|
+
}
|
|
4612
6102
|
searchToutiaoTopicList(params) {
|
|
4613
6103
|
return this.bindTask(searchToutiaoTopicList, params);
|
|
4614
6104
|
}
|
|
@@ -4633,6 +6123,9 @@ var __webpack_exports__ = {};
|
|
|
4633
6123
|
getToutiaoConfig(params) {
|
|
4634
6124
|
return this.bindTask(getToutiaoConfig, params);
|
|
4635
6125
|
}
|
|
6126
|
+
getWeixinConfig(params) {
|
|
6127
|
+
return this.bindTask(getWeixinConfig, params);
|
|
6128
|
+
}
|
|
4636
6129
|
getBaijiahaoConfig(params) {
|
|
4637
6130
|
return this.bindTask(getBaijiahaoConfig, params);
|
|
4638
6131
|
}
|