From bdb38d62c70ceb4988e251b0c991ae06fbfa1553 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Fri, 15 Jan 2021 16:32:44 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E4=BC=98=E5=8C=96=E6=94=B6=E9=87=91?= =?UTF-8?q?=E5=B8=81=E9=80=BB=E8=BE=91=EF=BC=8C8s=E6=94=B6=E5=8F=96?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E9=87=91=E5=B8=81=EF=BC=8C=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E5=A4=9A=E8=B4=A6=E5=8F=B7=E6=97=B6=E6=94=B6=E8=8E=B7=E9=87=91?= =?UTF-8?q?=E5=B8=81=E6=9B=B4=E5=A4=9A=EF=BC=9B=20=E9=80=82=E5=BD=93?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A7=82=E7=9C=8B=E8=A7=86=E9=A2=91=E6=97=B6?= =?UTF-8?q?=E9=95=BF=EF=BC=8C=E5=87=8F=E5=B0=91=E5=BC=80=E5=AE=9D=E7=AE=B1?= =?UTF-8?q?=E9=87=91=E5=B8=81=E4=B8=BA0=E7=9A=84=E6=A6=82=E7=8E=87"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9d1f38e1 --- jd_crazy_joy_coin.js | 50 ++++++-------------------------------------- 1 file changed, 6 insertions(+), 44 deletions(-) diff --git a/jd_crazy_joy_coin.js b/jd_crazy_joy_coin.js index c0696428..3b18c8f3 100644 --- a/jd_crazy_joy_coin.js +++ b/jd_crazy_joy_coin.js @@ -166,15 +166,6 @@ if ($.isNode()) { return; } let count = 0 - - if (cookiesArr.length) { - console.log(`\n挂机开始,自动8s收一次金币`); - setInterval(async () => { - const promiseArr = cookiesArr.map(ck => getCoinForInterval(ck)); - await Promise.all(promiseArr); - }, 8000); - } - while (true) { count++ console.log(`============开始第${count}次挂机=============`) @@ -191,7 +182,7 @@ if ($.isNode()) { $.log(`\n京东账号${$.index} ${$.nickName || $.UserName}\ncookie已过期,请重新登录获取\n`) continue } - await jdCrazyJoy() + await jdJxStory() } } $.log(`\n\n`) @@ -204,7 +195,7 @@ if ($.isNode()) { $.done(); }) -async function jdCrazyJoy() { +async function jdJxStory() { $.coin = 0 $.bean = 0 @@ -522,35 +513,6 @@ function getCoin() { }) } -// 需传入cookie,不能使用全局的cookie -function getCoinForInterval(taskCookie) { - return new Promise(async resolve => { - $.get(taskUrl('crazyJoy_joy_produce', '', taskCookie), async (err, resp, data) => { - try { - if (err) { - console.log(`${JSON.stringify(err)}`) - console.log(`${$.name} API请求失败,请检查网路重试`) - } else { - if (safeGet(data)) { - // const userName = decodeURIComponent(taskCookie.match(/pt_pin=(.+?);/) && taskCookie.match(/pt_pin=(.+?);/)[1]) - // data = JSON.parse(data); - // if (data.data && data.data.tryMoneyJoyBeans) { - // console.log(`【京东账号 ${userName}】分红狗生效中,预计获得 ${data.data.tryMoneyJoyBeans} 京豆奖励`) - // } - // if (data.data) { - // $.log(`【京东账号 ${userName}】此次在线收益:获得 ${data.data['coins']} 金币`) - // } - } - } - } catch (e) { - $.logErr(e, resp) - } finally { - resolve(); - } - }) - }) -} - function openBox(eventType = 'LUCKY_BOX_DROP', boxId) { let body = { eventType, "eventRecordId": boxId} return new Promise(async resolve => { @@ -563,9 +525,9 @@ function openBox(eventType = 'LUCKY_BOX_DROP', boxId) { if (safeGet(data)) { data = JSON.parse(data); if (data['success']) { - $.log(`点击幸运盒子成功,剩余观看视频次数:${data.data.advertViewTimes}, ${data.data.advertViewTimes > 0 ? '等待32秒' : '跳出'}`) + $.log(`点击幸运盒子成功,剩余观看视频次数:${data.data.advertViewTimes}, ${data.data.advertViewTimes > 0 ? '等待30秒' : '跳出'}`) if (data.data.advertViewTimes > 0) { - await $.wait(32000) + await $.wait(30000) await rewardBox(eventType, boxId); } } @@ -637,7 +599,7 @@ function getGrowState() { }) }) } -function taskUrl(functionId, body = '', taskCookie = cookie) { +function taskUrl(functionId, body = '') { let t = Date.now().toString().substr(0, 10) let e = body || "" e = $.md5("aDvScBv$gGQvrXfva8dG!ZC@DA70Y%lX" + e + t) @@ -645,7 +607,7 @@ function taskUrl(functionId, body = '', taskCookie = cookie) { return { url: `${JD_API_HOST}?uts=${e}&appid=crazy_joy&functionId=${functionId}&body=${escape(body)}&t=${t}`, headers: { - 'Cookie': taskCookie, + 'Cookie': cookie, 'Host': 'api.m.jd.com', 'Accept': '*/*', 'Connection': 'keep-alive',