mirror of https://github.com/KingRan/KR.git
parent
93f8d7db1e
commit
4f13ddad92
|
@ -40,6 +40,7 @@ let cookiesArr = [], cookie = '', token = '';
|
|||
let UA, UAInfo = {};
|
||||
const randomCount = $.isNode() ? 20 : 3;
|
||||
$.appId = "92a36";
|
||||
let lnrun = 0;
|
||||
function oc(fn, defaultVal) {//optioanl chaining
|
||||
try {
|
||||
return fn()
|
||||
|
@ -89,14 +90,21 @@ if ($.isNode()) {
|
|||
$.allTask = []
|
||||
$.info = {}
|
||||
token = await getJxToken()
|
||||
lnrun++;
|
||||
await cfd();
|
||||
await $.wait(3000);
|
||||
await $.wait(2000);
|
||||
if (lnrun == 10) {
|
||||
console.log(`\n【访问接口次数达到10次,休息半分钟.....】\n`);
|
||||
await $.wait(30 * 1000);
|
||||
lnrun = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
let res = await getAuthorShareCode('https://gitee.com/KingRan521/JD-Scripts/raw/master/shareCodes/cfd.json')
|
||||
$.strMyShareIds = [...(res || [])]
|
||||
await shareCodesFormat()
|
||||
for (let i = 0; i < cookiesArr.length; i++) {
|
||||
lnrun++;
|
||||
cookie = cookiesArr[i];
|
||||
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
|
||||
$.canHelp = true
|
||||
|
@ -117,6 +125,11 @@ if ($.isNode()) {
|
|||
} else {
|
||||
break
|
||||
}
|
||||
if (lnrun == 5) {
|
||||
console.log(`\n【访问接口次数达到5次,休息半分钟.....】\n`);
|
||||
await $.wait(30 * 1000);
|
||||
lnrun = 0;
|
||||
}
|
||||
}
|
||||
await showMsg();
|
||||
})()
|
||||
|
@ -1463,7 +1476,7 @@ function shareCodesFormat() {
|
|||
} else {
|
||||
$.newShareCodes = [...new Set([...$.shareCodes, ...$.strMyShareIds])];
|
||||
}
|
||||
console.log(`您将要助力的好友${JSON.stringify($.newShareCodes)}`)
|
||||
console.log(`\n\n您将要助力的好友${JSON.stringify($.newShareCodes)}`)
|
||||
resolve();
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue