@iflyrpa/actions 4.0.3 → 4.0.4-beta.1

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/index.mjs CHANGED
@@ -4350,9 +4350,7 @@ function __webpack_require__(moduleId) {
4350
4350
  return module;
4351
4351
  };
4352
4352
  })();
4353
- var package_namespaceObject = {
4354
- i8: "4.0.3"
4355
- };
4353
+ var package_namespaceObject = JSON.parse('{"i8":"4.0.4-beta.1"}');
4356
4354
  const PROXY_CREDENTIALS = [
4357
4355
  {
4358
4356
  ip: "47.110.131.129",
@@ -15286,6 +15284,199 @@ async function getBaijiahaoData(_task, params) {
15286
15284
  };
15287
15285
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(bjhData, "百家号平台数据获取成功!");
15288
15286
  }
15287
+ async function getDouyinData(_task, params) {
15288
+ try {
15289
+ const sessionidCookie = params.cookies.find((it)=>"sessionid" === it.name)?.value;
15290
+ if (!sessionidCookie) return types_errorResponse("抖音账号数据异常,请重新绑定账号后重试。", 414);
15291
+ const csrfToken = params.cookies.find((it)=>"passport_csrf_token" === it.name)?.value || "";
15292
+ const headers = {
15293
+ cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
15294
+ referer: "https://creator.douyin.com/creator-micro/home",
15295
+ origin: "https://creator.douyin.com",
15296
+ "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",
15297
+ ...csrfToken ? {
15298
+ "x-secsdk-csrf-token": csrfToken
15299
+ } : {}
15300
+ };
15301
+ const args = [
15302
+ {
15303
+ headers
15304
+ },
15305
+ _task.logger,
15306
+ params.proxyLoc,
15307
+ params.localIP,
15308
+ params.accountId
15309
+ ];
15310
+ const http = new Http(...args);
15311
+ const toNum = (val)=>{
15312
+ if (null == val) return 0;
15313
+ const n = Number.parseInt(String(val).replace(/[+,]/g, ""), 10);
15314
+ return Number.isNaN(n) ? 0 : n;
15315
+ };
15316
+ const userProfileP = http.api({
15317
+ method: "get",
15318
+ url: "https://www.douyin.com/aweme/v1/web/user/profile/self/",
15319
+ params: {
15320
+ device_platform: "webapp",
15321
+ aid: "6383",
15322
+ channel: "channel_pc_web",
15323
+ pc_client_type: "1",
15324
+ version_code: "170400",
15325
+ version_name: "17.4.0",
15326
+ cookie_enabled: "true",
15327
+ platform: "PC"
15328
+ }
15329
+ }, {
15330
+ retries: 3,
15331
+ retryDelay: 100,
15332
+ timeout: 10000
15333
+ }).catch((e)=>{
15334
+ _task.logger.warn(`抖音用户信息获取失败: ${e instanceof Error ? e.message : String(e)}`);
15335
+ return null;
15336
+ });
15337
+ const overviewP = http.api({
15338
+ method: "get",
15339
+ url: "https://creator.douyin.com/aweme/janus/creator/data/overview/all/",
15340
+ params: {
15341
+ last_days_type: 1,
15342
+ aid: 2906,
15343
+ app_name: "aweme_creator_platform",
15344
+ device_platform: "web"
15345
+ }
15346
+ }, {
15347
+ retries: 3,
15348
+ retryDelay: 100,
15349
+ timeout: 5000
15350
+ }).catch((e)=>{
15351
+ _task.logger.warn(`抖音近7日数据获取失败(可能未开通数据中心或被风控): ${e instanceof Error ? e.message : String(e)}`);
15352
+ return null;
15353
+ });
15354
+ const [userProfile, overview] = await Promise.all([
15355
+ userProfileP,
15356
+ overviewP
15357
+ ]);
15358
+ _task.logger.info(`抖音用户信息响应: ${JSON.stringify(userProfile)}`);
15359
+ _task.logger.info(`抖音近7日数据响应: ${JSON.stringify(overview)}`);
15360
+ let fansNum = 0;
15361
+ let favedNum = 0;
15362
+ let followingNum = 0;
15363
+ if (userProfile?.status_code === 0 && userProfile.user) {
15364
+ const user = userProfile.user;
15365
+ fansNum = toNum(user.follower_count);
15366
+ followingNum = toNum(user.following_count);
15367
+ favedNum = toNum(user.total_favorited);
15368
+ _task.logger.info(`提取用户数据 - 昵称: ${user.nickname}, 粉丝: ${fansNum}, 关注: ${followingNum}, 获赞: ${favedNum}, 作品: ${user.aweme_count}`);
15369
+ } else _task.logger.warn(`用户信息接口返回异常: status_code=${userProfile?.status_code}, msg=${userProfile?.status_msg}`);
15370
+ const ov = overview?.data;
15371
+ const douyinData = {
15372
+ fansNum,
15373
+ favedNum,
15374
+ fansNumLastWeek: toNum(ov?.fans_incr?.current_count),
15375
+ watchNumLastWeek: toNum(ov?.play_count?.current_count),
15376
+ likeNumLastWeek: toNum(ov?.like_count?.current_count),
15377
+ commentNumLastWeek: toNum(ov?.comment_count?.current_count),
15378
+ shareNumLastWeek: toNum(ov?.share_count?.current_count),
15379
+ visitNumLastWeek: toNum(ov?.profile_visit?.current_count)
15380
+ };
15381
+ return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(douyinData, "抖音平台数据获取成功!");
15382
+ } catch (error) {
15383
+ if (error && "object" == typeof error && "code" in error && "message" in error) {
15384
+ const err = error;
15385
+ _task.logger.error(`抖音账号数据获取失败: ${err.message} (${err.code})`);
15386
+ return types_errorResponse(err.message, err.code);
15387
+ }
15388
+ const errMsg = error instanceof Error ? error.message : String(error);
15389
+ _task.logger.error(`抖音账号数据获取失败: ${errMsg}`);
15390
+ return types_errorResponse(errMsg || "抖音账号数据获取失败");
15391
+ }
15392
+ }
15393
+ async function getShipinhaoData(_task, params) {
15394
+ try {
15395
+ const sessionidCookie = params.cookies.find((it)=>"sessionid" === it.name)?.value;
15396
+ if (!sessionidCookie) return types_errorResponse("视频号账号数据异常,请重新绑定账号后重试。", 414);
15397
+ const uinCookie = params.cookies.find((it)=>"uin" === it.name || "wxuin" === it.name)?.value || "0000000000";
15398
+ const deviceIdCookie = params.cookies.find((it)=>"device_id" === it.name || "finger_print_device_id" === it.name)?.value;
15399
+ const aid = params.cookies.find((it)=>"_aid" === it.name)?.value || "9d3e0e9f-b842-498d-a273-4285d58df264";
15400
+ const finderId = params.cookies.find((it)=>"_log_finder_id" === it.name || "finder_id" === it.name)?.value || "";
15401
+ const headers = {
15402
+ cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
15403
+ referer: "https://channels.weixin.qq.com/platform",
15404
+ origin: "https://channels.weixin.qq.com",
15405
+ "content-type": "application/json",
15406
+ "X-WECHAT-UIN": uinCookie,
15407
+ ...deviceIdCookie ? {
15408
+ "finger-print-device-id": deviceIdCookie
15409
+ } : {}
15410
+ };
15411
+ const args = [
15412
+ {
15413
+ headers
15414
+ },
15415
+ _task.logger,
15416
+ params.proxyLoc,
15417
+ params.localIP,
15418
+ params.accountId
15419
+ ];
15420
+ const http = new Http(...args);
15421
+ const authData = await http.api({
15422
+ method: "post",
15423
+ url: "https://channels.weixin.qq.com/cgi-bin/mmfinderassistant-bin/auth/auth_data",
15424
+ params: {
15425
+ _aid: aid,
15426
+ _rid: `${Date.now().toString(16)}-${Math.random().toString(36).substring(2, 9)}`,
15427
+ _pageUrl: encodeURIComponent("https://channels.weixin.qq.com/platform")
15428
+ },
15429
+ data: {
15430
+ timestamp: Date.now().toString(),
15431
+ _log_finder_uin: "",
15432
+ _log_finder_id: finderId,
15433
+ rawKeyBuff: "",
15434
+ pluginSessionId: null,
15435
+ scene: 7,
15436
+ reqScene: 7
15437
+ }
15438
+ }, {
15439
+ retries: 3,
15440
+ retryDelay: 100,
15441
+ timeout: 5000
15442
+ });
15443
+ _task.logger.info(`视频号账号数据响应: ${JSON.stringify(authData)}`);
15444
+ const AUTH_ERROR_CODES = [
15445
+ 300333,
15446
+ 300334,
15447
+ 300330,
15448
+ 300331,
15449
+ 300332
15450
+ ];
15451
+ if (authData.errCode && AUTH_ERROR_CODES.includes(authData.errCode)) {
15452
+ _task.logger.warn(`视频号登录已失效:${authData.errMsg} (${authData.errCode})`);
15453
+ return types_errorResponse("视频号账号信息获取失败,请检查账号状态", 414);
15454
+ }
15455
+ if (authData.errCode) {
15456
+ _task.logger.warn(`视频号账号API错误:${authData.errMsg} (${authData.errCode})`);
15457
+ return types_errorResponse(`视频号账号信息获取失败:${authData.errMsg || "未知错误"}`, 414);
15458
+ }
15459
+ const finderUser = authData.data?.finderUser;
15460
+ const shipinhaoData = {
15461
+ fansNum: finderUser?.fansCount || 0,
15462
+ feedsCount: finderUser?.feedsCount || 0,
15463
+ fansNumYesterday: null,
15464
+ playNumYesterday: null,
15465
+ likeNumYesterday: null,
15466
+ commentNumYesterday: null
15467
+ };
15468
+ return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(shipinhaoData, "视频号平台数据获取成功!");
15469
+ } catch (error) {
15470
+ if (error && "object" == typeof error && "code" in error && "message" in error) {
15471
+ const err = error;
15472
+ _task.logger.error(`视频号账号数据获取失败: ${err.message} (${err.code})`);
15473
+ return types_errorResponse(err.message, err.code);
15474
+ }
15475
+ const errMsg = error instanceof Error ? error.message : String(error);
15476
+ _task.logger.error(`视频号账号数据获取失败: ${errMsg}`);
15477
+ return types_errorResponse(errMsg || "视频号账号数据获取失败");
15478
+ }
15479
+ }
15289
15480
  async function getToutiaoData(_task, params) {
15290
15481
  const http = new Http({
15291
15482
  headers: {
@@ -15382,7 +15573,7 @@ async function getWeixinData(_task, params) {
15382
15573
  userInfoHtmlPromise,
15383
15574
  userSummaryHtmlPromise
15384
15575
  ]);
15385
- if (userInfoHtml.includes("请重新<a id='jumpUrl' href='/'>登录</a>")) return types_errorResponse("Token已失效,请重新获取", 414);
15576
+ if (userInfoHtml.includes("请重新<a id='jumpUrl' href='/'>登录</a>")) return types_errorResponse("微信公众号数据获取失败,请检查账号状态", 414);
15386
15577
  const userInfoJson = exportWxCgiData(userInfoHtml);
15387
15578
  const userSummaryJson = exportWxCgiData(userSummaryHtml);
15388
15579
  const wxData = {
@@ -15459,7 +15650,9 @@ const SearchAccountInfoParamsSchema = ActionCommonParamsSchema.extend({
15459
15650
  "toutiao",
15460
15651
  "xiaohongshu",
15461
15652
  "weixin",
15462
- "baijiahao"
15653
+ "baijiahao",
15654
+ "douyin",
15655
+ "shipinhao"
15463
15656
  ])
15464
15657
  });
15465
15658
  const SearchAccountInfo = async (_task, params)=>{
@@ -15473,6 +15666,10 @@ const SearchAccountInfo = async (_task, params)=>{
15473
15666
  return getWeixinData(_task, params);
15474
15667
  case "baijiahao":
15475
15668
  return getBaijiahaoData(_task, params);
15669
+ case "douyin":
15670
+ return getDouyinData(_task, params);
15671
+ case "shipinhao":
15672
+ return getShipinhaoData(_task, params);
15476
15673
  default:
15477
15674
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(null, "暂不支持该平台");
15478
15675
  }
@@ -15567,18 +15764,44 @@ const XiaohongshuArticleSchema = BaseArticleSchema.extend({
15567
15764
  collectNum: schemas_number(),
15568
15765
  shareNum: schemas_number()
15569
15766
  });
15767
+ const DouyinArticleSchema = BaseArticleSchema.extend({
15768
+ playNum: schemas_number(),
15769
+ likeNum: schemas_number(),
15770
+ commentNum: schemas_number(),
15771
+ shareNum: schemas_number(),
15772
+ collectNum: schemas_number(),
15773
+ awemeId: schemas_string(),
15774
+ awemeType: schemas_number(),
15775
+ duration: schemas_number().optional(),
15776
+ status: schemas_string(),
15777
+ publicUrl: schemas_string()
15778
+ });
15779
+ const ShipinhaoArticleSchema = BaseArticleSchema.extend({
15780
+ readNum: schemas_number(),
15781
+ likeNum: schemas_number(),
15782
+ commentNum: schemas_number(),
15783
+ forwardNum: schemas_number(),
15784
+ favNum: schemas_number(),
15785
+ objectId: schemas_string(),
15786
+ postType: schemas_string(),
15787
+ postStatus: schemas_number()
15788
+ });
15570
15789
  const FetchArticlesDataSchema = schemas_object({
15571
15790
  articleCell: schemas_array(union([
15572
15791
  ToutiaoArticleSchema,
15573
15792
  WeixinArticleSchema,
15574
15793
  BaijiahaoArticleSchema,
15575
- XiaohongshuArticleSchema
15794
+ XiaohongshuArticleSchema,
15795
+ DouyinArticleSchema,
15796
+ ShipinhaoArticleSchema
15576
15797
  ])).optional(),
15577
15798
  timerPublish: schemas_array(union([
15578
15799
  ToutiaoArticleSchema,
15579
15800
  WeixinArticleSchema,
15580
15801
  BaijiahaoArticleSchema,
15581
- XiaohongshuArticleSchema
15802
+ XiaohongshuArticleSchema,
15803
+ DouyinArticleSchema,
15804
+ ShipinhaoArticleSchema
15582
15805
  ])).optional(),
15583
15806
  pagination: schemas_object({
15584
15807
  total: schemas_number().optional(),
@@ -15693,6 +15916,248 @@ async function handleBaijiahaoData(_task, params) {
15693
15916
  return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "百家号文章数据获取失败");
15694
15917
  }
15695
15918
  }
15919
+ async function handleDouyinData(_task, params) {
15920
+ try {
15921
+ const { cookies, pageNum = 1, pageSize = 12, status = 0, showOriginalData = false, onlySuccess = false } = params;
15922
+ const headers = {
15923
+ cookie: cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
15924
+ referer: "https://creator.douyin.com"
15925
+ };
15926
+ const args = [
15927
+ {
15928
+ headers
15929
+ },
15930
+ _task.logger,
15931
+ params.proxyLoc,
15932
+ params.localIP,
15933
+ params.accountId
15934
+ ];
15935
+ const http = new Http(...args);
15936
+ async function fetchWorks(cursor) {
15937
+ return await http.api({
15938
+ method: "get",
15939
+ url: "https://creator.douyin.com/janus/douyin/creator/pc/work_list",
15940
+ params: {
15941
+ scene: "star_atlas",
15942
+ device_platform: "android",
15943
+ aid: 1128,
15944
+ status,
15945
+ count: pageSize,
15946
+ max_cursor: cursor
15947
+ }
15948
+ }, {
15949
+ retries: 3,
15950
+ retryDelay: 100,
15951
+ timeout: 5000
15952
+ });
15953
+ }
15954
+ const isHasMore = (v)=>true === v || 1 === v;
15955
+ const skipCount = (pageNum - 1) * pageSize;
15956
+ const needCount = skipCount + pageSize;
15957
+ const workListResponse = await fetchWorks(0);
15958
+ if (!workListResponse || !Array.isArray(workListResponse.aweme_list)) return searchPublishInfo_types_errorResponse("抖音数据获取失败,请检查账号状态", 414);
15959
+ const allWorks = [
15960
+ ...workListResponse.aweme_list
15961
+ ];
15962
+ let hasMore = isHasMore(workListResponse.has_more);
15963
+ let currentCursor = workListResponse.cursor ?? workListResponse.max_cursor ?? 0;
15964
+ let guard = 0;
15965
+ while(allWorks.length < needCount && hasMore && guard < 20){
15966
+ const nextPageResponse = await fetchWorks(currentCursor);
15967
+ if (!Array.isArray(nextPageResponse.aweme_list) || 0 === nextPageResponse.aweme_list.length) break;
15968
+ allWorks.push(...nextPageResponse.aweme_list);
15969
+ hasMore = isHasMore(nextPageResponse.has_more);
15970
+ currentCursor = nextPageResponse.cursor ?? nextPageResponse.max_cursor ?? currentCursor;
15971
+ guard++;
15972
+ }
15973
+ const finalWorks = allWorks.slice(skipCount, needCount);
15974
+ const articleCell = finalWorks.map((item)=>{
15975
+ const workDetailUrl = `https://creator.douyin.com/creator-micro/work-management/work-detail/${item.aweme_id}`;
15976
+ const workPublicUrl = item.share_url || `https://www.douyin.com/video/${item.aweme_id}`;
15977
+ let statusText;
15978
+ statusText = item.status?.is_delete ? "deleted" : item.status?.is_private ? "private" : item.status?.in_reviewing ? "reviewing" : "public";
15979
+ return {
15980
+ title: item.desc || "无作品描述",
15981
+ imageUrl: item.Cover?.url_list?.[0] || "",
15982
+ createTime: item.create_time,
15983
+ redirectUrl: workDetailUrl,
15984
+ playNum: item.statistics?.play_count || 0,
15985
+ likeNum: item.statistics?.digg_count || 0,
15986
+ commentNum: item.statistics?.comment_count || 0,
15987
+ shareNum: item.statistics?.share_count || 0,
15988
+ collectNum: item.statistics?.collect_count || 0,
15989
+ awemeId: item.aweme_id,
15990
+ awemeType: item.aweme_type ?? 0,
15991
+ duration: item.duration,
15992
+ status: statusText,
15993
+ publicUrl: workPublicUrl,
15994
+ ...showOriginalData ? {
15995
+ originalData: item
15996
+ } : {}
15997
+ };
15998
+ });
15999
+ return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)({
16000
+ articleCell,
16001
+ ...onlySuccess ? {
16002
+ pagination: {
16003
+ total: workListResponse.total || allWorks.length,
16004
+ nextPage: hasMore,
16005
+ pageNum,
16006
+ pageSize
16007
+ }
16008
+ } : null
16009
+ }, "抖音数据获取成功");
16010
+ } catch (error) {
16011
+ return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "抖音数据获取失败");
16012
+ }
16013
+ }
16014
+ async function handleShipinhaoData(_task, params) {
16015
+ try {
16016
+ const { cookies, postType = "all", pageNum = 1, pageSize = 20, showOriginalData = false } = params;
16017
+ const aidCookie = cookies.find((it)=>"_aid" === it.name)?.value;
16018
+ const aid = aidCookie || "9d3e0e9f-b842-498d-a273-4285d58df264";
16019
+ const uinCookie = cookies.find((it)=>"uin" === it.name || "wxuin" === it.name)?.value || "0000000000";
16020
+ const deviceIdCookie = cookies.find((it)=>"device_id" === it.name || "finger_print_device_id" === it.name)?.value;
16021
+ const headers = {
16022
+ cookie: cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
16023
+ referer: "https://channels.weixin.qq.com",
16024
+ origin: "https://channels.weixin.qq.com",
16025
+ "content-type": "application/json",
16026
+ "X-WECHAT-UIN": uinCookie,
16027
+ ...deviceIdCookie ? {
16028
+ "finger-print-device-id": deviceIdCookie
16029
+ } : {}
16030
+ };
16031
+ const args = [
16032
+ {
16033
+ headers
16034
+ },
16035
+ _task.logger,
16036
+ params.proxyLoc,
16037
+ params.localIP,
16038
+ params.accountId
16039
+ ];
16040
+ const http = new Http(...args);
16041
+ const finderIdCookie = cookies.find((it)=>"_log_finder_id" === it.name || "finder_id" === it.name)?.value || "";
16042
+ async function fetchPosts(currentPage, userpageType, pageUrl) {
16043
+ return await http.api({
16044
+ method: "post",
16045
+ url: "https://channels.weixin.qq.com/micro/content/cgi-bin/mmfinderassistant-bin/post/post_list",
16046
+ params: {
16047
+ _aid: aid,
16048
+ _rid: `${Date.now().toString(16)}-${Math.random().toString(36).substring(2, 9)}`,
16049
+ _pageUrl: encodeURIComponent(pageUrl)
16050
+ },
16051
+ data: {
16052
+ pageSize,
16053
+ currentPage,
16054
+ userpageType,
16055
+ stickyOrder: true,
16056
+ timestamp: Date.now().toString(),
16057
+ _log_finder_uin: "",
16058
+ _log_finder_id: finderIdCookie,
16059
+ rawKeyBuff: "",
16060
+ pluginSessionId: null,
16061
+ scene: 7,
16062
+ reqScene: 7
16063
+ }
16064
+ }, {
16065
+ retries: 3,
16066
+ retryDelay: 100,
16067
+ timeout: 5000
16068
+ });
16069
+ }
16070
+ const mapPost = (item, forcePostType)=>{
16071
+ let imageUrl = "";
16072
+ if (item.desc?.media?.[0]?.thumbUrl) imageUrl = item.desc.media[0].thumbUrl;
16073
+ else if (item.desc?.media?.[0]?.coverUrl) imageUrl = item.desc.media[0].coverUrl;
16074
+ else if (item.cover?.url) imageUrl = item.cover.url;
16075
+ else if (item.media_url) imageUrl = item.media_url;
16076
+ const title = item.desc?.description || item.object_desc || "无标题";
16077
+ return {
16078
+ title,
16079
+ imageUrl,
16080
+ createTime: item.createTime || item.create_time,
16081
+ redirectUrl: "https://channels.weixin.qq.com/platform",
16082
+ readNum: item.readCount || item.read_count || 0,
16083
+ likeNum: item.likeCount || item.like_count || 0,
16084
+ commentNum: item.commentCount || item.comment_count || 0,
16085
+ forwardNum: item.forwardCount || item.forward_count || 0,
16086
+ favNum: item.favCount || item.fav_count || 0,
16087
+ objectId: item.exportId || item.objectId || "",
16088
+ postType: forcePostType,
16089
+ postStatus: item.status || item.post_status || 0,
16090
+ ...showOriginalData ? {
16091
+ originalData: item
16092
+ } : {}
16093
+ };
16094
+ };
16095
+ const allArticles = [];
16096
+ const needVideo = "all" === postType || "video" === postType;
16097
+ const needArticle = "all" === postType || "article" === postType;
16098
+ const AUTH_ERROR_CODES = [
16099
+ 300333,
16100
+ 300334,
16101
+ 300330,
16102
+ 300331,
16103
+ 300332
16104
+ ];
16105
+ if (needVideo) try {
16106
+ const videoPageUrl = "https://channels.weixin.qq.com/micro/content/post/list";
16107
+ const videoResponse = await fetchPosts(pageNum, 11, videoPageUrl);
16108
+ _task.logger.info(`视频号视频获取响应:${JSON.stringify(videoResponse)}`);
16109
+ if (videoResponse.errCode && AUTH_ERROR_CODES.includes(videoResponse.errCode)) throw new Error(`AUTH_ERROR:${videoResponse.errMsg || "登录已失效"}`);
16110
+ if (videoResponse.errCode) {
16111
+ _task.logger.warn(`视频号API错误:${videoResponse.errMsg} (${videoResponse.errCode})`);
16112
+ throw new Error(`视频号API错误:${videoResponse.errMsg} (${videoResponse.errCode})`);
16113
+ }
16114
+ {
16115
+ const posts = videoResponse.data?.list || videoResponse.posts || videoResponse.post_list || [];
16116
+ const videoArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "video"));
16117
+ allArticles.push(...videoArticles);
16118
+ _task.logger.info(`视频号视频获取成功,共${videoArticles.length}条`);
16119
+ }
16120
+ } catch (error) {
16121
+ const errMsg = error instanceof Error ? error.message : String(error);
16122
+ if (errMsg.startsWith("AUTH_ERROR:")) throw error;
16123
+ _task.logger.warn(`获取视频号视频失败:${errMsg}`);
16124
+ }
16125
+ if (needArticle) try {
16126
+ const articlePageUrl = "https://channels.weixin.qq.com/micro/content/post/finderNewLifePostList";
16127
+ const articleResponse = await fetchPosts(pageNum, 10, articlePageUrl);
16128
+ if (articleResponse.errCode && AUTH_ERROR_CODES.includes(articleResponse.errCode)) throw new Error(`AUTH_ERROR:${articleResponse.errMsg || "登录已失效"}`);
16129
+ if (articleResponse.errCode) {
16130
+ _task.logger.warn(`视频号图文API错误:${articleResponse.errMsg} (${articleResponse.errCode})`);
16131
+ throw new Error(`视频号图文API错误:${articleResponse.errMsg} (${articleResponse.errCode})`);
16132
+ }
16133
+ {
16134
+ const posts = articleResponse.data?.list || articleResponse.posts || articleResponse.post_list || [];
16135
+ const articleArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "article"));
16136
+ allArticles.push(...articleArticles);
16137
+ _task.logger.info(`视频号图文获取成功,共${articleArticles.length}条`);
16138
+ }
16139
+ } catch (error) {
16140
+ const errMsg = error instanceof Error ? error.message : String(error);
16141
+ if (errMsg.startsWith("AUTH_ERROR:")) throw error;
16142
+ _task.logger.warn(`获取视频号图文失败:${errMsg}`);
16143
+ }
16144
+ allArticles.sort((a, b)=>b.createTime - a.createTime);
16145
+ _task.logger.info(`视频号数据获取成功,${JSON.stringify(allArticles)}`);
16146
+ return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)({
16147
+ articleCell: allArticles,
16148
+ pagination: {
16149
+ total: allArticles.length,
16150
+ nextPage: false,
16151
+ pageNum,
16152
+ pageSize
16153
+ }
16154
+ }, "视频号数据获取成功");
16155
+ } catch (error) {
16156
+ const errMsg = error instanceof Error ? error.message : String(error);
16157
+ if (errMsg.startsWith("AUTH_ERROR:")) return searchPublishInfo_types_errorResponse("视频号数据获取失败,请检查账号状态", 414);
16158
+ return searchPublishInfo_types_errorResponse(errMsg || "视频号数据获取失败");
16159
+ }
16160
+ }
15696
16161
  async function handleToutiaoData(_task, params) {
15697
16162
  try {
15698
16163
  const { cookies, pageNum = 1, pageSize = 10, showOriginalData = false, onlySuccess = false, containsArticle = false } = params;
@@ -15725,7 +16190,7 @@ async function handleToutiaoData(_task, params) {
15725
16190
  app_id: 1231
15726
16191
  }
15727
16192
  });
