mirror of https://github.com/KingRan/KR.git
parent
4b3874c860
commit
93f8d7db1e
|
@ -24,7 +24,7 @@ cron "50 4,17 * * *" script-path=https://raw.githubusercontent.com/KingRan/JDJB/
|
|||
============小火箭=========
|
||||
东东工厂 = type=cron,script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_jdfactory_help.js, cronexpr="50 4,17 * * *", timeout=3600, enable=true
|
||||
*/
|
||||
const $ = new Env('东东工厂内部互助互助');
|
||||
const $ = new Env('东东工厂内部互助');
|
||||
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||
//Node.js用户请在jdCookie.js处填写京东ck;
|
||||
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||
|
@ -44,6 +44,7 @@ if ($.isNode()) {
|
|||
let wantProduct = ``;//心仪商品名称
|
||||
const JD_API_HOST = 'https://api.m.jd.com/client.action';
|
||||
const inviteCodes = [];
|
||||
let lnrun = 0;
|
||||
!(async () => {
|
||||
await requireConfig();
|
||||
if (!cookiesArr[0]) {
|
||||
|
@ -70,15 +71,18 @@ const inviteCodes = [];
|
|||
}
|
||||
//await shareCodesFormat();
|
||||
await jdFactory()
|
||||
await $.wait(1500);
|
||||
}
|
||||
}
|
||||
console.log(`\n开始账号内互助\n`);
|
||||
console.log(`\n【开始账号内互助】\n`);
|
||||
for (let i = 0; i < cookiesArr.length; i++) {
|
||||
lnrun++;
|
||||
cookie = cookiesArr[i];
|
||||
$.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
|
||||
|
||||
console.log('开始助力好友')
|
||||
|
||||
$.index = i + 1;
|
||||
$.isLogin = true;
|
||||
$.nickName = '';
|
||||
console.log(`\n【京东账号${$.index}(${$.UserName})开始助力好友】\n`)
|
||||
console.log(`格式化后的助力码::${JSON.stringify(inviteCodes)}\n`);
|
||||
for (let code of inviteCodes) {
|
||||
if (!code) continue
|
||||
|
@ -88,6 +92,11 @@ const inviteCodes = [];
|
|||
break
|
||||
}
|
||||
}
|
||||
if (lnrun == 5) {
|
||||
console.log(`\n【访问接口次数达到5次,休息一分钟.....】\n`);
|
||||
await $.wait(60 * 1000);
|
||||
lnrun = 0;
|
||||
}
|
||||
}
|
||||
})()
|
||||
.catch((e) => {
|
||||
|
|
|
@ -115,6 +115,7 @@ console.log(`共${cookiesArr.length}个京东账号\n`);
|
|||
goodsUrl = '';
|
||||
taskInfoKey = [];
|
||||
option = {};
|
||||
lnrun++;
|
||||
await jdPet();
|
||||
if (lnrun == 3) {
|
||||
console.log(`\n【访问接口次数达到3次,休息一分钟.....】\n`);
|
||||
|
|
Loading…
Reference in New Issue