@iflyrpa/actions 3.0.0-beta.2 → 3.0.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/bundle.js +595 -18
- package/dist/bundle.js.map +1 -1
- package/dist/index.js +42 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42 -14
- package/dist/index.mjs.map +1 -1
- package/dist/utils/douyin/imageUploader.d.ts +1 -0
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -5489,7 +5489,7 @@ var __webpack_exports__ = {};
|
|
|
5489
5489
|
});
|
|
5490
5490
|
const package_json_namespaceObject = require("@iflyrpa/share/package.json");
|
|
5491
5491
|
var package_json_default = /*#__PURE__*/ __webpack_require__.n(package_json_namespaceObject);
|
|
5492
|
-
var package_namespaceObject = JSON.parse('{"i8":"3.0.0-beta.
|
|
5492
|
+
var package_namespaceObject = JSON.parse('{"i8":"3.0.0-beta.3"}');
|
|
5493
5493
|
const share_namespaceObject = require("@iflyrpa/share");
|
|
5494
5494
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
5495
5495
|
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
@@ -5522,7 +5522,11 @@ var __webpack_exports__ = {};
|
|
|
5522
5522
|
url: "http://172.29.194.32:9998/pool/eip/proxy",
|
|
5523
5523
|
data: params
|
|
5524
5524
|
}).catch((err)=>{
|
|
5525
|
-
throw
|
|
5525
|
+
throw {
|
|
5526
|
+
code: 414,
|
|
5527
|
+
message: `请求代理失败:${err.message}`,
|
|
5528
|
+
data: {}
|
|
5529
|
+
};
|
|
5526
5530
|
});
|
|
5527
5531
|
const loggerInfo = {
|
|
5528
5532
|
params,
|
|
@@ -12793,6 +12797,7 @@ var __webpack_exports__ = {};
|
|
|
12793
12797
|
};
|
|
12794
12798
|
return (0, share_namespaceObject.response)(isSuccess ? 0 : 414, message, data);
|
|
12795
12799
|
};
|
|
12800
|
+
const external_fzstd_namespaceObject = require("fzstd");
|
|
12796
12801
|
const DouyinGetMusicParamsSchema = ActionCommonParamsSchema.extend({
|
|
12797
12802
|
keyword: schemas_string().optional(),
|
|
12798
12803
|
count: schemas_number().optional()
|
|
@@ -12874,8 +12879,11 @@ var __webpack_exports__ = {};
|
|
|
12874
12879
|
browser_version: userAgent,
|
|
12875
12880
|
browser_online: "true",
|
|
12876
12881
|
timezone_name: "Asia/Shanghai",
|
|
12877
|
-
support_h265: "1"
|
|
12882
|
+
support_h265: "1",
|
|
12883
|
+
a_bogus: ""
|
|
12878
12884
|
};
|
|
12885
|
+
const authQueryBefore = new URLSearchParams(authorizationParams).toString();
|
|
12886
|
+
authorizationParams.a_bogus = douyinGetMusic_getABogus(`https://creator.douyin.com/web/api/media/aweme/search/post/auth/?${authQueryBefore}`, {}, userAgent);
|
|
12879
12887
|
const authorizationQueryString = new URLSearchParams(authorizationParams).toString();
|
|
12880
12888
|
const authorization = await http.api({
|
|
12881
12889
|
method: "get",
|
|
@@ -12894,20 +12902,36 @@ var __webpack_exports__ = {};
|
|
|
12894
12902
|
total: 0
|
|
12895
12903
|
});
|
|
12896
12904
|
console.log("抖音获取音乐权限:", authorization);
|
|
12897
|
-
const
|
|
12905
|
+
const musicRes = await http.api({
|
|
12898
12906
|
method: "get",
|
|
12899
12907
|
url: `https://tsearch.amemv.com/openapi/aweme/v1/music/search/?${queryString}`,
|
|
12900
12908
|
headers: {
|
|
12901
|
-
|
|
12909
|
+
Accept: "application/json, text/plain, */*",
|
|
12910
|
+
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
|
|
12911
|
+
"cache-control": "no-cache",
|
|
12912
|
+
pragma: "no-cache",
|
|
12913
|
+
priority: "u=1, i",
|
|
12914
|
+
origin: "https://creator.douyin.com",
|
|
12915
|
+
referer: "https://creator.douyin.com/",
|
|
12916
|
+
"sec-ch-ua": params.extraParam?.browserInfo?.["sec-ch-ua"] || "",
|
|
12917
|
+
"sec-ch-ua-mobile": "?0",
|
|
12918
|
+
"sec-ch-ua-platform": params.extraParam?.browserInfo?.["sec-ch-ua-platform"] || "",
|
|
12919
|
+
"sec-fetch-dest": "empty",
|
|
12920
|
+
"sec-fetch-mode": "cors",
|
|
12921
|
+
"sec-fetch-site": "cross-site",
|
|
12922
|
+
"user-agent": userAgent,
|
|
12902
12923
|
"agw-auth": authorization?.signature || "",
|
|
12903
|
-
"
|
|
12904
|
-
}
|
|
12924
|
+
"openapi-omit-shark": "1"
|
|
12925
|
+
},
|
|
12926
|
+
responseType: "arraybuffer"
|
|
12905
12927
|
}, {
|
|
12906
12928
|
retries: 3,
|
|
12907
12929
|
retryDelay: 20,
|
|
12908
12930
|
timeout: 3000
|
|
12909
12931
|
});
|
|
12910
|
-
|
|
12932
|
+
const decompressed = (0, external_fzstd_namespaceObject.decompress)(new Uint8Array(musicRes));
|
|
12933
|
+
const res = JSON.parse(Buffer.from(decompressed).toString("utf-8"));
|
|
12934
|
+
console.log("抖音获取音乐响应:", JSON.stringify(res));
|
|
12911
12935
|
const isSuccess = 0 === res.status_code;
|
|
12912
12936
|
const message = `抖音获取音乐${isSuccess ? "成功" : `失败,原因:${res.status_msg}`}${_task.debug ? ` ${http.proxyInfo}` : ""}`;
|
|
12913
12937
|
const data = isSuccess ? {
|
|
@@ -13980,9 +14004,10 @@ var __webpack_exports__ = {};
|
|
|
13980
14004
|
this.authCache = null;
|
|
13981
14005
|
this.authExpireTime = 0;
|
|
13982
14006
|
this.AUTH_REFRESH_BUFFER = 300000;
|
|
13983
|
-
this.CONCURRENT_LIMIT =
|
|
14007
|
+
this.CONCURRENT_LIMIT = 5;
|
|
13984
14008
|
this.UPLOAD_DELAY = 1000;
|
|
13985
|
-
this.UPLOAD_TIMEOUT =
|
|
14009
|
+
this.UPLOAD_TIMEOUT = 300000;
|
|
14010
|
+
this.TOS_UPLOAD_TIMEOUT = 600000;
|
|
13986
14011
|
this.proxyHttp = proxyHttp;
|
|
13987
14012
|
this.headers = headers;
|
|
13988
14013
|
this.queryParams = queryParams;
|
|
@@ -13992,7 +14017,7 @@ var __webpack_exports__ = {};
|
|
|
13992
14017
|
keepAlive: true,
|
|
13993
14018
|
maxSockets: this.CONCURRENT_LIMIT,
|
|
13994
14019
|
maxFreeSockets: 2,
|
|
13995
|
-
timeout: this.
|
|
14020
|
+
timeout: this.TOS_UPLOAD_TIMEOUT
|
|
13996
14021
|
};
|
|
13997
14022
|
agentOptions.freeSocketTimeout = 30000;
|
|
13998
14023
|
this.uploadAgent = new Agent(agentOptions);
|
|
@@ -14016,7 +14041,7 @@ var __webpack_exports__ = {};
|
|
|
14016
14041
|
"Content-Type": "application/json"
|
|
14017
14042
|
}
|
|
14018
14043
|
}, {
|
|
14019
|
-
timeout:
|
|
14044
|
+
timeout: 300000
|
|
14020
14045
|
});
|
|
14021
14046
|
if (!uploadAuth.auth) throw new Error(uploadAuth.status_msg || "获取上传权限失败");
|
|
14022
14047
|
try {
|
|
@@ -14067,6 +14092,8 @@ var __webpack_exports__ = {};
|
|
|
14067
14092
|
"X-amz-date": amzDate,
|
|
14068
14093
|
"X-amz-security-token": authData.SessionToken
|
|
14069
14094
|
}
|
|
14095
|
+
}, {
|
|
14096
|
+
timeout: this.UPLOAD_TIMEOUT
|
|
14070
14097
|
});
|
|
14071
14098
|
if (!response) throw new Error("获取上传地址失败: 响应为空");
|
|
14072
14099
|
if (response.ResponseMetadata?.Error) throw new Error(`ImageX错误: ${response.ResponseMetadata.Error.Code} - ${response.ResponseMetadata.Error.Message}`);
|
|
@@ -14111,7 +14138,7 @@ var __webpack_exports__ = {};
|
|
|
14111
14138
|
data: fileBuffer,
|
|
14112
14139
|
httpAgent: this.uploadAgent,
|
|
14113
14140
|
httpsAgent: this.uploadAgent,
|
|
14114
|
-
timeout: this.
|
|
14141
|
+
timeout: this.TOS_UPLOAD_TIMEOUT,
|
|
14115
14142
|
maxBodyLength: 1 / 0,
|
|
14116
14143
|
maxContentLength: 1 / 0
|
|
14117
14144
|
});
|
|
@@ -14418,7 +14445,8 @@ var __webpack_exports__ = {};
|
|
|
14418
14445
|
};
|
|
14419
14446
|
}
|
|
14420
14447
|
if (params.banners && params.banners.length > 0) {
|
|
14421
|
-
const
|
|
14448
|
+
const banners = params.banners.filter((i)=>i !== params.coverImage);
|
|
14449
|
+
const uploadResults = await uploader.uploadImages(banners);
|
|
14422
14450
|
publishData.item.common.images = publishData.item.common.images.concat(uploadResults.map((result)=>({
|
|
14423
14451
|
uri: result.uri,
|
|
14424
14452
|
width: result.width,
|