15728
- if (0 !== visitedUid.code) return searchPublishInfo_types_errorResponse("头条号账号信息获取失败,请检查账号状态", 414);
16193
+ if (0 !== visitedUid.code) return searchPublishInfo_types_errorResponse("头条号数据获取失败,请检查账号状态", 414);
15729
16194
  const articleInfo = await http.api({
15730
16195
  method: "get",
15731
16196
  url: "https://mp.toutiao.com/api/feed/mp_provider/v1/",
@@ -15832,7 +16297,7 @@ async function handleWeixinData(_task, params) {
15832
16297
  const size = onlySuccess ? 10 : pageSize > 20 ? 20 : pageSize;
15833
16298
  let begin = (lastPage ?? pageNum) - 1;
15834
16299
  const rawArticlesInfo = await fetchArticles(begin * size, size, token);
15835
- if (rawArticlesInfo.includes("请重新<a id='jumpUrl' href='/'>登录</a>")) return searchPublishInfo_types_errorResponse("登陆已失效,请重新登陆!", 414);
16300
+ if (rawArticlesInfo.includes("请重新<a id='jumpUrl' href='/'>登录</a>")) return searchPublishInfo_types_errorResponse("微信公众号数据获取失败,请检查账号状态", 414);
15836
16301
  const articlesInfo = ParsePublishPage(rawArticlesInfo);
15837
16302
  let articleCell = [];
15838
16303
  if (!onlySuccess && pageSize > 20) {
@@ -15994,7 +16459,7 @@ async function handleXiaohongshuData(_task, params) {
15994
16459
  const a1Cookie = cookies.find((it)=>"a1" === it.name)?.value;
15995
16460
  if (!a1Cookie) return {
15996
16461
  code: 414,
15997
- message: "账号数据异常",
16462
+ message: "小红书数据获取失败,请检查账号状态",
15998
16463
  data: {}
15999
16464
  };
16000
16465
  if (onlySuccess && 10 !== pageSize) return {
@@ -16113,7 +16578,7 @@ async function handleXiaohongshuData(_task, params) {
16113
16578
  }, "小红书文章数据获取成功");
16114
16579
  }
16115
16580
  const FetchArticlesParamsSchema = ActionCommonParamsSchema.extend({
16116
- platform: schemas_string().describe("社交平台:weixin, toutiao, baijiahao, xiaohongshu"),
16581
+ platform: schemas_string().describe("社交平台:weixin, toutiao, baijiahao, xiaohongshu, douyin, shipinhao"),
16117
16582
  token: union([
16118
16583
  schemas_string(),
16119
16584
  schemas_number()
@@ -16125,7 +16590,14 @@ const FetchArticlesParamsSchema = ActionCommonParamsSchema.extend({
16125
16590
  showOriginalData: schemas_boolean().optional().describe("是否展示原始数据,默认false"),
16126
16591
  cursor: schemas_number().optional().describe("仅用于微信分页游标,默认为空"),
16127
16592
  lastPage: schemas_number().optional(),
16128
- containsArticle: schemas_boolean().optional().describe("是否包含文章内容,默认false")
16593
+ containsArticle: schemas_boolean().optional().describe("是否包含文章内容,默认false"),
16594
+ status: schemas_number().optional().describe("抖音作品状态:0=全部"),
16595
+ includeAccount: schemas_boolean().optional().describe("是否包含账号数据,默认true"),
16596
+ postType: schemas_enum([
16597
+ "video",
16598
+ "article",
16599
+ "all"
16600
+ ]).optional().describe("视频号作品类型:video=视频, article=图文, all=全部")
16129
16601
  });
16130
16602
  const FetchArticles = async (_task, params)=>{
16131
16603
  const { platform } = params;
@@ -16138,6 +16610,10 @@ const FetchArticles = async (_task, params)=>{
16138
16610
  return handleBaijiahaoData(_task, params);
16139
16611
  case "xiaohongshu":
16140
16612
  return handleXiaohongshuData(_task, params);
16613
+ case "douyin":
16614
+ return handleDouyinData(_task, params);
16615
+ case "shipinhao":
16616
+ return handleShipinhaoData(_task, params);
16141
16617
  default:
16142
16618
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)({}, "暂不支持该平台");
16143
16619
  }
@@ -24703,6 +25179,24 @@ const bjhConfigDataSchema = schemas_object({
24703
25179
  likeNumYesterday: schemas_number().nullable(),
24704
25180
  commentNumYesterday: schemas_number().nullable()
24705
25181
  });
25182
+ schemas_object({
25183
+ fansNum: schemas_number(),
25184
+ favedNum: schemas_number(),
25185
+ fansNumLastWeek: schemas_number(),
25186
+ watchNumLastWeek: schemas_number(),
25187
+ likeNumLastWeek: schemas_number(),
25188
+ commentNumLastWeek: schemas_number(),
25189
+ shareNumLastWeek: schemas_number(),
25190
+ visitNumLastWeek: schemas_number()
25191
+ });
25192
+ schemas_object({
25193
+ fansNum: schemas_number(),
25194
+ feedsCount: schemas_number(),
25195
+ fansNumYesterday: schemas_number().nullable(),
25196
+ playNumYesterday: schemas_number().nullable(),
25197
+ likeNumYesterday: schemas_number().nullable(),
25198
+ commentNumYesterday: schemas_number().nullable()
25199
+ });
24706
25200
  const BetaFlag = "HuiwenCanary";
24707
25201
  class Action {
24708
25202
  constructor(task){