@iflyrpa/actions 4.0.2-beta.0 → 4.0.4-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/searchPublishInfo/handleDouyinData.d.ts +17 -0
- package/dist/actions/searchPublishInfo/handleShipinhaoData.d.ts +17 -0
- package/dist/actions/searchPublishInfo/index.d.ts +7 -0
- package/dist/actions/searchPublishInfo/types.d.ts +94 -0
- package/dist/actions/weixinPublish/index.d.ts +2 -2
- package/dist/actions/xiaohongshuPublish/index.d.ts +1 -1
- package/dist/bundle.js +4379 -239
- package/dist/bundle.js.map +1 -1
- package/dist/index.d.ts +60 -0
- package/dist/index.js +451 -1154
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +451 -1148
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +2 -1
- package/dist/utils/http.d.ts +2 -1
- package/dist/utils/proxy.d.ts +2 -2
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import * as __WEBPACK_EXTERNAL_MODULE_assert__ from "assert";
|
|
2
1
|
import * as __WEBPACK_EXTERNAL_MODULE_crypto__ from "crypto";
|
|
3
2
|
import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
|
|
4
|
-
import * as __WEBPACK_EXTERNAL_MODULE_http__ from "http";
|
|
5
|
-
import * as __WEBPACK_EXTERNAL_MODULE_https__ from "https";
|
|
6
|
-
import * as __WEBPACK_EXTERNAL_MODULE_net__ from "net";
|
|
7
|
-
import * as __WEBPACK_EXTERNAL_MODULE_os__ from "os";
|
|
8
|
-
import * as __WEBPACK_EXTERNAL_MODULE_tls__ from "tls";
|
|
9
|
-
import * as __WEBPACK_EXTERNAL_MODULE_tty__ from "tty";
|
|
10
|
-
import * as __WEBPACK_EXTERNAL_MODULE_url__ from "url";
|
|
11
|
-
import * as __WEBPACK_EXTERNAL_MODULE_util__ from "util";
|
|
12
3
|
import * as __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_package_json_58ae5f06__ from "@iflyrpa/share/package.json";
|
|
13
4
|
import * as __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__ from "@iflyrpa/share";
|
|
14
5
|
import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
|
|
@@ -19,6 +10,7 @@ import * as __WEBPACK_EXTERNAL_MODULE_htmlparser2__ from "htmlparser2";
|
|
|
19
10
|
import * as __WEBPACK_EXTERNAL_MODULE_mime_types_eebf54a5__ from "mime-types";
|
|
20
11
|
import * as __WEBPACK_EXTERNAL_MODULE_node_crypto_9ba42079__ from "node:crypto";
|
|
21
12
|
import * as __WEBPACK_EXTERNAL_MODULE_axios__ from "axios";
|
|
13
|
+
import * as __WEBPACK_EXTERNAL_MODULE_socks_proxy_agent_cb52aaad__ from "socks-proxy-agent";
|
|
22
14
|
import * as __WEBPACK_EXTERNAL_MODULE_node_fetch_7c57b483__ from "node-fetch";
|
|
23
15
|
import * as __WEBPACK_EXTERNAL_MODULE_form_data_cf000082__ from "form-data";
|
|
24
16
|
import * as __WEBPACK_EXTERNAL_MODULE_node_https_626f33a7__ from "node:https";
|
|
@@ -28,1055 +20,6 @@ import * as __WEBPACK_EXTERNAL_MODULE_image_size_bc738ffb__ from "image-size";
|
|
|
28
20
|
import * as __WEBPACK_EXTERNAL_MODULE_vm__ from "vm";
|
|
29
21
|
import * as __WEBPACK_EXTERNAL_MODULE_node_vm_bd3d9cea__ from "node:vm";
|
|
30
22
|
var __webpack_modules__ = {
|
|
31
|
-
"../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
32
|
-
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
33
|
-
if (void 0 === k2) k2 = k;
|
|
34
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
35
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
36
|
-
enumerable: true,
|
|
37
|
-
get: function() {
|
|
38
|
-
return m[k];
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
Object.defineProperty(o, k2, desc);
|
|
42
|
-
} : function(o, m, k, k2) {
|
|
43
|
-
if (void 0 === k2) k2 = k;
|
|
44
|
-
o[k2] = m[k];
|
|
45
|
-
});
|
|
46
|
-
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
|
|
47
|
-
Object.defineProperty(o, "default", {
|
|
48
|
-
enumerable: true,
|
|
49
|
-
value: v
|
|
50
|
-
});
|
|
51
|
-
} : function(o, v) {
|
|
52
|
-
o["default"] = v;
|
|
53
|
-
});
|
|
54
|
-
var __importStar = this && this.__importStar || function(mod) {
|
|
55
|
-
if (mod && mod.__esModule) return mod;
|
|
56
|
-
var result = {};
|
|
57
|
-
if (null != mod) {
|
|
58
|
-
for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
59
|
-
}
|
|
60
|
-
__setModuleDefault(result, mod);
|
|
61
|
-
return result;
|
|
62
|
-
};
|
|
63
|
-
Object.defineProperty(exports, "__esModule", {
|
|
64
|
-
value: true
|
|
65
|
-
});
|
|
66
|
-
exports.req = exports.json = exports.toBuffer = void 0;
|
|
67
|
-
const http = __importStar(__webpack_require__("http"));
|
|
68
|
-
const https = __importStar(__webpack_require__("https"));
|
|
69
|
-
async function toBuffer(stream) {
|
|
70
|
-
let length = 0;
|
|
71
|
-
const chunks = [];
|
|
72
|
-
for await (const chunk of stream){
|
|
73
|
-
length += chunk.length;
|
|
74
|
-
chunks.push(chunk);
|
|
75
|
-
}
|
|
76
|
-
return Buffer.concat(chunks, length);
|
|
77
|
-
}
|
|
78
|
-
exports.toBuffer = toBuffer;
|
|
79
|
-
async function json(stream) {
|
|
80
|
-
const buf = await toBuffer(stream);
|
|
81
|
-
const str = buf.toString('utf8');
|
|
82
|
-
try {
|
|
83
|
-
return JSON.parse(str);
|
|
84
|
-
} catch (_err) {
|
|
85
|
-
const err = _err;
|
|
86
|
-
err.message += ` (input: ${str})`;
|
|
87
|
-
throw err;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
exports.json = json;
|
|
91
|
-
function req(url, opts = {}) {
|
|
92
|
-
const href = 'string' == typeof url ? url : url.href;
|
|
93
|
-
const req1 = (href.startsWith('https:') ? https : http).request(url, opts);
|
|
94
|
-
const promise = new Promise((resolve, reject)=>{
|
|
95
|
-
req1.once('response', resolve).once('error', reject).end();
|
|
96
|
-
});
|
|
97
|
-
req1.then = promise.then.bind(promise);
|
|
98
|
-
return req1;
|
|
99
|
-
}
|
|
100
|
-
exports.req = req;
|
|
101
|
-
},
|
|
102
|
-
"../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
103
|
-
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
104
|
-
if (void 0 === k2) k2 = k;
|
|
105
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
106
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
107
|
-
enumerable: true,
|
|
108
|
-
get: function() {
|
|
109
|
-
return m[k];
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
Object.defineProperty(o, k2, desc);
|
|
113
|
-
} : function(o, m, k, k2) {
|
|
114
|
-
if (void 0 === k2) k2 = k;
|
|
115
|
-
o[k2] = m[k];
|
|
116
|
-
});
|
|
117
|
-
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
|
|
118
|
-
Object.defineProperty(o, "default", {
|
|
119
|
-
enumerable: true,
|
|
120
|
-
value: v
|
|
121
|
-
});
|
|
122
|
-
} : function(o, v) {
|
|
123
|
-
o["default"] = v;
|
|
124
|
-
});
|
|
125
|
-
var __importStar = this && this.__importStar || function(mod) {
|
|
126
|
-
if (mod && mod.__esModule) return mod;
|
|
127
|
-
var result = {};
|
|
128
|
-
if (null != mod) {
|
|
129
|
-
for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
130
|
-
}
|
|
131
|
-
__setModuleDefault(result, mod);
|
|
132
|
-
return result;
|
|
133
|
-
};
|
|
134
|
-
var __exportStar = this && this.__exportStar || function(m, exports) {
|
|
135
|
-
for(var p in m)if ("default" !== p && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
136
|
-
};
|
|
137
|
-
Object.defineProperty(exports, "__esModule", {
|
|
138
|
-
value: true
|
|
139
|
-
});
|
|
140
|
-
exports.Agent = void 0;
|
|
141
|
-
const net = __importStar(__webpack_require__("net"));
|
|
142
|
-
const http = __importStar(__webpack_require__("http"));
|
|
143
|
-
const https_1 = __webpack_require__("https");
|
|
144
|
-
__exportStar(__webpack_require__("../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js"), exports);
|
|
145
|
-
const INTERNAL = Symbol('AgentBaseInternalState');
|
|
146
|
-
class Agent extends http.Agent {
|
|
147
|
-
constructor(opts){
|
|
148
|
-
super(opts);
|
|
149
|
-
this[INTERNAL] = {};
|
|
150
|
-
}
|
|
151
|
-
isSecureEndpoint(options) {
|
|
152
|
-
if (options) {
|
|
153
|
-
if ('boolean' == typeof options.secureEndpoint) return options.secureEndpoint;
|
|
154
|
-
if ('string' == typeof options.protocol) return 'https:' === options.protocol;
|
|
155
|
-
}
|
|
156
|
-
const { stack } = new Error();
|
|
157
|
-
if ('string' != typeof stack) return false;
|
|
158
|
-
return stack.split('\n').some((l)=>-1 !== l.indexOf('(https.js:') || -1 !== l.indexOf('node:https:'));
|
|
159
|
-
}
|
|
160
|
-
incrementSockets(name) {
|
|
161
|
-
if (this.maxSockets === 1 / 0 && this.maxTotalSockets === 1 / 0) return null;
|
|
162
|
-
if (!this.sockets[name]) this.sockets[name] = [];
|
|
163
|
-
const fakeSocket = new net.Socket({
|
|
164
|
-
writable: false
|
|
165
|
-
});
|
|
166
|
-
this.sockets[name].push(fakeSocket);
|
|
167
|
-
this.totalSocketCount++;
|
|
168
|
-
return fakeSocket;
|
|
169
|
-
}
|
|
170
|
-
decrementSockets(name, socket) {
|
|
171
|
-
if (!this.sockets[name] || null === socket) return;
|
|
172
|
-
const sockets = this.sockets[name];
|
|
173
|
-
const index = sockets.indexOf(socket);
|
|
174
|
-
if (-1 !== index) {
|
|
175
|
-
sockets.splice(index, 1);
|
|
176
|
-
this.totalSocketCount--;
|
|
177
|
-
if (0 === sockets.length) delete this.sockets[name];
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
getName(options) {
|
|
181
|
-
const secureEndpoint = this.isSecureEndpoint(options);
|
|
182
|
-
if (secureEndpoint) return https_1.Agent.prototype.getName.call(this, options);
|
|
183
|
-
return super.getName(options);
|
|
184
|
-
}
|
|
185
|
-
createSocket(req, options, cb) {
|
|
186
|
-
const connectOpts = {
|
|
187
|
-
...options,
|
|
188
|
-
secureEndpoint: this.isSecureEndpoint(options)
|
|
189
|
-
};
|
|
190
|
-
const name = this.getName(connectOpts);
|
|
191
|
-
const fakeSocket = this.incrementSockets(name);
|
|
192
|
-
Promise.resolve().then(()=>this.connect(req, connectOpts)).then((socket)=>{
|
|
193
|
-
this.decrementSockets(name, fakeSocket);
|
|
194
|
-
if (socket instanceof http.Agent) try {
|
|
195
|
-
return socket.addRequest(req, connectOpts);
|
|
196
|
-
} catch (err) {
|
|
197
|
-
return cb(err);
|
|
198
|
-
}
|
|
199
|
-
this[INTERNAL].currentSocket = socket;
|
|
200
|
-
super.createSocket(req, options, cb);
|
|
201
|
-
}, (err)=>{
|
|
202
|
-
this.decrementSockets(name, fakeSocket);
|
|
203
|
-
cb(err);
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
createConnection() {
|
|
207
|
-
const socket = this[INTERNAL].currentSocket;
|
|
208
|
-
this[INTERNAL].currentSocket = void 0;
|
|
209
|
-
if (!socket) throw new Error('No socket was returned in the `connect()` function');
|
|
210
|
-
return socket;
|
|
211
|
-
}
|
|
212
|
-
get defaultPort() {
|
|
213
|
-
return this[INTERNAL].defaultPort ?? ('https:' === this.protocol ? 443 : 80);
|
|
214
|
-
}
|
|
215
|
-
set defaultPort(v) {
|
|
216
|
-
if (this[INTERNAL]) this[INTERNAL].defaultPort = v;
|
|
217
|
-
}
|
|
218
|
-
get protocol() {
|
|
219
|
-
return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? 'https:' : 'http:');
|
|
220
|
-
}
|
|
221
|
-
set protocol(v) {
|
|
222
|
-
if (this[INTERNAL]) this[INTERNAL].protocol = v;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
exports.Agent = Agent;
|
|
226
|
-
},
|
|
227
|
-
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js": function(module, exports, __webpack_require__) {
|
|
228
|
-
exports.formatArgs = formatArgs;
|
|
229
|
-
exports.save = save;
|
|
230
|
-
exports.load = load;
|
|
231
|
-
exports.useColors = useColors;
|
|
232
|
-
exports.storage = localstorage();
|
|
233
|
-
exports.destroy = (()=>{
|
|
234
|
-
let warned = false;
|
|
235
|
-
return ()=>{
|
|
236
|
-
if (!warned) {
|
|
237
|
-
warned = true;
|
|
238
|
-
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
239
|
-
}
|
|
240
|
-
};
|
|
241
|
-
})();
|
|
242
|
-
exports.colors = [
|
|
243
|
-
'#0000CC',
|
|
244
|
-
'#0000FF',
|
|
245
|
-
'#0033CC',
|
|
246
|
-
'#0033FF',
|
|
247
|
-
'#0066CC',
|
|
248
|
-
'#0066FF',
|
|
249
|
-
'#0099CC',
|
|
250
|
-
'#0099FF',
|
|
251
|
-
'#00CC00',
|
|
252
|
-
'#00CC33',
|
|
253
|
-
'#00CC66',
|
|
254
|
-
'#00CC99',
|
|
255
|
-
'#00CCCC',
|
|
256
|
-
'#00CCFF',
|
|
257
|
-
'#3300CC',
|
|
258
|
-
'#3300FF',
|
|
259
|
-
'#3333CC',
|
|
260
|
-
'#3333FF',
|
|
261
|
-
'#3366CC',
|
|
262
|
-
'#3366FF',
|
|
263
|
-
'#3399CC',
|
|
264
|
-
'#3399FF',
|
|
265
|
-
'#33CC00',
|
|
266
|
-
'#33CC33',
|
|
267
|
-
'#33CC66',
|
|
268
|
-
'#33CC99',
|
|
269
|
-
'#33CCCC',
|
|
270
|
-
'#33CCFF',
|
|
271
|
-
'#6600CC',
|
|
272
|
-
'#6600FF',
|
|
273
|
-
'#6633CC',
|
|
274
|
-
'#6633FF',
|
|
275
|
-
'#66CC00',
|
|
276
|
-
'#66CC33',
|
|
277
|
-
'#9900CC',
|
|
278
|
-
'#9900FF',
|
|
279
|
-
'#9933CC',
|
|
280
|
-
'#9933FF',
|
|
281
|
-
'#99CC00',
|
|
282
|
-
'#99CC33',
|
|
283
|
-
'#CC0000',
|
|
284
|
-
'#CC0033',
|
|
285
|
-
'#CC0066',
|
|
286
|
-
'#CC0099',
|
|
287
|
-
'#CC00CC',
|
|
288
|
-
'#CC00FF',
|
|
289
|
-
'#CC3300',
|
|
290
|
-
'#CC3333',
|
|
291
|
-
'#CC3366',
|
|
292
|
-
'#CC3399',
|
|
293
|
-
'#CC33CC',
|
|
294
|
-
'#CC33FF',
|
|
295
|
-
'#CC6600',
|
|
296
|
-
'#CC6633',
|
|
297
|
-
'#CC9900',
|
|
298
|
-
'#CC9933',
|
|
299
|
-
'#CCCC00',
|
|
300
|
-
'#CCCC33',
|
|
301
|
-
'#FF0000',
|
|
302
|
-
'#FF0033',
|
|
303
|
-
'#FF0066',
|
|
304
|
-
'#FF0099',
|
|
305
|
-
'#FF00CC',
|
|
306
|
-
'#FF00FF',
|
|
307
|
-
'#FF3300',
|
|
308
|
-
'#FF3333',
|
|
309
|
-
'#FF3366',
|
|
310
|
-
'#FF3399',
|
|
311
|
-
'#FF33CC',
|
|
312
|
-
'#FF33FF',
|
|
313
|
-
'#FF6600',
|
|
314
|
-
'#FF6633',
|
|
315
|
-
'#FF9900',
|
|
316
|
-
'#FF9933',
|
|
317
|
-
'#FFCC00',
|
|
318
|
-
'#FFCC33'
|
|
319
|
-
];
|
|
320
|
-
function useColors() {
|
|
321
|
-
if ('undefined' != typeof window && window.process && ('renderer' === window.process.type || window.process.__nwjs)) return true;
|
|
322
|
-
if ('undefined' != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) return false;
|
|
323
|
-
let m;
|
|
324
|
-
return 'undefined' != typeof document && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || 'undefined' != typeof window && window.console && (window.console.firebug || window.console.exception && window.console.table) || 'undefined' != typeof navigator && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || 'undefined' != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
325
|
-
}
|
|
326
|
-
function formatArgs(args) {
|
|
327
|
-
args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
|
|
328
|
-
if (!this.useColors) return;
|
|
329
|
-
const c = 'color: ' + this.color;
|
|
330
|
-
args.splice(1, 0, c, 'color: inherit');
|
|
331
|
-
let index = 0;
|
|
332
|
-
let lastC = 0;
|
|
333
|
-
args[0].replace(/%[a-zA-Z%]/g, (match)=>{
|
|
334
|
-
if ('%%' === match) return;
|
|
335
|
-
index++;
|
|
336
|
-
if ('%c' === match) lastC = index;
|
|
337
|
-
});
|
|
338
|
-
args.splice(lastC, 0, c);
|
|
339
|
-
}
|
|
340
|
-
exports.log = console.debug || console.log || (()=>{});
|
|
341
|
-
function save(namespaces) {
|
|
342
|
-
try {
|
|
343
|
-
if (namespaces) exports.storage.setItem('debug', namespaces);
|
|
344
|
-
else exports.storage.removeItem('debug');
|
|
345
|
-
} catch (error) {}
|
|
346
|
-
}
|
|
347
|
-
function load() {
|
|
348
|
-
let r;
|
|
349
|
-
try {
|
|
350
|
-
r = exports.storage.getItem('debug');
|
|
351
|
-
} catch (error) {}
|
|
352
|
-
if (!r && 'undefined' != typeof process && 'env' in process) r = process.env.DEBUG;
|
|
353
|
-
return r;
|
|
354
|
-
}
|
|
355
|
-
function localstorage() {
|
|
356
|
-
try {
|
|
357
|
-
return localStorage;
|
|
358
|
-
} catch (error) {}
|
|
359
|
-
}
|
|
360
|
-
module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js")(exports);
|
|
361
|
-
const { formatters } = module.exports;
|
|
362
|
-
formatters.j = function(v) {
|
|
363
|
-
try {
|
|
364
|
-
return JSON.stringify(v);
|
|
365
|
-
} catch (error) {
|
|
366
|
-
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
367
|
-
}
|
|
368
|
-
};
|
|
369
|
-
},
|
|
370
|
-
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
371
|
-
function setup(env) {
|
|
372
|
-
createDebug.debug = createDebug;
|
|
373
|
-
createDebug.default = createDebug;
|
|
374
|
-
createDebug.coerce = coerce;
|
|
375
|
-
createDebug.disable = disable;
|
|
376
|
-
createDebug.enable = enable;
|
|
377
|
-
createDebug.enabled = enabled;
|
|
378
|
-
createDebug.humanize = __webpack_require__("../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js");
|
|
379
|
-
createDebug.destroy = destroy;
|
|
380
|
-
Object.keys(env).forEach((key)=>{
|
|
381
|
-
createDebug[key] = env[key];
|
|
382
|
-
});
|
|
383
|
-
createDebug.names = [];
|
|
384
|
-
createDebug.skips = [];
|
|
385
|
-
createDebug.formatters = {};
|
|
386
|
-
function selectColor(namespace) {
|
|
387
|
-
let hash = 0;
|
|
388
|
-
for(let i = 0; i < namespace.length; i++){
|
|
389
|
-
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
390
|
-
hash |= 0;
|
|
391
|
-
}
|
|
392
|
-
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
393
|
-
}
|
|
394
|
-
createDebug.selectColor = selectColor;
|
|
395
|
-
function createDebug(namespace) {
|
|
396
|
-
let prevTime;
|
|
397
|
-
let enableOverride = null;
|
|
398
|
-
let namespacesCache;
|
|
399
|
-
let enabledCache;
|
|
400
|
-
function debug(...args) {
|
|
401
|
-
if (!debug.enabled) return;
|
|
402
|
-
const self = debug;
|
|
403
|
-
const curr = Number(new Date());
|
|
404
|
-
const ms = curr - (prevTime || curr);
|
|
405
|
-
self.diff = ms;
|
|
406
|
-
self.prev = prevTime;
|
|
407
|
-
self.curr = curr;
|
|
408
|
-
prevTime = curr;
|
|
409
|
-
args[0] = createDebug.coerce(args[0]);
|
|
410
|
-
if ('string' != typeof args[0]) args.unshift('%O');
|
|
411
|
-
let index = 0;
|
|
412
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format)=>{
|
|
413
|
-
if ('%%' === match) return '%';
|
|
414
|
-
index++;
|
|
415
|
-
const formatter = createDebug.formatters[format];
|
|
416
|
-
if ('function' == typeof formatter) {
|
|
417
|
-
const val = args[index];
|
|
418
|
-
match = formatter.call(self, val);
|
|
419
|
-
args.splice(index, 1);
|
|
420
|
-
index--;
|
|
421
|
-
}
|
|
422
|
-
return match;
|
|
423
|
-
});
|
|
424
|
-
createDebug.formatArgs.call(self, args);
|
|
425
|
-
const logFn = self.log || createDebug.log;
|
|
426
|
-
logFn.apply(self, args);
|
|
427
|
-
}
|
|
428
|
-
debug.namespace = namespace;
|
|
429
|
-
debug.useColors = createDebug.useColors();
|
|
430
|
-
debug.color = createDebug.selectColor(namespace);
|
|
431
|
-
debug.extend = extend;
|
|
432
|
-
debug.destroy = createDebug.destroy;
|
|
433
|
-
Object.defineProperty(debug, 'enabled', {
|
|
434
|
-
enumerable: true,
|
|
435
|
-
configurable: false,
|
|
436
|
-
get: ()=>{
|
|
437
|
-
if (null !== enableOverride) return enableOverride;
|
|
438
|
-
if (namespacesCache !== createDebug.namespaces) {
|
|
439
|
-
namespacesCache = createDebug.namespaces;
|
|
440
|
-
enabledCache = createDebug.enabled(namespace);
|
|
441
|
-
}
|
|
442
|
-
return enabledCache;
|
|
443
|
-
},
|
|
444
|
-
set: (v)=>{
|
|
445
|
-
enableOverride = v;
|
|
446
|
-
}
|
|
447
|
-
});
|
|
448
|
-
if ('function' == typeof createDebug.init) createDebug.init(debug);
|
|
449
|
-
return debug;
|
|
450
|
-
}
|
|
451
|
-
function extend(namespace, delimiter) {
|
|
452
|
-
const newDebug = createDebug(this.namespace + (void 0 === delimiter ? ':' : delimiter) + namespace);
|
|
453
|
-
newDebug.log = this.log;
|
|
454
|
-
return newDebug;
|
|
455
|
-
}
|
|
456
|
-
function enable(namespaces) {
|
|
457
|
-
createDebug.save(namespaces);
|
|
458
|
-
createDebug.namespaces = namespaces;
|
|
459
|
-
createDebug.names = [];
|
|
460
|
-
createDebug.skips = [];
|
|
461
|
-
const split = ('string' == typeof namespaces ? namespaces : '').trim().replace(' ', ',').split(',').filter(Boolean);
|
|
462
|
-
for (const ns of split)if ('-' === ns[0]) createDebug.skips.push(ns.slice(1));
|
|
463
|
-
else createDebug.names.push(ns);
|
|
464
|
-
}
|
|
465
|
-
function matchesTemplate(search, template) {
|
|
466
|
-
let searchIndex = 0;
|
|
467
|
-
let templateIndex = 0;
|
|
468
|
-
let starIndex = -1;
|
|
469
|
-
let matchIndex = 0;
|
|
470
|
-
while(searchIndex < search.length)if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || '*' === template[templateIndex])) {
|
|
471
|
-
if ('*' === template[templateIndex]) {
|
|
472
|
-
starIndex = templateIndex;
|
|
473
|
-
matchIndex = searchIndex;
|
|
474
|
-
templateIndex++;
|
|
475
|
-
} else {
|
|
476
|
-
searchIndex++;
|
|
477
|
-
templateIndex++;
|
|
478
|
-
}
|
|
479
|
-
} else {
|
|
480
|
-
if (-1 === starIndex) return false;
|
|
481
|
-
templateIndex = starIndex + 1;
|
|
482
|
-
matchIndex++;
|
|
483
|
-
searchIndex = matchIndex;
|
|
484
|
-
}
|
|
485
|
-
while(templateIndex < template.length && '*' === template[templateIndex])templateIndex++;
|
|
486
|
-
return templateIndex === template.length;
|
|
487
|
-
}
|
|
488
|
-
function disable() {
|
|
489
|
-
const namespaces = [
|
|
490
|
-
...createDebug.names,
|
|
491
|
-
...createDebug.skips.map((namespace)=>'-' + namespace)
|
|
492
|
-
].join(',');
|
|
493
|
-
createDebug.enable('');
|
|
494
|
-
return namespaces;
|
|
495
|
-
}
|
|
496
|
-
function enabled(name) {
|
|
497
|
-
for (const skip of createDebug.skips)if (matchesTemplate(name, skip)) return false;
|
|
498
|
-
for (const ns of createDebug.names)if (matchesTemplate(name, ns)) return true;
|
|
499
|
-
return false;
|
|
500
|
-
}
|
|
501
|
-
function coerce(val) {
|
|
502
|
-
if (val instanceof Error) return val.stack || val.message;
|
|
503
|
-
return val;
|
|
504
|
-
}
|
|
505
|
-
function destroy() {
|
|
506
|
-
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
507
|
-
}
|
|
508
|
-
createDebug.enable(createDebug.load());
|
|
509
|
-
return createDebug;
|
|
510
|
-
}
|
|
511
|
-
module.exports = setup;
|
|
512
|
-
},
|
|
513
|
-
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
514
|
-
if ('undefined' == typeof process || 'renderer' === process.type || true === process.browser || process.__nwjs) module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js");
|
|
515
|
-
else module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js");
|
|
516
|
-
},
|
|
517
|
-
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js": function(module, exports, __webpack_require__) {
|
|
518
|
-
const tty = __webpack_require__("tty");
|
|
519
|
-
const util = __webpack_require__("util");
|
|
520
|
-
exports.init = init;
|
|
521
|
-
exports.log = log;
|
|
522
|
-
exports.formatArgs = formatArgs;
|
|
523
|
-
exports.save = save;
|
|
524
|
-
exports.load = load;
|
|
525
|
-
exports.useColors = useColors;
|
|
526
|
-
exports.destroy = util.deprecate(()=>{}, 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
527
|
-
exports.colors = [
|
|
528
|
-
6,
|
|
529
|
-
2,
|
|
530
|
-
3,
|
|
531
|
-
4,
|
|
532
|
-
5,
|
|
533
|
-
1
|
|
534
|
-
];
|
|
535
|
-
try {
|
|
536
|
-
const supportsColor = __webpack_require__("../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js");
|
|
537
|
-
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) exports.colors = [
|
|
538
|
-
20,
|
|
539
|
-
21,
|
|
540
|
-
26,
|
|
541
|
-
27,
|
|
542
|
-
32,
|
|
543
|
-
33,
|
|
544
|
-
38,
|
|
545
|
-
39,
|
|
546
|
-
40,
|
|
547
|
-
41,
|
|
548
|
-
42,
|
|
549
|
-
43,
|
|
550
|
-
44,
|
|
551
|
-
45,
|
|
552
|
-
56,
|
|
553
|
-
57,
|
|
554
|
-
62,
|
|
555
|
-
63,
|
|
556
|
-
68,
|
|
557
|
-
69,
|
|
558
|
-
74,
|
|
559
|
-
75,
|
|
560
|
-
76,
|
|
561
|
-
77,
|
|
562
|
-
78,
|
|
563
|
-
79,
|
|
564
|
-
80,
|
|
565
|
-
81,
|
|
566
|
-
92,
|
|
567
|
-
93,
|
|
568
|
-
98,
|
|
569
|
-
99,
|
|
570
|
-
112,
|
|
571
|
-
113,
|
|
572
|
-
128,
|
|
573
|
-
129,
|
|
574
|
-
134,
|
|
575
|
-
135,
|
|
576
|
-
148,
|
|
577
|
-
149,
|
|
578
|
-
160,
|
|
579
|
-
161,
|
|
580
|
-
162,
|
|
581
|
-
163,
|
|
582
|
-
164,
|
|
583
|
-
165,
|
|
584
|
-
166,
|
|
585
|
-
167,
|
|
586
|
-
168,
|
|
587
|
-
169,
|
|
588
|
-
170,
|
|
589
|
-
171,
|
|
590
|
-
172,
|
|
591
|
-
173,
|
|
592
|
-
178,
|
|
593
|
-
179,
|
|
594
|
-
184,
|
|
595
|
-
185,
|
|
596
|
-
196,
|
|
597
|
-
197,
|
|
598
|
-
198,
|
|
599
|
-
199,
|
|
600
|
-
200,
|
|
601
|
-
201,
|
|
602
|
-
202,
|
|
603
|
-
203,
|
|
604
|
-
204,
|
|
605
|
-
205,
|
|
606
|
-
206,
|
|
607
|
-
207,
|
|
608
|
-
208,
|
|
609
|
-
209,
|
|
610
|
-
214,
|
|
611
|
-
215,
|
|
612
|
-
220,
|
|
613
|
-
221
|
|
614
|
-
];
|
|
615
|
-
} catch (error) {}
|
|
616
|
-
exports.inspectOpts = Object.keys(process.env).filter((key)=>/^debug_/i.test(key)).reduce((obj, key)=>{
|
|
617
|
-
const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k)=>k.toUpperCase());
|
|
618
|
-
let val = process.env[key];
|
|
619
|
-
val = /^(yes|on|true|enabled)$/i.test(val) ? true : /^(no|off|false|disabled)$/i.test(val) ? false : 'null' === val ? null : Number(val);
|
|
620
|
-
obj[prop] = val;
|
|
621
|
-
return obj;
|
|
622
|
-
}, {});
|
|
623
|
-
function useColors() {
|
|
624
|
-
return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
|
|
625
|
-
}
|
|
626
|
-
function formatArgs(args) {
|
|
627
|
-
const { namespace: name, useColors } = this;
|
|
628
|
-
if (useColors) {
|
|
629
|
-
const c = this.color;
|
|
630
|
-
const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
|
|
631
|
-
const prefix = ` ${colorCode};1m${name} \u001B[0m`;
|
|
632
|
-
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
|
|
633
|
-
args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
|
|
634
|
-
} else args[0] = getDate() + name + ' ' + args[0];
|
|
635
|
-
}
|
|
636
|
-
function getDate() {
|
|
637
|
-
if (exports.inspectOpts.hideDate) return '';
|
|
638
|
-
return new Date().toISOString() + ' ';
|
|
639
|
-
}
|
|
640
|
-
function log(...args) {
|
|
641
|
-
return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
|
|
642
|
-
}
|
|
643
|
-
function save(namespaces) {
|
|
644
|
-
if (namespaces) process.env.DEBUG = namespaces;
|
|
645
|
-
else delete process.env.DEBUG;
|
|
646
|
-
}
|
|
647
|
-
function load() {
|
|
648
|
-
return process.env.DEBUG;
|
|
649
|
-
}
|
|
650
|
-
function init(debug) {
|
|
651
|
-
debug.inspectOpts = {};
|
|
652
|
-
const keys = Object.keys(exports.inspectOpts);
|
|
653
|
-
for(let i = 0; i < keys.length; i++)debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
654
|
-
}
|
|
655
|
-
module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js")(exports);
|
|
656
|
-
const { formatters } = module.exports;
|
|
657
|
-
formatters.o = function(v) {
|
|
658
|
-
this.inspectOpts.colors = this.useColors;
|
|
659
|
-
return util.inspect(v, this.inspectOpts).split('\n').map((str)=>str.trim()).join(' ');
|
|
660
|
-
};
|
|
661
|
-
formatters.O = function(v) {
|
|
662
|
-
this.inspectOpts.colors = this.useColors;
|
|
663
|
-
return util.inspect(v, this.inspectOpts);
|
|
664
|
-
};
|
|
665
|
-
},
|
|
666
|
-
"../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js": function(module) {
|
|
667
|
-
module.exports = (flag, argv = process.argv)=>{
|
|
668
|
-
const prefix = flag.startsWith('-') ? '' : 1 === flag.length ? '-' : '--';
|
|
669
|
-
const position = argv.indexOf(prefix + flag);
|
|
670
|
-
const terminatorPosition = argv.indexOf('--');
|
|
671
|
-
return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
|
|
672
|
-
};
|
|
673
|
-
},
|
|
674
|
-
"../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
675
|
-
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
676
|
-
if (void 0 === k2) k2 = k;
|
|
677
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
678
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
679
|
-
enumerable: true,
|
|
680
|
-
get: function() {
|
|
681
|
-
return m[k];
|
|
682
|
-
}
|
|
683
|
-
};
|
|
684
|
-
Object.defineProperty(o, k2, desc);
|
|
685
|
-
} : function(o, m, k, k2) {
|
|
686
|
-
if (void 0 === k2) k2 = k;
|
|
687
|
-
o[k2] = m[k];
|
|
688
|
-
});
|
|
689
|
-
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
|
|
690
|
-
Object.defineProperty(o, "default", {
|
|
691
|
-
enumerable: true,
|
|
692
|
-
value: v
|
|
693
|
-
});
|
|
694
|
-
} : function(o, v) {
|
|
695
|
-
o["default"] = v;
|
|
696
|
-
});
|
|
697
|
-
var __importStar = this && this.__importStar || function(mod) {
|
|
698
|
-
if (mod && mod.__esModule) return mod;
|
|
699
|
-
var result = {};
|
|
700
|
-
if (null != mod) {
|
|
701
|
-
for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
702
|
-
}
|
|
703
|
-
__setModuleDefault(result, mod);
|
|
704
|
-
return result;
|
|
705
|
-
};
|
|
706
|
-
var __importDefault = this && this.__importDefault || function(mod) {
|
|
707
|
-
return mod && mod.__esModule ? mod : {
|
|
708
|
-
default: mod
|
|
709
|
-
};
|
|
710
|
-
};
|
|
711
|
-
Object.defineProperty(exports, "__esModule", {
|
|
712
|
-
value: true
|
|
713
|
-
});
|
|
714
|
-
exports.HttpsProxyAgent = void 0;
|
|
715
|
-
const net = __importStar(__webpack_require__("net"));
|
|
716
|
-
const tls = __importStar(__webpack_require__("tls"));
|
|
717
|
-
const assert_1 = __importDefault(__webpack_require__("assert"));
|
|
718
|
-
const debug_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js"));
|
|
719
|
-
const agent_base_1 = __webpack_require__("../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js");
|
|
720
|
-
const url_1 = __webpack_require__("url");
|
|
721
|
-
const parse_proxy_response_1 = __webpack_require__("../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/parse-proxy-response.js");
|
|
722
|
-
const debug = (0, debug_1.default)('https-proxy-agent');
|
|
723
|
-
const setServernameFromNonIpHost = (options)=>{
|
|
724
|
-
if (void 0 === options.servername && options.host && !net.isIP(options.host)) return {
|
|
725
|
-
...options,
|
|
726
|
-
servername: options.host
|
|
727
|
-
};
|
|
728
|
-
return options;
|
|
729
|
-
};
|
|
730
|
-
class HttpsProxyAgent extends agent_base_1.Agent {
|
|
731
|
-
constructor(proxy, opts){
|
|
732
|
-
super(opts);
|
|
733
|
-
this.options = {
|
|
734
|
-
path: void 0
|
|
735
|
-
};
|
|
736
|
-
this.proxy = 'string' == typeof proxy ? new url_1.URL(proxy) : proxy;
|
|
737
|
-
this.proxyHeaders = opts?.headers ?? {};
|
|
738
|
-
debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href);
|
|
739
|
-
const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, '');
|
|
740
|
-
const port = this.proxy.port ? parseInt(this.proxy.port, 10) : 'https:' === this.proxy.protocol ? 443 : 80;
|
|
741
|
-
this.connectOpts = {
|
|
742
|
-
ALPNProtocols: [
|
|
743
|
-
'http/1.1'
|
|
744
|
-
],
|
|
745
|
-
...opts ? omit(opts, 'headers') : null,
|
|
746
|
-
host,
|
|
747
|
-
port
|
|
748
|
-
};
|
|
749
|
-
}
|
|
750
|
-
async connect(req, opts) {
|
|
751
|
-
const { proxy } = this;
|
|
752
|
-
if (!opts.host) throw new TypeError('No "host" provided');
|
|
753
|
-
let socket;
|
|
754
|
-
if ('https:' === proxy.protocol) {
|
|
755
|
-
debug('Creating `tls.Socket`: %o', this.connectOpts);
|
|
756
|
-
socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
|
|
757
|
-
} else {
|
|
758
|
-
debug('Creating `net.Socket`: %o', this.connectOpts);
|
|
759
|
-
socket = net.connect(this.connectOpts);
|
|
760
|
-
}
|
|
761
|
-
const headers = 'function' == typeof this.proxyHeaders ? this.proxyHeaders() : {
|
|
762
|
-
...this.proxyHeaders
|
|
763
|
-
};
|
|
764
|
-
const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
|
|
765
|
-
let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`;
|
|
766
|
-
if (proxy.username || proxy.password) {
|
|
767
|
-
const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
|
|
768
|
-
headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`;
|
|
769
|
-
}
|
|
770
|
-
headers.Host = `${host}:${opts.port}`;
|
|
771
|
-
if (!headers['Proxy-Connection']) headers['Proxy-Connection'] = this.keepAlive ? 'Keep-Alive' : 'close';
|
|
772
|
-
for (const name of Object.keys(headers))payload += `${name}: ${headers[name]}\r\n`;
|
|
773
|
-
const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket);
|
|
774
|
-
socket.write(`${payload}\r\n`);
|
|
775
|
-
const { connect, buffered } = await proxyResponsePromise;
|
|
776
|
-
req.emit('proxyConnect', connect);
|
|
777
|
-
this.emit('proxyConnect', connect, req);
|
|
778
|
-
if (200 === connect.statusCode) {
|
|
779
|
-
req.once('socket', resume);
|
|
780
|
-
if (opts.secureEndpoint) {
|
|
781
|
-
debug('Upgrading socket connection to TLS');
|
|
782
|
-
return tls.connect({
|
|
783
|
-
...omit(setServernameFromNonIpHost(opts), 'host', 'path', 'port'),
|
|
784
|
-
socket
|
|
785
|
-
});
|
|
786
|
-
}
|
|
787
|
-
return socket;
|
|
788
|
-
}
|
|
789
|
-
socket.destroy();
|
|
790
|
-
const fakeSocket = new net.Socket({
|
|
791
|
-
writable: false
|
|
792
|
-
});
|
|
793
|
-
fakeSocket.readable = true;
|
|
794
|
-
req.once('socket', (s)=>{
|
|
795
|
-
debug('Replaying proxy buffer for failed request');
|
|
796
|
-
(0, assert_1.default)(s.listenerCount('data') > 0);
|
|
797
|
-
s.push(buffered);
|
|
798
|
-
s.push(null);
|
|
799
|
-
});
|
|
800
|
-
return fakeSocket;
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
HttpsProxyAgent.protocols = [
|
|
804
|
-
'http',
|
|
805
|
-
'https'
|
|
806
|
-
];
|
|
807
|
-
exports.HttpsProxyAgent = HttpsProxyAgent;
|
|
808
|
-
function resume(socket) {
|
|
809
|
-
socket.resume();
|
|
810
|
-
}
|
|
811
|
-
function omit(obj, ...keys) {
|
|
812
|
-
const ret = {};
|
|
813
|
-
let key;
|
|
814
|
-
for(key in obj)if (!keys.includes(key)) ret[key] = obj[key];
|
|
815
|
-
return ret;
|
|
816
|
-
}
|
|
817
|
-
},
|
|
818
|
-
"../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/parse-proxy-response.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
819
|
-
var __importDefault = this && this.__importDefault || function(mod) {
|
|
820
|
-
return mod && mod.__esModule ? mod : {
|
|
821
|
-
default: mod
|
|
822
|
-
};
|
|
823
|
-
};
|
|
824
|
-
Object.defineProperty(exports, "__esModule", {
|
|
825
|
-
value: true
|
|
826
|
-
});
|
|
827
|
-
exports.parseProxyResponse = void 0;
|
|
828
|
-
const debug_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js"));
|
|
829
|
-
const debug = (0, debug_1.default)('https-proxy-agent:parse-proxy-response');
|
|
830
|
-
function parseProxyResponse(socket) {
|
|
831
|
-
return new Promise((resolve, reject)=>{
|
|
832
|
-
let buffersLength = 0;
|
|
833
|
-
const buffers = [];
|
|
834
|
-
function read() {
|
|
835
|
-
const b = socket.read();
|
|
836
|
-
if (b) ondata(b);
|
|
837
|
-
else socket.once('readable', read);
|
|
838
|
-
}
|
|
839
|
-
function cleanup() {
|
|
840
|
-
socket.removeListener('end', onend);
|
|
841
|
-
socket.removeListener('error', onerror);
|
|
842
|
-
socket.removeListener('readable', read);
|
|
843
|
-
}
|
|
844
|
-
function onend() {
|
|
845
|
-
cleanup();
|
|
846
|
-
debug('onend');
|
|
847
|
-
reject(new Error('Proxy connection ended before receiving CONNECT response'));
|
|
848
|
-
}
|
|
849
|
-
function onerror(err) {
|
|
850
|
-
cleanup();
|
|
851
|
-
debug('onerror %o', err);
|
|
852
|
-
reject(err);
|
|
853
|
-
}
|
|
854
|
-
function ondata(b) {
|
|
855
|
-
buffers.push(b);
|
|
856
|
-
buffersLength += b.length;
|
|
857
|
-
const buffered = Buffer.concat(buffers, buffersLength);
|
|
858
|
-
const endOfHeaders = buffered.indexOf('\r\n\r\n');
|
|
859
|
-
if (-1 === endOfHeaders) {
|
|
860
|
-
debug('have not received end of HTTP headers yet...');
|
|
861
|
-
read();
|
|
862
|
-
return;
|
|
863
|
-
}
|
|
864
|
-
const headerParts = buffered.slice(0, endOfHeaders).toString('ascii').split('\r\n');
|
|
865
|
-
const firstLine = headerParts.shift();
|
|
866
|
-
if (!firstLine) {
|
|
867
|
-
socket.destroy();
|
|
868
|
-
return reject(new Error('No header received from proxy CONNECT response'));
|
|
869
|
-
}
|
|
870
|
-
const firstLineParts = firstLine.split(' ');
|
|
871
|
-
const statusCode = +firstLineParts[1];
|
|
872
|
-
const statusText = firstLineParts.slice(2).join(' ');
|
|
873
|
-
const headers = {};
|
|
874
|
-
for (const header of headerParts){
|
|
875
|
-
if (!header) continue;
|
|
876
|
-
const firstColon = header.indexOf(':');
|
|
877
|
-
if (-1 === firstColon) {
|
|
878
|
-
socket.destroy();
|
|
879
|
-
return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`));
|
|
880
|
-
}
|
|
881
|
-
const key = header.slice(0, firstColon).toLowerCase();
|
|
882
|
-
const value = header.slice(firstColon + 1).trimStart();
|
|
883
|
-
const current = headers[key];
|
|
884
|
-
if ('string' == typeof current) headers[key] = [
|
|
885
|
-
current,
|
|
886
|
-
value
|
|
887
|
-
];
|
|
888
|
-
else if (Array.isArray(current)) current.push(value);
|
|
889
|
-
else headers[key] = value;
|
|
890
|
-
}
|
|
891
|
-
debug('got proxy server response: %o %o', firstLine, headers);
|
|
892
|
-
cleanup();
|
|
893
|
-
resolve({
|
|
894
|
-
connect: {
|
|
895
|
-
statusCode,
|
|
896
|
-
statusText,
|
|
897
|
-
headers
|
|
898
|
-
},
|
|
899
|
-
buffered
|
|
900
|
-
});
|
|
901
|
-
}
|
|
902
|
-
socket.on('error', onerror);
|
|
903
|
-
socket.on('end', onend);
|
|
904
|
-
read();
|
|
905
|
-
});
|
|
906
|
-
}
|
|
907
|
-
exports.parseProxyResponse = parseProxyResponse;
|
|
908
|
-
},
|
|
909
|
-
"../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js": function(module) {
|
|
910
|
-
var s = 1000;
|
|
911
|
-
var m = 60 * s;
|
|
912
|
-
var h = 60 * m;
|
|
913
|
-
var d = 24 * h;
|
|
914
|
-
var w = 7 * d;
|
|
915
|
-
var y = 365.25 * d;
|
|
916
|
-
module.exports = function(val, options) {
|
|
917
|
-
options = options || {};
|
|
918
|
-
var type = typeof val;
|
|
919
|
-
if ('string' === type && val.length > 0) return parse(val);
|
|
920
|
-
if ('number' === type && isFinite(val)) return options.long ? fmtLong(val) : fmtShort(val);
|
|
921
|
-
throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
|
|
922
|
-
};
|
|
923
|
-
function parse(str) {
|
|
924
|
-
str = String(str);
|
|
925
|
-
if (str.length > 100) return;
|
|
926
|
-
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
|
|
927
|
-
if (!match) return;
|
|
928
|
-
var n = parseFloat(match[1]);
|
|
929
|
-
var type = (match[2] || 'ms').toLowerCase();
|
|
930
|
-
switch(type){
|
|
931
|
-
case 'years':
|
|
932
|
-
case 'year':
|
|
933
|
-
case 'yrs':
|
|
934
|
-
case 'yr':
|
|
935
|
-
case 'y':
|
|
936
|
-
return n * y;
|
|
937
|
-
case 'weeks':
|
|
938
|
-
case 'week':
|
|
939
|
-
case 'w':
|
|
940
|
-
return n * w;
|
|
941
|
-
case 'days':
|
|
942
|
-
case 'day':
|
|
943
|
-
case 'd':
|
|
944
|
-
return n * d;
|
|
945
|
-
case 'hours':
|
|
946
|
-
case 'hour':
|
|
947
|
-
case 'hrs':
|
|
948
|
-
case 'hr':
|
|
949
|
-
case 'h':
|
|
950
|
-
return n * h;
|
|
951
|
-
case 'minutes':
|
|
952
|
-
case 'minute':
|
|
953
|
-
case 'mins':
|
|
954
|
-
case 'min':
|
|
955
|
-
case 'm':
|
|
956
|
-
return n * m;
|
|
957
|
-
case 'seconds':
|
|
958
|
-
case 'second':
|
|
959
|
-
case 'secs':
|
|
960
|
-
case 'sec':
|
|
961
|
-
case 's':
|
|
962
|
-
return n * s;
|
|
963
|
-
case 'milliseconds':
|
|
964
|
-
case 'millisecond':
|
|
965
|
-
case 'msecs':
|
|
966
|
-
case 'msec':
|
|
967
|
-
case 'ms':
|
|
968
|
-
return n;
|
|
969
|
-
default:
|
|
970
|
-
return;
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
function fmtShort(ms) {
|
|
974
|
-
var msAbs = Math.abs(ms);
|
|
975
|
-
if (msAbs >= d) return Math.round(ms / d) + 'd';
|
|
976
|
-
if (msAbs >= h) return Math.round(ms / h) + 'h';
|
|
977
|
-
if (msAbs >= m) return Math.round(ms / m) + 'm';
|
|
978
|
-
if (msAbs >= s) return Math.round(ms / s) + 's';
|
|
979
|
-
return ms + 'ms';
|
|
980
|
-
}
|
|
981
|
-
function fmtLong(ms) {
|
|
982
|
-
var msAbs = Math.abs(ms);
|
|
983
|
-
if (msAbs >= d) return plural(ms, msAbs, d, 'day');
|
|
984
|
-
if (msAbs >= h) return plural(ms, msAbs, h, 'hour');
|
|
985
|
-
if (msAbs >= m) return plural(ms, msAbs, m, 'minute');
|
|
986
|
-
if (msAbs >= s) return plural(ms, msAbs, s, 'second');
|
|
987
|
-
return ms + ' ms';
|
|
988
|
-
}
|
|
989
|
-
function plural(ms, msAbs, n, name) {
|
|
990
|
-
var isPlural = msAbs >= 1.5 * n;
|
|
991
|
-
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
992
|
-
}
|
|
993
|
-
},
|
|
994
|
-
"../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
995
|
-
const os = __webpack_require__("os");
|
|
996
|
-
const tty = __webpack_require__("tty");
|
|
997
|
-
const hasFlag = __webpack_require__("../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js");
|
|
998
|
-
const { env } = process;
|
|
999
|
-
let flagForceColor;
|
|
1000
|
-
if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) flagForceColor = 0;
|
|
1001
|
-
else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) flagForceColor = 1;
|
|
1002
|
-
function envForceColor() {
|
|
1003
|
-
if ('FORCE_COLOR' in env) {
|
|
1004
|
-
if ('true' === env.FORCE_COLOR) return 1;
|
|
1005
|
-
if ('false' === env.FORCE_COLOR) return 0;
|
|
1006
|
-
return 0 === env.FORCE_COLOR.length ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
function translateLevel(level) {
|
|
1010
|
-
if (0 === level) return false;
|
|
1011
|
-
return {
|
|
1012
|
-
level,
|
|
1013
|
-
hasBasic: true,
|
|
1014
|
-
has256: level >= 2,
|
|
1015
|
-
has16m: level >= 3
|
|
1016
|
-
};
|
|
1017
|
-
}
|
|
1018
|
-
function supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
1019
|
-
const noFlagForceColor = envForceColor();
|
|
1020
|
-
if (void 0 !== noFlagForceColor) flagForceColor = noFlagForceColor;
|
|
1021
|
-
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
1022
|
-
if (0 === forceColor) return 0;
|
|
1023
|
-
if (sniffFlags) {
|
|
1024
|
-
if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) return 3;
|
|
1025
|
-
if (hasFlag('color=256')) return 2;
|
|
1026
|
-
}
|
|
1027
|
-
if (haveStream && !streamIsTTY && void 0 === forceColor) return 0;
|
|
1028
|
-
const min = forceColor || 0;
|
|
1029
|
-
if ('dumb' === env.TERM) return min;
|
|
1030
|
-
if ('win32' === process.platform) {
|
|
1031
|
-
const osRelease = os.release().split('.');
|
|
1032
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
1033
|
-
return 1;
|
|
1034
|
-
}
|
|
1035
|
-
if ('CI' in env) {
|
|
1036
|
-
if ([
|
|
1037
|
-
'TRAVIS',
|
|
1038
|
-
'CIRCLECI',
|
|
1039
|
-
'APPVEYOR',
|
|
1040
|
-
'GITLAB_CI',
|
|
1041
|
-
'GITHUB_ACTIONS',
|
|
1042
|
-
'BUILDKITE',
|
|
1043
|
-
'DRONE'
|
|
1044
|
-
].some((sign)=>sign in env) || 'codeship' === env.CI_NAME) return 1;
|
|
1045
|
-
return min;
|
|
1046
|
-
}
|
|
1047
|
-
if ('TEAMCITY_VERSION' in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
1048
|
-
if ('truecolor' === env.COLORTERM) return 3;
|
|
1049
|
-
if ('TERM_PROGRAM' in env) {
|
|
1050
|
-
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
1051
|
-
switch(env.TERM_PROGRAM){
|
|
1052
|
-
case 'iTerm.app':
|
|
1053
|
-
return version >= 3 ? 3 : 2;
|
|
1054
|
-
case 'Apple_Terminal':
|
|
1055
|
-
return 2;
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
if (/-256(color)?$/i.test(env.TERM)) return 2;
|
|
1059
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
|
|
1060
|
-
if ('COLORTERM' in env) return 1;
|
|
1061
|
-
return min;
|
|
1062
|
-
}
|
|
1063
|
-
function getSupportLevel(stream, options = {}) {
|
|
1064
|
-
const level = supportsColor(stream, {
|
|
1065
|
-
streamIsTTY: stream && stream.isTTY,
|
|
1066
|
-
...options
|
|
1067
|
-
});
|
|
1068
|
-
return translateLevel(level);
|
|
1069
|
-
}
|
|
1070
|
-
module.exports = {
|
|
1071
|
-
supportsColor: getSupportLevel,
|
|
1072
|
-
stdout: getSupportLevel({
|
|
1073
|
-
isTTY: tty.isatty(1)
|
|
1074
|
-
}),
|
|
1075
|
-
stderr: getSupportLevel({
|
|
1076
|
-
isTTY: tty.isatty(2)
|
|
1077
|
-
})
|
|
1078
|
-
};
|
|
1079
|
-
},
|
|
1080
23
|
"./src/utils/XhsXsCommonEnc.js": function(module) {
|
|
1081
24
|
var encrypt_lookup = [
|
|
1082
25
|
"Z",
|
|
@@ -5357,38 +4300,11 @@ nazkkBvqQbbAqVbQFTF/DPikppu6ZT6lGIXvJKCreeFiHA2qK6tS18SWVHW9ARz1
|
|
|
5357
4300
|
}
|
|
5358
4301
|
module.exports = encode_mnsv2;
|
|
5359
4302
|
},
|
|
5360
|
-
assert: function(module) {
|
|
5361
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_assert__;
|
|
5362
|
-
},
|
|
5363
4303
|
crypto: function(module) {
|
|
5364
4304
|
module.exports = __WEBPACK_EXTERNAL_MODULE_crypto__;
|
|
5365
4305
|
},
|
|
5366
4306
|
fs: function(module) {
|
|
5367
4307
|
module.exports = __WEBPACK_EXTERNAL_MODULE_fs__;
|
|
5368
|
-
},
|
|
5369
|
-
http: function(module) {
|
|
5370
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_http__;
|
|
5371
|
-
},
|
|
5372
|
-
https: function(module) {
|
|
5373
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_https__;
|
|
5374
|
-
},
|
|
5375
|
-
net: function(module) {
|
|
5376
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_net__;
|
|
5377
|
-
},
|
|
5378
|
-
os: function(module) {
|
|
5379
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_os__;
|
|
5380
|
-
},
|
|
5381
|
-
tls: function(module) {
|
|
5382
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_tls__;
|
|
5383
|
-
},
|
|
5384
|
-
tty: function(module) {
|
|
5385
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_tty__;
|
|
5386
|
-
},
|
|
5387
|
-
url: function(module) {
|
|
5388
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_url__;
|
|
5389
|
-
},
|
|
5390
|
-
util: function(module) {
|
|
5391
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_util__;
|
|
5392
4308
|
}
|
|
5393
4309
|
};
|
|
5394
4310
|
var __webpack_module_cache__ = {};
|
|
@@ -5400,7 +4316,7 @@ function __webpack_require__(moduleId) {
|
|
|
5400
4316
|
loaded: false,
|
|
5401
4317
|
exports: {}
|
|
5402
4318
|
};
|
|
5403
|
-
__webpack_modules__[moduleId]
|
|
4319
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
5404
4320
|
module.loaded = true;
|
|
5405
4321
|
return module.exports;
|
|
5406
4322
|
}
|
|
@@ -5434,8 +4350,93 @@ function __webpack_require__(moduleId) {
|
|
|
5434
4350
|
return module;
|
|
5435
4351
|
};
|
|
5436
4352
|
})();
|
|
5437
|
-
var package_namespaceObject = JSON.parse('{"i8":"4.0.
|
|
5438
|
-
|
|
4353
|
+
var package_namespaceObject = JSON.parse('{"i8":"4.0.4-beta.0"}');
|
|
4354
|
+
const PROXY_CREDENTIALS = [
|
|
4355
|
+
{
|
|
4356
|
+
ip: "47.110.131.129",
|
|
4357
|
+
portStart: 44001,
|
|
4358
|
+
portEnd: 44050,
|
|
4359
|
+
user: "m64ut33hvzUzuh",
|
|
4360
|
+
pass: "pV2nKbhvgciM3URoRjnvk5D1d0CryaE"
|
|
4361
|
+
},
|
|
4362
|
+
{
|
|
4363
|
+
ip: "47.110.131.129",
|
|
4364
|
+
portStart: 44051,
|
|
4365
|
+
portEnd: 44100,
|
|
4366
|
+
user: "m64uz9EMrVpaCk",
|
|
4367
|
+
pass: "pAhDnBmdn12odgffGJnbFt9Jts6EiRz"
|
|
4368
|
+
},
|
|
4369
|
+
{
|
|
4370
|
+
ip: "47.110.131.129",
|
|
4371
|
+
portStart: 44101,
|
|
4372
|
+
portEnd: 44150,
|
|
4373
|
+
user: "m64uacZLZ1hQuz",
|
|
4374
|
+
pass: "p0oyBQtTFXk9x5BniP1GT3t5zmy1kWX"
|
|
4375
|
+
},
|
|
4376
|
+
{
|
|
4377
|
+
ip: "47.110.131.129",
|
|
4378
|
+
portStart: 44151,
|
|
4379
|
+
portEnd: 44200,
|
|
4380
|
+
user: "m64ugn30hbrv5w",
|
|
4381
|
+
pass: "pDMlGki6kx5ObJmIVNX9IyaTyLCNdwF"
|
|
4382
|
+
},
|
|
4383
|
+
{
|
|
4384
|
+
ip: "47.110.131.129",
|
|
4385
|
+
portStart: 44201,
|
|
4386
|
+
portEnd: 44250,
|
|
4387
|
+
user: "m64uxrjtLEuuiJ",
|
|
4388
|
+
pass: "pgSS3tw48oFBFKieAjJjsCzfdbvOxyD"
|
|
4389
|
+
},
|
|
4390
|
+
{
|
|
4391
|
+
ip: "47.110.131.129",
|
|
4392
|
+
portStart: 45001,
|
|
4393
|
+
portEnd: 45050,
|
|
4394
|
+
user: "m63uGNqJq3SfCR",
|
|
4395
|
+
pass: "p9gDMdIlxrfwK6DPpYxad6nnLy2oz7b"
|
|
4396
|
+
},
|
|
4397
|
+
{
|
|
4398
|
+
ip: "47.110.131.129",
|
|
4399
|
+
portStart: 45051,
|
|
4400
|
+
portEnd: 45100,
|
|
4401
|
+
user: "m63usvfyWYu6vY",
|
|
4402
|
+
pass: "pu0hLZL81K5u43XbWlWKjZsNOAPG238"
|
|
4403
|
+
},
|
|
4404
|
+
{
|
|
4405
|
+
ip: "47.110.131.129",
|
|
4406
|
+
portStart: 45101,
|
|
4407
|
+
portEnd: 45150,
|
|
4408
|
+
user: "m63uI2pvHbB0b0",
|
|
4409
|
+
pass: "p353azuJBlrzuu2EidptuhdnBIybdUy"
|
|
4410
|
+
},
|
|
4411
|
+
{
|
|
4412
|
+
ip: "47.110.131.129",
|
|
4413
|
+
portStart: 45151,
|
|
4414
|
+
portEnd: 45200,
|
|
4415
|
+
user: "m63uSpJbw46qnQ",
|
|
4416
|
+
pass: "pYWdnwHHXoKgIOLfuvruZFlSaGN2ZVO"
|
|
4417
|
+
},
|
|
4418
|
+
{
|
|
4419
|
+
ip: "47.110.131.129",
|
|
4420
|
+
portStart: 45201,
|
|
4421
|
+
portEnd: 45250,
|
|
4422
|
+
user: "m63ufKz8YekqZq",
|
|
4423
|
+
pass: "phDmq6dBU85Z85A99LsrtluBgG5OFQ2"
|
|
4424
|
+
}
|
|
4425
|
+
];
|
|
4426
|
+
function findProxyCredential(ip, port) {
|
|
4427
|
+
const portNum = Number(port);
|
|
4428
|
+
if (Number.isNaN(portNum)) return null;
|
|
4429
|
+
return PROXY_CREDENTIALS.find((c)=>c.ip === ip && portNum >= c.portStart && portNum <= c.portEnd) ?? null;
|
|
4430
|
+
}
|
|
4431
|
+
function buildProxyUrl(ip, port) {
|
|
4432
|
+
const credential = findProxyCredential(ip, port);
|
|
4433
|
+
if (credential) {
|
|
4434
|
+
const user = encodeURIComponent(credential.user);
|
|
4435
|
+
const pass = encodeURIComponent(credential.pass);
|
|
4436
|
+
return `socks5h://${user}:${pass}@${ip}:${port}`;
|
|
4437
|
+
}
|
|
4438
|
+
return `socks5h://${ip}:${port}`;
|
|
4439
|
+
}
|
|
5439
4440
|
async function ProxyAgent(task, ip, adr, accountId, refresh) {
|
|
5440
4441
|
const http = new Http({
|
|
5441
4442
|
headers: {
|
|
@@ -5467,11 +4468,12 @@ async function ProxyAgent(task, ip, adr, accountId, refresh) {
|
|
|
5467
4468
|
}
|
|
5468
4469
|
};
|
|
5469
4470
|
task.logger?.info(`请求代理:区域:${params.addr}, IP:${params.ip}, AccountId:${params.accountId}, 返回代理信息: ${ProxyInfo.data ? `${ProxyInfo.data.proxyIp}:${ProxyInfo.data.proxyPort}` : "无可用代理"}`, loggerInfo);
|
|
5470
|
-
|
|
4471
|
+
const proxyAgent = "000000" === ProxyInfo.code && ProxyInfo.data ? {
|
|
5471
4472
|
ip: ProxyInfo.data.proxyIp,
|
|
5472
4473
|
port: ProxyInfo.data.proxyPort,
|
|
5473
|
-
agent: new
|
|
4474
|
+
agent: new __WEBPACK_EXTERNAL_MODULE_socks_proxy_agent_cb52aaad__.SocksProxyAgent(buildProxyUrl(ProxyInfo.data.proxyIp, ProxyInfo.data.proxyPort))
|
|
5474
4475
|
} : null;
|
|
4476
|
+
return proxyAgent;
|
|
5475
4477
|
}
|
|
5476
4478
|
class Http {
|
|
5477
4479
|
static handleApiError(error) {
|
|
@@ -5482,12 +4484,13 @@ class Http {
|
|
|
5482
4484
|
data: error
|
|
5483
4485
|
};
|
|
5484
4486
|
}
|
|
5485
|
-
constructor(config, logger, adr, ip, accountId){
|
|
4487
|
+
constructor(config, logger, adr, ip, accountId, platform){
|
|
5486
4488
|
this.agentPromise = void 0;
|
|
5487
4489
|
this.apiClient = __WEBPACK_EXTERNAL_MODULE_axios__["default"].create({
|
|
5488
4490
|
...config
|
|
5489
4491
|
});
|
|
5490
4492
|
this.logger = logger;
|
|
4493
|
+
this.platform = platform;
|
|
5491
4494
|
if (ip) this.agentPromise = ProxyAgent({
|
|
5492
4495
|
logger
|
|
5493
4496
|
}, ip, adr, accountId);
|
|
@@ -5585,7 +4588,10 @@ class Http {
|
|
|
5585
4588
|
}
|
|
5586
4589
|
}
|
|
5587
4590
|
errorResponse.message = errorResponse.message ? errorResponse.message : _message;
|
|
5588
|
-
if ("canceled" === errorResponse.message)
|
|
4591
|
+
if ("canceled" === errorResponse.message) {
|
|
4592
|
+
const message = errorResponse.extra?.isProxyRequest ? "代理连接建立超时,请更换区域或稍后重试!" : "网络请求超时,请稍后重试!";
|
|
4593
|
+
errorResponse.message = message;
|
|
4594
|
+
}
|
|
5589
4595
|
if (error.message.includes("Proxy connection ended")) errorResponse.message = "所在区域代理连接超时,请更换区域或稍后重试!";
|
|
5590
4596
|
throw errorResponse;
|
|
5591
4597
|
});
|
|
@@ -5623,14 +4629,21 @@ class Http {
|
|
|
5623
4629
|
599
|
|
5624
4630
|
].includes(handledError.code);
|
|
5625
4631
|
if (Rtimes < retries && isRetry) {
|
|
5626
|
-
|
|
4632
|
+
const url = config.url || "";
|
|
4633
|
+
this.logger?.warn(`进入第${Rtimes + 1}次重试!错误码: ${handledError.code}, 请求地址: ${url}`);
|
|
5627
4634
|
await new Promise((resolve)=>setTimeout(resolve, retryDelay));
|
|
5628
4635
|
return sessionRt(Rtimes + 1);
|
|
5629
4636
|
}
|
|
5630
4637
|
return Promise.reject(handledError);
|
|
5631
4638
|
}
|
|
5632
4639
|
};
|
|
5633
|
-
if (this.agentPromise)
|
|
4640
|
+
if (this.agentPromise) {
|
|
4641
|
+
const requestUrl = config.url || "";
|
|
4642
|
+
const platformTag = this.platform ? `[${this.platform}]` : "";
|
|
4643
|
+
this.logger?.info(`${platformTag}[代理请求] 接口: ${requestUrl}`);
|
|
4644
|
+
agent = await this.agentPromise;
|
|
4645
|
+
if (agent) this.logger?.info(`${platformTag}[代理请求] 代理地址: ${agent.ip}:${agent.port}`);
|
|
4646
|
+
}
|
|
5634
4647
|
return sessionRt(0);
|
|
5635
4648
|
}
|
|
5636
4649
|
}
|
|
@@ -9990,7 +9003,8 @@ const mockAction = async (task, params)=>{
|
|
|
9990
9003
|
task.logger,
|
|
9991
9004
|
params.proxyLoc,
|
|
9992
9005
|
params.localIP,
|
|
9993
|
-
params.accountId
|
|
9006
|
+
params.accountId,
|
|
9007
|
+
"baijiahao"
|
|
9994
9008
|
];
|
|
9995
9009
|
const http = new Http({
|
|
9996
9010
|
headers
|
|
@@ -13344,7 +12358,7 @@ const douyinGetVerifyQrCode = async (task, params)=>{
|
|
|
13344
12358
|
});
|
|
13345
12359
|
} catch (err) {
|
|
13346
12360
|
const msg = err instanceof Error ? err.message : String(err);
|
|
13347
|
-
task.logger.warn(
|
|
12361
|
+
task.logger.warn(`[douyinGetVerifyQrCode] 获取二维码失败: ${msg}`);
|
|
13348
12362
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(500, `获取二维码失败: ${msg}`, "");
|
|
13349
12363
|
}
|
|
13350
12364
|
};
|
|
@@ -14437,7 +13451,8 @@ const mock_mockAction = async (task, params)=>{
|
|
|
14437
13451
|
task.logger,
|
|
14438
13452
|
"",
|
|
14439
13453
|
"",
|
|
14440
|
-
params.accountId
|
|
13454
|
+
params.accountId,
|
|
13455
|
+
"douyin"
|
|
14441
13456
|
];
|
|
14442
13457
|
const http = new Http({
|
|
14443
13458
|
headers
|
|
@@ -14474,12 +13489,11 @@ const mock_mockAction = async (task, params)=>{
|
|
|
14474
13489
|
publishData.item.common.creation_id = generateRandomString(8) + Date.now();
|
|
14475
13490
|
let decision = null;
|
|
14476
13491
|
proxyHttp.addResponseInterceptor((response)=>{
|
|
14477
|
-
|
|
14478
|
-
task.logger.
|
|
14479
|
-
task.logger.warn(`[douyinPublish] 拦截器收到响应response.data: ${JSON.stringify(response.data)} `);
|
|
13492
|
+
task.logger.info(`[douyinPublish] 拦截器收到响应response.headers: ${JSON.stringify(response.headers)} `);
|
|
13493
|
+
task.logger.info(`[douyinPublish] 拦截器收到响应response.data: ${JSON.stringify(response.data)} `);
|
|
14480
13494
|
decision = parseVerifyPassportDecision(response.headers["x-tt-verify-passport-decision"]);
|
|
14481
13495
|
if (needsVerification(decision)) {
|
|
14482
|
-
task.logger.
|
|
13496
|
+
task.logger.info(`[douyinPublish] 检测到需要验证: ${JSON.stringify(decision)}`);
|
|
14483
13497
|
return;
|
|
14484
13498
|
}
|
|
14485
13499
|
if (!response || !response.data) return;
|
|
@@ -14528,32 +13542,31 @@ const mock_mockAction = async (task, params)=>{
|
|
|
14528
13542
|
ts_sign = decoded.ts_sign;
|
|
14529
13543
|
}
|
|
14530
13544
|
} catch (error) {
|
|
14531
|
-
task.logger.
|
|
13545
|
+
task.logger.info(`[douyinPublish] 解析 bd_ticket_guard_server_data 失败,回退到 web_protect: ${error}`);
|
|
14532
13546
|
}
|
|
14533
13547
|
let ec_privateKey;
|
|
14534
13548
|
try {
|
|
14535
13549
|
ec_privateKey = JSON.parse(JSON.parse(params.extraParam["security-sdk/s_sdk_crypt_sdk"] || "{}").data || "{}").ec_privateKey;
|
|
14536
13550
|
if (!ec_privateKey) {
|
|
14537
|
-
task.logger.error("ec_privateKey 为空");
|
|
13551
|
+
task.logger.error("[douyinPublish] ec_privateKey 为空");
|
|
14538
13552
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 ec_privateKey 缺失,请重新获取后重试", "");
|
|
14539
13553
|
}
|
|
14540
13554
|
} catch (error) {
|
|
14541
|
-
task.logger.error(
|
|
13555
|
+
task.logger.error(`[douyinPublish] 解析 ec_privateKey 失败: ${error}`);
|
|
14542
13556
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 ec_privateKey 解析失败,请重新获取后重试", "");
|
|
14543
13557
|
}
|
|
14544
13558
|
let certificate;
|
|
14545
13559
|
try {
|
|
14546
13560
|
certificate = JSON.parse(params.extraParam["security-sdk/s_sdk_server_cert_key"] || "{}").cert;
|
|
14547
13561
|
if (!certificate) {
|
|
14548
|
-
task.logger.error("certificate 为空");
|
|
13562
|
+
task.logger.error("[douyinPublish] certificate 为空");
|
|
14549
13563
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 certificate 缺失,请重新获取后重试", "");
|
|
14550
13564
|
}
|
|
14551
13565
|
} catch (error) {
|
|
14552
|
-
task.logger.error(
|
|
13566
|
+
task.logger.error(`[douyinPublish] 解析 certificate 失败: ${error}`);
|
|
14553
13567
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 certificate 解析失败,请重新获取后重试", "");
|
|
14554
13568
|
}
|
|
14555
13569
|
const ree_public_key = webProtectData.client_cert.replace("pub.", "");
|
|
14556
|
-
task.logger.info(`生成 bdTicketGuardClientData 的参数: ticket: ${ticket?.substring(0, 20)}..., ts_sign: ${ts_sign}, ree_public_key: ${ree_public_key?.substring(0, 20)}...`);
|
|
14557
13570
|
let bdTicketGuardClientData;
|
|
14558
13571
|
try {
|
|
14559
13572
|
bdTicketGuardClientData = getBdV2({
|
|
@@ -14564,14 +13577,14 @@ const mock_mockAction = async (task, params)=>{
|
|
|
14564
13577
|
bd_ticket_guard_ree_public_key: ree_public_key
|
|
14565
13578
|
});
|
|
14566
13579
|
if (!bdTicketGuardClientData || !bdTicketGuardClientData["headers_bd_ticket_guard_client_data"]) {
|
|
14567
|
-
task.logger.error(`bdTicketGuardClientData 生成失败或不完整: ${JSON.stringify(bdTicketGuardClientData)}`);
|
|
13580
|
+
task.logger.error(`[douyinPublish] bdTicketGuardClientData 生成失败或不完整: ${JSON.stringify(bdTicketGuardClientData)}`);
|
|
14568
13581
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 bdTicketGuardClientData 生成失败,请重新获取后重试", "");
|
|
14569
13582
|
}
|
|
14570
13583
|
} catch (error) {
|
|
14571
|
-
task.logger.error(
|
|
13584
|
+
task.logger.error(`[douyinPublish] 生成 bdTicketGuardClientData 失败: ${error}`);
|
|
14572
13585
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 bdTicketGuardClientData 生成异常,请重新获取后重试", "");
|
|
14573
13586
|
}
|
|
14574
|
-
task.logger.info("bdTicketGuardClientData 生成成功");
|
|
13587
|
+
task.logger.info("[douyinPublish] bdTicketGuardClientData 生成成功");
|
|
14575
13588
|
const publishQuery = {
|
|
14576
13589
|
...publishParams,
|
|
14577
13590
|
a_bogus: ""
|
|
@@ -14581,12 +13594,11 @@ const mock_mockAction = async (task, params)=>{
|
|
|
14581
13594
|
try {
|
|
14582
13595
|
aBogus = mock_getABogus(`https://creator.douyin.com/web/api/media/aweme/create_v2/?${queryString}`, publishData, userAgent);
|
|
14583
13596
|
if (!aBogus || aBogus.length < 10) {
|
|
14584
|
-
task.logger.error(`a_bogus 生成异常,长度过短: ${aBogus}`);
|
|
13597
|
+
task.logger.error(`[douyinPublish] a_bogus 生成异常,长度过短: ${aBogus}`);
|
|
14585
13598
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 a_bogus 生成失败,请重试", "");
|
|
14586
13599
|
}
|
|
14587
|
-
task.logger.info(`a_bogus 生成成功: ${aBogus.substring(0, 20)}...`);
|
|
14588
13600
|
} catch (error) {
|
|
14589
|
-
task.logger.error(
|
|
13601
|
+
task.logger.error(`[douyinPublish] 生成 a_bogus 失败: ${error}`);
|
|
14590
13602
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 a_bogus 生成异常,请重试", "");
|
|
14591
13603
|
}
|
|
14592
13604
|
publishQuery.a_bogus = aBogus;
|
|
@@ -14600,20 +13612,20 @@ const mock_mockAction = async (task, params)=>{
|
|
|
14600
13612
|
userAgent
|
|
14601
13613
|
});
|
|
14602
13614
|
if (!csrfToken || csrfToken.length < 10) {
|
|
14603
|
-
task.logger.error(`csrfToken 生成异常,长度过短: ${csrfToken}`);
|
|
13615
|
+
task.logger.error(`[douyinPublish] csrfToken 生成异常,长度过短: ${csrfToken}`);
|
|
14604
13616
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 csrfToken 生成失败,请重试", "");
|
|
14605
13617
|
}
|
|
14606
|
-
task.logger.info(`csrfToken 生成成功: ${csrfToken.substring(0, 20)}...`);
|
|
13618
|
+
task.logger.info(`[douyinPublish] csrfToken 生成成功: ${csrfToken.substring(0, 20)}...`);
|
|
14607
13619
|
} catch (error) {
|
|
14608
|
-
task.logger.error(
|
|
13620
|
+
task.logger.error(`[douyinPublish] 生成 csrfToken 失败: ${error}`);
|
|
14609
13621
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 csrfToken 生成异常,请重试", "");
|
|
14610
13622
|
}
|
|
14611
13623
|
let sessionDtrait;
|
|
14612
13624
|
try {
|
|
14613
13625
|
sessionDtrait = mock_generateDtrait("/web/api/media/aweme/create_v2/");
|
|
14614
|
-
task.logger.info(`sessionDtrait 生成成功: ${sessionDtrait || "(空)"}`);
|
|
13626
|
+
task.logger.info(`[douyinPublish] sessionDtrait 生成成功: ${sessionDtrait || "(空)"}`);
|
|
14615
13627
|
} catch (error) {
|
|
14616
|
-
task.logger.error(
|
|
13628
|
+
task.logger.error(`[douyinPublish] 生成 sessionDtrait 失败: ${error}`);
|
|
14617
13629
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 sessionDtrait 生成异常,请重试", "");
|
|
14618
13630
|
}
|
|
14619
13631
|
task.logger.info(`[douyinPublish] headers: ${JSON.stringify({
|
|
@@ -14665,8 +13677,10 @@ const mock_mockAction = async (task, params)=>{
|
|
|
14665
13677
|
504
|
|
14666
13678
|
].includes(handledError.code);
|
|
14667
13679
|
if (isProxyOrNetworkError) {
|
|
14668
|
-
const
|
|
14669
|
-
|
|
13680
|
+
const isProxyRequest = handledError.extra?.isProxyRequest === true;
|
|
13681
|
+
const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
|
|
13682
|
+
const message = `图文发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
|
|
13683
|
+
task.logger.error(`[douyinPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
|
|
14670
13684
|
await updateTaskState?.({
|
|
14671
13685
|
state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
|
|
14672
13686
|
error: message
|
|
@@ -15469,7 +14483,7 @@ const rpaAction_Server = async (task, params)=>{
|
|
|
15469
14483
|
decision?.verify_title,
|
|
15470
14484
|
decision?.verify_desc
|
|
15471
14485
|
].filter(Boolean).join(" ");
|
|
15472
|
-
const message =
|
|
14486
|
+
const message = `[douyinPublish rpa-server]发布失败,需要二次验证${details ? `:${details}` : ""}`;
|
|
15473
14487
|
task.logger?.warn(message);
|
|
15474
14488
|
await updateTaskState?.({
|
|
15475
14489
|
state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
|
|
@@ -16551,18 +15565,44 @@ const XiaohongshuArticleSchema = BaseArticleSchema.extend({
|
|
|
16551
15565
|
collectNum: schemas_number(),
|
|
16552
15566
|
shareNum: schemas_number()
|
|
16553
15567
|
});
|
|
15568
|
+
const DouyinArticleSchema = BaseArticleSchema.extend({
|
|
15569
|
+
playNum: schemas_number(),
|
|
15570
|
+
likeNum: schemas_number(),
|
|
15571
|
+
commentNum: schemas_number(),
|
|
15572
|
+
shareNum: schemas_number(),
|
|
15573
|
+
collectNum: schemas_number(),
|
|
15574
|
+
awemeId: schemas_string(),
|
|
15575
|
+
awemeType: schemas_number(),
|
|
15576
|
+
duration: schemas_number().optional(),
|
|
15577
|
+
status: schemas_string(),
|
|
15578
|
+
publicUrl: schemas_string()
|
|
15579
|
+
});
|
|
15580
|
+
const ShipinhaoArticleSchema = BaseArticleSchema.extend({
|
|
15581
|
+
readNum: schemas_number(),
|
|
15582
|
+
likeNum: schemas_number(),
|
|
15583
|
+
commentNum: schemas_number(),
|
|
15584
|
+
forwardNum: schemas_number(),
|
|
15585
|
+
favNum: schemas_number(),
|
|
15586
|
+
objectId: schemas_string(),
|
|
15587
|
+
postType: schemas_string(),
|
|
15588
|
+
postStatus: schemas_number()
|
|
15589
|
+
});
|
|
16554
15590
|
const FetchArticlesDataSchema = schemas_object({
|
|
16555
15591
|
articleCell: schemas_array(union([
|
|
16556
15592
|
ToutiaoArticleSchema,
|
|
16557
15593
|
WeixinArticleSchema,
|
|
16558
15594
|
BaijiahaoArticleSchema,
|
|
16559
|
-
XiaohongshuArticleSchema
|
|
15595
|
+
XiaohongshuArticleSchema,
|
|
15596
|
+
DouyinArticleSchema,
|
|
15597
|
+
ShipinhaoArticleSchema
|
|
16560
15598
|
])).optional(),
|
|
16561
15599
|
timerPublish: schemas_array(union([
|
|
16562
15600
|
ToutiaoArticleSchema,
|
|
16563
15601
|
WeixinArticleSchema,
|
|
16564
15602
|
BaijiahaoArticleSchema,
|
|
16565
|
-
XiaohongshuArticleSchema
|
|
15603
|
+
XiaohongshuArticleSchema,
|
|
15604
|
+
DouyinArticleSchema,
|
|
15605
|
+
ShipinhaoArticleSchema
|
|
16566
15606
|
])).optional(),
|
|
16567
15607
|
pagination: schemas_object({
|
|
16568
15608
|
total: schemas_number().optional(),
|
|
@@ -16677,6 +15717,247 @@ async function handleBaijiahaoData(_task, params) {
|
|
|
16677
15717
|
return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "百家号文章数据获取失败");
|
|
16678
15718
|
}
|
|
16679
15719
|
}
|
|
15720
|
+
async function handleDouyinData(_task, params) {
|
|
15721
|
+
try {
|
|
15722
|
+
const { cookies, pageNum = 1, pageSize = 12, status = 0, showOriginalData = false, onlySuccess = false } = params;
|
|
15723
|
+
const headers = {
|
|
15724
|
+
cookie: cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
15725
|
+
referer: "https://creator.douyin.com"
|
|
15726
|
+
};
|
|
15727
|
+
const args = [
|
|
15728
|
+
{
|
|
15729
|
+
headers
|
|
15730
|
+
},
|
|
15731
|
+
_task.logger,
|
|
15732
|
+
params.proxyLoc,
|
|
15733
|
+
params.localIP,
|
|
15734
|
+
params.accountId
|
|
15735
|
+
];
|
|
15736
|
+
const http = new Http(...args);
|
|
15737
|
+
let authorUid = "";
|
|
15738
|
+
try {
|
|
15739
|
+
const userInfo = await http.api({
|
|
15740
|
+
method: "get",
|
|
15741
|
+
url: "https://creator.douyin.com/aweme/v1/creator/user/info/"
|
|
15742
|
+
}, {
|
|
15743
|
+
retries: 3,
|
|
15744
|
+
retryDelay: 100,
|
|
15745
|
+
timeout: 5000
|
|
15746
|
+
});
|
|
15747
|
+
authorUid = userInfo.user_profile?.unique_id || "";
|
|
15748
|
+
if (!userInfo.has_data_mgmt_perm) _task.logger.warn("抖音账号未开通数据中心权限,近7日数据不可用");
|
|
15749
|
+
} catch (error) {
|
|
15750
|
+
_task.logger.warn("获取抖音用户信息失败");
|
|
15751
|
+
}
|
|
15752
|
+
async function fetchWorks(cursor) {
|
|
15753
|
+
return await http.api({
|
|
15754
|
+
method: "get",
|
|
15755
|
+
url: "https://creator.douyin.com/janus/douyin/creator/pc/work_list",
|
|
15756
|
+
params: {
|
|
15757
|
+
scene: "star_atlas",
|
|
15758
|
+
device_platform: "android",
|
|
15759
|
+
aid: 1128,
|
|
15760
|
+
status,
|
|
15761
|
+
count: pageSize,
|
|
15762
|
+
max_cursor: cursor
|
|
15763
|
+
}
|
|
15764
|
+
}, {
|
|
15765
|
+
retries: 3,
|
|
15766
|
+
retryDelay: 100,
|
|
15767
|
+
timeout: 5000
|
|
15768
|
+
});
|
|
15769
|
+
}
|
|
15770
|
+
const firstPageCursor = (pageNum - 1) * pageSize;
|
|
15771
|
+
const workListResponse = await fetchWorks(firstPageCursor);
|
|
15772
|
+
if (!workListResponse || !workListResponse.aweme_list) return searchPublishInfo_types_errorResponse("抖音数据获取失败,请检查账号状态", 414);
|
|
15773
|
+
const allWorks = [
|
|
15774
|
+
...workListResponse.aweme_list
|
|
15775
|
+
];
|
|
15776
|
+
let hasMore = workListResponse.has_more;
|
|
15777
|
+
let currentCursor = workListResponse.max_cursor;
|
|
15778
|
+
while(allWorks.length < pageSize && hasMore && !onlySuccess){
|
|
15779
|
+
const nextPageResponse = await fetchWorks(currentCursor);
|
|
15780
|
+
allWorks.push(...nextPageResponse.aweme_list);
|
|
15781
|
+
hasMore = nextPageResponse.has_more;
|
|
15782
|
+
currentCursor = nextPageResponse.max_cursor;
|
|
15783
|
+
if (allWorks.length >= 2 * pageSize) break;
|
|
15784
|
+
}
|
|
15785
|
+
const finalWorks = allWorks.slice(0, pageSize);
|
|
15786
|
+
const articleCell = finalWorks.map((item)=>{
|
|
15787
|
+
const workDetailUrl = `https://creator.douyin.com/creator-micro/work-management/work-detail/${item.aweme_id}`;
|
|
15788
|
+
const workPublicUrl = authorUid ? `https://www.douyin.com/user/${authorUid}?modal_id=${item.aweme_id}` : `https://www.douyin.com/video/${item.aweme_id}`;
|
|
15789
|
+
return {
|
|
15790
|
+
title: item.desc || "无作品描述",
|
|
15791
|
+
imageUrl: item.Cover?.url_list?.[0] || "",
|
|
15792
|
+
createTime: item.create_time,
|
|
15793
|
+
redirectUrl: workDetailUrl,
|
|
15794
|
+
playNum: item.statistics?.play_count || 0,
|
|
15795
|
+
likeNum: item.statistics?.digg_count || 0,
|
|
15796
|
+
commentNum: item.statistics?.comment_count || 0,
|
|
15797
|
+
shareNum: item.statistics?.share_count || 0,
|
|
15798
|
+
collectNum: item.statistics?.collect_count || 0,
|
|
15799
|
+
awemeId: item.aweme_id,
|
|
15800
|
+
awemeType: item.aweme_type,
|
|
15801
|
+
duration: item.duration,
|
|
15802
|
+
status: item.status?.is_private ? "private" : item.status?.in_reviewing ? "reviewing" : "public",
|
|
15803
|
+
publicUrl: workPublicUrl,
|
|
15804
|
+
...showOriginalData ? {
|
|
15805
|
+
originalData: item
|
|
15806
|
+
} : {}
|
|
15807
|
+
};
|
|
15808
|
+
});
|
|
15809
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)({
|
|
15810
|
+
articleCell,
|
|
15811
|
+
...onlySuccess ? {
|
|
15812
|
+
pagination: {
|
|
15813
|
+
total: workListResponse.total || workListResponse.aweme_list.length,
|
|
15814
|
+
nextPage: workListResponse.has_more,
|
|
15815
|
+
pageNum,
|
|
15816
|
+
pageSize
|
|
15817
|
+
}
|
|
15818
|
+
} : null
|
|
15819
|
+
}, "抖音数据获取成功");
|
|
15820
|
+
} catch (error) {
|
|
15821
|
+
return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "抖音数据获取失败");
|
|
15822
|
+
}
|
|
15823
|
+
}
|
|
15824
|
+
async function handleShipinhaoData(_task, params) {
|
|
15825
|
+
try {
|
|
15826
|
+
const { cookies, postType = "all", pageNum = 1, pageSize = 20, showOriginalData = false } = params;
|
|
15827
|
+
const aidCookie = cookies.find((it)=>"_aid" === it.name)?.value;
|
|
15828
|
+
const aid = aidCookie || "9d3e0e9f-b842-498d-a273-4285d58df264";
|
|
15829
|
+
const uinCookie = cookies.find((it)=>"uin" === it.name || "wxuin" === it.name)?.value || "0000000000";
|
|
15830
|
+
const deviceIdCookie = cookies.find((it)=>"device_id" === it.name || "finger_print_device_id" === it.name)?.value;
|
|
15831
|
+
const headers = {
|
|
15832
|
+
cookie: cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
15833
|
+
referer: "https://channels.weixin.qq.com",
|
|
15834
|
+
origin: "https://channels.weixin.qq.com",
|
|
15835
|
+
"content-type": "application/json",
|
|
15836
|
+
"X-WECHAT-UIN": uinCookie,
|
|
15837
|
+
...deviceIdCookie ? {
|
|
15838
|
+
"finger-print-device-id": deviceIdCookie
|
|
15839
|
+
} : {}
|
|
15840
|
+
};
|
|
15841
|
+
const args = [
|
|
15842
|
+
{
|
|
15843
|
+
headers
|
|
15844
|
+
},
|
|
15845
|
+
_task.logger,
|
|
15846
|
+
params.proxyLoc,
|
|
15847
|
+
params.localIP,
|
|
15848
|
+
params.accountId
|
|
15849
|
+
];
|
|
15850
|
+
const http = new Http(...args);
|
|
15851
|
+
const finderIdCookie = cookies.find((it)=>"_log_finder_id" === it.name || "finder_id" === it.name)?.value || "";
|
|
15852
|
+
async function fetchPosts(currentPage, userpageType, pageUrl) {
|
|
15853
|
+
return await http.api({
|
|
15854
|
+
method: "post",
|
|
15855
|
+
url: "https://channels.weixin.qq.com/micro/content/cgi-bin/mmfinderassistant-bin/post/post_list",
|
|
15856
|
+
params: {
|
|
15857
|
+
_aid: aid,
|
|
15858
|
+
_rid: `${Date.now().toString(16)}-${Math.random().toString(36).substring(2, 9)}`,
|
|
15859
|
+
_pageUrl: encodeURIComponent(pageUrl)
|
|
15860
|
+
},
|
|
15861
|
+
data: {
|
|
15862
|
+
pageSize,
|
|
15863
|
+
currentPage,
|
|
15864
|
+
userpageType,
|
|
15865
|
+
stickyOrder: true,
|
|
15866
|
+
timestamp: Date.now().toString(),
|
|
15867
|
+
_log_finder_uin: "",
|
|
15868
|
+
_log_finder_id: finderIdCookie,
|
|
15869
|
+
rawKeyBuff: "",
|
|
15870
|
+
pluginSessionId: null,
|
|
15871
|
+
scene: 7,
|
|
15872
|
+
reqScene: 7
|
|
15873
|
+
}
|
|
15874
|
+
}, {
|
|
15875
|
+
retries: 3,
|
|
15876
|
+
retryDelay: 100,
|
|
15877
|
+
timeout: 5000
|
|
15878
|
+
});
|
|
15879
|
+
}
|
|
15880
|
+
const mapPost = (item, forcePostType)=>{
|
|
15881
|
+
let imageUrl = "";
|
|
15882
|
+
if (item.desc?.media?.[0]?.thumbUrl) imageUrl = item.desc.media[0].thumbUrl;
|
|
15883
|
+
else if (item.desc?.media?.[0]?.coverUrl) imageUrl = item.desc.media[0].coverUrl;
|
|
15884
|
+
else if (item.cover?.url) imageUrl = item.cover.url;
|
|
15885
|
+
else if (item.media_url) imageUrl = item.media_url;
|
|
15886
|
+
const title = item.desc?.description || item.object_desc || "无标题";
|
|
15887
|
+
return {
|
|
15888
|
+
title,
|
|
15889
|
+
imageUrl,
|
|
15890
|
+
createTime: item.createTime || item.create_time,
|
|
15891
|
+
redirectUrl: "https://channels.weixin.qq.com/platform",
|
|
15892
|
+
readNum: item.readCount || item.read_count || 0,
|
|
15893
|
+
likeNum: item.likeCount || item.like_count || 0,
|
|
15894
|
+
commentNum: item.commentCount || item.comment_count || 0,
|
|
15895
|
+
forwardNum: item.forwardCount || item.forward_count || 0,
|
|
15896
|
+
favNum: item.favCount || item.fav_count || 0,
|
|
15897
|
+
objectId: item.exportId || item.objectId || "",
|
|
15898
|
+
postType: forcePostType,
|
|
15899
|
+
postStatus: item.status || item.post_status || 0,
|
|
15900
|
+
...showOriginalData ? {
|
|
15901
|
+
originalData: item
|
|
15902
|
+
} : {}
|
|
15903
|
+
};
|
|
15904
|
+
};
|
|
15905
|
+
const allArticles = [];
|
|
15906
|
+
const needVideo = "all" === postType || "video" === postType;
|
|
15907
|
+
const needArticle = "all" === postType || "article" === postType;
|
|
15908
|
+
const AUTH_ERROR_CODES = [
|
|
15909
|
+
300333,
|
|
15910
|
+
300334
|
|
15911
|
+
];
|
|
15912
|
+
if (needVideo) try {
|
|
15913
|
+
const videoPageUrl = "https://channels.weixin.qq.com/micro/content/post/list";
|
|
15914
|
+
const videoResponse = await fetchPosts(pageNum, 11, videoPageUrl);
|
|
15915
|
+
if (videoResponse.errCode && AUTH_ERROR_CODES.includes(videoResponse.errCode)) throw new Error(`AUTH_ERROR:${videoResponse.errMsg || "登录已失效"}`);
|
|
15916
|
+
if (videoResponse.errCode) _task.logger.warn(`视频号API错误:${videoResponse.errMsg} (${videoResponse.errCode})`);
|
|
15917
|
+
else {
|
|
15918
|
+
const posts = videoResponse.data?.list || videoResponse.posts || videoResponse.post_list || [];
|
|
15919
|
+
const videoArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "video"));
|
|
15920
|
+
allArticles.push(...videoArticles);
|
|
15921
|
+
_task.logger.info(`视频号视频获取成功,共${videoArticles.length}条`);
|
|
15922
|
+
}
|
|
15923
|
+
} catch (error) {
|
|
15924
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
15925
|
+
if (errMsg.startsWith("AUTH_ERROR:")) throw error;
|
|
15926
|
+
_task.logger.warn(`获取视频号视频失败:${errMsg}`);
|
|
15927
|
+
}
|
|
15928
|
+
if (needArticle) try {
|
|
15929
|
+
const articlePageUrl = "https://channels.weixin.qq.com/micro/content/post/finderNewLifePostList";
|
|
15930
|
+
const articleResponse = await fetchPosts(pageNum, 10, articlePageUrl);
|
|
15931
|
+
if (articleResponse.errCode && AUTH_ERROR_CODES.includes(articleResponse.errCode)) throw new Error(`AUTH_ERROR:${articleResponse.errMsg || "登录已失效"}`);
|
|
15932
|
+
if (articleResponse.errCode) _task.logger.warn(`视频号图文API错误:${articleResponse.errMsg} (${articleResponse.errCode})`);
|
|
15933
|
+
else {
|
|
15934
|
+
const posts = articleResponse.data?.list || articleResponse.posts || articleResponse.post_list || [];
|
|
15935
|
+
const articleArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "article"));
|
|
15936
|
+
allArticles.push(...articleArticles);
|
|
15937
|
+
_task.logger.info(`视频号图文获取成功,共${articleArticles.length}条`);
|
|
15938
|
+
}
|
|
15939
|
+
} catch (error) {
|
|
15940
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
15941
|
+
if (errMsg.startsWith("AUTH_ERROR:")) throw error;
|
|
15942
|
+
_task.logger.warn(`获取视频号图文失败:${errMsg}`);
|
|
15943
|
+
}
|
|
15944
|
+
allArticles.sort((a, b)=>b.createTime - a.createTime);
|
|
15945
|
+
_task.logger.info(`视频号数据获取成功,${JSON.stringify(allArticles)}`);
|
|
15946
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)({
|
|
15947
|
+
articleCell: allArticles,
|
|
15948
|
+
pagination: {
|
|
15949
|
+
total: allArticles.length,
|
|
15950
|
+
nextPage: false,
|
|
15951
|
+
pageNum,
|
|
15952
|
+
pageSize
|
|
15953
|
+
}
|
|
15954
|
+
}, "视频号数据获取成功");
|
|
15955
|
+
} catch (error) {
|
|
15956
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
15957
|
+
if (errMsg.startsWith("AUTH_ERROR:")) return searchPublishInfo_types_errorResponse("视频号数据获取失败,请检查账号状态", 414);
|
|
15958
|
+
return searchPublishInfo_types_errorResponse(errMsg || "视频号数据获取失败");
|
|
15959
|
+
}
|
|
15960
|
+
}
|
|
16680
15961
|
async function handleToutiaoData(_task, params) {
|
|
16681
15962
|
try {
|
|
16682
15963
|
const { cookies, pageNum = 1, pageSize = 10, showOriginalData = false, onlySuccess = false, containsArticle = false } = params;
|
|
@@ -16709,7 +15990,7 @@ async function handleToutiaoData(_task, params) {
|
|
|
16709
15990
|
app_id: 1231
|
|
16710
15991
|
}
|
|
16711
15992
|
});
|
|
16712
|
-
if (0 !== visitedUid.code) return searchPublishInfo_types_errorResponse("
|
|
15993
|
+
if (0 !== visitedUid.code) return searchPublishInfo_types_errorResponse("头条号数据获取失败,请检查账号状态", 414);
|
|
16713
15994
|
const articleInfo = await http.api({
|
|
16714
15995
|
method: "get",
|
|
16715
15996
|
url: "https://mp.toutiao.com/api/feed/mp_provider/v1/",
|
|
@@ -16816,7 +16097,7 @@ async function handleWeixinData(_task, params) {
|
|
|
16816
16097
|
const size = onlySuccess ? 10 : pageSize > 20 ? 20 : pageSize;
|
|
16817
16098
|
let begin = (lastPage ?? pageNum) - 1;
|
|
16818
16099
|
const rawArticlesInfo = await fetchArticles(begin * size, size, token);
|
|
16819
|
-
if (rawArticlesInfo.includes("请重新<a id='jumpUrl' href='/'>登录</a>")) return searchPublishInfo_types_errorResponse("
|
|
16100
|
+
if (rawArticlesInfo.includes("请重新<a id='jumpUrl' href='/'>登录</a>")) return searchPublishInfo_types_errorResponse("微信公众号数据获取失败,请检查账号状态", 414);
|
|
16820
16101
|
const articlesInfo = ParsePublishPage(rawArticlesInfo);
|
|
16821
16102
|
let articleCell = [];
|
|
16822
16103
|
if (!onlySuccess && pageSize > 20) {
|
|
@@ -16978,7 +16259,7 @@ async function handleXiaohongshuData(_task, params) {
|
|
|
16978
16259
|
const a1Cookie = cookies.find((it)=>"a1" === it.name)?.value;
|
|
16979
16260
|
if (!a1Cookie) return {
|
|
16980
16261
|
code: 414,
|
|
16981
|
-
message: "
|
|
16262
|
+
message: "小红书数据获取失败,请检查账号状态",
|
|
16982
16263
|
data: {}
|
|
16983
16264
|
};
|
|
16984
16265
|
if (onlySuccess && 10 !== pageSize) return {
|
|
@@ -17097,7 +16378,7 @@ async function handleXiaohongshuData(_task, params) {
|
|
|
17097
16378
|
}, "小红书文章数据获取成功");
|
|
17098
16379
|
}
|
|
17099
16380
|
const FetchArticlesParamsSchema = ActionCommonParamsSchema.extend({
|
|
17100
|
-
platform: schemas_string().describe("社交平台:weixin, toutiao, baijiahao, xiaohongshu"),
|
|
16381
|
+
platform: schemas_string().describe("社交平台:weixin, toutiao, baijiahao, xiaohongshu, douyin, shipinhao"),
|
|
17101
16382
|
token: union([
|
|
17102
16383
|
schemas_string(),
|
|
17103
16384
|
schemas_number()
|
|
@@ -17109,7 +16390,14 @@ const FetchArticlesParamsSchema = ActionCommonParamsSchema.extend({
|
|
|
17109
16390
|
showOriginalData: schemas_boolean().optional().describe("是否展示原始数据,默认false"),
|
|
17110
16391
|
cursor: schemas_number().optional().describe("仅用于微信分页游标,默认为空"),
|
|
17111
16392
|
lastPage: schemas_number().optional(),
|
|
17112
|
-
containsArticle: schemas_boolean().optional().describe("是否包含文章内容,默认false")
|
|
16393
|
+
containsArticle: schemas_boolean().optional().describe("是否包含文章内容,默认false"),
|
|
16394
|
+
status: schemas_number().optional().describe("抖音作品状态:0=全部"),
|
|
16395
|
+
includeAccount: schemas_boolean().optional().describe("是否包含账号数据,默认true"),
|
|
16396
|
+
postType: schemas_enum([
|
|
16397
|
+
"video",
|
|
16398
|
+
"article",
|
|
16399
|
+
"all"
|
|
16400
|
+
]).optional().describe("视频号作品类型:video=视频, article=图文, all=全部")
|
|
17113
16401
|
});
|
|
17114
16402
|
const FetchArticles = async (_task, params)=>{
|
|
17115
16403
|
const { platform } = params;
|
|
@@ -17122,6 +16410,10 @@ const FetchArticles = async (_task, params)=>{
|
|
|
17122
16410
|
return handleBaijiahaoData(_task, params);
|
|
17123
16411
|
case "xiaohongshu":
|
|
17124
16412
|
return handleXiaohongshuData(_task, params);
|
|
16413
|
+
case "douyin":
|
|
16414
|
+
return handleDouyinData(_task, params);
|
|
16415
|
+
case "shipinhao":
|
|
16416
|
+
return handleShipinhaoData(_task, params);
|
|
17125
16417
|
default:
|
|
17126
16418
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)({}, "暂不支持该平台");
|
|
17127
16419
|
}
|
|
@@ -19030,7 +18322,7 @@ async function publishDynamic(cookies, uin, fingerPrintDeviceId, aId, proxyHttp,
|
|
|
19030
18322
|
return apiResponse;
|
|
19031
18323
|
}
|
|
19032
18324
|
const shipinhaoPublish_mock_mockAction = async (task, params)=>{
|
|
19033
|
-
task.logger.info("开始执行视频号发布 - Mock API 方式");
|
|
18325
|
+
task.logger.info("[shipinhaoPublish] 开始执行视频号发布 - Mock API 方式");
|
|
19034
18326
|
const updateTaskState = task.taskStageStore?.update?.bind(task.taskStageStore, task.taskId || "");
|
|
19035
18327
|
if (!params.extraParam.fingerPrintDeviceId || !params.extraParam.aId) return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(400, "fingerPrintDeviceId和aId 不能为空", "");
|
|
19036
18328
|
try {
|
|
@@ -19047,7 +18339,8 @@ const shipinhaoPublish_mock_mockAction = async (task, params)=>{
|
|
|
19047
18339
|
task.logger,
|
|
19048
18340
|
params.proxyLoc,
|
|
19049
18341
|
params.localIP,
|
|
19050
|
-
params.accountId
|
|
18342
|
+
params.accountId,
|
|
18343
|
+
"shipinhao"
|
|
19051
18344
|
];
|
|
19052
18345
|
const http = new Http({
|
|
19053
18346
|
headers
|
|
@@ -19055,7 +18348,7 @@ const shipinhaoPublish_mock_mockAction = async (task, params)=>{
|
|
|
19055
18348
|
const proxyHttp = new Http(...args);
|
|
19056
18349
|
if (!params.banners || 0 === params.banners.length) return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(400, "至少需要一张图片", "");
|
|
19057
18350
|
const images = params.banners.slice(0, 18).filter((img)=>"string" == typeof img);
|
|
19058
|
-
task.logger.info("获取用户信息...");
|
|
18351
|
+
task.logger.info("[shipinhaoPublish] 获取用户信息...");
|
|
19059
18352
|
console.log("cookieString", cookieString);
|
|
19060
18353
|
const userInfo = await mock_getUserInfo(cookieString, http);
|
|
19061
18354
|
console.log(JSON.stringify(userInfo));
|
|
@@ -19065,17 +18358,17 @@ const shipinhaoPublish_mock_mockAction = async (task, params)=>{
|
|
|
19065
18358
|
}
|
|
19066
18359
|
const finderUsername = userInfo.data.finderUser.finderUsername;
|
|
19067
18360
|
console.log(finderUsername);
|
|
19068
|
-
task.logger.info("获取上传认证密钥...");
|
|
18361
|
+
task.logger.info("[shipinhaoPublish] 获取上传认证密钥...");
|
|
19069
18362
|
const authKeyResponse = await getUploadAuthKey(cookieString, finderUsername, http);
|
|
19070
18363
|
if (0 !== authKeyResponse.errCode || !authKeyResponse.data?.authKey) return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(authKeyResponse.errCode || 500, `获取上传认证参数失败: ${authKeyResponse.errMsg}`, "");
|
|
19071
18364
|
const authKey = authKeyResponse.data.authKey;
|
|
19072
18365
|
const uin = authKeyResponse.data.uin;
|
|
19073
18366
|
if (!uin) return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(500, "获取用户 uin 失败", "");
|
|
19074
18367
|
const taskId = String(generateUUID());
|
|
19075
|
-
task.logger.info(
|
|
18368
|
+
task.logger.info(`[shipinhaoPublish] 开始上传 ${images.length} 张图片...`);
|
|
19076
18369
|
const uploadedImages = [];
|
|
19077
18370
|
for(let i = 0; i < images.length; i++){
|
|
19078
|
-
task.logger.info(
|
|
18371
|
+
task.logger.info(`[shipinhaoPublish] 上传图片 ${i + 1}/${images.length}...`);
|
|
19079
18372
|
const uploadResult = await uploadImageComplete(images[i], taskId, finderUsername, uin, authKey, http);
|
|
19080
18373
|
console.log(JSON.stringify(uploadResult));
|
|
19081
18374
|
if (!uploadResult.DownloadURL) return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(500, `图片上传失败: ${uploadResult.errMsg}`, "");
|
|
@@ -19092,7 +18385,7 @@ const shipinhaoPublish_mock_mockAction = async (task, params)=>{
|
|
|
19092
18385
|
urlCdnTaskId: ""
|
|
19093
18386
|
});
|
|
19094
18387
|
}
|
|
19095
|
-
task.logger.info("正在发布...");
|
|
18388
|
+
task.logger.info("[shipinhaoPublish] 正在发布...");
|
|
19096
18389
|
const topicNames = params.topic || void 0;
|
|
19097
18390
|
const addressInfo = params.address ? {
|
|
19098
18391
|
name: params.address.name,
|
|
@@ -19136,8 +18429,10 @@ const shipinhaoPublish_mock_mockAction = async (task, params)=>{
|
|
|
19136
18429
|
504
|
|
19137
18430
|
].includes(handledError.code);
|
|
19138
18431
|
if (isProxyOrNetworkError) {
|
|
19139
|
-
const
|
|
19140
|
-
|
|
18432
|
+
const isProxyRequest = handledError.extra?.isProxyRequest === true;
|
|
18433
|
+
const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
|
|
18434
|
+
const message = `图文发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
|
|
18435
|
+
task.logger.error(`[shipinhaoPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
|
|
19141
18436
|
await updateTaskState?.({
|
|
19142
18437
|
state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
|
|
19143
18438
|
error: message
|
|
@@ -19154,7 +18449,7 @@ const shipinhaoPublish_mock_mockAction = async (task, params)=>{
|
|
|
19154
18449
|
const resultCode = publishResult.data?.baseResp?.errcode ?? publishResult.errCode;
|
|
19155
18450
|
const resultMsg = publishResult.data?.baseResp?.errmsg ?? publishResult.errMsg;
|
|
19156
18451
|
if (0 === resultCode) {
|
|
19157
|
-
task.logger.info("发布成功");
|
|
18452
|
+
task.logger.info("[shipinhaoPublish] 发布成功");
|
|
19158
18453
|
const publishId = uploadedImages[0]?.thumbUrl?.split("encfilekey=")[1]?.split("&")[0] || "";
|
|
19159
18454
|
await updateTaskState?.({
|
|
19160
18455
|
state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.SUCCESS,
|
|
@@ -19169,7 +18464,7 @@ const shipinhaoPublish_mock_mockAction = async (task, params)=>{
|
|
|
19169
18464
|
else if (300333 === resultCode || 300334 === resultCode) errorMessage = "登录失效";
|
|
19170
18465
|
else if (300330 === resultCode) errorMessage = "未登录";
|
|
19171
18466
|
else if (300002 === resultCode) errorMessage = "官方平台在校验音乐/位置/定时信息时失败了,请重新编辑后发布";
|
|
19172
|
-
task.logger.error(
|
|
18467
|
+
task.logger.error(`[shipinhaoPublish] 发布失败: ${errorMessage}`);
|
|
19173
18468
|
await updateTaskState?.({
|
|
19174
18469
|
state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
|
|
19175
18470
|
error: errorMessage
|
|
@@ -19177,7 +18472,7 @@ const shipinhaoPublish_mock_mockAction = async (task, params)=>{
|
|
|
19177
18472
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(resultCode || 500, errorMessage, "");
|
|
19178
18473
|
} catch (error) {
|
|
19179
18474
|
const errorMsg = error instanceof Error ? error.message : "发布失败";
|
|
19180
|
-
task.logger.error(
|
|
18475
|
+
task.logger.error(`[shipinhaoPublish] 发布异常: ${errorMsg}`);
|
|
19181
18476
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(500, errorMsg, "");
|
|
19182
18477
|
}
|
|
19183
18478
|
};
|
|
@@ -20409,7 +19704,8 @@ const toutiaoPublish_mock_mockAction = async (task, params)=>{
|
|
|
20409
19704
|
task.logger,
|
|
20410
19705
|
params.proxyLoc,
|
|
20411
19706
|
params.localIP,
|
|
20412
|
-
params.accountId
|
|
19707
|
+
params.accountId,
|
|
19708
|
+
"toutiao"
|
|
20413
19709
|
];
|
|
20414
19710
|
const http = new Http({
|
|
20415
19711
|
headers
|
|
@@ -21742,7 +21038,8 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
21742
21038
|
task.logger,
|
|
21743
21039
|
params.proxyLoc,
|
|
21744
21040
|
params.localIP,
|
|
21745
|
-
params.accountId
|
|
21041
|
+
params.accountId,
|
|
21042
|
+
"weixin"
|
|
21746
21043
|
];
|
|
21747
21044
|
const http = new Http({
|
|
21748
21045
|
headers
|
|
@@ -22498,8 +21795,10 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
22498
21795
|
504
|
|
22499
21796
|
].includes(handledError.code);
|
|
22500
21797
|
if (isProxyOrNetworkError) {
|
|
22501
|
-
const
|
|
22502
|
-
|
|
21798
|
+
const isProxyRequest = handledError.extra?.isProxyRequest === true;
|
|
21799
|
+
const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
|
|
21800
|
+
const message = `文章发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
|
|
21801
|
+
task.logger.error(`[weixinPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
|
|
22503
21802
|
await updateTaskState?.({
|
|
22504
21803
|
state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
|
|
22505
21804
|
error: message
|
|
@@ -23649,7 +22948,8 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
23649
22948
|
task.logger,
|
|
23650
22949
|
params.proxyLoc,
|
|
23651
22950
|
params.localIP,
|
|
23652
|
-
params.accountId
|
|
22951
|
+
params.accountId,
|
|
22952
|
+
"xiaohongshu"
|
|
23653
22953
|
];
|
|
23654
22954
|
const http = new Http({
|
|
23655
22955
|
headers
|
|
@@ -23992,8 +23292,10 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
23992
23292
|
504
|
|
23993
23293
|
].includes(handledError.code);
|
|
23994
23294
|
if (isProxyOrNetworkError) {
|
|
23995
|
-
const
|
|
23996
|
-
|
|
23295
|
+
const isProxyRequest = handledError.extra?.isProxyRequest === true;
|
|
23296
|
+
const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
|
|
23297
|
+
const message = `文章发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
|
|
23298
|
+
task.logger.error(`[xiaohongshuPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
|
|
23997
23299
|
await updateTaskState?.({
|
|
23998
23300
|
state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
|
|
23999
23301
|
error: message
|
|
@@ -24712,7 +24014,8 @@ const rpaAction_Server_Mock = async (task, params)=>{
|
|
|
24712
24014
|
task.logger,
|
|
24713
24015
|
params.proxyLoc,
|
|
24714
24016
|
params.localIP,
|
|
24715
|
-
params.accountId
|
|
24017
|
+
params.accountId,
|
|
24018
|
+
"xiaohongshu-rpa"
|
|
24716
24019
|
];
|
|
24717
24020
|
const http = new Http({
|
|
24718
24021
|
headers
|