mirror of https://github.com/KingRan/KR.git
parent
cdaf734415
commit
25e3a482ff
|
@ -75,7 +75,7 @@ RemainMessage += '【其他】京喜红包只能在京喜使用,其他同理';
|
|||
let WP_APP_TOKEN_ONE = "";
|
||||
|
||||
let TempBaipiao = "";
|
||||
|
||||
let llgeterror=false;
|
||||
|
||||
let doExJxBeans ="false";
|
||||
let time = new Date().getHours();
|
||||
|
@ -359,14 +359,19 @@ if(DisableIndex!=-1){
|
|||
if(EnableJdMs)
|
||||
await getMs();
|
||||
|
||||
//东东农场
|
||||
if(EnableJdFruit){
|
||||
await jdfruitRequest('taskInitForFarm', {
|
||||
"version": 14,
|
||||
"channel": 1,
|
||||
"babelChannel": "120"
|
||||
});
|
||||
await getjdfruit();
|
||||
//东东农场
|
||||
if (EnableJdFruit) {
|
||||
llgeterror = false;
|
||||
await getjdfruit();
|
||||
if (llgeterror) {
|
||||
console.log(`东东农场API查询失败,等待10秒后再次尝试...`)
|
||||
await $.wait(10 * 1000);
|
||||
await getjdfruit();
|
||||
}
|
||||
if (llgeterror) {
|
||||
console.log(`东东农场API查询失败,有空重启路由器换个IP吧.`)
|
||||
}
|
||||
|
||||
}
|
||||
//极速金币
|
||||
if(EnableJdSpeed)
|
||||
|
@ -1826,10 +1831,13 @@ async function getjdfruit() {
|
|||
$.post(option, (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log('\n东东农场: API查询请求失败 ‼️‼️');
|
||||
console.log(JSON.stringify(err));
|
||||
$.logErr(err);
|
||||
if(!llgeterror){
|
||||
console.log('\n东东农场: API查询请求失败 ‼️‼️');
|
||||
console.log(JSON.stringify(err));
|
||||
}
|
||||
llgeterror = true;
|
||||
} else {
|
||||
llgeterror = false;
|
||||
if (safeGet(data)) {
|
||||
$.farmInfo = JSON.parse(data)
|
||||
if ($.farmInfo.farmUserPro) {
|
||||
|
@ -1856,33 +1864,6 @@ async function getjdfruit() {
|
|||
})
|
||||
}
|
||||
|
||||
function jdfruitRequest(function_id, body = {}, timeout = 1000) {
|
||||
return new Promise(resolve => {
|
||||
setTimeout(() => {
|
||||
$.get(taskfruitUrl(function_id, body), (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log('\n东东农场: API查询请求失败 ‼️‼️')
|
||||
console.log(JSON.stringify(err));
|
||||
console.log(`function_id:${function_id}`)
|
||||
$.logErr(err);
|
||||
} else {
|
||||
if (safeGet(data)) {
|
||||
data = JSON.parse(data);
|
||||
$.JDwaterEveryDayT = data.totalWaterTaskInit.totalWaterTaskTimes;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp);
|
||||
}
|
||||
finally {
|
||||
resolve(data);
|
||||
}
|
||||
})
|
||||
}, timeout)
|
||||
})
|
||||
}
|
||||
|
||||
async function PetRequest(function_id, body = {}) {
|
||||
await $.wait(3000);
|
||||
return new Promise((resolve, reject) => {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
50 8 * * * jd_plusReward.js
|
||||
TG https://t.me/okyydsnb
|
||||
|
||||
*/
|
||||
const $ = new Env('逛plus,抽京豆');
|
||||
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||
|
@ -18,7 +18,6 @@ if ($.isNode()) {
|
|||
} else {
|
||||
cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
|
||||
}
|
||||
console.log("TG https://t.me/okyydsnb")
|
||||
!(async () => {
|
||||
if (!cookiesArr[0]) {
|
||||
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" });
|
||||
|
@ -55,13 +54,19 @@ console.log("TG https://t.me/okyydsnb")
|
|||
for(let i of id.assignmentList) {
|
||||
if(i.assignmentName !== "积分抽奖赢好礼"){
|
||||
console.log(`做${i.assignmentName}任务`)
|
||||
for(let j of i.ext.shoppingActivity){
|
||||
b = await task("doInteractiveAssignment", {"encryptProjectId":`${encryptProjectId}`,"encryptAssignmentId":`${i.encryptAssignmentId}`,"itemId":`${j.advId}`,"sourceCode":"aceaceqingzhan"})
|
||||
console.log(b.msg)
|
||||
if(b.msg == "该用户不符合资质校验条件"){
|
||||
return
|
||||
}
|
||||
}
|
||||
if(i.userVerificationInfo) {
|
||||
for(let j of i.ext.shoppingActivity){
|
||||
b = await task("doInteractiveAssignment", {"encryptProjectId":`${encryptProjectId}`,"encryptAssignmentId":`${i.encryptAssignmentId}`,"itemId":`${j.advId}`,"sourceCode":"aceaceqingzhan"})
|
||||
console.log(b.msg)
|
||||
if(b.msg == "该用户不符合资质校验条件"){
|
||||
return
|
||||
}
|
||||
}
|
||||
}else {
|
||||
console.log("账号返回数据为空,请到活动页面查看是否黑号")
|
||||
return
|
||||
}
|
||||
|
||||
await $.wait(2000)
|
||||
}else if(i.assignmentName == "积分抽奖赢好礼"){
|
||||
drawId = i.encryptAssignmentId;
|
||||
|
@ -73,7 +78,7 @@ console.log("TG https://t.me/okyydsnb")
|
|||
if(c.msg == "兑换积分不足") {
|
||||
console.log("兑换积分不足")
|
||||
return
|
||||
}else {
|
||||
}else if(c.msg == "success"){
|
||||
if(c.rewardsInfo.successRewards){
|
||||
for(let k in c.rewardsInfo.successRewards) {
|
||||
let data = c.rewardsInfo.successRewards[k]
|
||||
|
@ -82,6 +87,9 @@ console.log("TG https://t.me/okyydsnb")
|
|||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
console.log("账号异常,请到活动页面查看是否黑号")
|
||||
return
|
||||
}
|
||||
await $.wait(2000)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue