@iflyrpa/actions 3.0.3 → 3.0.5-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/bundle.js +53 -22
- package/dist/bundle.js.map +1 -1
- package/dist/index.js +53 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +53 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -5434,9 +5434,7 @@ function __webpack_require__(moduleId) {
|
|
|
5434
5434
|
return module;
|
|
5435
5435
|
};
|
|
5436
5436
|
})();
|
|
5437
|
-
var package_namespaceObject = {
|
|
5438
|
-
i8: "3.0.2"
|
|
5439
|
-
};
|
|
5437
|
+
var package_namespaceObject = JSON.parse('{"i8":"3.0.5-beta.1"}');
|
|
5440
5438
|
var dist = __webpack_require__("../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js");
|
|
5441
5439
|
async function ProxyAgent(task, ip, adr, accountId, refresh) {
|
|
5442
5440
|
const http = new Http({
|
|
@@ -5451,7 +5449,7 @@ async function ProxyAgent(task, ip, adr, accountId, refresh) {
|
|
|
5451
5449
|
};
|
|
5452
5450
|
const ProxyInfo = await http.api({
|
|
5453
5451
|
method: "POST",
|
|
5454
|
-
url: "
|
|
5452
|
+
url: "https://fetdev.iflysec.com/ip-pool/pool/eip/proxy",
|
|
5455
5453
|
data: params
|
|
5456
5454
|
}).catch((err)=>{
|
|
5457
5455
|
throw {
|
|
@@ -5526,6 +5524,13 @@ class Http {
|
|
|
5526
5524
|
}
|
|
5527
5525
|
};
|
|
5528
5526
|
if (foundError) Object.assign(errorResponse, foundError);
|
|
5527
|
+
if (error.response?.status === 403) {
|
|
5528
|
+
this.logger?.warn(`[403 详细信息] URL: ${error.config?.url}`);
|
|
5529
|
+
this.logger?.warn(`[403 响应头] ${JSON.stringify(error.response?.headers || {})}`);
|
|
5530
|
+
this.logger?.warn(`[403 响应体] ${JSON.stringify(error.response?.data || null)}`);
|
|
5531
|
+
const verifyDecision = error.response?.headers?.["x-tt-verify-passport-decision"];
|
|
5532
|
+
if (verifyDecision) this.logger?.warn(`[403 验证决策] x-tt-verify-passport-decision: ${verifyDecision}`);
|
|
5533
|
+
}
|
|
5529
5534
|
if (error.response?.data) {
|
|
5530
5535
|
if ("object" == typeof error.response.data) {
|
|
5531
5536
|
const serverError = error.response.data;
|
|
@@ -14506,6 +14511,32 @@ const mock_mockAction = async (task, params)=>{
|
|
|
14506
14511
|
retries: 3,
|
|
14507
14512
|
retryDelay: 2000
|
|
14508
14513
|
});
|
|
14514
|
+
task.logger.info("========== api调用完成 ==========");
|
|
14515
|
+
task.logger.info(`decision值: ${JSON.stringify(decision)}, needsVerification(decision): ${needsVerification(decision)}`);
|
|
14516
|
+
if (needsVerification(decision)) {
|
|
14517
|
+
const details = [
|
|
14518
|
+
publishResult.status_msg,
|
|
14519
|
+
decision?.verify_title,
|
|
14520
|
+
decision?.verify_desc
|
|
14521
|
+
].filter(Boolean).join(" ");
|
|
14522
|
+
const message = `图文发布失败,原因:${details}${task.debug ? ` ${http.proxyInfo}` : ""}`;
|
|
14523
|
+
task.logger.warn(`TaskId:${task.taskId},检测到需要验证,准备返回验证信息`);
|
|
14524
|
+
const mockData = {
|
|
14525
|
+
state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
|
|
14526
|
+
error: message,
|
|
14527
|
+
result: {
|
|
14528
|
+
data: decision,
|
|
14529
|
+
uploadedImgList: JSON.stringify(publishData.item.common.images)
|
|
14530
|
+
}
|
|
14531
|
+
};
|
|
14532
|
+
await updateTaskState?.(mockData);
|
|
14533
|
+
return {
|
|
14534
|
+
code: 0,
|
|
14535
|
+
data: mockData,
|
|
14536
|
+
message: "操作成功"
|
|
14537
|
+
};
|
|
14538
|
+
}
|
|
14539
|
+
task.logger.info("不需要验证,继续正常流程");
|
|
14509
14540
|
reportLogger({
|
|
14510
14541
|
token: params.huiwenToken || "",
|
|
14511
14542
|
enverionment: task.enverionment || "development",
|
|
@@ -16024,26 +16055,26 @@ async function getToutiaoData(_task, params) {
|
|
|
16024
16055
|
const http = new Http({
|
|
16025
16056
|
headers: {
|
|
16026
16057
|
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
16027
|
-
referer: "https://mp.toutiao.com/profile_v4/graphic/publish"
|
|
16058
|
+
referer: "https://mp.toutiao.com/profile_v4/graphic/publish",
|
|
16059
|
+
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"
|
|
16060
|
+
}
|
|
16061
|
+
});
|
|
16062
|
+
const totalData = await http.api({
|
|
16063
|
+
method: "get",
|
|
16064
|
+
url: "https://mp.toutiao.com/mp/fe_api/home/merge_v2",
|
|
16065
|
+
params: {
|
|
16066
|
+
app_id: 1231
|
|
16067
|
+
}
|
|
16068
|
+
});
|
|
16069
|
+
await new Promise((r)=>setTimeout(r, 1000));
|
|
16070
|
+
const contentDataYesterday = await http.api({
|
|
16071
|
+
method: "get",
|
|
16072
|
+
url: "https://mp.toutiao.com/mp/agw/statistic/v2/content_stat",
|
|
16073
|
+
params: {
|
|
16074
|
+
type: 0,
|
|
16075
|
+
app_id: 1231
|
|
16028
16076
|
}
|
|
16029
16077
|
});
|
|
16030
|
-
const [totalData, contentDataYesterday] = await Promise.all([
|
|
16031
|
-
http.api({
|
|
16032
|
-
method: "get",
|
|
16033
|
-
url: "https://mp.toutiao.com/mp/fe_api/home/merge_v2",
|
|
16034
|
-
params: {
|
|
16035
|
-
app_id: 1231
|
|
16036
|
-
}
|
|
16037
|
-
}),
|
|
16038
|
-
http.api({
|
|
16039
|
-
method: "get",
|
|
16040
|
-
url: "https://mp.toutiao.com/mp/agw/statistic/v2/content_stat",
|
|
16041
|
-
params: {
|
|
16042
|
-
type: 0,
|
|
16043
|
-
app_id: 1231
|
|
16044
|
-
}
|
|
16045
|
-
})
|
|
16046
|
-
]);
|
|
16047
16078
|
const isSuccess = !!(totalData?.data?.statistic && contentDataYesterday?.author_stat);
|
|
16048
16079
|
if (!isSuccess || !totalData?.data || !contentDataYesterday?.author_stat) return types_errorResponse(totalData?.message || contentDataYesterday?.message || "头条号数据获取失败,请检查Cookie是否有效", 414);
|
|
16049
16080
|
const ttData = {
|