From e2c2c89d0bac00333175f0b1847532f90558faf4 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Sun, 20 Dec 2020 17:22:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E8=B5=9A=E8=B5=9A=E8=84=9A?= =?UTF-8?q?=E6=9C=AC(jd=5Fjdzz.js)=E6=9B=B4=E6=96=B0,=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=AE=A0=E6=B1=AA=E6=B1=AA=E8=B5=9B=E8=B7=91=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Loon/lxk0301_LoonTask.conf | 2 +- QuantumultX/lxk0301_gallery.json | 2 +- Surge/lxk0301_Task.sgmodule.sgmodule | 2 +- jd_bean_home.js | 60 ++++++++++++++-------------- jd_jdzz.js | 34 ++++++++++++++-- jd_joy_run.js | 13 ++++-- 6 files changed, 73 insertions(+), 40 deletions(-) diff --git a/Loon/lxk0301_LoonTask.conf b/Loon/lxk0301_LoonTask.conf index 1d1b41ab..7fdff7ca 100644 --- a/Loon/lxk0301_LoonTask.conf +++ b/Loon/lxk0301_LoonTask.conf @@ -105,7 +105,7 @@ cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scrip # 京东健康 cron "3 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdh.js,tag=京东健康 # 京东赚赚 -cron "10 10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdzz.js, tag=京东赚赚 +cron "10 11 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdzz.js, tag=京东赚赚 # 京东秒杀红包雨 cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, tag=秒杀红包雨 diff --git a/QuantumultX/lxk0301_gallery.json b/QuantumultX/lxk0301_gallery.json index 5a484bcd..0a9854d4 100644 --- a/QuantumultX/lxk0301_gallery.json +++ b/QuantumultX/lxk0301_gallery.json @@ -33,7 +33,7 @@ "40 9,10 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_watch.js, tag=京东看一看, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_watch.png", "10-20/5 12 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js, tag=京东直播, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_live_redrain.png", "10 8 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdh.js, tag=京东健康, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_jdh.png", - "10 8 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdzz.js, tag=京东赚赚, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdzz.png", + "14 11 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdzz.js, tag=京东赚赚, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdzz.png", "1 0,20,9-23/2 15-31 12 * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_live_redrain.png", "10 12 1-31 12 * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=京东金融打卡, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png", "15 17 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/xmSports.js, tag=小米运动, img-url=https://raw.githubusercontent.com/58xinian/icon/master/xmyd.png" diff --git a/Surge/lxk0301_Task.sgmodule.sgmodule b/Surge/lxk0301_Task.sgmodule.sgmodule index 360eb8db..14bdfe62 100644 --- a/Surge/lxk0301_Task.sgmodule.sgmodule +++ b/Surge/lxk0301_Task.sgmodule.sgmodule @@ -68,7 +68,7 @@ cron "40 9,10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_sc #京东健康 cron "20 23 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdh.js, timeout=750, wake-system=1, tag=京东健康 #京东赚赚 -cron "20 17 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdzz.js, timeout=750, wake-system=1, tag=京东赚赚 +cron "20 11 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdzz.js, timeout=750, wake-system=1, tag=京东赚赚 #以下为短期活动 #金融打卡领年终奖 cron "30 7 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, timeout=750, wake-system=1, tag=金融打卡领年终奖 diff --git a/jd_bean_home.js b/jd_bean_home.js index b236949d..b6e9ce5e 100644 --- a/jd_bean_home.js +++ b/jd_bean_home.js @@ -46,8 +46,8 @@ if ($.isNode()) { const JD_API_HOST = 'https://api.m.jd.com/'; !(async () => { $.newShareCodes = [] - await getAuthorShareCode(); - await getAuthorShareCode2(); + // await getAuthorShareCode(); + // await getAuthorShareCode2(); if (!cookiesArr[0]) { $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); return; @@ -75,34 +75,34 @@ const JD_API_HOST = 'https://api.m.jd.com/'; await jdBeanHome(); } } - for (let i = 0; i < cookiesArr.length; i++) { - if (cookiesArr[i]) { - $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) - console.log(`${$.UserName}去帮助下一个人`) - cookie = cookiesArr[i]; - if ($.newShareCodes.length > 1) { - let code = $.newShareCodes[(i + 1) % $.newShareCodes.length] - await help(code[0], code[1]) - } - if (helpAuthor && $.authorCode) { - console.log(`去帮助作者`) - const helpRes = await help($.authorCode[0], $.authorCode[1]) - if (helpRes && helpRes.data.respCode === 'SG209') { - console.log(`助力次数已耗尽,跳出助力`) - break; - } - } - if (helpAuthor && $.authorCode2) { - for (let code of $.authorCode2) { - const helpRes = await help(code.shareCode, code.groupCode); - if (helpRes && helpRes.data.respCode === 'SG209') { - console.log(`助力次数已耗尽,跳出助力`) - break; - } - } - } - } - } + // for (let i = 0; i < cookiesArr.length; i++) { + // if (cookiesArr[i]) { + // $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + // console.log(`${$.UserName}去帮助下一个人`) + // cookie = cookiesArr[i]; + // if ($.newShareCodes.length > 1) { + // let code = $.newShareCodes[(i + 1) % $.newShareCodes.length] + // await help(code[0], code[1]) + // } + // if (helpAuthor && $.authorCode) { + // console.log(`去帮助作者`) + // const helpRes = await help($.authorCode[0], $.authorCode[1]) + // if (helpRes && helpRes.data.respCode === 'SG209') { + // console.log(`助力次数已耗尽,跳出助力`) + // break; + // } + // } + // if (helpAuthor && $.authorCode2) { + // for (let code of $.authorCode2) { + // const helpRes = await help(code.shareCode, code.groupCode); + // if (helpRes && helpRes.data.respCode === 'SG209') { + // console.log(`助力次数已耗尽,跳出助力`) + // break; + // } + // } + // } + // } + // } })() .catch((e) => { $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') diff --git a/jd_jdzz.js b/jd_jdzz.js index 91f28c75..725f259f 100644 --- a/jd_jdzz.js +++ b/jd_jdzz.js @@ -25,6 +25,7 @@ const notify = $.isNode() ? require('./sendNotify') : ''; //Node.js用户请在jdCookie.js处填写京东ck; const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; let helpAuthor=true; // 帮助作者 +const randomCount = 5; let jdNotify = true; // 是否关闭通知,false打开通知推送,true关闭通知推送 //IOS等用户直接用NobyDa的jd cookie let cookiesArr = [], cookie = '', message; @@ -51,6 +52,7 @@ const inviteCodes = [ $.tuanList = [] await requireConfig(); if (helpAuthor) await getAuthorShareCode('https://gitee.com/shylocks/updateTeam/raw/main/jd_zz.json'); + if (helpAuthor) await getAuthorShareCode('https://gitee.com/lxk0301/updateTeam/raw/master/jd_zz.json'); if (!cookiesArr[0]) { $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); return; @@ -173,7 +175,7 @@ function helpFriendTuan(body) { if (data.resultCode === '9200008') console.log('不能助力自己') else if (data.resultCode === '9200011') console.log('已经助力过') else if (data.resultCode === '2400205') console.log('团已满') - else if (data.resultCode === '2400203') {console.log('助力次数已满');$.canHelp = false} + else if (data.resultCode === '2400203') {console.log('助力次数已耗尽');$.canHelp = false} else console.log(`未知错误`) } } @@ -329,7 +331,30 @@ async function helpFriends() { await doTask({"itemId": code, "taskId": "3", "mpVersion": "3.1.0"}, "doHelpTask") } } - +function readShareCode() { + console.log(`开始`) + return new Promise(async resolve => { + $.get({url: `https://code.chiang.fun/api/v1/jd/jdzz/read/${randomCount}/`}, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + console.log(`随机取${randomCount}个码放到您固定的互助码后面`) + data = JSON.parse(data); + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + await $.wait(10000); + resolve() + }) +} //格式化助力码 function shareCodesFormat() { return new Promise(async resolve => { @@ -342,7 +367,7 @@ function shareCodesFormat() { const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1); $.newShareCodes = inviteCodes[tempIndex].split('@'); } - const readShareCodeRes = null //await readShareCode(); + const readShareCodeRes = await readShareCode(); if (readShareCodeRes && readShareCodeRes.code === 200) { $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])]; } @@ -355,7 +380,8 @@ function requireConfig() { return new Promise(resolve => { console.log(`开始获取${$.name}配置文件\n`); //Node.js用户请在jdCookie.js处填写京东ck; - const shareCodes = [] //$.isNode() ? require('./jdSplitShareCodes.js') : ''; + // TODO 互助 + const shareCodes = []; console.log(`共${cookiesArr.length}个京东账号\n`); $.shareCodesArr = []; if ($.isNode()) { diff --git a/jd_joy_run.js b/jd_joy_run.js index 21a10746..c22fd5ae 100644 --- a/jd_joy_run.js +++ b/jd_joy_run.js @@ -41,7 +41,7 @@ const JD_BASE_API = `https://draw.jdfcloud.com//pet`; //下面给出好友邀请助力的示例填写规则 let invite_pins = ["jd_6cd93e613b0e5,被折叠的记忆33,jd_704a2e5e28a66,jd_45a6b5953b15b,zooooo58,jd_66f5cecc1efcd"]; //下面给出好友赛跑助力的示例填写规则 -let run_pins = ["jd_6cd93e613b0e5,被折叠的记忆33,jd_704a2e5e28a66,jd_45a6b5953b15b,zooooo58,jd_66f5cecc1efcd"]; +let run_pins = ["被折叠的记忆33,jd_6cd93e613b0e5,jd_45a6b5953b15b,zooooo58,jd_66f5cecc1efcd,jd_sIhNpDXJehOr,jd_704a2e5e28a66"]; // $.LKYLToken = '76fe7794c475c18711e3b47185f114b5' || $.getdata('jdJoyRunToken'); // $.LKYLToken = $.getdata('jdJoyRunToken'); const friendsArr = ["yhr_19820404", "13008094886_p", "13966269193_p", "jd_4e4d9825e5fb1", "jd_5ff306cf94512", "ququkoko", "jd_59a9823f35496", "529577509-275616", "18923155789_p", "jd_455da88071d1e", "dreamscometrue5120", "蒋周南19620607", "jd_620ceca400151", "杉雨2011", "MARYMY88", "13682627696_p", "jd_6777ee65f9fcc", "夏海东12315", "jd_437b4f3fa5d83", "zyjyc9998", "meoygua", "MLHK7288", "jd_42d9ce3001acd", "jd_57650a30ef6eb", "jd_44ca1016e0f96", "jd_74332d1d62a97", "jd_7dbe4f8a40a7d", "jd_4fa238e4e3039", "elbereth1122", "jd_4d9be23908e41", "jd_51f0d43d78900", "13588108107_p", "123by456", "09niuniuma", "143798682-947527", "jd_560c6f30e6951", "jd_54ddb8af5374a", "夏革平", "247466310", "wang2011", "chensue", "1362245003-624122", "wdGefYCBlyOuvz", "jd_412f7eb363cd8", "18311575050_p", "1307976-34738981", "wdgOGLtOJjjbnp", "klhzdx", "jd_5fdcdcb183d7d", "jd_5862fd8834680", "jd_6cd93e613b0e5", "jd_51a64a9da6b94", "302990512-553401", "jd_4078f69a72873", "jd_ewYCRdmukzQH", "13348822441_p", "hlcx86021", "390823571-784974", "jd_79af2bc7a56a3", "15053231812_p", "jd_6f53253d117c5", "jd_5bf29dffa62ea", "jd_47a1c4ad02103", "刘凤苓", "145391572-102667", "yanglan0409", "jd_4b8a70f3b06c3", "弑神X", "jd_59d962a076126", "sjw3000", "jd_4d4def8b59787", "L1518235423", "jd_579b891fbea9b", "frank818", "hellohuhua", "jd_4cf1918577871", "jd_akYbyiXqrIDC", "李纪红", "jd_54a4260ca986c", "jd_4cba35cfa8220", "13654075776_p", "13916051043", "jd_6f9b9a6769afb", "iamkgbfox", "jd_5fbda9be54d5b", "jd_76763ba485c5e", "jd_45a6b5953b15b", "jd_485c757b79422", "xiaojingang_0", "lanye1545", "chenzhiyun2002", "lmpbjs1988", "jd_SmPxpudoGYOb", "jwl19690905", "荷舞弄清影88", "jd_750d6a9734717", "jd_64e37854e713f", "jd_573c9832d8989", "wdkplHVQlgowTW", "wwk232323", "jd_6bfe51f915c90", "我手机号码", "13681610268_p", "ss836580793", "15868005933_p", "zooooo58", "陌上花开花又落", "jd_701f52f8badbb", "jd_462f9229c20e4", "jd_42193689987a0", "jd_7dc5829121bcc", "13656692651_phz", "jd_47f49f22f1dc3", "handechun959", "13775208986_p", "guoyizhang", "jd_677dd20bf2749", "被折叠的记忆33", "jd_FfAnqFVEoBul", "jd_4e59841cae4f9", "jd_5279d593e7803", "思绪随风2011", "jd_62e335d785872", "suyugen", "jd_4e68b48d16f7b", "jd_56b7a4e092e85", "cocoty", "jd_7b6d6e7dc98f1", "jd_63423cd594e8b", "greatyunyun", "4349小丢丢", "18027486801_p", "15207695569_p", "llbai11", "wdNRUvbJItetlvB", "jd_54154982c707f", "85192cool", "jd_60d497271825b", "greatyunyun9320", "ky252571504", "jd_74e60dbcae365", "wdiicnSbYSHWwE", "jd_529a0a309d418", "jd_7be92b11b7e8f", "13486659225_p", "jd_iFnquhpWWAzO", "jd_6e348ece13e20", "jd_6f5b49bb757cb", "znz传奇", "418001066_m", "jd_67ded5748c3ab", "361372-27819972", "jd_5fafb631c98af", "jd_76dd04e844d63", "小鹿Jenny", "00数字方程式", "jd_77a82b603c6c3", "勇敢的小泪", "jd_4481f68984466", "jd_758f5224ee957", "mwb1992062_m", "15975229552_p", "zdj8341", "pet_virtual_friend_胡皋三", "pet_virtual_friend_绿茶sama", "pet_virtual_friend_Ainio", "jd_4915949b7bfa1", "jd_7ca74ed9224ef", "jd_42764f5ea2341", "5317123-63418293", "jd_40a2d9485cbdb", "qazmcl1230", "jd_7ced325aba4fd", "jd_402fe7425fcaf", "95581245-627991", "luffy-314_m", "jd_BCXgLlmxHdiS", "jd_610b3d00928e5", "你要醒来", "338379384-148135", "pet_virtual_friend_乔治桑", "jd_54130a3e282ea", "jd_6169b3411ed5b", "jd_428d930ca56a5", "qq6924309", "pet_virtual_friend_路遇狗与少年", "jd_712bd3bfd55d6", "jd_4e97fe5ca4003", "tommy_he1", "13981372001_p", "129867657-673064", "jd_525d6e7a57e7c", "wdZuirGekSHKmF", "jd_75e1da74980ab", "jd_RVMXldNSQNOP", "jd_5f94da0265e0d", "jd_67ab629be7e61", "13887490621_p", "jd_4e0d529ba3c35", "jd_493918e314b50", "jd_71a220104187a", "jd_vVhhkdUpTkJQ", "gary388jingdong", "wdjQkAbFobMTyo", "cloud_kim", "jd_558ed75f52d39", "15555448319_p", "wdhxZuEvXhhvCf", "jd_72b940be8c0f4", "congcong炒葱葱", "jd_7eb0de64eb25a", "13209558123_p", "jd_53bf7cb6fb8e6", "jd_4fe620f72fa7c", "夏雨的爱情", "jd_47ba82eb392a5", "jd_LXnFHXoJwXkW", "62160785-578856", "醒醒该睡了", "jd_LOEWgvNwQIWD", "xiiirww", "pet_virtual_friend_特兰克斯", "pet_virtual_friend_Talon", "jd_4f7cd5b108733", "jd_NgNWXMVkJIvk", "jadonglin", "玩家卫弈", "liangxuejingdong", "jd_627171efb7c0a", "jd_53bc7a14f64d6", "15809290902_p", "jd_65a2ab73d9aa5", "jd_6edb943cacbfb", "jd_7f7eabc5caf7d", "jd_725e17effb6a9", "蔡辉煌", "voxb", "gdxx_hhw_m", "jd_78f0d6524a1dc", "jd_sDtnONLeHwfG", "xyyshy1983", "yinlang46", "ypqian", "15817094457_p", "fdxwb", "wuyaoxin2012", "明子溪", "henry1927_m", "chamy99", "jd_461e384274c34", "248358330-645106", "jd_4fd63de4a6033", "蜜糖向日葵", "wonghe", "36453197-121619", "琳琅满目cbb", "jd_5b7cc9e532426", "134795344-89911673", "15211488203_p", "jd_6f1f0722f8365", "jd_JmGCpqgpCtqG", "墨明棋妙陈", "pet_virtual_friend_1314爱澳", "1209815-33190621", "zhouhuayh", "jd_6d3cbb8b0751a", "jd_6e00e826f939b", "jd_704a2e5e28a66", "mztvip", "davidharry", "sara35424", "sun5025", "jd_62ce2385bb364", "352834026-406289", "pet_virtual_friend_丁座的真爱粉", "jd_582eecf8d27a9", "jd_49acdb02e8514", "13976911784_p", "jd_uGzohbhFpRuz", "wzywolfgang", "yjbonny", "沧海不轮回", "649297742_327799447", "倚兰椒", "琳琳8796", "snzh2013", "jd_73751adc04afd", "wdNnlMzPGJJKgqI", "yygt1158", "jd_53df36eb204a0", "花开花花落", "jd_611e082213c89", "jd_71e77d9235cf5", "jd_596fd9fea411f", "jd_7277d200aa1ac", "15230573701_p", "zb19881021", "692620136落", "168876810-159969", "zhushidan100", "上自习的猪", "15602231009_p", "jd_5213fd3fd5e09", "jd_6711f97ee4dfe", "44787591-640051", "MisterGlasses", "jd_7b22bbfe1e7e5", "138555963-81748582", "jd_QEVVkkDTQAlJ", "4932713-24535180", "jd_6dce98c07a644", "jd_DUtPtiiDamDr", "wangyneu", "wBm1TsDy3p_m", "jd_6acd3a6cc79cc","jd_444f5c020f31c","jd_71caf6b3ec4cb", "shin_dynasty", "carola82", "jd_AOhLSBLdSnux", "ningbormb"]; @@ -225,8 +225,15 @@ function showMsg() { return new Promise(async resolve => { if ($.inviteReward || $.runReward) { let message = ''; - message += `给${$.inviteReward / 30}人邀请助力成功,获得${$.inviteReward}积分\n给${$.runReward / 5}人赛跑助力成功,获得狗粮${$.runReward}g`; - $.msg($.name, '', `京东账号${$.index} ${UserName}\n${message}`); + if ($.inviteReward > 0) { + message += `给${$.inviteReward / 30}人邀请助力成功,获得${$.inviteReward}积分\n`; + } + if ($.runReward > 0) { + message += `给${$.runReward / 5}人赛跑助力成功,获得狗粮${$.runReward}g`; + } + if (message) { + $.msg($.name, '', `京东账号${$.index} ${UserName}\n${message}`); + } } resolve(); })