From 4d04c64fa6f724152a4bee645114c7060a6d5a2a Mon Sep 17 00:00:00 2001 From: Aaron-lv <674560606@qq.com> Date: Fri, 1 Oct 2021 00:51:49 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E9=A6=96=E6=AC=A1=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + README.md | 1 + Task/jd_half_redrain.js | 284 +++++++++++++++++++++++++++++++ Task/jd_shop_sign.js | 359 +++++++++++++++++++++++++++++++++++++++ Task/jd_super_mh.js | 339 ++++++++++++++++++++++++++++++++++++ Task/jd_super_redrain.js | 284 +++++++++++++++++++++++++++++++ 6 files changed, 1268 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 Task/jd_half_redrain.js create mode 100644 Task/jd_shop_sign.js create mode 100644 Task/jd_super_mh.js create mode 100644 Task/jd_super_redrain.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a57582c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/src diff --git a/README.md b/README.md new file mode 100644 index 0000000..52258b5 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# JavaScript diff --git a/Task/jd_half_redrain.js b/Task/jd_half_redrain.js new file mode 100644 index 0000000..709d840 --- /dev/null +++ b/Task/jd_half_redrain.js @@ -0,0 +1,284 @@ +/* +半点京豆雨 +已支持IOS双京东账号,Node.js支持N个京东账号 +脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js + +[task_local] +#半点京豆雨 +30 16-23/1 * * * https://raw.githubusercontent.com/Aaron-lv/JavaScript/master/Task/jd_half_redrain.js, tag=半点京豆雨, enabled=true + +================Loon============== +[Script] +cron "30 16-23/1 * * *" script-path=https://raw.githubusercontent.com/Aaron-lv/JavaScript/master/Task/jd_half_redrain.js,tag=半点京豆雨 + +===============Surge================= +半点京豆雨 = type=cron,cronexp="30 16-23/1 * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/Aaron-lv/JavaScript/master/Task/jd_half_redrain.js + +============小火箭========= +半点京豆雨= type=cron,script-path=https://raw.githubusercontent.com/Aaron-lv/JavaScript/master/Task/jd_half_redrain.js, cronexpr="30 16-23/1 * * *",timeout=200, enable=true +*/ +const $ = new Env("半点京豆雨"); +let allMessage = ""; +const notify = $.isNode() ? require("./sendNotify") : ""; +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require("./jdCookie.js") : ""; +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = "", message; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]); + }); + if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false") console.log = () => {}; + if (JSON.stringify(process.env).indexOf("GITHUB") > -1) process.exit(0); +} else { + cookiesArr = [$.getdata("CookieJD"), $.getdata("CookieJD2"), ...jsonParse($.getdata("CookiesJD") || "[]").map((item) => item.cookie)].filter((item) => !!item); +} +const JD_API_HOST = "https://api.m.jd.com/api"; +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, "【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取", "https://bean.m.jd.com/", {"open-url": "https://bean.m.jd.com/"}); + return; + } + + let url = rraUrl(); + console.log(`召唤龙王`); + let code = await redRainId(url); + console.log(`召唤完成`); + + if (!code) { + $.log(`今日龙王🐲出差,天气晴朗☀️,改日再来~`); + return; + } + + let codeList = code.split(";"); + console.log(`龙王就位: ${codeList}`); + + for (let codeItem of codeList) { + let ids = {}; + for (let i = 0; i < 24; i++) { + ids[String(i)] = codeItem; + } + + let hour = (new Date().getUTCHours() + 8) % 24; + if (ids[hour]) { + $.activityId = ids[hour]; + $.log(`\nRRA: ${codeItem}`); + } else { + $.log(`无法从本地读取配置,请检查运行时间`); + return; + } + + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]); + $.index = i + 1; + $.isLogin = true; + $.nickName = ""; + message = ""; + await TotalBean(); + console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); + if (!$.isLogin) { + $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/`, {"open-url": "https://bean.m.jd.com/"}) + + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue; + } + + await receiveRedRain(); + // await showMsg(); + } + } + } + + if (allMessage && isNotify()) { + if ($.isNode()) await notify.sendNotify(`${$.name}`, `${allMessage}`); + $.msg($.name, "", allMessage); + } +})() + .catch((e) => { + $.log("", `❌ ${$.name}, 失败! 原因: ${e}!`, ""); + }) + .finally(() => { + $.done(); + }); + +function showMsg() { + return new Promise((resolve) => { + $.msg($.name, "", `【京东账号${$.index}】${$.nickName}\n${message}`); + resolve(); + }); +} + +function receiveRedRain() { + return new Promise((resolve) => { + const body = { actId: $.activityId }; + $.get(taskUrl("noahRedRainLottery", body), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.subCode === "0") { + console.log(`领取成功,获得 ${JSON.stringify(data.lotteryResult)}`); + // message+= `领取成功,获得${JSON.stringify(data.lotteryResult)}\n` + message += `领取成功,获得 ${data.lotteryResult.jPeasList[0].quantity} 京豆`; + allMessage += `【京东账号${$.index}】${$.nickName || $.UserName}\n领取成功,获得 ${data.lotteryResult.jPeasList[0].quantity} 京豆${$.index !== cookiesArr.length ? "\n\n" : "\n\n"}`; + } else if (data.subCode === "8") { + console.log(`领取失败:本场已领过`); + message += `领取失败,本场已领过`; + } else { + console.log(`异常:${JSON.stringify(data)}`); + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +function redRainId(url) { + return new Promise((resolve) => { + const options = { + url: `${url}?${new Date()}`, + timeout: 10000, + headers: { + "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88" + }, + }; + let id = ""; + $.get(options, async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + id = "error"; + } else { + if (!!data) { + id = data.replace(/[\r\n]/g, ""); + } else { + id = ""; + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(id); + } + }); + }); +} + +function rraUrl() { + let url = "http://qyuyful8s.hb-bkt.clouddn.com/jd-half-rain.json"; + if ($.isNode() && process.env.JD_HALF_RRA_URL) { + url = process.env.JD_HALF_RRA_URL; + } else if ($.getdata("jdHalfRRAUrl")) { + url = $.getdata("jdHalfRRAUrl"); + } + return url; +} + +function isNotify() { + if ($.isNode() && process.env.RAIN_NOTIFY_CONTROL) { + return process.env.RAIN_NOTIFY_CONTROL != "false"; + } else if ($.getdata("rainNotifyControl")) { + return $.getdata("rainNotifyControl") != "false"; + } + return true; +} + +function taskUrl(function_id, body = {}) { + return { + url: `${JD_API_HOST}?functionId=${function_id}&body=${escape(JSON.stringify(body))}&client=wh5&clientVersion=1.0.0&_=${new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000}`, + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Content-Type": "application/x-www-form-urlencoded", + "Host": "api.m.jd.com", + "Referer": `https://h5.m.jd.com/active/redrain/index.html?id=${$.activityId}&lng=0.000000&lat=0.000000&sid=&un_area=`, + "Cookie": cookie, + "User-Agent": "JD4iPhone/9.3.5 CFNetwork/1209 Darwin/20.2.0", + }, + }; +} + +function TotalBean() { + return new Promise(async (resolve) => { + const options = { + url: `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + headers: { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "JD4iPhone/9.3.5 CFNetwork/1209 Darwin/20.2.0" : $.getdata("JDUA") ? $.getdata("JDUA") : "JD4iPhone/9.3.5 CFNetwork/1209 Darwin/20.2.0", + }, + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + if (data) { + data = JSON.parse(data); + if (data["retcode"] === 13) { + $.isLogin = false; //cookie过期 + return; + } + if (data["retcode"] === 0) { + $.nickName = (data["base"] && data["base"].nickname) || $.UserName; + } else { + $.nickName = $.UserName; + } + } else { + console.log(`京东服务器返回空数据`); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, "", "不要在BoxJS手动复制粘贴修改cookie"); + return []; + } + } +} +// 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/Task/jd_shop_sign.js b/Task/jd_shop_sign.js new file mode 100644 index 0000000..40543e0 --- /dev/null +++ b/Task/jd_shop_sign.js @@ -0,0 +1,359 @@ +/* +店铺签到,各类店铺签到,有新的店铺直接添加token即可 +============Quantumultx=============== +[task_local] +#店铺签到 +0 0 * * * https://raw.githubusercontent.com/Aaron-lv/JavaScript/master/Task/jd_shop_sign.js, tag=店铺签到, enabled=true +===========Loon============ +[Script] +cron "0 0 * * *" script-path=https://raw.githubusercontent.com/Aaron-lv/JavaScript/master/Task/jd_shop_sign.js,tag=店铺签到 +============Surge============= +店铺签到 = type=cron,cronexp="0 0 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/Aaron-lv/JavaScript/master/Task/jd_shop_sign.js +===========小火箭======== +店铺签到 = type=cron,script-path=https://raw.githubusercontent.com/Aaron-lv/JavaScript/master/Task/jd_shop_sign.jss, cronexpr="0 0 * * *", timeout=3600, enable=true +*/ +const $ = new Env('店铺签到'); +const notify = $.isNode() ? require('./sendNotify') : ''; +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = '', allMessage = '', message; +const JD_API_HOST = 'https://api.m.jd.com/api?appid=interCenter_shopSign'; + +let activityId='' +let vender='' +let num=0 +let shopname='' +const token = [ + "EC51AB87807801FC31D3E36AA56BD16F", + "A999F0F41763FD4C392677A00B930D4E", + "77F925F11B0F8D26C4804B73CEB95C16", + "63CA2A609B3A988B46812441B4EBB6D8", + "12DD65EC41A80686FE2FA28C54C3FAF1", + "2D01F8529A3FDF70C106459FE90E263C", + "08CF28B9C0DB32912238B36662E075B6", + "1B32B3957981C1AE9FBAAA9A1846697F", + "B3A9883216190B198C546D21A18E0738", + "E401DB88AD9518168404A947BD069655", + "513D954BF67D7B0A7A777EEFCC047013", + "1B9C6FFEBB6608C114E2EB88FA493507", + "9C5F0B51AE22D8A1B2B93B140127CF13", + "AA2480321D300985EEEF9D772749F5BE", + "5975ADF27E90C34C09E0E51C2F03195D" +] + +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; +} else { + let cookiesData = $.getdata('CookiesJD') || "[]"; + cookiesData = jsonParse(cookiesData); + cookiesArr = cookiesData.map(item => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]); + cookiesArr.reverse(); + cookiesArr = cookiesArr.filter(item => item !== "" && item !== null && item !== undefined); +} + +!(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"}); + return; + } + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + message = ''; + await TotalBean(); + console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); + if (!$.isLogin) { + $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue + } + await dpqd() + await showMsg() + } + } + if ($.isNode() && allMessage) { + await notify.sendNotify(`${$.name}`, `${allMessage}`) + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) + +//开始店铺签到 +async function dpqd(){ + for (var j = 0; j < token.length; j++) { + num=j+1 + if (token[j]=='') {continue} + await getvenderId(token[j]) + if (vender=='') {continue} + await getvenderName(vender) + await getActivityInfo(token[j],vender) + await signCollectGift(token[j],vender,activityId) + await taskUrl(token[j],vender) + } +} + +//获取店铺ID +function getvenderId(token) { + return new Promise(resolve => { + const options = { + url: `https://api.m.jd.com/api?appid=interCenter_shopSign&t=${Date.now()}&loginType=2&functionId=interact_center_shopSign_getActivityInfo&body={%22token%22:%22${token}%22,%22venderId%22:%22%22}&jsonp=jsonp1000`, + headers: { + "accept": "*/*", + "accept-encoding": "gzip, deflate, br", + "accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", + "cookie": cookie, + "referer": 'https://h5.m.jd.com/', + "User-Agent": `Mozilla/5.0 (Linux; U; Android 10; zh-cn; MI 8 Build/QKQ1.190828.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.147 Mobile Safari/537.36 XiaoMi/MiuiBrowser/13.5.40` + } + } + $.get(options, (err, resp, data) => { + try { + if (err) { + console.log(`\n${$.name}: API查询请求失败 ‼️‼️`) + $.logErr(err); + } else { + //console.log(data) + data = JSON.parse(/{(.*)}/g.exec(data)[0]) + if (data.code==402) { + vender='' + console.log(`第`+num+`个店铺签到活动已失效`) + message +=`第`+num+`个店铺签到活动已失效\n` + }else{ + vender=data.data.venderId + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) +} + +//获取店铺名称 +function getvenderName(venderId) { + return new Promise(resolve => { + const options = { + url: `https://wq.jd.com/mshop/QueryShopMemberInfoJson?venderId=${venderId}`, + headers: { + "accept": "*/*", + "accept-encoding": "gzip, deflate, br", + "accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", + "cookie": cookie, + "User-Agent": `Mozilla/5.0 (Linux; U; Android 10; zh-cn; MI 8 Build/QKQ1.190828.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.147 Mobile Safari/537.36 XiaoMi/MiuiBrowser/13.5.40` + } + } + $.get(options, (err, resp, data) => { + try { + if (err) { + console.log(`\n${$.name}: API查询请求失败 ‼️‼️`) + $.logErr(err); + } else { + //console.log(data) + data = JSON.parse(data) + shopName = data.shopName + console.log(`【`+shopName+`】`) + message +=`【`+shopName+`】` + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) +} + + +//获取店铺活动信息 +function getActivityInfo(token,venderId) { + return new Promise(resolve => { + const options = { + url: `${JD_API_HOST}&t=${Date.now()}&loginType=2&functionId=interact_center_shopSign_getActivityInfo&body={%22token%22:%22${token}%22,%22venderId%22:${venderId}}&jsonp=jsonp1005`, + headers: { + "accept": "accept", + "accept-encoding": "gzip, deflate", + "accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", + "cookie": cookie, + "referer": `https://h5.m.jd.com/babelDiy/Zeus/2PAAf74aG3D61qvfKUM5dxUssJQ9/index.html?token=${token}&sceneval=2&jxsid=16105853541009626903&cu=true&utm_source=kong&utm_medium=jingfen&utm_campaign=t_1001280291_&utm_term=fa3f8f38c56f44e2b4bfc2f37bce9713`, + "User-Agent": `Mozilla/5.0 (Linux; U; Android 10; zh-cn; MI 8 Build/QKQ1.190828.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.147 Mobile Safari/537.36 XiaoMi/MiuiBrowser/13.5.40` + } + } + $.get(options, (err, resp, data) => { + try { + if (err) { + // console.log(data) + console.log(`\n${$.name}: API查询请求失败 ‼️‼️`) + $.logErr(err); + } else { + //console.log(data) + data = JSON.parse(/{(.*)}/g.exec(data)[0]) + activityId=data.data.id + //console.log(data) + let mes=''; + for (let i = 0; i < data.data.continuePrizeRuleList.length; i++) { + const level=data.data.continuePrizeRuleList[i].level + const discount=data.data.continuePrizeRuleList[i].prizeList[0].discount + mes += "签到"+level+"天,获得"+discount+'豆' + } + // console.log(message+mes+'\n') + // message += mes+'\n' + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) +} + +//店铺签到 +function signCollectGift(token,venderId,activitytemp) { + return new Promise(resolve => { + const options = { + url: `${JD_API_HOST}&t=${Date.now()}&loginType=2&functionId=interact_center_shopSign_signCollectGift&body={%22token%22:%22${token}%22,%22venderId%22:688200,%22activityId%22:${activitytemp},%22type%22:56,%22actionType%22:7}&jsonp=jsonp1004`, + headers: { + "accept": "accept", + "accept-encoding": "gzip, deflate", + "accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", + "cookie": cookie, + "referer": `https://h5.m.jd.com/babelDiy/Zeus/2PAAf74aG3D61qvfKUM5dxUssJQ9/index.html?token=${token}&sceneval=2&jxsid=16105853541009626903&cu=true&utm_source=kong&utm_medium=jingfen&utm_campaign=t_1001280291_&utm_term=fa3f8f38c56f44e2b4bfc2f37bce9713`, + "User-Agent": `Mozilla/5.0 (Linux; U; Android 10; zh-cn; MI 8 Build/QKQ1.190828.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.147 Mobile Safari/537.36 XiaoMi/MiuiBrowser/13.5.40` + } + } + $.get(options, (err, resp, data) => { + try { + if (err) { + console.log(`\n${$.name}: API查询请求失败 ‼️‼️`) + $.logErr(err); + } else { + //console.log(data) + data = JSON.parse(/{(.*)}/g.exec(data)[0]) + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) +} + +//店铺获取签到信息 +function taskUrl(token,venderId) { + return new Promise(resolve => { + const options = { + url: `${JD_API_HOST}&t=${Date.now()}&loginType=2&functionId=interact_center_shopSign_getSignRecord&body={%22token%22:%22${token}%22,%22venderId%22:${venderId},%22activityId%22:${activityId},%22type%22:56}&jsonp=jsonp1006`, + headers: { + "accept": "application/json", + "accept-encoding": "gzip, deflate, br", + "accept-language": "zh-CN,zh;q=0.9", + "cookie": cookie, + "referer": `https://h5.m.jd.com/`, + "user-agent": `Mozilla/5.0 (Linux; U; Android 10; zh-cn; MI 8 Build/QKQ1.190828.002) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/79.0.3945.147 Mobile Safari/537.36 XiaoMi/MiuiBrowser/13.5.40` + } + } + $.get(options, (err, resp, data) => { + try { + if (err) { + console.log(`\n${$.name}: API查询请求失败 ‼️‼️`) + $.logErr(err); + } else { + //console.log(data) + data = JSON.parse(/{(.*)}/g.exec(data)[0]) + console.log(`已签到:`+data.data.days+`天`) + message +=`已签到:`+data.data.days+`天\n` + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }) +} + +async function showMsg() { + if ($.isNode()) { + $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`); + allMessage += `【京东账号${$.index}】${$.nickName}\n${message}${$.index !== cookiesArr.length ? '\n\n' : ''}`; + } +} + +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": `jdapp;android;9.3.5;10;3353234393134326-3673735303632613;network/wifi;model/MI 8;addressid/138719729;aid/3524914bc77506b1;oaid/274aeb3d01b03a22;osVer/29;appBuild/86390;psn/Mp0dlaZf4czQtfPNMEfpcYU9S/f2Vv4y|2255;psq/1;adk/;ads/;pap/JA2015_311210|9.3.5|ANDROID 10;osv/10;pv/2039.1;jdv/0|androidapp|t_335139774|appshare|QQfriends|1611211482018|1611211495;ref/com.jingdong.app.mall.home.JDHomeFragment;partner/jingdong;apprpd/Home_Main;eufv/1;jdSupportDarkMode/0;Mozilla/5.0 (Linux; Android 10; MI 8 Build/QKQ1.190828.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36` + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + if (data['retcode'] === 0) { + $.nickName = data['base'].nickname; + } else { + $.nickName = $.UserName + } + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') + return []; + } + } +} + +// prettier-ignore +function Env(t,e){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("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}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("@"),a={url:`http://${h}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:r},headers:{"X-Key":o,Accept:"*/*"}};this.post(a,(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();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){let e={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let s in e)new RegExp("("+s+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[s]:("00"+e[s]).substr((""+e[s]).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}}}};this.isMute||(this.isSurge()||this.isLoon()?$notification.post(e,s,i,o(r)):this.isQuanX()&&$notify(e,s,i,o(r)));let h=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];h.push(e),s&&h.push(s),i&&h.push(i),console.log(h.join("\n")),this.logs=this.logs.concat(h)}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("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):this.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(e=>setTimeout(e,t))}done(t={}){const e=(new Date).getTime(),s=(e-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${s} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,e)} diff --git a/Task/jd_super_mh.js b/Task/jd_super_mh.js new file mode 100644 index 0000000..53fe475 --- /dev/null +++ b/Task/jd_super_mh.js @@ -0,0 +1,339 @@ +/* +超级直播间盲盒抽京豆 +已支持IOS双京东账号,Node.js支持N个京东账号 +脚本兼容: Quantumult X, Surge, Loon, JSBox, Node.js +==============Quantumult X============== +[task_local] +#超级直播间盲盒抽京豆 +1 18,20 * * * https://raw.githubusercontent.com/Aaron-lv/JavaScript/master/Task/jd_super_mh.js, tag=超级直播间盲盒抽京豆, enabled=true + +==============Loon============== +[Script] +cron "1 18,20 * * *" script-path=https://raw.githubusercontent.com/Aaron-lv/JavaScript/master/Task/jd_super_mh.js,tag=超级直播间盲盒抽京豆 + +================Surge=============== +超级直播间盲盒抽京豆 = type=cron,cronexp="1 18,20 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/Aaron-lv/JavaScript/master/Task/jd_super_mh.js + +===============小火箭========== +超级直播间盲盒抽京豆 = type=cron,script-path=https://raw.githubusercontent.com/Aaron-lv/JavaScript/master/Task/jd_super_mh.js, cronexpr="1 18,20 * * *", timeout=3600, enable=true +*/ +const $ = new Env('超级直播间盲盒抽京豆'); +let allMessage = ''; +const notify = $.isNode() ? require('./sendNotify') : ''; +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = '', message; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {}; + if (JSON.stringify(process.env).indexOf('GITHUB') > -1) process.exit(0) +} else { + cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item); +} +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"}); + return; + } + + let url = mhUrl() + console.log(`召唤锦鲤`) + let code = await mhId(url) + console.log(`召唤完成`) + + if(!code){ + $.log(`今日锦鲤🐠出差,天气晴朗☀️,改日再来~`) + return + } + + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + $.beans = 0 + message = ''; + await TotalBean(); + console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); + if (!$.isLogin) { + $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/`, {"open-url": "https://bean.m.jd.com/"}); + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue + } + try { + await jdMh(code) + } catch (e) { + $.logErr(e) + } + } + } + if (allMessage) { + if ($.isNode()) await notify.sendNotify(`${$.name}`, `${allMessage}`); + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) + +async function jdMh(url) { + try { + await getInfo(url) + await getUserInfo() + await draw() + while ($.userInfo.bless >= $.userInfo.cost_bless_one_time) { + await draw() + await getUserInfo() + await $.wait(500) + } + await showMsg(); + } catch (e) { + $.logErr(e) + } +} + +function mhId(url) { + return new Promise(resolve => { + const options = { + url: `${url}?${new Date()}`, "timeout": 10000, headers: { + "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88" + } + }; + let id = '' + $.get(options, async (err, resp, data) => { + try { + if (err) { + console.log(JSON.stringify(err)) + id = 'error' + } else { + if (!!data) { + id = data.replace(/[\r\n]/g,"") + } else { + id = '' + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(id); + } + }) + }) +} + +function mhUrl() { + let url = 'http://qyuyful8s.hb-bkt.clouddn.com/jd-half-mh.json' + if ($.isNode() && process.env.JD_MH_URL) { + url = process.env.JD_MH_URL + } else if ($.getdata('jdMHUrl')) { + url = $.getdata('jdMHUrl') + } + + return url +} + +function showMsg() { + return new Promise(resolve => { + message += `本次运行获得${$.beans}京豆` + if($.beans > 0 ){ + allMessage += `【京东账号${$.index}】${$.nickName || $.UserName}\n领取成功,本次运行获得${$.beans}京豆${$.index !== cookiesArr.length ? '\n\n' : '\n\n'}`; + } + $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`); + resolve() + }) +} + +function getInfo(url = code) { + console.log(`url:${url}`) + return new Promise(resolve => { + $.get({ + url, + headers: { + Cookie: cookie + } + }, async (err, resp, data) => { + try { + $.info = JSON.parse(data.match(/var snsConfig = (.*)/)[1]) + $.prize = JSON.parse($.info.prize) + } catch (e) { + console.log(e) + } finally { + resolve() + } + }) + }) +} + +function getUserInfo() { + return new Promise(resolve => { + $.get(taskUrl('query'), async (err, resp, data) => { + try { + if (err) { + console.log(`${err},${jsonParse(resp.body)['message']}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + $.userInfo = JSON.parse(data.match(/query\((.*)\n/)[1]).data + // console.log(`您的好友助力码为${$.userInfo.shareid}`) + console.log(`当前幸运值:${$.userInfo.bless}`) + for (let task of $.info.config.tasks) { + if (!$.userInfo.complete_task_list.includes(task['_id'])) { + console.log(`去做任务${task['_id']}`) + await doTask(task['_id']) + await $.wait(500) + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} + +function doTask(taskId) { + let body = `task_bless=10&taskid=${taskId}` + return new Promise(resolve => { + $.get(taskUrl('completeTask', body), async (err, resp, data) => { + try { + if (err) { + console.log(`${err},${jsonParse(resp.body)['message']}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data.match(/query\((.*)\n/)[1]) + if (data.data.complete_task_list.includes(taskId)) { + console.log(`任务完成成功,当前幸运值${data.data.curbless}`) + $.userInfo.bless = data.data.curbless + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} + +function draw() { + return new Promise(resolve => { + $.get(taskUrl('draw'), async (err, resp, data) => { + try { + if (err) { + console.log(`${err},${jsonParse(resp.body)['message']}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + data = JSON.parse(data.match(/query\((.*)\n/)[1]) + if (data.data && data.data.drawflag) { + if ($.prize.filter(vo => vo.prizeLevel === data.data.level).length > 0) { + console.log(`获得${$.prize.filter(vo => vo.prizeLevel === data.data.level)[0].prizename}`) + $.beans += $.prize.filter(vo => vo.prizeLevel === data.data.level)[0].beansPerNum + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(data); + } + }) + }) +} + +function taskUrl(function_id, body = '') { + body = `activeid=${$.info.activeId}&token=${$.info.actToken}&sceneval=2&shareid=&_=${new Date().getTime()}&callback=query&${body}` + return { + url: `https://wq.jd.com/activet2/piggybank/${function_id}?${body}`, + headers: { + 'Host': 'wq.jd.com', + 'Accept': 'application/json', + 'Accept-Language': 'zh-cn', + 'Content-Type': 'application/json;charset=utf-8', + 'Origin': 'wq.jd.com', + 'User-Agent': 'JD4iPhone/167490 (iPhone; iOS 14.2; Scale/3.00)', + 'Referer': `https://anmp.jd.com/babelDiy/Zeus/xKACpgVjVJM7zPKbd5AGCij5yV9/index.html?wxAppName=jd`, + 'Cookie': cookie + } + } +} + +function TotalBean() { + return new Promise(async resolve => { + const options = { + "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + "headers": { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1") + } + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`${$.name} API请求失败,请检查网路重试`) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 13) { + $.isLogin = false; //cookie过期 + return + } + if (data['retcode'] === 0) { + $.nickName = (data['base'] && data['base'].nickname) || $.UserName; + } else { + $.nickName = $.UserName + } + } else { + console.log(`京东服务器返回空数据`) + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') + return []; + } + } +} +// 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/Task/jd_super_redrain.js b/Task/jd_super_redrain.js new file mode 100644 index 0000000..5ecd38b --- /dev/null +++ b/Task/jd_super_redrain.js @@ -0,0 +1,284 @@ +/* +整点京豆雨 +已支持IOS双京东账号,Node.js支持N个京东账号 +脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js + +[task_local] +#整点京豆雨 +0 0-23/1 * * * https://raw.githubusercontent.com/Aaron-lv/JavaScript/master/Task/jd_super_redrain.js, tag=整点京豆雨, enabled=true + +================Loon============== +[Script] +cron "0 0-23/1 * * *" script-path=https://raw.githubusercontent.com/Aaron-lv/JavaScript/master/Task/jd_super_redrain.js, tag=整点京豆雨 + +===============Surge================= +整点京豆雨 = type=cron,cronexp="0 0-23/1 * * *",wake-system=1,timeout=20,script-path=https://raw.githubusercontent.com/Aaron-lv/JavaScript/master/Task/jd_super_redrain.js + +============小火箭========= +整点京豆雨= type=cron,script-path=https://raw.githubusercontent.com/Aaron-lv/JavaScript/master/Task/jd_super_redrain.js, cronexpr="0 0-23/1 * * *",timeout=200, enable=true +*/ +const $ = new Env("整点京豆雨"); +let allMessage = ""; +const notify = $.isNode() ? require("./sendNotify") : ""; +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require("./jdCookie.js") : ""; +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = "", message; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]); + }); + if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false") console.log = () => {}; + if (JSON.stringify(process.env).indexOf("GITHUB") > -1) process.exit(0); +} else { + cookiesArr = [$.getdata("CookieJD"), $.getdata("CookieJD2"), ...jsonParse($.getdata("CookiesJD") || "[]").map((item) => item.cookie)].filter((item) => !!item); +} +const JD_API_HOST = "https://api.m.jd.com/api"; +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, "【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取", "https://bean.m.jd.com/", {"open-url": "https://bean.m.jd.com/"}); + return; + } + + let url = rraUrl(); + console.log(`召唤龙王`); + let code = await redRainId(url); + console.log(`召唤完成`); + + if (!code) { + $.log(`今日龙王🐲出差,天气晴朗☀️,改日再来~`); + return; + } + + let codeList = code.split(";"); + console.log(`龙王就位: ${codeList}`); + + for (let codeItem of codeList) { + let ids = {}; + for (let i = 0; i < 24; i++) { + ids[String(i)] = codeItem; + } + + let hour = (new Date().getUTCHours() + 8) % 24; + if (ids[hour]) { + $.activityId = ids[hour]; + $.log(`\nRRA: ${codeItem}`); + } else { + $.log(`无法从本地读取配置,请检查运行时间`); + return; + } + + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]); + $.index = i + 1; + $.isLogin = true; + $.nickName = ""; + message = ""; + await TotalBean(); + console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); + if (!$.isLogin) { + $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/`, {"open-url": "https://bean.m.jd.com/"}) + + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue; + } + + await receiveRedRain(); + // await showMsg(); + } + } + } + + if (allMessage && isNotify()) { + if ($.isNode()) await notify.sendNotify(`${$.name}`, `${allMessage}`); + $.msg($.name, "", allMessage); + } +})() + .catch((e) => { + $.log("", `❌ ${$.name}, 失败! 原因: ${e}!`, ""); + }) + .finally(() => { + $.done(); + }); + +function showMsg() { + return new Promise((resolve) => { + $.msg($.name, "", `【京东账号${$.index}】${$.nickName}\n${message}`); + resolve(); + }); +} + +function receiveRedRain() { + return new Promise((resolve) => { + const body = { actId: $.activityId }; + $.get(taskUrl("noahRedRainLottery", body), (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + if (safeGet(data)) { + data = JSON.parse(data); + if (data.subCode === "0") { + console.log(`领取成功,获得 ${JSON.stringify(data.lotteryResult)}`); + // message+= `领取成功,获得${JSON.stringify(data.lotteryResult)}\n` + message += `领取成功,获得 ${data.lotteryResult.jPeasList[0].quantity} 京豆`; + allMessage += `【京东账号${$.index}】${$.nickName || $.UserName}\n领取成功,获得 ${data.lotteryResult.jPeasList[0].quantity} 京豆${$.index !== cookiesArr.length ? "\n\n" : "\n\n"}`; + } else if (data.subCode === "8") { + console.log(`领取失败:本场已领过`); + message += `领取失败,本场已领过`; + } else { + console.log(`异常:${JSON.stringify(data)}`); + } + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +function redRainId(url) { + return new Promise((resolve) => { + const options = { + url: `${url}?${new Date()}`, + timeout: 10000, + headers: { + "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88" + }, + }; + let id = ""; + $.get(options, async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + id = "error"; + } else { + if (!!data) { + id = data.replace(/[\r\n]/g, ""); + } else { + id = ""; + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(id); + } + }); + }); +} + +function rraUrl() { + let url = "http://qyuyful8s.hb-bkt.clouddn.com/jd-live-rain.json"; + if ($.isNode() && process.env.JD_RRA_URL) { + url = process.env.JD_RRA_URL; + } else if ($.getdata("jdRRAUrl")) { + url = $.getdata("jdRRAUrl"); + } + return url; +} + +function isNotify() { + if ($.isNode() && process.env.RAIN_NOTIFY_CONTROL) { + return process.env.RAIN_NOTIFY_CONTROL != "false"; + } else if ($.getdata("rainNotifyControl")) { + return $.getdata("rainNotifyControl") != "false"; + } + return true; +} + +function taskUrl(function_id, body = {}) { + return { + url: `${JD_API_HOST}?functionId=${function_id}&body=${escape(JSON.stringify(body))}&client=wh5&clientVersion=1.0.0&_=${new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000}`, + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Content-Type": "application/x-www-form-urlencoded", + "Host": "api.m.jd.com", + "Referer": `https://h5.m.jd.com/active/redrain/index.html?id=${$.activityId}&lng=0.000000&lat=0.000000&sid=&un_area=`, + "Cookie": cookie, + "User-Agent": "JD4iPhone/9.3.5 CFNetwork/1209 Darwin/20.2.0", + }, + }; +} + +function TotalBean() { + return new Promise(async (resolve) => { + const options = { + url: `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, + headers: { + "Accept": "application/json,text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-cn", + "Connection": "keep-alive", + "Cookie": cookie, + "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", + "User-Agent": $.isNode() ? process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : "JD4iPhone/9.3.5 CFNetwork/1209 Darwin/20.2.0" : $.getdata("JDUA") ? $.getdata("JDUA") : "JD4iPhone/9.3.5 CFNetwork/1209 Darwin/20.2.0", + }, + } + $.post(options, (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`); + console.log(`${$.name} API请求失败,请检查网路重试`); + } else { + if (data) { + data = JSON.parse(data); + if (data["retcode"] === 13) { + $.isLogin = false; //cookie过期 + return; + } + if (data["retcode"] === 0) { + $.nickName = (data["base"] && data["base"].nickname) || $.UserName; + } else { + $.nickName = $.UserName; + } + } else { + console.log(`京东服务器返回空数据`); + } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(); + } + }); + }); +} + +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, "", "不要在BoxJS手动复制粘贴修改cookie"); + return []; + } + } +} +// 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)} From 6d51386835c278a6a251996b1910cfdf95222df4 Mon Sep 17 00:00:00 2001 From: Aaron-lv <674560606@qq.com> Date: Fri, 1 Oct 2021 12:40:47 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/jd_half_redrain.js | 2 +- Task/jd_super_mh.js | 2 +- Task/jd_super_redrain.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Task/jd_half_redrain.js b/Task/jd_half_redrain.js index 709d840..3cf4d57 100644 --- a/Task/jd_half_redrain.js +++ b/Task/jd_half_redrain.js @@ -177,7 +177,7 @@ function redRainId(url) { } function rraUrl() { - let url = "http://qyuyful8s.hb-bkt.clouddn.com/jd-half-rain.json"; + let url = "http://r0a79r6l0.hb-bkt.clouddn.com/jd-half-rain.json"; if ($.isNode() && process.env.JD_HALF_RRA_URL) { url = process.env.JD_HALF_RRA_URL; } else if ($.getdata("jdHalfRRAUrl")) { diff --git a/Task/jd_super_mh.js b/Task/jd_super_mh.js index 53fe475..fa3187f 100644 --- a/Task/jd_super_mh.js +++ b/Task/jd_super_mh.js @@ -131,7 +131,7 @@ function mhId(url) { } function mhUrl() { - let url = 'http://qyuyful8s.hb-bkt.clouddn.com/jd-half-mh.json' + let url = 'http://r0a79r6l0.hb-bkt.clouddn.com/jd-half-mh.json' if ($.isNode() && process.env.JD_MH_URL) { url = process.env.JD_MH_URL } else if ($.getdata('jdMHUrl')) { diff --git a/Task/jd_super_redrain.js b/Task/jd_super_redrain.js index 5ecd38b..cb2b25b 100644 --- a/Task/jd_super_redrain.js +++ b/Task/jd_super_redrain.js @@ -177,7 +177,7 @@ function redRainId(url) { } function rraUrl() { - let url = "http://qyuyful8s.hb-bkt.clouddn.com/jd-live-rain.json"; + let url = "http://r0a79r6l0.hb-bkt.clouddn.com/jd-live-rain.json"; if ($.isNode() && process.env.JD_RRA_URL) { url = process.env.JD_RRA_URL; } else if ($.getdata("jdRRAUrl")) { From 34f0fdd441b1e7e7322d342f20aa9ca317fde6cd Mon Sep 17 00:00:00 2001 From: Aaron-lv <674560606@qq.com> Date: Sat, 2 Oct 2021 23:52:43 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=97=E9=93=BAtoken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/jd_shop_sign.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Task/jd_shop_sign.js b/Task/jd_shop_sign.js index 40543e0..90fc4cb 100644 --- a/Task/jd_shop_sign.js +++ b/Task/jd_shop_sign.js @@ -25,6 +25,10 @@ let vender='' let num=0 let shopname='' const token = [ + "77F925F11B0F8D26C4804B73CEB95C16", + "A67EE89F75D841DFA0E81269C872A56A", + "E7D7CCF263E80892238598037AE59471", + "7CCCBB68FCE03A1A6762173DC2EA363C", "EC51AB87807801FC31D3E36AA56BD16F", "A999F0F41763FD4C392677A00B930D4E", "77F925F11B0F8D26C4804B73CEB95C16", @@ -38,8 +42,7 @@ const token = [ "513D954BF67D7B0A7A777EEFCC047013", "1B9C6FFEBB6608C114E2EB88FA493507", "9C5F0B51AE22D8A1B2B93B140127CF13", - "AA2480321D300985EEEF9D772749F5BE", - "5975ADF27E90C34C09E0E51C2F03195D" + "AA2480321D300985EEEF9D772749F5BE" ] if ($.isNode()) { From 195f934f2b2f07b889941218eb641201437765a3 Mon Sep 17 00:00:00 2001 From: Aaron-lv <674560606@qq.com> Date: Mon, 4 Oct 2021 00:15:56 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=97=E9=93=BAtoken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/jd_shop_sign.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Task/jd_shop_sign.js b/Task/jd_shop_sign.js index 90fc4cb..855b3c6 100644 --- a/Task/jd_shop_sign.js +++ b/Task/jd_shop_sign.js @@ -25,24 +25,24 @@ let vender='' let num=0 let shopname='' const token = [ + "DA052DD01D564F695F96D229AB525783", + "63CA2A609B3A988B46812441B4EBB6D8", + "2D01F8529A3FDF70C106459FE90E263C", + "3F031B619925A2895A2E04BC7248F723", + "B3A9883216190B198C546D21A18E0738", + "513D954BF67D7B0A7A777EEFCC047013", + "1B9C6FFEBB6608C114E2EB88FA493507", + "9C5F0B51AE22D8A1B2B93B140127CF13", + "0BE9C8EFCB13B6C404583F00DA3F2E7B", "77F925F11B0F8D26C4804B73CEB95C16", - "A67EE89F75D841DFA0E81269C872A56A", "E7D7CCF263E80892238598037AE59471", - "7CCCBB68FCE03A1A6762173DC2EA363C", - "EC51AB87807801FC31D3E36AA56BD16F", - "A999F0F41763FD4C392677A00B930D4E", "77F925F11B0F8D26C4804B73CEB95C16", - "63CA2A609B3A988B46812441B4EBB6D8", - "12DD65EC41A80686FE2FA28C54C3FAF1", - "2D01F8529A3FDF70C106459FE90E263C", "08CF28B9C0DB32912238B36662E075B6", "1B32B3957981C1AE9FBAAA9A1846697F", "B3A9883216190B198C546D21A18E0738", "E401DB88AD9518168404A947BD069655", "513D954BF67D7B0A7A777EEFCC047013", - "1B9C6FFEBB6608C114E2EB88FA493507", - "9C5F0B51AE22D8A1B2B93B140127CF13", - "AA2480321D300985EEEF9D772749F5BE" + "9C5F0B51AE22D8A1B2B93B140127CF13" ] if ($.isNode()) { From 23aaf167307122007c9334744a1dc03f6effbda8 Mon Sep 17 00:00:00 2001 From: Aaron-lv <674560606@qq.com> Date: Tue, 5 Oct 2021 01:05:15 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=97=E9=93=BAtoken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/jd_shop_sign.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Task/jd_shop_sign.js b/Task/jd_shop_sign.js index 855b3c6..bedbe1e 100644 --- a/Task/jd_shop_sign.js +++ b/Task/jd_shop_sign.js @@ -25,24 +25,24 @@ let vender='' let num=0 let shopname='' const token = [ - "DA052DD01D564F695F96D229AB525783", - "63CA2A609B3A988B46812441B4EBB6D8", - "2D01F8529A3FDF70C106459FE90E263C", - "3F031B619925A2895A2E04BC7248F723", "B3A9883216190B198C546D21A18E0738", - "513D954BF67D7B0A7A777EEFCC047013", "1B9C6FFEBB6608C114E2EB88FA493507", - "9C5F0B51AE22D8A1B2B93B140127CF13", - "0BE9C8EFCB13B6C404583F00DA3F2E7B", "77F925F11B0F8D26C4804B73CEB95C16", + "A67EE89F75D841DFA0E81269C872A56A", + "15AAA32F10BED920EFC2B5333C6B5E6E", "E7D7CCF263E80892238598037AE59471", - "77F925F11B0F8D26C4804B73CEB95C16", - "08CF28B9C0DB32912238B36662E075B6", - "1B32B3957981C1AE9FBAAA9A1846697F", - "B3A9883216190B198C546D21A18E0738", - "E401DB88AD9518168404A947BD069655", - "513D954BF67D7B0A7A777EEFCC047013", - "9C5F0B51AE22D8A1B2B93B140127CF13" + "DA052DD01D564F695F96D229AB525783", + "2D01F8529A3FDF70C106459FE90E263C", + "3F031B619925A2895A2E04BC7248F723", + "69B38A94102034161E49482E9754E8B2", + "2152CCBFBBDCFFDF11EFB8C90252FB3A", + "5BFD60270889439B26FCEA611D299A1B", + "63DCF7ED48BCE0B3AAE8C18C13BB4000", + "C2C9FE340BEA6E4FE8B4B868904DABB2", + "FBD586E1BA834B20BD4CC7CC04C3D0BD", + "603A6D84F23C176DB1F932A9FDDDA5F2", + "E2C480571521C4CC992AF19BB6B4978E", + "E401DB88AD9518168404A947BD069655" ] if ($.isNode()) { From 5c6df868d237e3b03ab44be381ec0945a2b69966 Mon Sep 17 00:00:00 2001 From: Aaron-lv <674560606@qq.com> Date: Tue, 5 Oct 2021 01:19:11 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=97=E9=93=BAtoken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/jd_shop_sign.js | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/Task/jd_shop_sign.js b/Task/jd_shop_sign.js index bedbe1e..d1d6441 100644 --- a/Task/jd_shop_sign.js +++ b/Task/jd_shop_sign.js @@ -25,24 +25,26 @@ let vender='' let num=0 let shopname='' const token = [ - "B3A9883216190B198C546D21A18E0738", - "1B9C6FFEBB6608C114E2EB88FA493507", - "77F925F11B0F8D26C4804B73CEB95C16", - "A67EE89F75D841DFA0E81269C872A56A", - "15AAA32F10BED920EFC2B5333C6B5E6E", - "E7D7CCF263E80892238598037AE59471", - "DA052DD01D564F695F96D229AB525783", - "2D01F8529A3FDF70C106459FE90E263C", - "3F031B619925A2895A2E04BC7248F723", - "69B38A94102034161E49482E9754E8B2", - "2152CCBFBBDCFFDF11EFB8C90252FB3A", - "5BFD60270889439B26FCEA611D299A1B", - "63DCF7ED48BCE0B3AAE8C18C13BB4000", "C2C9FE340BEA6E4FE8B4B868904DABB2", - "FBD586E1BA834B20BD4CC7CC04C3D0BD", "603A6D84F23C176DB1F932A9FDDDA5F2", + "FBD586E1BA834B20BD4CC7CC04C3D0BD", "E2C480571521C4CC992AF19BB6B4978E", - "E401DB88AD9518168404A947BD069655" + "A82BB3D06455B9674F63F48979A73BCC", + "7DC877395EBDCFE3C3E6031782CAB049", + "B49BC0794947A75595CF1DFA7C7304D8", + "50A6EFF0F4CFCE65B0FA46CF0A23DB53", + "889BB484BDC0F98C9760B44DE353E04E", + "95FB2047E4912D89A9394B446C118E08", + "09B11D03ED26858DC16DC11A2D92816E", + "49672BF85F90A1C9B2AF486521F47EC0", + "6B807AAB2FAB609ABCC64F3D948A7990", + "CEF366C139A7D0A5ADC99F19CFBA4054", + "BA157BE581B5E40BDFEBD44277AF29B7", + "EDC5452E351B6360488A611BBCB6FD18", + "3A5DA1F4D7BE40E65654C733F7333657", + "6DA953F013BAF9AC80B074A15752048F", + "C30B2DCBE52B8830CA52B5D7FFB1FC12", + "2F18BA1F94BB3F601ADC5CB0756F32BB" ] if ($.isNode()) { From fed0b227889c9a6f691fdbf6ee50b5997ce6e25c Mon Sep 17 00:00:00 2001 From: Aaron-lv <674560606@qq.com> Date: Thu, 7 Oct 2021 00:11:52 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=97=E9=93=BAtoken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/jd_shop_sign.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Task/jd_shop_sign.js b/Task/jd_shop_sign.js index d1d6441..7ecf895 100644 --- a/Task/jd_shop_sign.js +++ b/Task/jd_shop_sign.js @@ -25,6 +25,9 @@ let vender='' let num=0 let shopname='' const token = [ + "AB5172B51CF895DB51A9C9CAE86DF17B", + "AE67114D509F65CF7BF7ADD27419489D", + "407910EA26539B7058C483ACAAD92EA8", "C2C9FE340BEA6E4FE8B4B868904DABB2", "603A6D84F23C176DB1F932A9FDDDA5F2", "FBD586E1BA834B20BD4CC7CC04C3D0BD", @@ -35,11 +38,8 @@ const token = [ "50A6EFF0F4CFCE65B0FA46CF0A23DB53", "889BB484BDC0F98C9760B44DE353E04E", "95FB2047E4912D89A9394B446C118E08", - "09B11D03ED26858DC16DC11A2D92816E", - "49672BF85F90A1C9B2AF486521F47EC0", "6B807AAB2FAB609ABCC64F3D948A7990", "CEF366C139A7D0A5ADC99F19CFBA4054", - "BA157BE581B5E40BDFEBD44277AF29B7", "EDC5452E351B6360488A611BBCB6FD18", "3A5DA1F4D7BE40E65654C733F7333657", "6DA953F013BAF9AC80B074A15752048F", From d253e2567c031d1a6abd940f1bf71f03c473b507 Mon Sep 17 00:00:00 2001 From: Aaron-lv <674560606@qq.com> Date: Thu, 7 Oct 2021 16:40:43 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=97=E9=93=BAtoken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/jd_shop_sign.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Task/jd_shop_sign.js b/Task/jd_shop_sign.js index 7ecf895..ea37f37 100644 --- a/Task/jd_shop_sign.js +++ b/Task/jd_shop_sign.js @@ -25,10 +25,10 @@ let vender='' let num=0 let shopname='' const token = [ + "E51D8F403EE7B7C11AA23771254DCD8A", "AB5172B51CF895DB51A9C9CAE86DF17B", "AE67114D509F65CF7BF7ADD27419489D", "407910EA26539B7058C483ACAAD92EA8", - "C2C9FE340BEA6E4FE8B4B868904DABB2", "603A6D84F23C176DB1F932A9FDDDA5F2", "FBD586E1BA834B20BD4CC7CC04C3D0BD", "E2C480571521C4CC992AF19BB6B4978E", From d523880825f0e38e6a187025f4c937fb8afbbf8c Mon Sep 17 00:00:00 2001 From: Aaron-lv <674560606@qq.com> Date: Sat, 9 Oct 2021 17:15:12 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=97=E9=93=BAtoken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/jd_shop_sign.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Task/jd_shop_sign.js b/Task/jd_shop_sign.js index ea37f37..049db4c 100644 --- a/Task/jd_shop_sign.js +++ b/Task/jd_shop_sign.js @@ -25,22 +25,22 @@ let vender='' let num=0 let shopname='' const token = [ - "E51D8F403EE7B7C11AA23771254DCD8A", + "C42A5A817AFEFD928254B42D3249873B", + "32BCC4761C4F50A8173C5E0B9FE52A6E", + "9745341EAF7A0D198BB2D3ED10E538CB", + "1278D2D9916E3BAC83FCB2636E85D756", + "1C031CDF02B934C060936F1FB5ABF062", + "90FF9108E3769B3C0FA04B723F692EB7", + "9EACB4A30B9E44DBC2780BEF1E5D2C8C", "AB5172B51CF895DB51A9C9CAE86DF17B", "AE67114D509F65CF7BF7ADD27419489D", "407910EA26539B7058C483ACAAD92EA8", - "603A6D84F23C176DB1F932A9FDDDA5F2", "FBD586E1BA834B20BD4CC7CC04C3D0BD", "E2C480571521C4CC992AF19BB6B4978E", "A82BB3D06455B9674F63F48979A73BCC", "7DC877395EBDCFE3C3E6031782CAB049", - "B49BC0794947A75595CF1DFA7C7304D8", "50A6EFF0F4CFCE65B0FA46CF0A23DB53", - "889BB484BDC0F98C9760B44DE353E04E", "95FB2047E4912D89A9394B446C118E08", - "6B807AAB2FAB609ABCC64F3D948A7990", - "CEF366C139A7D0A5ADC99F19CFBA4054", - "EDC5452E351B6360488A611BBCB6FD18", "3A5DA1F4D7BE40E65654C733F7333657", "6DA953F013BAF9AC80B074A15752048F", "C30B2DCBE52B8830CA52B5D7FFB1FC12", From b55ac3217986c016931c39e3528d42fb3f717928 Mon Sep 17 00:00:00 2001 From: Aaron-lv <674560606@qq.com> Date: Mon, 11 Oct 2021 18:13:06 +0800 Subject: [PATCH 10/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=97=E9=93=BAtoken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/jd_shop_sign.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Task/jd_shop_sign.js b/Task/jd_shop_sign.js index 049db4c..5b4c48f 100644 --- a/Task/jd_shop_sign.js +++ b/Task/jd_shop_sign.js @@ -25,9 +25,12 @@ let vender='' let num=0 let shopname='' const token = [ + "8ADADEAE7D16D33DA04A147D4418D881", + "C7DB74FE1C4A277C5255F47E36F91385", + "2CD290865D5844EA6951B5778A2C7379", + "E401DB88AD9518168404A947BD069655", + "638D7446A5712C226B334665166ECFD9", "C42A5A817AFEFD928254B42D3249873B", - "32BCC4761C4F50A8173C5E0B9FE52A6E", - "9745341EAF7A0D198BB2D3ED10E538CB", "1278D2D9916E3BAC83FCB2636E85D756", "1C031CDF02B934C060936F1FB5ABF062", "90FF9108E3769B3C0FA04B723F692EB7", @@ -35,13 +38,10 @@ const token = [ "AB5172B51CF895DB51A9C9CAE86DF17B", "AE67114D509F65CF7BF7ADD27419489D", "407910EA26539B7058C483ACAAD92EA8", - "FBD586E1BA834B20BD4CC7CC04C3D0BD", - "E2C480571521C4CC992AF19BB6B4978E", "A82BB3D06455B9674F63F48979A73BCC", "7DC877395EBDCFE3C3E6031782CAB049", "50A6EFF0F4CFCE65B0FA46CF0A23DB53", "95FB2047E4912D89A9394B446C118E08", - "3A5DA1F4D7BE40E65654C733F7333657", "6DA953F013BAF9AC80B074A15752048F", "C30B2DCBE52B8830CA52B5D7FFB1FC12", "2F18BA1F94BB3F601ADC5CB0756F32BB" From f9aae249d9f01fcb121046767682aca1878ee6ad Mon Sep 17 00:00:00 2001 From: Aaron-lv <674560606@qq.com> Date: Wed, 13 Oct 2021 17:13:59 +0800 Subject: [PATCH 11/11] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BA=97=E9=93=BAtoken?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Task/jd_shop_sign.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Task/jd_shop_sign.js b/Task/jd_shop_sign.js index 5b4c48f..446b8a2 100644 --- a/Task/jd_shop_sign.js +++ b/Task/jd_shop_sign.js @@ -25,7 +25,11 @@ let vender='' let num=0 let shopname='' const token = [ - "8ADADEAE7D16D33DA04A147D4418D881", + "806AB8851560F6F462489526E3216EA1", + "F9B4F1AE95822A31172C333437624725", + "21BE9A81CF5230DB1B28DFE4C8E5E57D", + "C3E62BCF3E9D62593FBF634D349D864A", + "68B823FFD5F0E4326E3256E05E102280", "C7DB74FE1C4A277C5255F47E36F91385", "2CD290865D5844EA6951B5778A2C7379", "E401DB88AD9518168404A947BD069655", @@ -34,17 +38,13 @@ const token = [ "1278D2D9916E3BAC83FCB2636E85D756", "1C031CDF02B934C060936F1FB5ABF062", "90FF9108E3769B3C0FA04B723F692EB7", - "9EACB4A30B9E44DBC2780BEF1E5D2C8C", "AB5172B51CF895DB51A9C9CAE86DF17B", - "AE67114D509F65CF7BF7ADD27419489D", "407910EA26539B7058C483ACAAD92EA8", "A82BB3D06455B9674F63F48979A73BCC", - "7DC877395EBDCFE3C3E6031782CAB049", "50A6EFF0F4CFCE65B0FA46CF0A23DB53", "95FB2047E4912D89A9394B446C118E08", "6DA953F013BAF9AC80B074A15752048F", - "C30B2DCBE52B8830CA52B5D7FFB1FC12", - "2F18BA1F94BB3F601ADC5CB0756F32BB" + "C30B2DCBE52B8830CA52B5D7FFB1FC12" ] if ($.isNode()) {