faker3/jd_zfq_task.js

16 lines
76 KiB
JavaScript
Raw Normal View History

2025-01-13 17:06:36 +08:00
/*
活动名称02.05 新年集福气任务
活动入口https://prodev.m.jd.com/mall/active/2Eby36UFbEhZ3EfM9sS5ZZm6NgT2/index.html
活动变量jd_zfq_notify // 是否推送通知true/false默认不推送
jd_zfq_pinFilter // 账号pin过滤多个用@进行分割
cron:59 23 29 2 *
*/
const $ = new Env('02.05 新年集福气任务')
function mVnx8N(){}var fHbpMuE=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],vHvTClP,pF1Asx,HfoVfWI,RBu1Fzr,SuMKPpe,xrltHcZ,nWnZTQQ,hSYhZko,Funpa3,Yk5oNTD,fyEp9xX,eO5FrTu,oMehl5,nHrvqJY,pHrg8y,fOQYlS,QSj2LIn;function ZBabt_d(mVnx8N){return vHvTClP[mVnx8N<0x18?mVnx8N-0x2c:mVnx8N<0x75?mVnx8N-0x19:mVnx8N-0x55]}mVnx8N(vHvTClP=HBoqBR(),pF1Asx=m78H4_y((mVnx8N,fHbpMuE)=>{return fHbpMuE(mVnx8N())},0x2)(iOXTMcQ,RuQayi));var f68d7l=[],mM7qjD=['\u0066\u005b\u0061\u003d\u0073\u0049\u0051\u007a\u0068','\u004b\u0035\u0072\u0022\u0034\u0057\u003e\u0044','sM={?','\x7c\x6b\x30\x7b','\u007e\u0031\u0028\u0036\u0072\u0043\u0052\u0041\u005e\u0062\u0069\u0022\u0064\u0050\u0048\u005b\u0058\u0070\u006d','\x7e\x31\x28\x36\x72\x43\x52\x41\x40\x50\x39\x32\x5b\x50\x38\x6b\x7b\x6a\x76\x4c','\u002f\u007c\u0079\u006a\u0031',DjiB6VD(0x0),'\u007e\u0031\u0028\u0036\u0072\u0043\u0052\u0041\u0026\u0065\u006c\u002c\u003c\u0043\u0035\u002a','\u0053\u002f\u0075\u0074\u0039',DjiB6VD(0x1),'\u0039\u0037\u006d\u0074\u0073\u0067\u0049','HYT})',DjiB6VD(0x2),DjiB6VD(0x3),'\u004d\u0070\u0033\u004c',DjiB6VD(0x4),'|V2Qb=/*+);XSb&gQ#$*+_RS9ntH[k=qYt@E9',DjiB6VD(0x5),'\x64\x77\x32\x70\x3d\x5a\x46\x56',DjiB6VD(0x6),'\x40\x37\x5f\x23\x42','\u003e\u0059\u0060\u0074\u0048\u0026\u0030\u0063\u003c\u0035\u006f\u0066\u0047','\x59\x79\x36\x25\x46','\x69\x6d\x6c\x6e\x30\x2c\x49','xwpE:R7V','\x6b\x64\x63\x74\x38\x4a\x47\x36\x4f','\u004b\u0077\u0063\u0074\u0039',DjiB6VD(ZBabt_d(0x25)),DjiB6VD(0x8),ZBabt_d(0x1b),'\u0051\u0075\u007b\u0025\u0079\u002c\u0048\u004d\u005b\u006b\u0076\u0030\u004b\u0079\u0071\u0076\u005e\u0021\u0032\u0031\u006e\u003b\u0023\u0036\u007a\u0064\u0044\u0065\u005a\u002f\u004f\u0067\u0058\u0024\u006a\u0077\u0032\u0055\u0052\u0053\u0076\u007d\u0072\u004e\u0042\u003e\u003a\u0066\u0054\u0046\u0021\u0069\u0077','\x78\x77\x33\x4c','\x56\x6a\x3d\x74\x39','\x3e\x59\x79\x7b\x28\x52\x34\x57\x3a\x23\x70\x2c\x64\x68\x4b\x34\x46\x47',DjiB6VD(ZBabt_d(0x33)),ZBabt_d(0x19),'\x64\x77\x38\x6e\x45\x4d\x47\x63\x67\x3e','Nm<{(ROgw26h:b&~?wm',DjiB6VD(0xa),';Y8n}gdV','\u0068\u006b\u0060\u0033\u0036\u0069\u005d\u005d\u0064\u0038',DjiB6VD(0xb),'\x36\x38\x28\x22\x6e\x5e\x50\x45\x62','\x21\x5f\x2e\x3c\x61\x48\x49','\x78\x77\x33\x4c',DjiB6VD(0xa),'\x3e\x59\x6c\x6e\x48\x7d\x5d\x7a\x68\x24\x7c\x45\x64\x68\x64\x34\x7b\x47','\u007c\u0051\u0078\u0033\u0025\u005a\u007e\u0056',DjiB6VD(ZBabt_d(0x22)),'\x73\x2f\x39\x70\x52\x67\x58\x66\x4d\x54\x69\x22\x47','\x23\x2f\x7e\x45\x6e\x67\x38\x56',';Y8n}gdV',DjiB6VD(ZBabt_d(0x2a)),DjiB6VD(ZBabt_d(0x2d)),DjiB6VD(ZBabt_d(0x21)),'\x75\x59\x67\x3a',',anK91P.>s%=8U"I[Ilf','\u0039\u0059\u0053\u0033\u0041\u0051\u003a\u0075\u0036\u0063\u0024\u0066\u0023\u0067\u0062\u0071\u007c\u0064\u007e\u0045\u002f\u006e\u005d\u005d\u0059\u0079',DjiB6VD(0x10),'\x3e\x59\x79\x7b\x39\x7d\x69\x66\x7e\x7a\x70\x2c\x64\x68\x4b\x34\x46\x47','\u0039\u0077\u0043\u004c\u005d\u0026\u0069\u0052\u0072',DjiB6VD(0x11),'\x6b\x64\x36\x7b','\x5a\x65\x25\x30\x62\x3d\x43\x30\x7a\x64\x5d\x70\x36\x72\x54',ZBabt_d(0x19),DjiB6VD(ZBabt_d(0x24)),'\u003e\u0059\u0063\u0074\u0041\u007c\u0049','\u003e\u0059\u0063\u0074\u0057\u0069\u005a\u0046\u0072','\x4a\x6c\x36\x7b\x23\x42\x4d\x57\x62\x79\x71\x73\x64\x5f\x3a\x2a\x4a\x6c\x36\x7b\x23\x42\x4d\x57\x62\x79\x71\x73\x64\x5f\x3a\x2a\x4a\x6c\x36\x7b\x23\x42\x4d\x57\x62\x79\x71\x73\x64\x5f\x3a\x2a\x3f\x47','\u0028\u0059\u0066\u0036\u003d\u0060\u0062\u0033\u004b\u0032\u0077\u0035\u0078\u007e\u0041\u006b','\x78\x77\x70\x45\x4d\x6e\x49','\x57\x70\x4d\x74\x23\x43\x2f\x75\x75\x54\x6c\x2c\x6f\x25\x36\x6b\x39\x47','\x57\x70\x4d\x74\x23\x43\x2f\x75\x75\x54\x6c\x2c\x4e\x25\x58\x71\x7b\x47','|kl60a.FW":C(SZ~FYzLD/>V',DjiB6VD(0x13),DjiB6VD(0x14),DjiB6VD(0x15),DjiB6VD(0x16),'\x64\x77\x22\x4c\x46\x4a\x23\x46\x58\x24\x29\x32\x77\x40\x61\x6b',DjiB6VD(ZBabt_d(0x36)),'\u0066\u007c\u004f\u0066\u003f\u004d\u0064\u0046\u007d\u0033\u003d\u0050\u0047\u0042\u0036\u004b\u0042\u007c\u0035\u0045\u0034\u0068\u007e\u0046\u0059\u0031\u0042\u005f\u0076\u0059\u0074\u0054\u0028\u003f\u006d',ZBabt_d(0x1c),DjiB6VD(0x18),'\u003f\u0077\u0076\u004c\u003a\
// 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"])