mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-04-23 02:48:44 +08:00
Update jd_try.js
This commit is contained in:
parent
f453d5923c
commit
88d89a4f91
14
jd_try.js
14
jd_try.js
@ -1,6 +1,7 @@
|
||||
/*
|
||||
* 2022-07-20 修复获取试用列表风控问题;
|
||||
* 2022-08-12 修复申请试用风控,更换nolan接口
|
||||
* 2022-9-5 某个商品timeout继续下一个不中断
|
||||
* By https://github.com/6dylan6/jdpro/
|
||||
* 基于X1a0He版本修改
|
||||
* @Address: https://github.com/X1a0He/jd_scripts_fixed/blob/main/jd_try_xh.js
|
||||
@ -255,11 +256,11 @@ let args_xh = {
|
||||
await $.wait(2000);
|
||||
for (let i = 0; i < trialActivityIdList.length && $.isLimit === false; i++) {
|
||||
if ($.isLimit) {
|
||||
console.log("试用上限")
|
||||
console.log("试用上限");
|
||||
break
|
||||
}
|
||||
if ($.isForbidden) { console.log('403了,跳出'); break }
|
||||
await try_apply(trialActivityTitleList[i], trialActivityIdList[i])
|
||||
if ($.isForbidden) { console.log('403了,跳出'); break };
|
||||
await try_apply(trialActivityTitleList[i], trialActivityIdList[i]);
|
||||
//console.log(`间隔等待中,请等待 ${args_xh.applyInterval} ms\n`)
|
||||
const waitTime = generateRandomInteger(args_xh.applyInterval, 9000);
|
||||
console.log(`随机等待${waitTime}ms后继续`);
|
||||
@ -498,8 +499,7 @@ function try_feedsList(tabId, page) {
|
||||
})
|
||||
}
|
||||
|
||||
function try_apply(title, activityId) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
async function try_apply(title, activityId) {
|
||||
console.log(`申请试用商品提交中...`)
|
||||
args_xh.printLog ? console.log(`商品:${title}`) : ''
|
||||
args_xh.printLog ? console.log(`id为:${activityId}`) : ''
|
||||
@ -523,6 +523,7 @@ function try_apply(title, activityId) {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
}
|
||||
return new Promise(async (resolve, reject) => {
|
||||
$.get(opt, (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
@ -738,12 +739,13 @@ function geth5st(body) {
|
||||
try {
|
||||
if (err) {
|
||||
console.log(JSON.stringify(err));
|
||||
console.log('连接服务失败\n');
|
||||
} else {
|
||||
data = JSON.parse(data);
|
||||
if (data.code == 200) {
|
||||
str = data.body;
|
||||
} else {
|
||||
$.log('连接服务失败',data.msg);
|
||||
$.log('获取失败',data.msg);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
Loading…
Reference in New Issue
Block a user