@iflyrpa/actions 4.0.4-beta.0 → 4.0.4-beta.2
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/searchAccountInfo/getDouyinInfo.d.ts +16 -0
- package/dist/actions/searchAccountInfo/getShipinhaoInfo.d.ts +14 -0
- package/dist/actions/searchAccountInfo/index.d.ts +4 -2
- package/dist/actions/searchAccountInfo/types.d.ts +21 -1
- package/dist/actions/shipinhaoPublish/uploader.d.ts +4 -0
- package/dist/bundle.js +273 -46
- package/dist/bundle.js.map +1 -1
- package/dist/index.d.ts +16 -0
- package/dist/index.js +273 -46
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +273 -46
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="253dad15-2fc6-50a4-a558-e0db69e40773")}catch(e){}}();
|
|
1
3
|
import * as __WEBPACK_EXTERNAL_MODULE_crypto__ from "crypto";
|
|
2
4
|
import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
|
|
3
5
|
import * as __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_package_json_58ae5f06__ from "@iflyrpa/share/package.json";
|
|
@@ -4350,7 +4352,7 @@ function __webpack_require__(moduleId) {
|
|
|
4350
4352
|
return module;
|
|
4351
4353
|
};
|
|
4352
4354
|
})();
|
|
4353
|
-
var package_namespaceObject = JSON.parse('{"i8":"4.0.4-beta.
|
|
4355
|
+
var package_namespaceObject = JSON.parse('{"i8":"4.0.4-beta.2"}');
|
|
4354
4356
|
const PROXY_CREDENTIALS = [
|
|
4355
4357
|
{
|
|
4356
4358
|
ip: "47.110.131.129",
|
|
@@ -4583,11 +4585,12 @@ class Http {
|
|
|
4583
4585
|
this.logger?.debug(`未处理的网络错误代码: ${error.code} ${error.message}`, {
|
|
4584
4586
|
errorString: stringifyError(error)
|
|
4585
4587
|
});
|
|
4586
|
-
_message =
|
|
4588
|
+
_message = `网络错误: ${error.message}`;
|
|
4587
4589
|
break;
|
|
4588
4590
|
}
|
|
4589
4591
|
}
|
|
4590
|
-
|
|
4592
|
+
if (error.code && !error.response?.data) errorResponse.message = _message || errorResponse.message;
|
|
4593
|
+
else errorResponse.message = errorResponse.message ? errorResponse.message : _message;
|
|
4591
4594
|
if ("canceled" === errorResponse.message) {
|
|
4592
4595
|
const message = errorResponse.extra?.isProxyRequest ? "代理连接建立超时,请更换区域或稍后重试!" : "网络请求超时,请稍后重试!";
|
|
4593
4596
|
errorResponse.message = message;
|
|
@@ -15284,6 +15287,199 @@ async function getBaijiahaoData(_task, params) {
|
|
|
15284
15287
|
};
|
|
15285
15288
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(bjhData, "百家号平台数据获取成功!");
|
|
15286
15289
|
}
|
|
15290
|
+
async function getDouyinData(_task, params) {
|
|
15291
|
+
try {
|
|
15292
|
+
const sessionidCookie = params.cookies.find((it)=>"sessionid" === it.name)?.value;
|
|
15293
|
+
if (!sessionidCookie) return types_errorResponse("抖音账号数据异常,请重新绑定账号后重试。", 414);
|
|
15294
|
+
const csrfToken = params.cookies.find((it)=>"passport_csrf_token" === it.name)?.value || "";
|
|
15295
|
+
const headers = {
|
|
15296
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
15297
|
+
referer: "https://creator.douyin.com/creator-micro/home",
|
|
15298
|
+
origin: "https://creator.douyin.com",
|
|
15299
|
+
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36",
|
|
15300
|
+
...csrfToken ? {
|
|
15301
|
+
"x-secsdk-csrf-token": csrfToken
|
|
15302
|
+
} : {}
|
|
15303
|
+
};
|
|
15304
|
+
const args = [
|
|
15305
|
+
{
|
|
15306
|
+
headers
|
|
15307
|
+
},
|
|
15308
|
+
_task.logger,
|
|
15309
|
+
params.proxyLoc,
|
|
15310
|
+
params.localIP,
|
|
15311
|
+
params.accountId
|
|
15312
|
+
];
|
|
15313
|
+
const http = new Http(...args);
|
|
15314
|
+
const toNum = (val)=>{
|
|
15315
|
+
if (null == val) return 0;
|
|
15316
|
+
const n = Number.parseInt(String(val).replace(/[+,]/g, ""), 10);
|
|
15317
|
+
return Number.isNaN(n) ? 0 : n;
|
|
15318
|
+
};
|
|
15319
|
+
const userProfileP = http.api({
|
|
15320
|
+
method: "get",
|
|
15321
|
+
url: "https://www.douyin.com/aweme/v1/web/user/profile/self/",
|
|
15322
|
+
params: {
|
|
15323
|
+
device_platform: "webapp",
|
|
15324
|
+
aid: "6383",
|
|
15325
|
+
channel: "channel_pc_web",
|
|
15326
|
+
pc_client_type: "1",
|
|
15327
|
+
version_code: "170400",
|
|
15328
|
+
version_name: "17.4.0",
|
|
15329
|
+
cookie_enabled: "true",
|
|
15330
|
+
platform: "PC"
|
|
15331
|
+
}
|
|
15332
|
+
}, {
|
|
15333
|
+
retries: 3,
|
|
15334
|
+
retryDelay: 100,
|
|
15335
|
+
timeout: 10000
|
|
15336
|
+
}).catch((e)=>{
|
|
15337
|
+
_task.logger.warn(`抖音用户信息获取失败: ${e instanceof Error ? e.message : String(e)}`);
|
|
15338
|
+
return null;
|
|
15339
|
+
});
|
|
15340
|
+
const overviewP = http.api({
|
|
15341
|
+
method: "get",
|
|
15342
|
+
url: "https://creator.douyin.com/aweme/janus/creator/data/overview/all/",
|
|
15343
|
+
params: {
|
|
15344
|
+
last_days_type: 1,
|
|
15345
|
+
aid: 2906,
|
|
15346
|
+
app_name: "aweme_creator_platform",
|
|
15347
|
+
device_platform: "web"
|
|
15348
|
+
}
|
|
15349
|
+
}, {
|
|
15350
|
+
retries: 3,
|
|
15351
|
+
retryDelay: 100,
|
|
15352
|
+
timeout: 5000
|
|
15353
|
+
}).catch((e)=>{
|
|
15354
|
+
_task.logger.warn(`抖音近7日数据获取失败(可能未开通数据中心或被风控): ${e instanceof Error ? e.message : String(e)}`);
|
|
15355
|
+
return null;
|
|
15356
|
+
});
|
|
15357
|
+
const [userProfile, overview] = await Promise.all([
|
|
15358
|
+
userProfileP,
|
|
15359
|
+
overviewP
|
|
15360
|
+
]);
|
|
15361
|
+
_task.logger.info(`抖音用户信息响应: ${JSON.stringify(userProfile)}`);
|
|
15362
|
+
_task.logger.info(`抖音近7日数据响应: ${JSON.stringify(overview)}`);
|
|
15363
|
+
let fansNum = 0;
|
|
15364
|
+
let favedNum = 0;
|
|
15365
|
+
let followingNum = 0;
|
|
15366
|
+
if (userProfile?.status_code === 0 && userProfile.user) {
|
|
15367
|
+
const user = userProfile.user;
|
|
15368
|
+
fansNum = toNum(user.follower_count);
|
|
15369
|
+
followingNum = toNum(user.following_count);
|
|
15370
|
+
favedNum = toNum(user.total_favorited);
|
|
15371
|
+
_task.logger.info(`提取用户数据 - 昵称: ${user.nickname}, 粉丝: ${fansNum}, 关注: ${followingNum}, 获赞: ${favedNum}, 作品: ${user.aweme_count}`);
|
|
15372
|
+
} else _task.logger.warn(`用户信息接口返回异常: status_code=${userProfile?.status_code}, msg=${userProfile?.status_msg}`);
|
|
15373
|
+
const ov = overview?.data;
|
|
15374
|
+
const douyinData = {
|
|
15375
|
+
fansNum,
|
|
15376
|
+
favedNum,
|
|
15377
|
+
fansNumLastWeek: toNum(ov?.fans_incr?.current_count),
|
|
15378
|
+
watchNumLastWeek: toNum(ov?.play_count?.current_count),
|
|
15379
|
+
likeNumLastWeek: toNum(ov?.like_count?.current_count),
|
|
15380
|
+
commentNumLastWeek: toNum(ov?.comment_count?.current_count),
|
|
15381
|
+
shareNumLastWeek: toNum(ov?.share_count?.current_count),
|
|
15382
|
+
visitNumLastWeek: toNum(ov?.profile_visit?.current_count)
|
|
15383
|
+
};
|
|
15384
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(douyinData, "抖音平台数据获取成功!");
|
|
15385
|
+
} catch (error) {
|
|
15386
|
+
if (error && "object" == typeof error && "code" in error && "message" in error) {
|
|
15387
|
+
const err = error;
|
|
15388
|
+
_task.logger.error(`抖音账号数据获取失败: ${err.message} (${err.code})`);
|
|
15389
|
+
return types_errorResponse(err.message, err.code);
|
|
15390
|
+
}
|
|
15391
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
15392
|
+
_task.logger.error(`抖音账号数据获取失败: ${errMsg}`);
|
|
15393
|
+
return types_errorResponse(errMsg || "抖音账号数据获取失败");
|
|
15394
|
+
}
|
|
15395
|
+
}
|
|
15396
|
+
async function getShipinhaoData(_task, params) {
|
|
15397
|
+
try {
|
|
15398
|
+
const sessionidCookie = params.cookies.find((it)=>"sessionid" === it.name)?.value;
|
|
15399
|
+
if (!sessionidCookie) return types_errorResponse("视频号账号数据异常,请重新绑定账号后重试。", 414);
|
|
15400
|
+
const uinCookie = params.cookies.find((it)=>"uin" === it.name || "wxuin" === it.name)?.value || "0000000000";
|
|
15401
|
+
const deviceIdCookie = params.cookies.find((it)=>"device_id" === it.name || "finger_print_device_id" === it.name)?.value;
|
|
15402
|
+
const aid = params.cookies.find((it)=>"_aid" === it.name)?.value || "9d3e0e9f-b842-498d-a273-4285d58df264";
|
|
15403
|
+
const finderId = params.cookies.find((it)=>"_log_finder_id" === it.name || "finder_id" === it.name)?.value || "";
|
|
15404
|
+
const headers = {
|
|
15405
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
15406
|
+
referer: "https://channels.weixin.qq.com/platform",
|
|
15407
|
+
origin: "https://channels.weixin.qq.com",
|
|
15408
|
+
"content-type": "application/json",
|
|
15409
|
+
"X-WECHAT-UIN": uinCookie,
|
|
15410
|
+
...deviceIdCookie ? {
|
|
15411
|
+
"finger-print-device-id": deviceIdCookie
|
|
15412
|
+
} : {}
|
|
15413
|
+
};
|
|
15414
|
+
const args = [
|
|
15415
|
+
{
|
|
15416
|
+
headers
|
|
15417
|
+
},
|
|
15418
|
+
_task.logger,
|
|
15419
|
+
params.proxyLoc,
|
|
15420
|
+
params.localIP,
|
|
15421
|
+
params.accountId
|
|
15422
|
+
];
|
|
15423
|
+
const http = new Http(...args);
|
|
15424
|
+
const authData = await http.api({
|
|
15425
|
+
method: "post",
|
|
15426
|
+
url: "https://channels.weixin.qq.com/cgi-bin/mmfinderassistant-bin/auth/auth_data",
|
|
15427
|
+
params: {
|
|
15428
|
+
_aid: aid,
|
|
15429
|
+
_rid: `${Date.now().toString(16)}-${Math.random().toString(36).substring(2, 9)}`,
|
|
15430
|
+
_pageUrl: encodeURIComponent("https://channels.weixin.qq.com/platform")
|
|
15431
|
+
},
|
|
15432
|
+
data: {
|
|
15433
|
+
timestamp: Date.now().toString(),
|
|
15434
|
+
_log_finder_uin: "",
|
|
15435
|
+
_log_finder_id: finderId,
|
|
15436
|
+
rawKeyBuff: "",
|
|
15437
|
+
pluginSessionId: null,
|
|
15438
|
+
scene: 7,
|
|
15439
|
+
reqScene: 7
|
|
15440
|
+
}
|
|
15441
|
+
}, {
|
|
15442
|
+
retries: 3,
|
|
15443
|
+
retryDelay: 100,
|
|
15444
|
+
timeout: 5000
|
|
15445
|
+
});
|
|
15446
|
+
_task.logger.info(`视频号账号数据响应: ${JSON.stringify(authData)}`);
|
|
15447
|
+
const AUTH_ERROR_CODES = [
|
|
15448
|
+
300333,
|
|
15449
|
+
300334,
|
|
15450
|
+
300330,
|
|
15451
|
+
300331,
|
|
15452
|
+
300332
|
|
15453
|
+
];
|
|
15454
|
+
if (authData.errCode && AUTH_ERROR_CODES.includes(authData.errCode)) {
|
|
15455
|
+
_task.logger.warn(`视频号登录已失效:${authData.errMsg} (${authData.errCode})`);
|
|
15456
|
+
return types_errorResponse("视频号账号信息获取失败,请检查账号状态", 414);
|
|
15457
|
+
}
|
|
15458
|
+
if (authData.errCode) {
|
|
15459
|
+
_task.logger.warn(`视频号账号API错误:${authData.errMsg} (${authData.errCode})`);
|
|
15460
|
+
return types_errorResponse(`视频号账号信息获取失败:${authData.errMsg || "未知错误"}`, 414);
|
|
15461
|
+
}
|
|
15462
|
+
const finderUser = authData.data?.finderUser;
|
|
15463
|
+
const shipinhaoData = {
|
|
15464
|
+
fansNum: finderUser?.fansCount || 0,
|
|
15465
|
+
feedsCount: finderUser?.feedsCount || 0,
|
|
15466
|
+
fansNumYesterday: null,
|
|
15467
|
+
playNumYesterday: null,
|
|
15468
|
+
likeNumYesterday: null,
|
|
15469
|
+
commentNumYesterday: null
|
|
15470
|
+
};
|
|
15471
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(shipinhaoData, "视频号平台数据获取成功!");
|
|
15472
|
+
} catch (error) {
|
|
15473
|
+
if (error && "object" == typeof error && "code" in error && "message" in error) {
|
|
15474
|
+
const err = error;
|
|
15475
|
+
_task.logger.error(`视频号账号数据获取失败: ${err.message} (${err.code})`);
|
|
15476
|
+
return types_errorResponse(err.message, err.code);
|
|
15477
|
+
}
|
|
15478
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
15479
|
+
_task.logger.error(`视频号账号数据获取失败: ${errMsg}`);
|
|
15480
|
+
return types_errorResponse(errMsg || "视频号账号数据获取失败");
|
|
15481
|
+
}
|
|
15482
|
+
}
|
|
15287
15483
|
async function getToutiaoData(_task, params) {
|
|
15288
15484
|
const http = new Http({
|
|
15289
15485
|
headers: {
|
|
@@ -15380,7 +15576,7 @@ async function getWeixinData(_task, params) {
|
|
|
15380
15576
|
userInfoHtmlPromise,
|
|
15381
15577
|
userSummaryHtmlPromise
|
|
15382
15578
|
]);
|
|
15383
|
-
if (userInfoHtml.includes("请重新<a id='jumpUrl' href='/'>登录</a>")) return types_errorResponse("
|
|
15579
|
+
if (userInfoHtml.includes("请重新<a id='jumpUrl' href='/'>登录</a>")) return types_errorResponse("微信公众号数据获取失败,请检查账号状态", 414);
|
|
15384
15580
|
const userInfoJson = exportWxCgiData(userInfoHtml);
|
|
15385
15581
|
const userSummaryJson = exportWxCgiData(userSummaryHtml);
|
|
15386
15582
|
const wxData = {
|
|
@@ -15457,7 +15653,9 @@ const SearchAccountInfoParamsSchema = ActionCommonParamsSchema.extend({
|
|
|
15457
15653
|
"toutiao",
|
|
15458
15654
|
"xiaohongshu",
|
|
15459
15655
|
"weixin",
|
|
15460
|
-
"baijiahao"
|
|
15656
|
+
"baijiahao",
|
|
15657
|
+
"douyin",
|
|
15658
|
+
"shipinhao"
|
|
15461
15659
|
])
|
|
15462
15660
|
});
|
|
15463
15661
|
const SearchAccountInfo = async (_task, params)=>{
|
|
@@ -15471,6 +15669,10 @@ const SearchAccountInfo = async (_task, params)=>{
|
|
|
15471
15669
|
return getWeixinData(_task, params);
|
|
15472
15670
|
case "baijiahao":
|
|
15473
15671
|
return getBaijiahaoData(_task, params);
|
|
15672
|
+
case "douyin":
|
|
15673
|
+
return getDouyinData(_task, params);
|
|
15674
|
+
case "shipinhao":
|
|
15675
|
+
return getShipinhaoData(_task, params);
|
|
15474
15676
|
default:
|
|
15475
15677
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(null, "暂不支持该平台");
|
|
15476
15678
|
}
|
|
@@ -15734,21 +15936,6 @@ async function handleDouyinData(_task, params) {
|
|
|
15734
15936
|
params.accountId
|
|
15735
15937
|
];
|
|
15736
15938
|
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
15939
|
async function fetchWorks(cursor) {
|
|
15753
15940
|
return await http.api({
|
|
15754
15941
|
method: "get",
|
|
@@ -15767,25 +15954,31 @@ async function handleDouyinData(_task, params) {
|
|
|
15767
15954
|
timeout: 5000
|
|
15768
15955
|
});
|
|
15769
15956
|
}
|
|
15770
|
-
const
|
|
15771
|
-
const
|
|
15772
|
-
|
|
15957
|
+
const isHasMore = (v)=>true === v || 1 === v;
|
|
15958
|
+
const skipCount = (pageNum - 1) * pageSize;
|
|
15959
|
+
const needCount = skipCount + pageSize;
|
|
15960
|
+
const workListResponse = await fetchWorks(0);
|
|
15961
|
+
if (!workListResponse || !Array.isArray(workListResponse.aweme_list)) return searchPublishInfo_types_errorResponse("抖音数据获取失败,请检查账号状态", 414);
|
|
15773
15962
|
const allWorks = [
|
|
15774
15963
|
...workListResponse.aweme_list
|
|
15775
15964
|
];
|
|
15776
|
-
let hasMore = workListResponse.has_more;
|
|
15777
|
-
let currentCursor = workListResponse.max_cursor;
|
|
15778
|
-
|
|
15965
|
+
let hasMore = isHasMore(workListResponse.has_more);
|
|
15966
|
+
let currentCursor = workListResponse.cursor ?? workListResponse.max_cursor ?? 0;
|
|
15967
|
+
let guard = 0;
|
|
15968
|
+
while(allWorks.length < needCount && hasMore && guard < 20){
|
|
15779
15969
|
const nextPageResponse = await fetchWorks(currentCursor);
|
|
15970
|
+
if (!Array.isArray(nextPageResponse.aweme_list) || 0 === nextPageResponse.aweme_list.length) break;
|
|
15780
15971
|
allWorks.push(...nextPageResponse.aweme_list);
|
|
15781
|
-
hasMore = nextPageResponse.has_more;
|
|
15782
|
-
currentCursor = nextPageResponse.max_cursor;
|
|
15783
|
-
|
|
15972
|
+
hasMore = isHasMore(nextPageResponse.has_more);
|
|
15973
|
+
currentCursor = nextPageResponse.cursor ?? nextPageResponse.max_cursor ?? currentCursor;
|
|
15974
|
+
guard++;
|
|
15784
15975
|
}
|
|
15785
|
-
const finalWorks = allWorks.slice(
|
|
15976
|
+
const finalWorks = allWorks.slice(skipCount, needCount);
|
|
15786
15977
|
const articleCell = finalWorks.map((item)=>{
|
|
15787
15978
|
const workDetailUrl = `https://creator.douyin.com/creator-micro/work-management/work-detail/${item.aweme_id}`;
|
|
15788
|
-
const workPublicUrl =
|
|
15979
|
+
const workPublicUrl = item.share_url || `https://www.douyin.com/video/${item.aweme_id}`;
|
|
15980
|
+
let statusText;
|
|
15981
|
+
statusText = item.status?.is_delete ? "deleted" : item.status?.is_private ? "private" : item.status?.in_reviewing ? "reviewing" : "public";
|
|
15789
15982
|
return {
|
|
15790
15983
|
title: item.desc || "无作品描述",
|
|
15791
15984
|
imageUrl: item.Cover?.url_list?.[0] || "",
|
|
@@ -15797,9 +15990,9 @@ async function handleDouyinData(_task, params) {
|
|
|
15797
15990
|
shareNum: item.statistics?.share_count || 0,
|
|
15798
15991
|
collectNum: item.statistics?.collect_count || 0,
|
|
15799
15992
|
awemeId: item.aweme_id,
|
|
15800
|
-
awemeType: item.aweme_type,
|
|
15993
|
+
awemeType: item.aweme_type ?? 0,
|
|
15801
15994
|
duration: item.duration,
|
|
15802
|
-
status:
|
|
15995
|
+
status: statusText,
|
|
15803
15996
|
publicUrl: workPublicUrl,
|
|
15804
15997
|
...showOriginalData ? {
|
|
15805
15998
|
originalData: item
|
|
@@ -15810,8 +16003,8 @@ async function handleDouyinData(_task, params) {
|
|
|
15810
16003
|
articleCell,
|
|
15811
16004
|
...onlySuccess ? {
|
|
15812
16005
|
pagination: {
|
|
15813
|
-
total: workListResponse.total ||
|
|
15814
|
-
nextPage:
|
|
16006
|
+
total: workListResponse.total || allWorks.length,
|
|
16007
|
+
nextPage: hasMore,
|
|
15815
16008
|
pageNum,
|
|
15816
16009
|
pageSize
|
|
15817
16010
|
}
|
|
@@ -15907,14 +16100,21 @@ async function handleShipinhaoData(_task, params) {
|
|
|
15907
16100
|
const needArticle = "all" === postType || "article" === postType;
|
|
15908
16101
|
const AUTH_ERROR_CODES = [
|
|
15909
16102
|
300333,
|
|
15910
|
-
300334
|
|
16103
|
+
300334,
|
|
16104
|
+
300330,
|
|
16105
|
+
300331,
|
|
16106
|
+
300332
|
|
15911
16107
|
];
|
|
15912
16108
|
if (needVideo) try {
|
|
15913
16109
|
const videoPageUrl = "https://channels.weixin.qq.com/micro/content/post/list";
|
|
15914
16110
|
const videoResponse = await fetchPosts(pageNum, 11, videoPageUrl);
|
|
16111
|
+
_task.logger.info(`视频号视频获取响应:${JSON.stringify(videoResponse)}`);
|
|
15915
16112
|
if (videoResponse.errCode && AUTH_ERROR_CODES.includes(videoResponse.errCode)) throw new Error(`AUTH_ERROR:${videoResponse.errMsg || "登录已失效"}`);
|
|
15916
|
-
if (videoResponse.errCode)
|
|
15917
|
-
|
|
16113
|
+
if (videoResponse.errCode) {
|
|
16114
|
+
_task.logger.warn(`视频号API错误:${videoResponse.errMsg} (${videoResponse.errCode})`);
|
|
16115
|
+
throw new Error(`视频号API错误:${videoResponse.errMsg} (${videoResponse.errCode})`);
|
|
16116
|
+
}
|
|
16117
|
+
{
|
|
15918
16118
|
const posts = videoResponse.data?.list || videoResponse.posts || videoResponse.post_list || [];
|
|
15919
16119
|
const videoArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "video"));
|
|
15920
16120
|
allArticles.push(...videoArticles);
|
|
@@ -15929,8 +16129,11 @@ async function handleShipinhaoData(_task, params) {
|
|
|
15929
16129
|
const articlePageUrl = "https://channels.weixin.qq.com/micro/content/post/finderNewLifePostList";
|
|
15930
16130
|
const articleResponse = await fetchPosts(pageNum, 10, articlePageUrl);
|
|
15931
16131
|
if (articleResponse.errCode && AUTH_ERROR_CODES.includes(articleResponse.errCode)) throw new Error(`AUTH_ERROR:${articleResponse.errMsg || "登录已失效"}`);
|
|
15932
|
-
if (articleResponse.errCode)
|
|
15933
|
-
|
|
16132
|
+
if (articleResponse.errCode) {
|
|
16133
|
+
_task.logger.warn(`视频号图文API错误:${articleResponse.errMsg} (${articleResponse.errCode})`);
|
|
16134
|
+
throw new Error(`视频号图文API错误:${articleResponse.errMsg} (${articleResponse.errCode})`);
|
|
16135
|
+
}
|
|
16136
|
+
{
|
|
15934
16137
|
const posts = articleResponse.data?.list || articleResponse.posts || articleResponse.post_list || [];
|
|
15935
16138
|
const articleArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "article"));
|
|
15936
16139
|
allArticles.push(...articleArticles);
|
|
@@ -17817,6 +18020,11 @@ class VideoChannelUploader {
|
|
|
17817
18020
|
this.concurrentLimit = config.concurrentLimit || 4;
|
|
17818
18021
|
this.singleFileSize = config.singleFileSize || 10485760;
|
|
17819
18022
|
this.http = config.http || new Http();
|
|
18023
|
+
this.reqOptions = {
|
|
18024
|
+
timeout: config.timeout ?? 60000,
|
|
18025
|
+
retries: config.retries ?? 3,
|
|
18026
|
+
retryDelay: config.retryDelay ?? 2000
|
|
18027
|
+
};
|
|
17820
18028
|
}
|
|
17821
18029
|
calculateMd5(buffer) {
|
|
17822
18030
|
const MAX_SIZE = 5242880;
|
|
@@ -17873,7 +18081,7 @@ class VideoChannelUploader {
|
|
|
17873
18081
|
url: filePath,
|
|
17874
18082
|
method: "get",
|
|
17875
18083
|
responseType: "arraybuffer"
|
|
17876
|
-
});
|
|
18084
|
+
}, this.reqOptions);
|
|
17877
18085
|
return Buffer.from(resp);
|
|
17878
18086
|
}
|
|
17879
18087
|
return __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].promises.readFile(filePath);
|
|
@@ -17903,7 +18111,7 @@ class VideoChannelUploader {
|
|
|
17903
18111
|
headers,
|
|
17904
18112
|
data: requestBody,
|
|
17905
18113
|
defaultErrorMsg: "获取UploadID失败"
|
|
17906
|
-
});
|
|
18114
|
+
}, this.reqOptions);
|
|
17907
18115
|
if (!resp?.UploadID) throw new Error(`获取 UploadID 失败: ${resp?.errMsg || "未知错误"}`);
|
|
17908
18116
|
return resp.UploadID;
|
|
17909
18117
|
}
|
|
@@ -17924,7 +18132,7 @@ class VideoChannelUploader {
|
|
|
17924
18132
|
headers,
|
|
17925
18133
|
data: chunk,
|
|
17926
18134
|
defaultErrorMsg: `分片 ${partNumber} 上传失败`
|
|
17927
|
-
});
|
|
18135
|
+
}, this.reqOptions);
|
|
17928
18136
|
if (resp?.errCode !== void 0 && 0 !== resp.errCode) throw new Error(`分片 ${partNumber} 上传失败: ${resp.errMsg}`);
|
|
17929
18137
|
if (onProgress) onProgress(chunk.length);
|
|
17930
18138
|
return resp.ETag || "";
|
|
@@ -17948,7 +18156,7 @@ class VideoChannelUploader {
|
|
|
17948
18156
|
headers,
|
|
17949
18157
|
data: requestBody,
|
|
17950
18158
|
defaultErrorMsg: "确认分片上传失败"
|
|
17951
|
-
});
|
|
18159
|
+
}, this.reqOptions);
|
|
17952
18160
|
if (resp?.ListPartsResult?.Part) return resp.ListPartsResult.Part.map((p)=>({
|
|
17953
18161
|
PartNumber: parseInt(p.PartNumber),
|
|
17954
18162
|
ETag: p.ETag
|
|
@@ -17974,7 +18182,7 @@ class VideoChannelUploader {
|
|
|
17974
18182
|
headers,
|
|
17975
18183
|
data: requestBody,
|
|
17976
18184
|
defaultErrorMsg: "完成上传失败"
|
|
17977
|
-
});
|
|
18185
|
+
}, this.reqOptions);
|
|
17978
18186
|
if (!resp?.DownloadURL) throw new Error(`完成上传失败: ${resp?.errMsg || "未知错误"}`);
|
|
17979
18187
|
return resp.DownloadURL;
|
|
17980
18188
|
}
|
|
@@ -24979,6 +25187,24 @@ const bjhConfigDataSchema = schemas_object({
|
|
|
24979
25187
|
likeNumYesterday: schemas_number().nullable(),
|
|
24980
25188
|
commentNumYesterday: schemas_number().nullable()
|
|
24981
25189
|
});
|
|
25190
|
+
schemas_object({
|
|
25191
|
+
fansNum: schemas_number(),
|
|
25192
|
+
favedNum: schemas_number(),
|
|
25193
|
+
fansNumLastWeek: schemas_number(),
|
|
25194
|
+
watchNumLastWeek: schemas_number(),
|
|
25195
|
+
likeNumLastWeek: schemas_number(),
|
|
25196
|
+
commentNumLastWeek: schemas_number(),
|
|
25197
|
+
shareNumLastWeek: schemas_number(),
|
|
25198
|
+
visitNumLastWeek: schemas_number()
|
|
25199
|
+
});
|
|
25200
|
+
schemas_object({
|
|
25201
|
+
fansNum: schemas_number(),
|
|
25202
|
+
feedsCount: schemas_number(),
|
|
25203
|
+
fansNumYesterday: schemas_number().nullable(),
|
|
25204
|
+
playNumYesterday: schemas_number().nullable(),
|
|
25205
|
+
likeNumYesterday: schemas_number().nullable(),
|
|
25206
|
+
commentNumYesterday: schemas_number().nullable()
|
|
25207
|
+
});
|
|
24982
25208
|
const BetaFlag = "HuiwenCanary";
|
|
24983
25209
|
class Action {
|
|
24984
25210
|
constructor(task){
|
|
@@ -25263,4 +25489,5 @@ class Action {
|
|
|
25263
25489
|
var __webpack_exports__version = package_namespaceObject.i8;
|
|
25264
25490
|
export { Action, ActionCommonParamsSchema, BaijiahaoPublishParamsSchema, BetaFlag, CollectionDetailSchema, ConfigDataSchema, DouyinCheckVerifyQrCodeParamsSchema, DouyinCreateCommentReplyParamsSchema, DouyinGetCollectionParamsSchema, DouyinGetCommentListParamsSchema, DouyinGetCommentReplyListParamsSchema, DouyinGetHotParamsSchema, DouyinGetLocationParamsSchema, DouyinGetMusicByCategoryParamsSchema, DouyinGetMusicCategoryParamsSchema, DouyinGetMusicParamsSchema, DouyinGetTopicsParamsSchema, DouyinGetVerifyQrCodeParamsSchema, DouyinGetWorkListParamsSchema, DouyinPublishParamsSchema, FetchArticlesDataSchema, FetchArticlesParamsSchema, Http, ProxyAgent, SearchAccountInfoParamsSchema, SessionCheckResultSchema, ShipinhaoCheckLinkValidateParamsSchema, ShipinhaoGetLocationParamsSchema, ShipinhaoGetMsgParamsSchema, ShipinhaoPublishParamsSchema, ShipinhaoSendMsgParamsSchema, ToutiaoPublishParamsSchema, UnreadCountSchema, WeixinPublishParamsSchema, WxBjhSessionParamsSchema, XhsWebSearchParamsSchema, XiaohongshuPublishParamsSchema, bjhConfigDataSchema, getFileState, reportLogger, rpaAction_Server_Mock, ttConfigDataSchema, wxConfigDataSchema, xhsConfigDataSchema, __webpack_exports__version as version };
|
|
25265
25491
|
|
|
25266
|
-
//# sourceMappingURL=index.mjs.map
|
|
25492
|
+
//# sourceMappingURL=index.mjs.map
|
|
25493
|
+
//# debugId=253dad15-2fc6-50a4-a558-e0db69e40773
|