From f0d68ac5cd15a42704e3b04f761897552cc7a2a1 Mon Sep 17 00:00:00 2001 From: Faker Date: Sat, 28 Jan 2023 11:36:17 +0800 Subject: [PATCH] Update jd_ppdt.js --- jd_ppdt.js | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 103 insertions(+), 5 deletions(-) diff --git a/jd_ppdt.js b/jd_ppdt.js index 072cc1b..45bd303 100644 --- a/jd_ppdt.js +++ b/jd_ppdt.js @@ -39,18 +39,24 @@ if ($.isNode()) { } continue } + await xxx7(); + await $.wait(1000); await xxx1(); + if ($.ban) { console.log('风控,跳出'); continue }; await $.wait(500); + if ($.done) continue; await xxx2(); - await $.wait(500); - await xxx4(); + await $.wait(500); + await xxx4(); await $.wait(500); await xxx3(); await $.wait(500); - await xxx5(); + await xxx5(); + await $.wait(500); + await xxx6(); await $.wait(2000); - - + + } } @@ -91,6 +97,12 @@ async function xxx1() { } else { console.log(JSON.stringify(data.data?.result)); } + } else if (data.data.bizMsg.indexOf('风控') > -1) { + console.log(data.data.bizMsg); + $.ban = true; + } else if (data.data.bizMsg.indexOf('完成') > -1) { + console.log(data.data.bizMsg); + $.done = true; } else { console.log(data.data.bizMsg); } @@ -281,6 +293,92 @@ async function xxx5() { }) }) } +async function xxx6() { + let opt = { + url: `https://api.m.jd.com/?client=wh5&appid=ProductZ4Brand&functionId=superBrandDoTask&t=1674780027902&body=%7B%22source%22:%22hall_1111%22,%22activityId%22:1012475,%22completionFlag%22:1,%22encryptProjectId%22:%2247yMVdNbddRfnKm5SKuUPfuid3LT%22,%22encryptAssignmentId%22:%223nrQJYLHKg3pHFWvd2oadunRbMWx%22,%22assignmentType%22:0,%22actionType%22:0%7D`, + headers: { + 'Origin': 'https://prodev.m.jd.com', + 'User-Agent': $.UA, + 'Cookie': cookie + } + } + return new Promise(async (resolve) => { + $.post(opt, async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(` API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data) + if (data.code == 0) { + if (data.data.bizCode == 0) { + if (data.data?.result?.rewards.length != 0) { + if (data.data?.result?.rewards[0].awardType === 3) { + console.log(` 恭喜获得 ${data.data?.result?.rewards[0].beanNum} 京豆`); + } else { + console.log(JSON.stringify(data.data?.result?.rewards)); + } + } else { + console.log(JSON.stringify(data.data?.result)); + } + } else { + console.log(data.data.bizMsg); + } + } else { + console.log(data.msg) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data) + } + }) + }) +} +async function xxx7() { + let opt = { + url: `https://api.m.jd.com/?client=wh5&appid=ProductZ4Brand&functionId=superBrandDoTask&t=1674865770750&body=%7B%22source%22:%22hall_1111%22,%22activityId%22:1012476,%22completionFlag%22:1,%22encryptProjectId%22:%222GRBptWGUbVNFwfZLW6AxDQHCDTo%22,%22encryptAssignmentId%22:%223F6VgHQjejVYZqetSSqdP45bYbuq%22,%22assignmentType%22:0,%22actionType%22:0%7D`, + headers: { + 'Origin': 'https://prodev.m.jd.com', + 'User-Agent': $.UA, + 'Cookie': cookie + } + } + return new Promise(async (resolve) => { + $.post(opt, async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(` API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data) + if (data.code == 0) { + if (data.data.bizCode == 0) { + if (data.data?.result?.rewards.length != 0) { + if (data.data?.result?.rewards[0].awardType === 3) { + console.log(` 恭喜获得 ${data.data?.result?.rewards[0].beanNum} 京豆`); + } else { + console.log(JSON.stringify(data.data?.result?.rewards)); + } + } else { + console.log(JSON.stringify(data.data?.result)); + } + } else { + console.log(data.data.bizMsg); + } + } else { + console.log(data.msg) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data) + } + }) + }) +} function TotalBean() { return new Promise((resolve) => { const options = {