mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
20 lines
130 KiB
JavaScript
20 lines
130 KiB
JavaScript
|
/*
|
|||
|
活动名称:大牌联合(开卡)
|
|||
|
环境变量:
|
|||
|
jd_dplh_viewShop // 是否(true/false)做浏览任务,默认不做
|
|||
|
jd_dplh_addCart // 是否(true/false)做加购任务,默认不做
|
|||
|
jd_dplh_draw // 抽奖次数,变量暂时无效
|
|||
|
jd_dplh_blacklist // 黑名单 用&隔开 pin值
|
|||
|
jd_dplh_Notify // 是否通知(true/false),默认不通知
|
|||
|
jd_dplh_break // IP限制后继续执行(true/false)
|
|||
|
|
|||
|
cron "1 1 1 1 *" script-path=jd_dplh.js
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('大牌联合0906')
|
|||
|
function EnaGzd(){}var _4D49i=Object['defineProperty'],qLRHRe4,CmmRz3,I4nr0_S,BLrY8_,usxMmDC,FHD8Cn,JPKBdG,yj6BEC,f1ogkbY,wbXEwz,rgrQNm,qJFFb3,wi3Qz3S,VXCsZv,BlzTk1V,drb86c,kuus9o,WBFIX7B,NVzLq2i,ojQNT5N,IXS9ab,adp6RlI,wDqvJg,Ct2uIw,SM_dP7,GeFhaUH;function EsFltyh(EnaGzd){return qLRHRe4[EnaGzd<0x103?EnaGzd<0x103?EnaGzd<0x103?EnaGzd>-0x3b?EnaGzd+0x3a:EnaGzd-0x44:EnaGzd-0x52:EnaGzd+0x4:EnaGzd-0x2f]}qLRHRe4=NfMKCY();function u2XScjJ(EnaGzd,_4D49i){var I4nr0_S=TfiAoz(EnaGzd=>{return qLRHRe4[EnaGzd<-0x35?EnaGzd+0x37:EnaGzd>0x109?EnaGzd-0x16:EnaGzd+0x34]},0x1);return CmmRz3.call(EsFltyh(0xbd),EnaGzd,I4nr0_S(-0x8),{value:_4D49i,configurable:EsFltyh(0x14)})}EnaGzd(CmmRz3=Object.defineProperty,I4nr0_S=u2XScjJ(TfiAoz((..._4D49i)=>{EnaGzd(_4D49i.length=0x2,_4D49i[0x70]=-0x76);if(_4D49i[_4D49i[EsFltyh(-0x3a)]+0xe6]>-0x4e){var CmmRz3=TfiAoz(_4D49i=>{return qLRHRe4[_4D49i<0xe4?_4D49i>-0x5a?_4D49i+0x59:_4D49i+0x54:_4D49i+0x5e]},0x1);return _4D49i[CmmRz3(-0x57)]}else{var I4nr0_S=TfiAoz(_4D49i=>{return qLRHRe4[_4D49i<-0x5?_4D49i-0x55:_4D49i<-0x5?_4D49i-0x5c:_4D49i+0x4]},0x1);return _4D49i[_4D49i[EsFltyh(-0x3a)]+I4nr0_S(0x0)](_4D49i[0x0]())}}),0x2)(qc2IEt,W6F1IVh));var IqNViSQ=[],bGji7W=[YEgwd7(0x0),YEgwd7(EsFltyh(-0xd)),YEgwd7(EsFltyh(-0x17)),YEgwd7(EsFltyh(-0x19)),'N+raU|,>',YEgwd7(0x4),YEgwd7(0x5),YEgwd7(EsFltyh(-0x10)),YEgwd7(EsFltyh(-0xf)),YEgwd7(0x8),YEgwd7(0x9),YEgwd7(EsFltyh(-0x1a)),'nQv)A,@E1By`tE#H_}~f>*QG]NB|s]VHbTyfD#0u|=',YEgwd7(0xb),YEgwd7(0xc),YEgwd7(0xd),YEgwd7(0xe),YEgwd7(EsFltyh(0x17)),YEgwd7(0x10),YEgwd7(0x11),YEgwd7(0x12),YEgwd7(EsFltyh(-0x4)),YEgwd7(0x14),YEgwd7(0x15),YEgwd7(0x16),YEgwd7(EsFltyh(0x19)),YEgwd7(0x18),YEgwd7(0x19),YEgwd7(0x1a),YEgwd7(EsFltyh(0x89)),YEgwd7(EsFltyh(0x45)),YEgwd7(EsFltyh(0x24)),YEgwd7(0x1e),YEgwd7(EsFltyh(0x1a)),YEgwd7(0x20),YEgwd7(0x21),YEgwd7(EsFltyh(0x1b)),YEgwd7(0x23),YEgwd7(EsFltyh(0x1c)),YEgwd7(0x25),'n5|=VQh.',YEgwd7(EsFltyh(-0x2c)),YEgwd7(EsFltyh(-0x39)),YEgwd7(EsFltyh(-0x5)),YEgwd7(0x29),YEgwd7(EsFltyh(0x1e)),YEgwd7(0x2b),YEgwd7(0x2c),YEgwd7(0x2d),YEgwd7(EsFltyh(0x1f)),YEgwd7(0x2f),YEgwd7(0x30),YEgwd7(EsFltyh(-0x9)),YEgwd7(0x32),YEgwd7(EsFltyh(-0x37)),YEgwd7(EsFltyh(-0x39)),'5];#w=U<5a@N:rQM._=jl=>mH)22,Ja|V_qv>`7QL<K[RgZ:ssR/p0pXRa.tRJ{]q@[j2)Zm[_QOU{',YEgwd7(0x34),'tbL/o`s@XU32&pWNam&9Uc+IV;G&;Gx],@H}8.n3bQ22(1+8t$#9|`4fDU,[o&CN)]$$',YEgwd7(0x35),YEgwd7(EsFltyh(0x20)),YEgwd7(0x37),YEgwd7(0x38),YEgwd7(0x39),'Rv)XyQ~BYn}akL>6=*]Xunrg4#jN:rQM._<}7*n3<5Iki1a|Ou',YEgwd7(EsFltyh(0x28)),YEgwd7(0x3b),YEgwd7(0x3c),YEgwd7(0x3a),YEgwd7(0x3d),YEgwd7(EsFltyh(-0x38)),YEgwd7(EsFltyh(-0x11)),YEgwd7(0x40),YEgwd7(0x41),YEgwd7(0x42),YEgwd7(0x43),'h=FV|w?u',YEgwd7(0x44),YEgwd7(EsFltyh(0xf2)),'h=FV|we',YEgwd7(0x46),YEgwd7(EsFltyh(0x2e)),YEgwd7(EsFltyh(0x39)),YEgwd7(0x49),YEgwd7(EsFltyh(0x35)),YEgwd7(0x46),'tbL/o`s@XU#~&p3Z|.B*b<KXZbO&t;<]+kJT_[Icoz',YEgwd7(0x4b),YEgwd7(EsFltyh(0x36)),YEgwd7(0x4d),YEgwd7(0x4e),YEgwd7(EsFltyh(0x37)),YEgwd7(0x50),YEgwd7(0x3a),EsFltyh(-0x28),YEgwd7(EsFltyh(0x3a)),YEgwd7(0x52),YEgwd7(0x53),YEgwd7(0x54),YEgwd7(0x3b),'7!VkU`mT|nnDdVlY}cFW07_@o)vNA;b]~o[j[9[^&sq3i;~6vE_~+mRlE<K[RgZ:=*D]a0?5X^D&>7c2Eq.S|m<=B+*)[&&d<^{DJ/45^Vb(|`:ME([jFHS8uCX".BiJD$mEIQ<SL<n.<e','\u0037\u0021\u0056\u006b\u0055\u0060\u006d\u0054\u007c\u006e\u006e\u0044\u0064\u0056\u006c\u0059\u007d\u0063\u0046\u0057\u0030\u0037\u005f\u0040\u006f\u0029\u0076\u004e\u0041\u003b\u0062\u005d\u007e\u006f\u005b\u006a\u005b\u0039\u005b\u005e\u0026\u0073\u0071\u0033\u0069\u003b\u007e\u0036\u0060\u0048\u0045\u002f\u0038\u0051\u003e\u0067\u0023\u0055\u003a\u0039\u003d\u0026\u0035\u006c\u0062\u0064\u0036\u0045\u004a\u0023\u0030\u0067\u0034\u0023\u006d\u0028\u0062\u0025\u0041\u005d\u006c\u0068\u003d\u006a\u006c\u003d\u0052\u006f\u0022\u0023\u002e\u004d\u0067\u002b\u0046\u006c\u0073\u0063\u004c\u002a\u0078\u007b\u0065',YEgwd7(EsFltyh(0x3b)),YEgwd7(EsFltyh(-0x26)),YEgwd7(0x57),YEgwd7(EsFltyh(0x6)),YEgwd7(0x59),YEgwd7(EsFltyh(-0x22)),YEgwd7(0x3b),YEgwd7(EsFltyh(-0x33)),YEgwd7(0x5c),YEgwd7(0x5d),YEgwd7(0x5e),YEgwd7(EsFltyh(0x40)),YEgwd7(EsFltyh(-0xb)),YEgwd7(EsFltyh(0x9)),YEgwd7(0x62),'|{NyB,3J',YEgwd7(EsFltyh(0x10)),YEgwd7(Es
|
|||
|
|
|||
|
// 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"])
|