diff --git a/README.md b/README.md index 3c7fe966..6df28594 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,24 @@ -## 特别声明: +## Special statement: -* 本仓库发布的Script项目中涉及的任何解锁和解密分析脚本,仅用于测试和学习研究,禁止用于商业用途,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断. +* Any unlocking and decryption analysis scripts involved in the Script project released by this warehouse are only used for testing, learning and research, and are forbidden to be used for commercial purposes. Their legality, accuracy, completeness and effectiveness cannot be guaranteed. Please make your own judgment based on the situation. . -* 本项目内所有资源文件,禁止任何公众号、自媒体进行任何形式的转载、发布。 +* All resource files in this project are forbidden to be reproduced or published in any form by any official account or self-media. -* 本仓库对任何脚本问题概不负责,包括但不限于由任何脚本错误导致的任何损失或损害. +* This warehouse is not responsible for any script problems, including but not limited to any loss or damage caused by any script errors. -* 间接使用脚本的任何用户,包括但不限于建立VPS或在某些行为违反国家/地区法律或相关法规的情况下进行传播, 本仓库 对于由此引起的任何隐私泄漏或其他后果概不负责. +* Any user who indirectly uses the script, including but not limited to establishing a VPS or disseminating it when certain actions violate national/regional laws or related regulations, this warehouse is not responsible for any privacy leakage or other consequences caused by this. -* 请勿将Script项目的任何内容用于商业或非法目的,否则后果自负. +* Do not use any content of the Script project for commercial or illegal purposes, otherwise you will be responsible for the consequences. -* 如果任何单位或个人认为该项目的脚本可能涉嫌侵犯其权利,则应及时通知并提供身份证明,所有权证明,我们将在收到认证文件后删除相关脚本. +* If any unit or individual believes that the script of the project may be suspected of infringing on their rights, they should promptly notify and provide proof of identity and ownership. We will delete the relevant script after receiving the certification document. -* 任何以任何方式查看此项目的人或直接或间接使用该Script项目的任何脚本的使用者都应仔细阅读此声明。本仓库 保留随时更改或补充此免责声明的权利。一旦使用并复制了任何相关脚本或Script项目的规则,则视为您已接受此免责声明. +* Anyone who views this item in any way or directly or indirectly uses any script of the Script item should read this statement carefully. This warehouse reserves the right to change or supplement this disclaimer at any time. Once you have used and copied any relevant scripts or rules of the Script project, you are deemed to have accepted this disclaimer. - **您必须在下载后的24小时内从计算机或手机中完全删除以上内容.**
-> ***您使用或者复制了本仓库且本人制作的任何脚本,则视为`已接受`此声明,请仔细阅读*** + **You must completely delete the above content from your computer or mobile phone within 24 hours after downloading.**
+> ***You have used or copied any script made by yourself in this warehouse, it is deemed to have accepted this statement, please read it carefully*** -## 特别感谢(排名不分先后): +## Special thanks to: * [@NobyDa](https://github.com/NobyDa) diff --git a/docker/crontab_list.sh b/docker/crontab_list.sh index 1cb4f03f..18dca5bf 100644 --- a/docker/crontab_list.sh +++ b/docker/crontab_list.sh @@ -25,13 +25,11 @@ #家电星推官 活动时间:2021年5月27日 00:00:00-2021年6月18日 23:59:59 0 0 * * * node /scripts/jd_xtg.js >> /scripts/logs/jd_xtg.log 2>&1 -#家电星推官 活动时间:2021年5月27日 00:00:00-2021年6月18日 23:59:59 +#家电星推官好友互助 活动时间:2021年5月27日 00:00:00-2021年6月18日 23:59:59 0 0 * * * node /scripts/jd_xtg_help.js >> /scripts/logs/jd_xtg_help.log 2>&1 #金榜创造营 活动时间:2021-05-21至2021-12-31 0 1,22 * * * node /scripts/jd_gold_creator.js >> /scripts/logs/jd_gold_creator.log 2>&1 -#京东沸腾之夜(5.31日有效) -0 15-19/1 * * * node /scripts/jd_party_night.js >> /scripts/logs/jd_party_night.log 2>&1 ##############长期活动############## # 签到 7 0,17 * * * cd /scripts && node jd_bean_sign.js >> /scripts/logs/jd_bean_sign.log 2>&1 diff --git a/jd_city.js b/jd_city.js index e8739a68..d5995a01 100644 --- a/jd_city.js +++ b/jd_city.js @@ -37,8 +37,8 @@ if ($.isNode()) { } const JD_API_HOST = 'https://api.m.jd.com/client.action'; let inviteCodes = [ - 'xBd-HlYMlLUzqSkuz0qzAzuayqOG3FfAIeOTGLowr29_KbnH2bV4EX4@RtGKzr_wSAn2eIKZRdRm07jvOMS2zVH-g8ri6aOIZPDcI8v7CA@RtGKzr-gRAmmdoaZQdcz30FEv6dt0Mio6a5hyr9dt0vq1P8G0g@RtGKz-WhSAjyL4GfFtY2gs1_v5yhlLelj5Ko2YGb24YTen5vjA', - 'xBd-HlYMlLUzqSkuz0qzAzuayqOG3FfAIeOTGLowr29_KbnH2bV4EX4@RtGKzr_wSAn2eIKZRdRm07jvOMS2zVH-g8ri6aOIZPDcI8v7CA@RtGKzr-gRAmmdoaZQdcz30FEv6dt0Mio6a5hyr9dt0vq1P8G0g@RtGKz-WhSAjyL4GfFtY2gs1_v5yhlLelj5Ko2YGb24YTen5vjA' + 'xBd-HlYMlLUzqSkuz0qzAzuayqOG3FfAIeOTGLowr29_KbnH2bV4EX4@RtGKzr_wSAn2eIKZRdRm07jvOMS2zVH-g8ri6aOIZPDcI8v7CA@RtGKzr-gRAmmdoaZQdcz30FEv6dt0Mio6a5hyr9dt0vq1P8G0g@RtGKz-ygEAj2e9aYH4U10HcN_2_yeoSSOH50A7CItcn6lB6jwQ', + 'RtGKz-ygEAj2e9aYH4U10HcN_2_yeoSSOH50A7CItcn6lB6jwQ' ] !(async () => { if (!cookiesArr[0]) { diff --git a/jd_lotteryMachine.js b/jd_lotteryMachine.js index 9b750b28..65df994a 100644 --- a/jd_lotteryMachine.js +++ b/jd_lotteryMachine.js @@ -18,7 +18,7 @@ Object.keys(jdCookieNode).forEach((item) => { if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; if (JSON.stringify(process.env).indexOf('GITHUB') > -1) process.exit(0); -const appIdArr = ['1EFRRxA','1EFRQwA','1EFRYxQ','1EFRXxg','1EFVRwA','1EFVRxw','1EFRZwA','1EFRZwQ','1EFRYwA']; +const appIdArr = ['1EFRRxA','1EFRQwA','1EFVRxQ','1EFRXxg','1EFVRwA','1EFVRxw','1EFRZwA','1EFRZwQ','1EFRYwA']; const homeDataFunPrefixArr = ['interact_template','interact_template','harmony_template','','','','','','','','','','','','','','','interact_template','interact_template']; const collectScoreFunPrefixArr = ['','','','','','','','','','','','','','','','','','interact_template','interact_template']; $.allShareId = {}; diff --git a/jd_nzmh.js b/jd_nzmh.js index 38f9b9c1..1cbc689e 100644 --- a/jd_nzmh.js +++ b/jd_nzmh.js @@ -64,7 +64,7 @@ if ($.isNode()) { continue } try { - await jdMh('https://h5.m.jd.com/babelDiy/Zeus/3eeruLXVbXge6CexVq8XkBbBvAfy/index.html') + //await jdMh('https://h5.m.jd.com/babelDiy/Zeus/3eeruLXVbXge6CexVq8XkBbBvAfy/index.html') await jdMh('https://h5.m.jd.com/babelDiy/Zeus/2k7Tx67WzLHDtdDNB2KPnqWEwavX/index.html') // await jdMh('https://anmp.jd.com/babelDiy/Zeus/yiNQjMxQvs3R3SdS4nwa2MFk1FE/index.html?wxAppName=jd') } catch (e) { diff --git a/jd_party_night.js b/jd_party_night.js index 1a96d851..3c0f687f 100644 --- a/jd_party_night.js +++ b/jd_party_night.js @@ -42,56 +42,70 @@ if ($.isNode()) { $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); return; } - for (let i = 0; i < cookiesArr.length; i++) { - $.index = i + 1; - $.cookie = cookiesArr[i]; - $.UserName = decodeURIComponent($.cookie.match(/pt_pin=([^; ]+)(?=;?)/) && $.cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]); - console.log(`\n*****开始【京东账号${$.index}】${$.nickName || $.UserName}*****\n`); - await partyNight(); - await $.wait(3000); - } - //助力------------------------- - for (let i = 0; i < cookiesArr.length; i++) { - $.index = i + 1; - $.cookie = cookiesArr[i]; - $.UserName = decodeURIComponent($.cookie.match(/pt_pin=([^; ]+)(?=;?)/) && $.cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]); - console.log(`\n*****开始【京东账号${$.index}】${$.nickName || $.UserName}*****\n`); - $.canHelp = true; - for (let j = 0; j < $.inviteCodeList.length && $.canHelp; j++) { - await $.wait(2000); - $.oneInviteInfo = $.inviteCodeList[j]; - if($.oneInviteInfo.use === $.UserName){ - continue; + for (let i = 0; i < 5; i++) { + console.log(`开始第${i+1}次抽奖`); + for (let i = 0; i < cookiesArr.length; i++) { + $.index = i + 1; + $.cookie = cookiesArr[i]; + $.UserName = decodeURIComponent($.cookie.match(/pt_pin=([^; ]+)(?=;?)/) && $.cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]); + console.log(`\n*****开始【京东账号${$.index}】${$.nickName || $.UserName}*****\n`); + await partyNight(); + if(cookiesArr.length>5){ + await $.wait(1500); + }else{ + await $.wait(5000); } - if($.oneInviteInfo.max){ - continue; - } - $.inviteCode = $.oneInviteInfo.inviteCode; - console.log(`${$.UserName}去助力${$.oneInviteInfo.use},助力码:${$.inviteCode}`) - await takePostRequest('partyTonight_assist'); } - //await $.wait(3000); } + + // //助力------------------------- + // for (let i = 0; i < cookiesArr.length; i++) { + // $.index = i + 1; + // $.cookie = cookiesArr[i]; + // $.UserName = decodeURIComponent($.cookie.match(/pt_pin=([^; ]+)(?=;?)/) && $.cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]); + // console.log(`\n*****开始【京东账号${$.index}】${$.nickName || $.UserName}*****\n`); + // $.canHelp = true; + // for (let j = 0; j < $.inviteCodeList.length && $.canHelp; j++) { + // await $.wait(2000); + // $.oneInviteInfo = $.inviteCodeList[j]; + // if($.oneInviteInfo.use === $.UserName){ + // continue; + // } + // if($.oneInviteInfo.max){ + // continue; + // } + // $.inviteCode = $.oneInviteInfo.inviteCode; + // console.log(`${$.UserName}去助力${$.oneInviteInfo.use},助力码:${$.inviteCode}`) + // await takePostRequest('partyTonight_assist'); + // } + // //await $.wait(3000); + // } })() - .catch((e) => { - $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') - }) - .finally(() => { - $.done(); - }) + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) async function partyNight(){ - $.mainInfo = {}; - await takePostRequest('partyTonight_init'); - if(JSON.stringify($.mainInfo) === '{}'){ - return ; - }else { - console.log('获取活动信息成功'); - } - //预约 - await $.wait(2000); - await takePostRequest('partyTonight_remind'); + // $.mainInfo = {}; + // await takePostRequest('partyTonight_init'); + // if(JSON.stringify($.mainInfo) === '{}'){ + // return ; + // }else { + // console.log('获取活动信息成功'); + // } + $.runFlag = true; + //for (let i = 0; i < 10 && $.runFlag; i++) { + + await takePostRequest('partyTonight_lottery'); + //await $.wait(5000); + //} + //预约 + //await $.wait(2000); + //await takePostRequest('partyTonight_remind'); } async function takePostRequest(type) { @@ -110,6 +124,10 @@ async function takePostRequest(type) { body = `functionId=partyTonight_assist&body={"inviteCode":"${$.inviteCode}"}&client=wh5&clientVersion=1.0.0&uuid=`; myRequest = getPostRequest(`partyTonight_assist`, body); break; + case 'partyTonight_lottery': + body = `functionId=partyTonight_lottery&body={}&client=wh5&clientVersion=1.0.0&uuid=`; + myRequest = getPostRequest(`partyTonight_lottery`, body); + break; default: console.log(`错误${type}`); } @@ -143,11 +161,11 @@ function dealReturn(type, data) { console.log(`助力已满`); }else{ $.inviteCodeList.push( - { - 'inviteCode':$.inviteCode, - 'use':$.UserName, - 'max':false - } + { + 'inviteCode':$.inviteCode, + 'use':$.UserName, + 'max':false + } ) } }else{ @@ -171,8 +189,24 @@ function dealReturn(type, data) { } console.log(JSON.stringify(data)); break; + case 'partyTonight_lottery': + if (data.code === 0 && data.data && data.data.bizCode === 0) { + let result = data.data.result; + if(result.type === 1){ + console.log(`获得红包:${result.hongbaoValue}`); + }else if(result.type === 2){ + console.log(`获得优惠券:`); + }else if(result.type === 3){ + console.log(`获得京豆:${result.beanCount}`); + }else{ + console.log(JSON.stringify(data)); + } + }else { + $.runFlag = false; + console.log(JSON.stringify(data)); + } + break; default: - console.log(`未判断的异常${type}`); } } diff --git a/jd_speed_redpocke.js b/jd_speed_redpocke.js index 77d1cacc..71196e07 100644 --- a/jd_speed_redpocke.js +++ b/jd_speed_redpocke.js @@ -1,7 +1,7 @@ /* 京东极速版红包 自动提现微信现金 -更新时间:2021-5-228 +更新时间:2021-5-31 活动时间:2021-4-6至2021-5-30 活动地址:https://prodev.m.jd.com/jdlite/active/31U4T6S4PbcK83HyLPioeCWrD63j/index.html 活动入口:京东极速版-领红包 @@ -83,10 +83,11 @@ async function jsRedPacket() { await sign();//极速版签到提现 await reward_query(); for (let i = 0; i < 3; ++i) { - await redPacket() + await redPacket();//开红包 await $.wait(500) } - await getPacketList() + await getPacketList();//领红包提现 + await signPrizeDetailList(); await showMsg() } catch (e) { $.logErr(e) @@ -238,6 +239,115 @@ function getPacketList() { }) }) } +function signPrizeDetailList() { + return new Promise(resolve => { + const body = {"linkId":signLinkId,"serviceName":"dayDaySignGetRedEnvelopeSignService","business":1,"pageSize":20,"page":1}; + const options = { + url: `https://api.m.jd.com`, + body: `functionId=signPrizeDetailList&body=${escape(JSON.stringify(body))}&_t=${+new Date()}&appid=activities_platform`, + headers: { + 'Cookie': cookie, + "Host": "api.m.jd.com", + 'Origin': 'https://daily-redpacket.jd.com', + "Content-Type": "application/x-www-form-urlencoded", + "Accept": "*/*", + "Connection": "keep-alive", + "User-Agent": "jdltapp;iPhone;3.3.2;14.5.1network/wifi;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone13,2;addressid/137923973;hasOCPay/0;appBuild/1047;supportBestPay/0;pv/467.11;apprpd/MyJD_Main;", + "Accept-Language": "zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8", + 'Referer': 'https://daily-redpacket.jd.com/?activityId=9WA12jYGulArzWS7vcrwhw', + "Accept-Encoding": "gzip, deflate, br" + } + } + $.post(options, async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = $.toObj(data); + if (data.code === 0) { + if (data.data.code === 0) { + const list = (data.data.prizeDrawBaseVoPageBean.items || []).filter(vo => vo['prizeType'] === 4 && vo['prizeStatus'] === 0); + for (let code of list) { + console.log(`极速版签到提现,去提现${code['prizeValue']}现金\n`); + message += `极速版签到提现,去提现${code['prizeValue']}微信现金,` + await apCashWithDraw(code['id'], code['poolBaseId'], code['prizeGroupId'], code['prizeBaseId']); + } + } else { + console.log(`极速版签到查询奖品:失败:${JSON.stringify(data)}\n`); + } + } else { + console.log(`极速版签到查询奖品:异常:${JSON.stringify(data)}\n`); + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} +function apCashWithDraw(id, poolBaseId, prizeGroupId, prizeBaseId) { + return new Promise(resolve => { + const body = { + "linkId": signLinkId, + "businessSource": "DAY_DAY_RED_PACKET_SIGN", + "base": { + "prizeType": 4, + "business": "dayDayRedPacket", + "id": id, + "poolBaseId": poolBaseId, + "prizeGroupId": prizeGroupId, + "prizeBaseId": prizeBaseId + } + } + const options = { + url: `https://api.m.jd.com`, + body: `functionId=apCashWithDraw&body=${escape(JSON.stringify(body))}&_t=${+new Date()}&appid=activities_platform`, + headers: { + 'Cookie': cookie, + "Host": "api.m.jd.com", + 'Origin': 'https://daily-redpacket.jd.com', + "Content-Type": "application/x-www-form-urlencoded", + "Accept": "*/*", + "Connection": "keep-alive", + "User-Agent": "jdltapp;iPhone;3.3.2;14.5.1network/wifi;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone13,2;addressid/137923973;hasOCPay/0;appBuild/1047;supportBestPay/0;pv/467.11;apprpd/MyJD_Main;", + "Accept-Language": "zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8", + 'Referer': 'https://daily-redpacket.jd.com/?activityId=9WA12jYGulArzWS7vcrwhw', + "Accept-Encoding": "gzip, deflate, br" + } + } + $.post(options, async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = $.toObj(data); + if (data.code === 0) { + if (data.data.status === "310") { + console.log(`极速版签到提现现金成功!`) + message += `极速版签到提现现金成功!`; + } else { + console.log(`极速版签到提现现金:失败:${JSON.stringify(data)}\n`); + } + } else { + console.log(`极速版签到提现现金:异常:${JSON.stringify(data)}\n`); + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} function cashOut(id,poolBaseId,prizeGroupId,prizeBaseId,) { let body = { "businessSource": "SPRING_FESTIVAL_RED_ENVELOPE", @@ -265,7 +375,7 @@ function cashOut(id,poolBaseId,prizeGroupId,prizeBaseId,) { if (data.code === 0) { if (data['data']['status'] === "310") { console.log(`提现成功!`) - message += `提现成功!`; + message += `提现成功!\n`; } else { console.log(`提现失败:${data['data']['message']}`); message += `提现失败:${data['data']['message']}`; diff --git a/jd_zoo.js b/jd_zoo.js index 9e262252..a0eefd32 100644 --- a/jd_zoo.js +++ b/jd_zoo.js @@ -9,7 +9,7 @@ PK互助:内部账号自行互助(排名靠前账号得到的机会多),多余 地图任务:已添加,下午2点到5点执行,抽奖已添加(基本都是优惠券) 金融APP任务:已完成 活动时间:2021-05-24至2021-06-20 -脚本更新时间:2021-05-30 21:25 +脚本更新时间:2021-05-31 23:00 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js ===================quantumultx================ [task_local] @@ -36,7 +36,7 @@ let cookiesArr = []; $.cookie = ''; $.inviteList = []; $.pkInviteList = [ - 'sSKNX-MpqKOJsNu8mJ7RA9BJMup4tAAmPcPPPhBUWYKUJ19UKeC8EAoKeUXELi0o', + 'sSKNX-MpqKOJsNu8mJ7RA9BJMup4tAAmPcPPPhBUWYKUJ19UKeC8EAoKeUXELi4o', ]; $.secretpInfo = {}; $.innerPkInviteList = [ @@ -64,8 +64,7 @@ if ($.isNode()) { '地图任务:已添加,下午2点到5点执行,抽奖已添加\n' + '金融APP任务:已完成\n' + '活动时间:2021-05-24至2021-06-20\n' + - '脚本更新时间:2021-05-30 21:25\n' + - '火爆账户暂时不做任务,找到解决办法后再做任务' + '脚本更新时间:2021-05-31 23:00\n' ); for (let i = 0; i < cookiesArr.length; i++) { if (cookiesArr[i]) { @@ -92,7 +91,7 @@ if ($.isNode()) { let res = [], res2 = [], res3 = []; res3 = await getAuthorShareCode('https://raw.githubusercontent.com/gitupdate/updateTeam/master/shareCodes/jd_zoo.json'); if (!res3) await getAuthorShareCode('https://cdn.jsdelivr.net/gh/gitupdate/updateTeam@master/shareCodes/jd_zoo.json') - if (new Date().getUTCHours() + 8 >= 17) { + if (new Date().getHours()>= 17) { res = await getAuthorShareCode() || []; res2 = await getAuthorShareCode('http://cdn.trueorfalse.top/e528ffae31d5407aac83b8c37a4c86bc/') || []; } @@ -111,7 +110,7 @@ if ($.isNode()) { $.index = i + 1; //console.log($.inviteList); //pk助力 - if (new Date().getUTCHours() + 8 >= 9) { + if (new Date().getHours() >= 9) { console.log(`\n******开始内部京东账号【怪兽大作战pk】助力*********\n`); for (let i = 0; i < $.pkInviteList.length && pKHelpFlag && $.canHelp; i++) { console.log(`${$.UserName} 去助力PK码 ${$.pkInviteList[i]}`); @@ -237,7 +236,7 @@ async function zoo() { await takePostRequest('zoo_raise'); } //===================================图鉴里的店铺==================================================================== - if (new Date().getUTCHours() + 8 >= 17 && new Date().getUTCHours() + 8 <= 18 && !$.hotFlag) {//分享 + if (new Date().getHours()>= 17 && new Date().getHours()<= 18 && !$.hotFlag) {//分享 $.myMapList = []; await takePostRequest('zoo_myMap'); for (let i = 0; i < $.myMapList.length; i++) { @@ -249,7 +248,7 @@ async function zoo() { } } } - if (new Date().getUTCHours() + 8 >= 14 && new Date().getUTCHours() + 8 <= 17 && !$.hotFlag){//30个店铺,为了避免代码执行太久,下午2点到5点才做店铺任务 + if (new Date().getHours() >= 14 && new Date().getHours() <= 17 && !$.hotFlag){//30个店铺,为了避免代码执行太久,下午2点到5点才做店铺任务 console.log(`去做店铺任务`); $.shopInfoList = []; await takePostRequest('qryCompositeMaterials'); @@ -821,25 +820,21 @@ async function getPostRequest(type, body) { } function getBody(type) { - let rnd = Math.round(Math.random() * 1e6) - let nonstr = randomWord(false, 10) - let time = Date.now() - let key = minusByByte(nonstr.slice(0, 5), String(time).slice(-5)) - let msg = `random=${rnd}&time=${time}&nonce_str=${nonstr}&key=${key}&is_trust=true` - let sign = bytesToHex(wordsToBytes(getSign(msg))).toUpperCase(); + let rnd = Math.floor(1e6 + 9e6 * Math.random()).toString() + let ss = JSON.stringify({"extraData" : {"log": "-1", "sceneid": "QD216hPageh5"}, "secretp": $.secretp, "random": rnd.toString()}); let taskBody = ''; if (type === 'help') { - taskBody = `functionId=zoo_collectScore&body={"taskId":2,"ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"fpb\\":\\"\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"cf_v\\":\\"1.0.2\\",\\"client_version\\":\\"2.2.1\\",\\"buttonid\\":\\"jmdd-react-smash_62\\",\\"sceneid\\":\\"homePageh5\\"},\\"secretp\\":\\"${$.secretp}\\",\\"random\\":\\"${rnd}\\"}","inviteId":"${$.inviteId}","actionType":1}&client=wh5&clientVersion=1.0.0` + taskBody = `functionId=zoo_collectScore&body=${JSON.stringify({"taskId": 2,"inviteId":$.inviteId,"actionType":1,"ss" :ss})}&client=wh5&clientVersion=1.0.0` } else if (type === 'pkHelp') { - taskBody = `functionId=zoo_pk_assistGroup&body={"taskId":2,"ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"fpb\\":\\"\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"cf_v\\":\\"1.0.2\\",\\"client_version\\":\\"2.2.1\\",\\"buttonid\\":\\"jmdd-react-smash_62\\",\\"sceneid\\":\\"homePageh5\\"},\\"secretp\\":\\"${$.secretp}\\",\\"random\\":\\"${rnd}\\"}","inviteId":"${$.pkInviteId}","actionType":1}&client=wh5&clientVersion=1.0.0`; + taskBody = `functionId=zoo_pk_assistGroup&body=${JSON.stringify({"confirmFlag": 1,"inviteId" : $.pkInviteId,"ss" : ss})}&client=wh5&clientVersion=1.0.0`; } else if (type === 'zoo_collectProduceScore') { - taskBody = `functionId=zoo_collectProduceScore&body={"ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"fpb\\":\\"\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"cf_v\\":\\"1.0.2\\",\\"client_version\\":\\"2.2.1\\",\\"buttonid\\":\\"jmdd-react-smash_0\\",\\"sceneid\\":\\"homePageh5\\"},\\"secretp\\":\\"${$.secretp}\\",\\"random\\":\\"${rnd}\\"}"}&client=wh5&clientVersion=1.0.0`; + taskBody = `functionId=zoo_collectProduceScore&body=${JSON.stringify({"ss" :ss})}&client=wh5&clientVersion=1.0.0`; } else if(type === 'zoo_getWelfareScore'){ - taskBody = `functionId=zoo_getWelfareScore&body={"type":2,"currentScence":${$.currentScence},"ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"fpb\\":\\"\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"cf_v\\":\\"1.0.2\\",\\"client_version\\":\\"2.2.1\\",\\"buttonid\\":\\"jmdd-react-smash_62\\",\\"sceneid\\":\\"homePageh5\\"},\\"secretp\\":\\"${$.secretp}\\",\\"random\\":\\"${rnd}\\"}"}&client=wh5&clientVersion=1.0.0`; + taskBody = `functionId=zoo_getWelfareScore&body=${JSON.stringify({"type": 2,"currentScence":$.currentScence,"ss" : ss})}&client=wh5&clientVersion=1.0.0`; } else if(type === 'add_car'){ - taskBody = `functionId=zoo_collectScore&body={"taskId":"${$.taskId}","taskToken":"${$.taskToken}","actionType":1,"ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"fpb\\":\\"\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"cf_v\\":\\"1.0.2\\",\\"client_version\\":\\"2.2.1\\",\\"buttonid\\":\\"jmdd-react-smash_62\\",\\"sceneid\\":\\"homePageh5\\"},\\"secretp\\":\\"${$.secretp}\\",\\"random\\":\\"${rnd}\\"}"}&client=wh5&clientVersion=1.0.0` + taskBody = `functionId=zoo_collectScore&body=${JSON.stringify({"taskId": $.taskId,"taskToken":$.taskToken,"actionType":1,"ss" : ss})}&client=wh5&clientVersion=1.0.0` }else{ - taskBody = `functionId=${type}&body={"taskId":"${$.oneTask.taskId}","taskToken":"${$.oneActivityInfo.taskToken}","actionType":1,"ss":"{\\"extraData\\":{\\"is_trust\\":true,\\"sign\\":\\"${sign}\\",\\"fpb\\":\\"\\",\\"time\\":${time},\\"encrypt\\":\\"3\\",\\"nonstr\\":\\"${nonstr}\\",\\"jj\\":\\"\\",\\"cf_v\\":\\"1.0.2\\",\\"client_version\\":\\"2.2.1\\",\\"buttonid\\":\\"jmdd-react-smash_62\\",\\"sceneid\\":\\"homePageh5\\"},\\"secretp\\":\\"${$.secretp}\\",\\"random\\":\\"${rnd}\\"}","itemId":"${$.oneActivityInfo.itemId}","shopSign":"${$.shopSign}"}&client=wh5&clientVersion=1.0.0` + taskBody = `functionId=${type}&body=${JSON.stringify({"taskId": $.oneTask.taskId,"actionType":1,"taskToken" : $.oneActivityInfo.taskToken,"ss" : ss})}&client=wh5&clientVersion=1.0.0` } return taskBody } @@ -940,122 +935,6 @@ function TotalBean() { }) } -function randomWord(randomFlag, min, max) { - let str = "", - range = min, - arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; - // 随机产生 - if (randomFlag) { - range = Math.round(Math.random() * (max - min)) + min; - } - for (let i = 0; i < range; i++) { - pos = Math.round(Math.random() * (arr.length - 1)); - str += arr[pos]; - } - return str; -} - -function minusByByte(t, n) { - var e = t.length - , r = n.length - , o = Math.max(e, r) - , i = toAscii(t) - , a = toAscii(n) - , s = "" - , u = 0; - for (e !== r && (i = add0(i, o), - a = this.add0(a, o)); u < o;) - s += Math.abs(i[u] - a[u]), - u++; - return s -} - -function toAscii(t) { - var n = ""; - for (var e in t) { - var r = t[e] - , o = /[a-zA-Z]/.test(r); - if (t.hasOwnProperty(e)) - if (o) - n += getLastAscii(r); - else - n += r - } - return n -} - -function add0(t, n) { - return (Array(n).join("0") + t).slice(-n) -} - -function getLastAscii(t) { - var n = t.charCodeAt(0).toString(); - return n[n.length - 1] -} - -function wordsToBytes(t) { - for (var n = [], e = 0; e < 32 * t.length; e += 8) - n.push(t[e >>> 5] >>> 24 - e % 32 & 255); - return n -} - -function bytesToHex(t) { - for (var n = [], e = 0; e < t.length; e++) - n.push((t[e] >>> 4).toString(16)), - n.push((15 & t[e]).toString(16)); - return n.join("") -} - -function stringToBytes(t) { - t = unescape(encodeURIComponent(t)) - for (var n = [], e = 0; e < t.length; e++) - n.push(255 & t.charCodeAt(e)); - return n -} - -function bytesToWords(t) { - for (var n = [], e = 0, r = 0; e < t.length; e++, - r += 8) - n[r >>> 5] |= t[e] << 24 - r % 32; - return n -} - -function getSign(t) { - t = stringToBytes(t) - var e = bytesToWords(t) - , i = 8 * t.length - , a = [] - , s = 1732584193 - , u = -271733879 - , c = -1732584194 - , f = 271733878 - , h = -1009589776; - e[i >> 5] |= 128 << 24 - i % 32, - e[15 + (i + 64 >>> 9 << 4)] = i; - for (var l = 0; l < e.length; l += 16) { - for (var p = s, g = u, v = c, d = f, y = h, m = 0; m < 80; m++) { - if (m < 16) - a[m] = e[l + m]; - else { - var w = a[m - 3] ^ a[m - 8] ^ a[m - 14] ^ a[m - 16]; - a[m] = w << 1 | w >>> 31 - } - var _ = (s << 5 | s >>> 27) + h + (a[m] >>> 0) + (m < 20 ? 1518500249 + (u & c | ~u & f) : m < 40 ? 1859775393 + (u ^ c ^ f) : m < 60 ? (u & c | u & f | c & f) - 1894007588 : (u ^ c ^ f) - 899497514); - h = f, - f = c, - c = u << 30 | u >>> 2, - u = s, - s = _ - } - s += p, - u += g, - c += v, - f += d, - h += y - } - return [s, u, c, f, h] -} - // prettier-ignore function Env(t,e){"undefined"!=typeof process&&JSON.stringify(process.env).indexOf("GITHUB")>-1&&process.exit(0);class s{constructor(t){this.env=t}send(t,e="GET"){t="string"==typeof t?{url:t}:t;let s=this.get;return"POST"===e&&(s=this.post),new Promise((e,i)=>{s.call(this,t,(t,s,r)=>{t?i(t):e(s)})})}get(t){return this.send.call(this.env,t)}post(t){return this.send.call(this.env,t,"POST")}}return new class{constructor(t,e){this.name=t,this.http=new s(this),this.data=null,this.dataFile="box.dat",this.logs=[],this.isMute=!1,this.isNeedRewrite=!1,this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null){try{return JSON.stringify(t)}catch{return e}}getjson(t,e){let s=e;const i=this.getdata(t);if(i)try{s=JSON.parse(this.getdata(t))}catch{}return s}setjson(t,e){try{return this.setdata(JSON.stringify(t),e)}catch{return!1}}getScript(t){return new Promise(e=>{this.get({url:t},(t,s,i)=>e(i))})}runScript(t,e){return new Promise(s=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let r=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");r=r?1*r:20,r=e&&e.timeout?e.timeout:r;const[o,h]=i.split("@"),n={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(n,(t,e,i)=>s(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e);if(!s&&!i)return{};{const i=s?t:e;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),i=!s&&this.fs.existsSync(e),r=JSON.stringify(this.data);s?this.fs.writeFileSync(t,r):i?this.fs.writeFileSync(e,r):this.fs.writeFileSync(t,r)}}lodash_get(t,e,s){const i=e.replace(/\[(\d+)\]/g,".$1").split(".");let r=t;for(const t of i)if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,e,s){return Object(t)!==t?t:(Array.isArray(e)||(e=e.toString().match(/[^.[\]]+/g)||[]),e.slice(0,-1).reduce((t,s,i)=>Object(t[s])===t[s]?t[s]:t[s]=Math.abs(e[i+1])>>0==+e[i+1]?[]:{},t)[e[e.length-1]]=s,t)}getdata(t){let e=this.getval(t);if(/^@/.test(t)){const[,s,i]=/^@(.*?)\.(.*?)$/.exec(t),r=s?this.getval(s):"";if(r)try{const t=JSON.parse(r);e=t?this.lodash_get(t,i,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){const[,i,r]=/^@(.*?)\.(.*?)$/.exec(e),o=this.getval(i),h=i?"null"===o?null:o||"{}":"{}";try{const e=JSON.parse(h);this.lodash_set(e,r,t),s=this.setval(JSON.stringify(e),i)}catch(e){const o={};this.lodash_set(o,r,t),s=this.setval(JSON.stringify(o),i)}}else s=this.setval(t,e);return s}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,e){return this.isSurge()||this.isLoon()?$persistentStore.write(t,e):this.isQuanX()?$prefs.setValueForKey(t,e):this.isNode()?(this.data=this.loaddata(),this.data[e]=t,this.writedata(),!0):this.data&&this.data[e]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,e=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?(this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.get(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)})):this.isQuanX()?(this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t))):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,e)=>{try{if(t.headers["set-cookie"]){const s=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();s&&this.ckjar.setCookieSync(s,null),e.cookieJar=this.ckjar}}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)}))}post(t,e=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),t.headers&&delete t.headers["Content-Length"],this.isSurge()||this.isLoon())this.isSurge()&&this.isNeedRewrite&&(t.headers=t.headers||{},Object.assign(t.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient.post(t,(t,s,i)=>{!t&&s&&(s.body=i,s.statusCode=s.status),e(t,s,i)});else if(this.isQuanX())t.method="POST",this.isNeedRewrite&&(t.opts=t.opts||{},Object.assign(t.opts,{hints:!1})),$task.fetch(t).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>e(t));else if(this.isNode()){this.initGotEnv(t);const{url:s,...i}=t;this.got.post(s,i).then(t=>{const{statusCode:s,statusCode:i,headers:r,body:o}=t;e(null,{status:s,statusCode:i,headers:r,body:o},o)},t=>{const{message:s,response:i}=t;e(s,i,i&&i.body)})}}time(t,e=null){const s=e?new Date(e):new Date;let i={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in i)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?i[e]:("00"+i[e]).substr((""+i[e]).length)));return t}msg(e=t,s="",i="",r){const o=t=>{if(!t)return t;if("string"==typeof t)return this.isLoon()?t:this.isQuanX()?{"open-url":t}:this.isSurge()?{url:t}:void 0;if("object"==typeof t){if(this.isLoon()){let e=t.openUrl||t.url||t["open-url"],s=t.mediaUrl||t["media-url"];return{openUrl:e,mediaUrl:s}}if(this.isQuanX()){let e=t["open-url"]||t.url||t.openUrl,s=t["media-url"]||t.mediaUrl;return{"open-url":e,"media-url":s}}if(this.isSurge()){let e=t.url||t.openUrl||t["open-url"];return{url:e}}}};if(this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r))),!this.isMuteLog){let t=["","==============📣系统通知📣=============="];t.push(e),s&&t.push(s),i&&t.push(i),console.log(t.join("\n")),this.logs=this.logs.concat(t)}}log(...t){t.length>0&&(this.logs=[...this.logs,...t]),console.log(t.join(this.logSeparator))}logErr(t,e){const s=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();s?this.log("",`❗️${this.name}, 错误!`,t.stack):this.log("",`❗️${this.name}, 错误!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`🔔${this.name}, 结束! 🕛 ${s} 秒`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} diff --git a/serverless.yml b/serverless.yml index 2372a065..e05e9db6 100644 --- a/serverless.yml +++ b/serverless.yml @@ -64,12 +64,12 @@ inputs: cronExpression: "0 15 */1 * * * *" enable: true argument: jd_superMarket&jd_syj&jd_city&jd_zoo - - timer: #京豆变动通知 #疯狂的joy #监控crazyJoy分红 #京东排行榜 #领京豆额外奖励 #京东保价 #闪购盲盒 + - timer: #京豆变动通知 #疯狂的joy #监控crazyJoy分红 #京东排行榜 #领京豆额外奖励 #京东保价 #闪购盲盒 #京东沸腾之夜 parameters: - name: beanchange_crazyjoy_crazyjoybonus_rankingList_beanhome_price_sgmh + name: beanchange_crazyjoy_crazyjoybonus_rankingList_beanhome_price_sgmh_partynight cronExpression: "0 30 7 * * * *" enable: true - argument: jd_bean_change&jd_crazy_joy&jd_crazy_joy_bonus&jd_rankingList&jd_bean_home&jd_price&jd_sgmh + argument: jd_bean_change&jd_crazy_joy&jd_crazy_joy_bonus&jd_rankingList&jd_bean_home&jd_price&jd_sgmh&jd_party_nigth - timer: #金融养猪 #京东快递 #京东赚赚 #京喜签到 #京东极速版红包 #领金贴 parameters: name: pigPet_kd_jdzz_sign_speedredpocke_jintie