@iflyrpa/actions 1.2.24-beta.9 → 1.2.25-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/baijiahaoPublish/index.d.ts +6 -0
- package/dist/actions/baijiahaoPublish/utils.d.ts +10 -0
- package/dist/actions/getWeixinCollection/index.d.ts +32 -0
- package/dist/actions/getXhsCollection/index.d.ts +31 -0
- package/dist/actions/getXhsGroup/index.d.ts +19 -0
- package/dist/actions/getXhsHotTopic/index.d.ts +35 -0
- package/dist/actions/searchBjhTopicList/index.d.ts +12 -0
- package/dist/actions/weixinPublish/index.d.ts +3 -0
- package/dist/actions/weixinPublish/utils.d.ts +6 -0
- package/dist/actions/xiaohongshuPublish/index.d.ts +7 -1
- package/dist/bundle.js +488 -47
- package/dist/bundle.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.js +419 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +418 -33
- package/dist/index.mjs.map +1 -1
- package/dist/utils/http.d.ts +5 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -16,8 +16,8 @@ import * as __WEBPACK_EXTERNAL_MODULE_mime_types_eebf54a5__ from "mime-types";
|
|
|
16
16
|
import * as __WEBPACK_EXTERNAL_MODULE_axios__ from "axios";
|
|
17
17
|
import * as __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__ from "@iflyrpa/share";
|
|
18
18
|
import * as __WEBPACK_EXTERNAL_MODULE_form_data_cf000082__ from "form-data";
|
|
19
|
-
import * as __WEBPACK_EXTERNAL_MODULE_node_buffer_fb286294__ from "node:buffer";
|
|
20
19
|
import * as __WEBPACK_EXTERNAL_MODULE_node_crypto_9ba42079__ from "node:crypto";
|
|
20
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_buffer_fb286294__ from "node:buffer";
|
|
21
21
|
var __webpack_modules__ = {
|
|
22
22
|
"../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
23
23
|
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
@@ -2929,27 +2929,60 @@ class Http {
|
|
|
2929
2929
|
errorResponse.data = serverError;
|
|
2930
2930
|
}
|
|
2931
2931
|
}
|
|
2932
|
+
if (error.code) switch(error.code){
|
|
2933
|
+
case "ECONNRESET":
|
|
2934
|
+
errorResponse.message = "连接被重置,请检查网络或稍后重试!";
|
|
2935
|
+
break;
|
|
2936
|
+
case "ENOTFOUND":
|
|
2937
|
+
errorResponse.message = "域名解析失败,请检查 URL 是否正确!";
|
|
2938
|
+
break;
|
|
2939
|
+
case "ETIMEDOUT":
|
|
2940
|
+
errorResponse.message = "网络请求超时,请检查网络连接!";
|
|
2941
|
+
break;
|
|
2942
|
+
case "ECONNREFUSED":
|
|
2943
|
+
errorResponse.message = "服务器拒绝连接,请稍后重试!";
|
|
2944
|
+
break;
|
|
2945
|
+
case "EAI_AGAIN":
|
|
2946
|
+
errorResponse.message = "DNS 查询超时,请稍后重试!";
|
|
2947
|
+
break;
|
|
2948
|
+
default:
|
|
2949
|
+
errorResponse.message = `网络错误: ${error.message}`;
|
|
2950
|
+
break;
|
|
2951
|
+
}
|
|
2932
2952
|
return Promise.reject(errorResponse);
|
|
2933
2953
|
});
|
|
2934
2954
|
}
|
|
2935
|
-
async api(config) {
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2955
|
+
async api(config, options) {
|
|
2956
|
+
const retries = options?.retries ?? 0;
|
|
2957
|
+
const retryDelay = options?.retryDelay ?? 500;
|
|
2958
|
+
const sessionRt = async (Rtimes)=>{
|
|
2959
|
+
try {
|
|
2960
|
+
const agent = this.adr ? await ProxyAgent(this.adr, this.heiwenToken) : void 0;
|
|
2961
|
+
if (this.adr && null == agent) return Promise.reject({
|
|
2962
|
+
code: 200,
|
|
2963
|
+
message: "当前发文IP地址暂不支持!"
|
|
2964
|
+
});
|
|
2965
|
+
this.proxyInfo = agent?.proxy.host;
|
|
2966
|
+
const response = await this.apiClient({
|
|
2967
|
+
...config,
|
|
2968
|
+
...agent ? {
|
|
2969
|
+
httpAgent: agent,
|
|
2970
|
+
httpsAgent: agent
|
|
2971
|
+
} : {}
|
|
2972
|
+
});
|
|
2973
|
+
return response.data;
|
|
2974
|
+
} catch (error) {
|
|
2975
|
+
const handledError = Http.handleApiError(error);
|
|
2976
|
+
const isRetry = handledError.code >= 500 || 0 === handledError.code;
|
|
2977
|
+
if (Rtimes < retries && isRetry) {
|
|
2978
|
+
console.log("Loger: 进入重试!");
|
|
2979
|
+
await new Promise((resolve)=>setTimeout(resolve, retryDelay));
|
|
2980
|
+
return sessionRt(Rtimes + 1);
|
|
2981
|
+
}
|
|
2982
|
+
return Promise.reject(handledError);
|
|
2983
|
+
}
|
|
2984
|
+
};
|
|
2985
|
+
return sessionRt(0);
|
|
2953
2986
|
}
|
|
2954
2987
|
}
|
|
2955
2988
|
function getRandomInRange(min, max) {
|
|
@@ -3153,6 +3186,69 @@ const parseUrlQueryString = (url)=>{
|
|
|
3153
3186
|
return queryStringObject;
|
|
3154
3187
|
};
|
|
3155
3188
|
const defaultParams = (params, defaults)=>Object.assign({}, defaults, params);
|
|
3189
|
+
const generateTopicHtml = function(topic, id, sv_small_images) {
|
|
3190
|
+
const generateUid = function() {
|
|
3191
|
+
const e = ()=>Math.floor(65536 * (1 + Math.random())).toString(16).substring(1);
|
|
3192
|
+
return e() + e() + e() + e() + e() + e() + e() + e();
|
|
3193
|
+
};
|
|
3194
|
+
const topicBase = function(topic, id, sv_small_images) {
|
|
3195
|
+
const t = function(r) {
|
|
3196
|
+
let n = [];
|
|
3197
|
+
let e = 0;
|
|
3198
|
+
for(; e < 256; ++e)n[e] = (e + 256).toString(16).substr(1);
|
|
3199
|
+
let o = 0;
|
|
3200
|
+
return [
|
|
3201
|
+
n[r[o++]],
|
|
3202
|
+
n[r[o++]],
|
|
3203
|
+
n[r[o++]],
|
|
3204
|
+
n[r[o++]],
|
|
3205
|
+
"-",
|
|
3206
|
+
n[r[o++]],
|
|
3207
|
+
n[r[o++]],
|
|
3208
|
+
"-",
|
|
3209
|
+
n[r[o++]],
|
|
3210
|
+
n[r[o++]],
|
|
3211
|
+
"-",
|
|
3212
|
+
n[r[o++]],
|
|
3213
|
+
n[r[o++]],
|
|
3214
|
+
"-",
|
|
3215
|
+
n[r[o++]],
|
|
3216
|
+
n[r[o++]],
|
|
3217
|
+
n[r[o++]],
|
|
3218
|
+
n[r[o++]],
|
|
3219
|
+
n[r[o++]],
|
|
3220
|
+
n[r[o++]]
|
|
3221
|
+
].join("");
|
|
3222
|
+
};
|
|
3223
|
+
const s = __WEBPACK_EXTERNAL_MODULE_node_crypto_9ba42079__["default"].randomBytes(16);
|
|
3224
|
+
s[6] = 15 & s[6] | 64, s[8] = 63 & s[8] | 128;
|
|
3225
|
+
return {
|
|
3226
|
+
id: id || t(s),
|
|
3227
|
+
sv_small_images: sv_small_images || "",
|
|
3228
|
+
title: topic.replace(/[^\u4E00-\u9FA5a-zA-Z0-9]/g, ""),
|
|
3229
|
+
isCreate: 1
|
|
3230
|
+
};
|
|
3231
|
+
};
|
|
3232
|
+
const n = id ? topicBase(topic, id, sv_small_images) : topicBase(topic);
|
|
3233
|
+
const topicAttr = {
|
|
3234
|
+
style: "border:none;display:inline-block;color:#3E5599;text-decoration:none;font-style:normal;",
|
|
3235
|
+
href: `https://m.baidu.com/s?word=%23${n.title}%23&topic_id=${n.id}&sa=edit&sfrom=1023524a&append=1&newwindow=0&upqrade=1`.replace(/&/g, "&"),
|
|
3236
|
+
target: "_blank",
|
|
3237
|
+
"data-bjh-cover": "".concat(n.sv_small_images && (n.sv_small_images.https || n.sv_small_images.http)),
|
|
3238
|
+
"data-bjh-src": `https://m.baidu.com/s?word=%23${n.title}%23&topic_id=${n.id}&sa=edit&sfrom=1023524a&append=1&newwindow=0&upqrade=1`.replace(/&/g, "&"),
|
|
3239
|
+
"data-bjh-box": "topic",
|
|
3240
|
+
"data-bjh-title": n.title,
|
|
3241
|
+
"data-bjh-id": id || n.id,
|
|
3242
|
+
"data-bjh-type": "topic",
|
|
3243
|
+
contenteditable: "false",
|
|
3244
|
+
"data-ignore-remove-style": "1",
|
|
3245
|
+
"data-bjh-create": id ? "0" : "1",
|
|
3246
|
+
"data-bjh-adinspiration": "0",
|
|
3247
|
+
"data-diagnose-id": generateUid()
|
|
3248
|
+
};
|
|
3249
|
+
const attrStr = Object.entries(topicAttr).map(([key, val])=>`${key}="${val}"`).join(" ");
|
|
3250
|
+
return `<p><span data-diagnose-id=${generateUid()}></span><a ${attrStr}>#${n.title}#</a></p>`;
|
|
3251
|
+
};
|
|
3156
3252
|
const errnoMap = {
|
|
3157
3253
|
20040706: "正文图片和封面图片推荐jpg、png格式。",
|
|
3158
3254
|
20040084: "正文图片和封面图片推荐jpg、png格式。",
|
|
@@ -3168,7 +3264,8 @@ const errnoMap = {
|
|
|
3168
3264
|
20040124: "服务器异常,请稍后重试!",
|
|
3169
3265
|
20040001: "当前用户未登录,请登陆后重试!",
|
|
3170
3266
|
401100025: "该应用不支持此媒资类型",
|
|
3171
|
-
401100033: "图片宽高不满足要求"
|
|
3267
|
+
401100033: "图片宽高不满足要求",
|
|
3268
|
+
'-6': "文章分类信息错误"
|
|
3172
3269
|
};
|
|
3173
3270
|
const mockAction = async (task, params)=>{
|
|
3174
3271
|
const { baijiahaoSingleCover, baijiahaoMultCover, baijiahaoCoverType } = params.settingInfo;
|
|
@@ -3230,7 +3327,21 @@ const mockAction = async (task, params)=>{
|
|
|
3230
3327
|
};
|
|
3231
3328
|
const originContentImages = extractImgTag(params.content);
|
|
3232
3329
|
const targetContentImages = await uploadImages(originContentImages);
|
|
3233
|
-
|
|
3330
|
+
if (params.settingInfo.baijiahaoTopic && !params.settingInfo.baijiahaoTopic?.id) {
|
|
3331
|
+
let topicCheck = await http.api({
|
|
3332
|
+
method: "get",
|
|
3333
|
+
url: "https://baijiahao.baidu.com/pcui/topic/topiccheck",
|
|
3334
|
+
params: {
|
|
3335
|
+
topicName: params.settingInfo.baijiahaoTopic?.title
|
|
3336
|
+
}
|
|
3337
|
+
});
|
|
3338
|
+
if (0 != topicCheck.errno) return {
|
|
3339
|
+
code: 200,
|
|
3340
|
+
message: topicCheck.errmsg,
|
|
3341
|
+
data: ''
|
|
3342
|
+
};
|
|
3343
|
+
}
|
|
3344
|
+
const content = replaceImgSrc(params.settingInfo?.baijiahaoTopic && params.settingInfo.baijiahaoTopic?.title ? params.content + generateTopicHtml(params.settingInfo?.baijiahaoTopic?.title, params.settingInfo?.baijiahaoTopic?.id || "", params.settingInfo.baijiahaoTopic?.sv_small_images || "") : params.content, (dom)=>{
|
|
3234
3345
|
if (dom.attribs.src) {
|
|
3235
3346
|
const idx = originContentImages.findIndex((it)=>it === dom.attribs.src);
|
|
3236
3347
|
dom.attribs.src = targetContentImages[idx].bos_url;
|
|
@@ -3290,6 +3401,14 @@ const mockAction = async (task, params)=>{
|
|
|
3290
3401
|
activity_list,
|
|
3291
3402
|
...params.settingInfo.timer ? {
|
|
3292
3403
|
timer_time: params.settingInfo.timer
|
|
3404
|
+
} : {},
|
|
3405
|
+
...params.settingInfo.baijiahaoCms ? {
|
|
3406
|
+
'cate_user_cms[0]': params.settingInfo.baijiahaoCms[0],
|
|
3407
|
+
'cate_user_cms[1]': params.settingInfo.baijiahaoCms[1]
|
|
3408
|
+
} : {},
|
|
3409
|
+
...params.settingInfo.baijiahaoEventSpec ? {
|
|
3410
|
+
'event_spec[time]': params.settingInfo.baijiahaoEventSpec.time,
|
|
3411
|
+
'event_spec[pos]': params.settingInfo.baijiahaoEventSpec.pos
|
|
3293
3412
|
} : {}
|
|
3294
3413
|
};
|
|
3295
3414
|
const isDraft = "draft" === params.saveType;
|
|
@@ -3308,8 +3427,11 @@ const mockAction = async (task, params)=>{
|
|
|
3308
3427
|
referer: "https://baijiahao.baidu.com/builder/rc/edit?type=news"
|
|
3309
3428
|
},
|
|
3310
3429
|
defaultErrorMsg: isDraft ? "文章同步出现异常,请稍后重试。" : "文章发布出现异常,请稍后重试。"
|
|
3430
|
+
}, {
|
|
3431
|
+
retries: 2,
|
|
3432
|
+
retryDelay: 500
|
|
3311
3433
|
});
|
|
3312
|
-
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(0 == res.errno ? res?.ret?.article_id || '' : "", 0 == res.errno ? `文章发布成功!` : res.errmsg ?? '文章发布失败,请稍后重试。');
|
|
3434
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(0 == res.errno ? res?.ret?.article_id || '' : "", 0 == res.errno ? `文章发布成功!` + (proxyHttp.proxyInfo || "") : res.errmsg ?? '文章发布失败,请稍后重试。');
|
|
3313
3435
|
};
|
|
3314
3436
|
const rpaAction = async (task, params)=>{
|
|
3315
3437
|
const tmpCachePath = task.getTmpPath();
|
|
@@ -4345,8 +4467,11 @@ const mock_mockAction = async (task, params)=>{
|
|
|
4345
4467
|
const proxyHttp = task?.isBeta ?? false ? new Http({
|
|
4346
4468
|
headers
|
|
4347
4469
|
}, params.proxyLoc, params.huiwenToken) : http;
|
|
4348
|
-
const publishResult = await proxyHttp.api(publishOption
|
|
4349
|
-
|
|
4470
|
+
const publishResult = await proxyHttp.api(publishOption, {
|
|
4471
|
+
retries: 2,
|
|
4472
|
+
retryDelay: 500
|
|
4473
|
+
});
|
|
4474
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(publishResult.data.pgc_id, `文章发布成功!` + (proxyHttp.proxyInfo || ""));
|
|
4350
4475
|
};
|
|
4351
4476
|
const rpa_GenAB = __webpack_require__("./src/utils/ttABEncrypt.js");
|
|
4352
4477
|
const rpa_rpaAction = async (task, params)=>{
|
|
@@ -5015,6 +5140,24 @@ const SearchAccountInfo = async (_task, params)=>{
|
|
|
5015
5140
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(null, "暂不支持该平台");
|
|
5016
5141
|
}
|
|
5017
5142
|
};
|
|
5143
|
+
const searchBjhTopicList = async (_task, params)=>{
|
|
5144
|
+
const cookies = params.cookies ?? [];
|
|
5145
|
+
const http = new Http({
|
|
5146
|
+
headers: {
|
|
5147
|
+
cookie: cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
5148
|
+
token: params.token
|
|
5149
|
+
}
|
|
5150
|
+
});
|
|
5151
|
+
const res = await http.api({
|
|
5152
|
+
method: "get",
|
|
5153
|
+
url: "https://baijiahao.baidu.com/pcui/pcpublisher/searchtopic",
|
|
5154
|
+
params: {
|
|
5155
|
+
content: params.topicContent,
|
|
5156
|
+
resource_type: 1
|
|
5157
|
+
}
|
|
5158
|
+
});
|
|
5159
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(res?.data?.hot ?? [], "百家号" + (0 == res.errno ? "话题获取成功!" : "话题获取失败"));
|
|
5160
|
+
};
|
|
5018
5161
|
const searchPublishInfo_types_errorResponse = (message, code = 500)=>({
|
|
5019
5162
|
code,
|
|
5020
5163
|
message,
|
|
@@ -5453,6 +5596,51 @@ const getWeixinConfig = async (_task, params)=>{
|
|
|
5453
5596
|
};
|
|
5454
5597
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(filtered, 0 === res.base_resp.ret ? "微信配置信息获取成功!" : "微信配置信息获取失败!");
|
|
5455
5598
|
};
|
|
5599
|
+
const getWeixinCollection = async (_task, params)=>{
|
|
5600
|
+
const http = new Http({
|
|
5601
|
+
headers: {
|
|
5602
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";")
|
|
5603
|
+
}
|
|
5604
|
+
});
|
|
5605
|
+
const fingerprint = "4695500bc93ab4ce8fb2692da6564e04";
|
|
5606
|
+
const res = await http.api({
|
|
5607
|
+
method: "get",
|
|
5608
|
+
url: "https://mp.weixin.qq.com/cgi-bin/appmsgalbummgr",
|
|
5609
|
+
params: {
|
|
5610
|
+
action: 'list',
|
|
5611
|
+
begin: 0,
|
|
5612
|
+
count: 100,
|
|
5613
|
+
sub_title: '',
|
|
5614
|
+
type: 0,
|
|
5615
|
+
latest: 1,
|
|
5616
|
+
need_pay: 0,
|
|
5617
|
+
fingerprint,
|
|
5618
|
+
token: params.token,
|
|
5619
|
+
lang: 'zh_CN',
|
|
5620
|
+
f: 'json',
|
|
5621
|
+
ajax: 1
|
|
5622
|
+
}
|
|
5623
|
+
});
|
|
5624
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(res.list_resp.items, 0 === res.base_resp.ret ? "微信合计信息获取成功!" : "微信合集信息获取失败!");
|
|
5625
|
+
};
|
|
5626
|
+
const getXhsCollection = async (_task, params)=>{
|
|
5627
|
+
const http = new Http({
|
|
5628
|
+
headers: {
|
|
5629
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
5630
|
+
referer: "https://creator.xiaohongshu.com",
|
|
5631
|
+
origin: "https://creator.xiaohongshu.com"
|
|
5632
|
+
}
|
|
5633
|
+
});
|
|
5634
|
+
try {
|
|
5635
|
+
const res = await http.api({
|
|
5636
|
+
method: "get",
|
|
5637
|
+
url: "https://creator.xiaohongshu.com/api/galaxy/user/my-info"
|
|
5638
|
+
});
|
|
5639
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(0 === res.result ? res.data.collections : [], "合集信息获取" + (0 === res.result ? "成功!" : `失败!`));
|
|
5640
|
+
} catch (error) {
|
|
5641
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)([]);
|
|
5642
|
+
}
|
|
5643
|
+
};
|
|
5456
5644
|
const weitoutiaoPublish_mock_mockAction = async (task, params)=>{
|
|
5457
5645
|
const tmpCachePath = task.getTmpPath();
|
|
5458
5646
|
const http = new Http({
|
|
@@ -5599,6 +5787,16 @@ const QuotaType = {
|
|
|
5599
5787
|
Normal: "kQuotaTypeMassSendNormal",
|
|
5600
5788
|
ProductActivity: "kQuotaTypeMassSendProductActivity"
|
|
5601
5789
|
};
|
|
5790
|
+
function genTopicHTML(topics) {
|
|
5791
|
+
if (!topics || 0 === topics.length) return "";
|
|
5792
|
+
const rn = ()=>{
|
|
5793
|
+
const O = Date.now().toString(36);
|
|
5794
|
+
const B = Math.random().toString(36).substring(2, 8);
|
|
5795
|
+
return `${O}-${B}`;
|
|
5796
|
+
};
|
|
5797
|
+
const aTags = topics.map((topic)=>`<a class="wx_topic_link" topic-id="${rn()}" style="color: #576B95 !important;" data-topic="1">#${topic}</a>`).join(" ");
|
|
5798
|
+
return `<p style="line-height: 1.75;margin: 0px 0px 24px;padding: 0px;" data-bothblock="0px"><span leaf="">${aTags}</span></p>`;
|
|
5799
|
+
}
|
|
5602
5800
|
const GET_QRCODE_DEFAULT_ERROR = "二维码获取异常,请稍后重试。";
|
|
5603
5801
|
const weixinPublish_mock_errnoMap = {
|
|
5604
5802
|
200003: "微信公众号号登录状态失效,请重新绑定账号后重试。",
|
|
@@ -5613,10 +5811,14 @@ const weixinPublish_mock_errnoMap = {
|
|
|
5613
5811
|
"-1": "系统错误,请注意备份内容后重试",
|
|
5614
5812
|
770001: "不支持发布审核中或转码中的视频",
|
|
5615
5813
|
200074: "系统繁忙,请稍后重试!",
|
|
5616
|
-
64702: "标题超出64字长度限制,请修改标题后重试。"
|
|
5814
|
+
64702: "标题超出64字长度限制,请修改标题后重试。",
|
|
5815
|
+
64552: "请检查阅读原文中的链接后重试。"
|
|
5617
5816
|
};
|
|
5618
5817
|
const ignoreErrno = [
|
|
5619
|
-
154019
|
|
5818
|
+
154019,
|
|
5819
|
+
154011,
|
|
5820
|
+
154008,
|
|
5821
|
+
154009
|
|
5620
5822
|
];
|
|
5621
5823
|
const userTypeMap = {
|
|
5622
5824
|
所有用户: 1,
|
|
@@ -5721,7 +5923,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
5721
5923
|
};
|
|
5722
5924
|
const originContentImages = extractImgTag(params.content);
|
|
5723
5925
|
const targetContentImages = await uploadImages(originContentImages);
|
|
5724
|
-
const content = replaceImgSrc(params.content, (dom)=>{
|
|
5926
|
+
const content = replaceImgSrc(params.settingInfo.wxTopic && params.settingInfo.wxTopic.length > 0 ? params.content + genTopicHTML(params.settingInfo.wxTopic) : params.content, (dom)=>{
|
|
5725
5927
|
if (dom.attribs.src) {
|
|
5726
5928
|
const idx = originContentImages.findIndex((it)=>it === dom.attribs.src);
|
|
5727
5929
|
dom.attribs.src = targetContentImages[idx].cdn_url;
|
|
@@ -5994,6 +6196,11 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
5994
6196
|
allow_fast_reprint0: params?.settingInfo?.wxQuickReprint ? 1 : 0,
|
|
5995
6197
|
disable_recommend0: params?.settingInfo?.wxNotAllowRecommend ? 1 : 0,
|
|
5996
6198
|
claim_source_type0: params?.settingInfo?.wxCreationSource?.[0] || "",
|
|
6199
|
+
appmsg_album_info0: JSON.stringify({
|
|
6200
|
+
appmsg_album_infos: params.settingInfo?.wxCollectionInfo ? [
|
|
6201
|
+
params.settingInfo.wxCollectionInfo
|
|
6202
|
+
] : []
|
|
6203
|
+
}),
|
|
5997
6204
|
masssend_check: 1,
|
|
5998
6205
|
is_masssend: 1
|
|
5999
6206
|
};
|
|
@@ -6016,6 +6223,42 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
6016
6223
|
data: appMsgId,
|
|
6017
6224
|
message: "微信公众号保存草稿成功。"
|
|
6018
6225
|
};
|
|
6226
|
+
let checkTimes = 0;
|
|
6227
|
+
let copyrightStatRes = {
|
|
6228
|
+
base_resp: {
|
|
6229
|
+
ret: -1
|
|
6230
|
+
},
|
|
6231
|
+
list: ''
|
|
6232
|
+
};
|
|
6233
|
+
do {
|
|
6234
|
+
checkTimes++;
|
|
6235
|
+
const copyrightStat = http.api({
|
|
6236
|
+
method: 'post',
|
|
6237
|
+
url: 'https://mp.weixin.qq.com/cgi-bin/masssend',
|
|
6238
|
+
params: {
|
|
6239
|
+
action: 'get_appmsg_copyright_stat',
|
|
6240
|
+
token: params.token,
|
|
6241
|
+
lang: 'zh_CN'
|
|
6242
|
+
},
|
|
6243
|
+
data: weixinPublish_mock_generatorFormData({
|
|
6244
|
+
token: params.token,
|
|
6245
|
+
lang: 'zh_CN',
|
|
6246
|
+
f: 'json',
|
|
6247
|
+
ajax: 1,
|
|
6248
|
+
fingerprint,
|
|
6249
|
+
random: Math.random().toString(),
|
|
6250
|
+
first_check: 1 === checkTimes ? 1 : 0,
|
|
6251
|
+
type: 10,
|
|
6252
|
+
appMsgId
|
|
6253
|
+
})
|
|
6254
|
+
});
|
|
6255
|
+
copyrightStatRes = await copyrightStat;
|
|
6256
|
+
if (154008 === copyrightStatRes.base_resp.ret && copyrightStatRes?.list) return {
|
|
6257
|
+
code: 200,
|
|
6258
|
+
message: `文章内容未通过原创校验,请修改后重试!`,
|
|
6259
|
+
data: JSON.parse(copyrightStatRes.list).list
|
|
6260
|
+
};
|
|
6261
|
+
}while (154011 === copyrightStatRes.base_resp.ret && checkTimes < 10);
|
|
6019
6262
|
const masssendpage = ()=>http.api({
|
|
6020
6263
|
method: "get",
|
|
6021
6264
|
url: "https://mp.weixin.qq.com/cgi-bin/masssendpage",
|
|
@@ -6329,8 +6572,11 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
6329
6572
|
userType: "1"
|
|
6330
6573
|
}),
|
|
6331
6574
|
defaultErrorMsg: params.masssend ? "文章群发异常,请尝试关闭群发或稍后重试。" : "文章发布异常,请稍后重试。"
|
|
6575
|
+
}, {
|
|
6576
|
+
retries: 2,
|
|
6577
|
+
retryDelay: 500
|
|
6332
6578
|
});
|
|
6333
|
-
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(appMsgId, `微信公众号发布完成!`);
|
|
6579
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(appMsgId, `微信公众号发布完成!` + (proxyHttp.proxyInfo || ""));
|
|
6334
6580
|
};
|
|
6335
6581
|
const waitQrcodeResultMaxTime = 2000 * scanRetryMaxCount;
|
|
6336
6582
|
const weixinPublish_rpa_rpaAction = async (task, params)=>{
|
|
@@ -6996,6 +7242,11 @@ const xiaohongshuPublish_mock_errnoMap = {
|
|
|
6996
7242
|
const mock_xsEncrypt = new Xhshow();
|
|
6997
7243
|
const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
6998
7244
|
const tmpCachePath = task.getTmpPath();
|
|
7245
|
+
if (params?.selfDeclaration?.type == "source-statement" && "transshipment" == params.selfDeclaration.childType && params.originalBind) return {
|
|
7246
|
+
code: 200,
|
|
7247
|
+
message: "原创声明与转载声明互斥,请重新选择后发布!",
|
|
7248
|
+
data: ""
|
|
7249
|
+
};
|
|
6999
7250
|
const a1Cookie = params.cookies.find((it)=>"a1" === it.name)?.value;
|
|
7000
7251
|
if (!a1Cookie) return {
|
|
7001
7252
|
code: 200,
|
|
@@ -7130,6 +7381,11 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
7130
7381
|
Object.assign(topic, createTopic.data.topic_infos[0]);
|
|
7131
7382
|
}
|
|
7132
7383
|
}));
|
|
7384
|
+
const visibleRangeMap = {
|
|
7385
|
+
public: 0,
|
|
7386
|
+
private: 1,
|
|
7387
|
+
friends: 4
|
|
7388
|
+
};
|
|
7133
7389
|
const publishData = {
|
|
7134
7390
|
common: {
|
|
7135
7391
|
ats: [],
|
|
@@ -7147,7 +7403,7 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
7147
7403
|
type: "normal",
|
|
7148
7404
|
privacy_info: {
|
|
7149
7405
|
op_type: 1,
|
|
7150
|
-
type:
|
|
7406
|
+
type: visibleRangeMap[params.visibleRange] || 1
|
|
7151
7407
|
},
|
|
7152
7408
|
post_loc: params.address ? {
|
|
7153
7409
|
name: params.address?.name,
|
|
@@ -7199,6 +7455,10 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
7199
7455
|
};
|
|
7200
7456
|
}
|
|
7201
7457
|
}
|
|
7458
|
+
const bizId = params?.originalBind && (params.cookies.find((it)=>"x-user-id-creator.xiaohongshu.com" === it.name)?.value || await http.api({
|
|
7459
|
+
method: "get",
|
|
7460
|
+
url: "https://creator.xiaohongshu.com/api/galaxy/user/my-info"
|
|
7461
|
+
}).then((userData)=>userData.data?.userDetail?.id));
|
|
7202
7462
|
const business_binds = {
|
|
7203
7463
|
version: 1,
|
|
7204
7464
|
bizType: "",
|
|
@@ -7207,11 +7467,41 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
7207
7467
|
notePostTiming: params.isImmediatelyPublish ? {} : {
|
|
7208
7468
|
postTime: params.scheduledPublish
|
|
7209
7469
|
},
|
|
7210
|
-
|
|
7211
|
-
|
|
7470
|
+
coProduceBind: {
|
|
7471
|
+
enable: !!params?.coProduceBind
|
|
7472
|
+
},
|
|
7473
|
+
noteCopyBind: {
|
|
7474
|
+
copyable: !!params?.noteCopyBind
|
|
7475
|
+
},
|
|
7476
|
+
optionRelationList: params.originalBind ? [
|
|
7477
|
+
{
|
|
7478
|
+
type: "ORIGINAL_STATEMENT",
|
|
7479
|
+
relationList: [
|
|
7480
|
+
{
|
|
7481
|
+
bizId,
|
|
7482
|
+
bizType: "ORIGINAL_STATEMENT",
|
|
7483
|
+
extraInfo: "{}"
|
|
7484
|
+
}
|
|
7485
|
+
]
|
|
7486
|
+
}
|
|
7487
|
+
] : [],
|
|
7488
|
+
...params?.groupBind ? {
|
|
7489
|
+
groupBind: {
|
|
7490
|
+
groupId: params?.groupBind?.group_id,
|
|
7491
|
+
groupName: params.groupBind?.group_name,
|
|
7492
|
+
desc: params.groupBind?.desc,
|
|
7493
|
+
avatar: params.groupBind?.avatar
|
|
7494
|
+
}
|
|
7495
|
+
} : {
|
|
7496
|
+
groupBind: {}
|
|
7212
7497
|
},
|
|
7213
7498
|
...params.selfDeclaration ? {
|
|
7214
7499
|
userDeclarationBind
|
|
7500
|
+
} : {},
|
|
7501
|
+
...params?.collectionId ? {
|
|
7502
|
+
noteCollectionBind: {
|
|
7503
|
+
id: params.collectionId
|
|
7504
|
+
}
|
|
7215
7505
|
} : {}
|
|
7216
7506
|
};
|
|
7217
7507
|
publishData.common.business_binds = JSON.stringify(business_binds);
|
|
@@ -7232,8 +7522,11 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
7232
7522
|
"x-s-common": xscommon
|
|
7233
7523
|
},
|
|
7234
7524
|
defaultErrorMsg: "文章发布异常,请稍后重试。"
|
|
7525
|
+
}, {
|
|
7526
|
+
retries: 2,
|
|
7527
|
+
retryDelay: 500
|
|
7235
7528
|
});
|
|
7236
|
-
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(publishResult.data?.id, `文章发布成功!`);
|
|
7529
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(publishResult.data?.id, `文章发布成功!` + (proxyHttp.proxyInfo || ""));
|
|
7237
7530
|
};
|
|
7238
7531
|
const rpa_GenXSCommon = __webpack_require__("./src/utils/XhsXsCommonEnc.js");
|
|
7239
7532
|
const rpa_xsEncrypt = new Xhshow();
|
|
@@ -7454,7 +7747,84 @@ const xiaohongshuPublish = async (task, params)=>{
|
|
|
7454
7747
|
if ("mockApi" === params.actionType) return xiaohongshuPublish_mock_mockAction(task, params);
|
|
7455
7748
|
return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
|
|
7456
7749
|
};
|
|
7457
|
-
|
|
7750
|
+
const getXhsGroup_xsEncrypt = new Xhshow();
|
|
7751
|
+
const getXhsGroup = async (_task, params)=>{
|
|
7752
|
+
const http = new Http({
|
|
7753
|
+
headers: {
|
|
7754
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
7755
|
+
referer: "https://creator.xiaohongshu.com",
|
|
7756
|
+
origin: "https://creator.xiaohongshu.com"
|
|
7757
|
+
}
|
|
7758
|
+
});
|
|
7759
|
+
const a1Cookie = params.cookies.find((it)=>"a1" === it.name)?.value;
|
|
7760
|
+
if (!a1Cookie) return {
|
|
7761
|
+
code: 200,
|
|
7762
|
+
message: "账号数据异常,请重新绑定账号后重试。",
|
|
7763
|
+
data: []
|
|
7764
|
+
};
|
|
7765
|
+
try {
|
|
7766
|
+
const xt = Date.now().toString();
|
|
7767
|
+
const groupListParams = {
|
|
7768
|
+
note_id: ""
|
|
7769
|
+
};
|
|
7770
|
+
const fatchGroup = "/api/im/web/nns/group_list";
|
|
7771
|
+
const xs = getXhsGroup_xsEncrypt.signXsGet(fatchGroup, a1Cookie, "xhs-pc-web", groupListParams);
|
|
7772
|
+
const res = await http.api({
|
|
7773
|
+
method: "get",
|
|
7774
|
+
url: "https://edith.xiaohongshu.com/api/im/web/nns/group_list",
|
|
7775
|
+
params: groupListParams,
|
|
7776
|
+
headers: {
|
|
7777
|
+
"x-s": xs,
|
|
7778
|
+
"x-t": xt
|
|
7779
|
+
}
|
|
7780
|
+
});
|
|
7781
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(0 === res.code ? res.data.group_list : [], "群聊信息获取" + (0 === res.code ? "成功!" : `失败!原因${res.msg}`));
|
|
7782
|
+
} catch (error) {
|
|
7783
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)([]);
|
|
7784
|
+
}
|
|
7785
|
+
};
|
|
7786
|
+
const getXhsHotTopic_xsEncrypt = new Xhshow();
|
|
7787
|
+
const getXhsHotTopic = async (_task, params)=>{
|
|
7788
|
+
const http = new Http({
|
|
7789
|
+
headers: {
|
|
7790
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
7791
|
+
referer: "https://creator.xiaohongshu.com",
|
|
7792
|
+
origin: "https://creator.xiaohongshu.com"
|
|
7793
|
+
}
|
|
7794
|
+
});
|
|
7795
|
+
const a1Cookie = params.cookies.find((it)=>"a1" === it.name)?.value;
|
|
7796
|
+
if (!a1Cookie) return {
|
|
7797
|
+
code: 200,
|
|
7798
|
+
message: "账号数据异常,请重新绑定账号后重试。",
|
|
7799
|
+
data: []
|
|
7800
|
+
};
|
|
7801
|
+
try {
|
|
7802
|
+
const xt = Date.now().toString();
|
|
7803
|
+
const hotTopicParams = {
|
|
7804
|
+
sort: 1,
|
|
7805
|
+
type: 1,
|
|
7806
|
+
source: 3,
|
|
7807
|
+
topic_activity: 1
|
|
7808
|
+
};
|
|
7809
|
+
const fatchGroup = "/api/galaxy/v2/creator/activity_center/list";
|
|
7810
|
+
const xs = getXhsHotTopic_xsEncrypt.signXsGet(fatchGroup, a1Cookie, "xhs-pc-web", hotTopicParams);
|
|
7811
|
+
const res = await http.api({
|
|
7812
|
+
method: "get",
|
|
7813
|
+
url: "https://creator.xiaohongshu.com/api/galaxy/v2/creator/activity_center/list",
|
|
7814
|
+
params: hotTopicParams,
|
|
7815
|
+
headers: {
|
|
7816
|
+
"x-s": xs,
|
|
7817
|
+
"x-t": xt
|
|
7818
|
+
}
|
|
7819
|
+
});
|
|
7820
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(0 === res.code ? res.data.activity_list : [], "热门信息获取" + (0 === res.code ? "成功!" : `失败!原因${res.msg}`));
|
|
7821
|
+
} catch (error) {
|
|
7822
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)([]);
|
|
7823
|
+
}
|
|
7824
|
+
};
|
|
7825
|
+
var package_namespaceObject = {
|
|
7826
|
+
i8: "1.2.24"
|
|
7827
|
+
};
|
|
7458
7828
|
const BetaFlag = "HuiwenCanary";
|
|
7459
7829
|
class Action {
|
|
7460
7830
|
constructor(task){
|
|
@@ -7523,6 +7893,9 @@ class Action {
|
|
|
7523
7893
|
BjhFansExport(params) {
|
|
7524
7894
|
return this.bindTask(BjhFansExport, params);
|
|
7525
7895
|
}
|
|
7896
|
+
SearchBjhTopicList(params) {
|
|
7897
|
+
return this.bindTask(searchBjhTopicList, params);
|
|
7898
|
+
}
|
|
7526
7899
|
searchToutiaoUserID(params) {
|
|
7527
7900
|
return this.bindTask(searchToutiaoUserInfo, params);
|
|
7528
7901
|
}
|
|
@@ -7535,6 +7908,18 @@ class Action {
|
|
|
7535
7908
|
getWeixinConfig(params) {
|
|
7536
7909
|
return this.bindTask(getWeixinConfig, params);
|
|
7537
7910
|
}
|
|
7911
|
+
getWeixinCollection(params) {
|
|
7912
|
+
return this.bindTask(getWeixinCollection, params);
|
|
7913
|
+
}
|
|
7914
|
+
getXhsCollection(params) {
|
|
7915
|
+
return this.bindTask(getXhsCollection, params);
|
|
7916
|
+
}
|
|
7917
|
+
getXhsGroup(params) {
|
|
7918
|
+
return this.bindTask(getXhsGroup, params);
|
|
7919
|
+
}
|
|
7920
|
+
getXhsHotTopic(params) {
|
|
7921
|
+
return this.bindTask(getXhsHotTopic, params);
|
|
7922
|
+
}
|
|
7538
7923
|
getBaijiahaoConfig(params) {
|
|
7539
7924
|
return this.bindTask(getBaijiahaoConfig, params);
|
|
7540
7925
|
}
|