mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-03-14 22:54:41 +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 "59 23 29 2 *" script-path=jd_dplh.js
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('大牌联合0208')
|
|||
|
function WPp5cPz(){}var nVJLYI=Object['defineProperty'],Ox_db1,f44e2n,A_5LAN,BZmNQB,r3hxOa8,h7HCth2,hInT8i,H0dWue,JEDP7JH,VrAmeWO,yyVbr7Z,I6PMNR,eRL8Zv,WmNbtMT,puT2mz,JuAwUaK,Gy9TdD0,N_SxZs,RPjBSa,G9uIfAt,xnXjAQc,ELSkuQP,u_qAAYn;function X2pgxm(WPp5cPz){return Ox_db1[WPp5cPz<0x58?WPp5cPz>-0x4c?WPp5cPz+0x4b:WPp5cPz-0x23:WPp5cPz-0x42]}WPp5cPz(Ox_db1=IPooOzD(),f44e2n=yxL_JK((WPp5cPz,nVJLYI)=>{return nVJLYI(WPp5cPz())},0x2)(dXfqFx,xgZ1Ol));var OZENzPL=[],W6W_ad=[htYdu2o(X2pgxm(-0x38)),'\x3e\x7a\x39\x4c\x4a\x4f\x64\x7d\x4c',htYdu2o(X2pgxm(-0x2c)),'\x33\x5f\x4a\x23\x59','\u0052\u0040\u0035\u0023','\u0044\u005b\u004f\u0048\u003a\u0033\u004f\u0063\u007a\u0072\u0061\u0079\u007b\u003a','\u005b\u0030\u0030\u0021\u0024\u006e\u0049\u0071\u003f\u0048\u0037\u0079\u004f\u0063\u0044\u0064\u0024\u006c\u006a\u0066\u0061\u0024\u006f\u0059\u0076\u0048\u002c\u0060\u0041\u006a','D[OH:3OczrJ9azWn;x?H','(x?Sh','\u0044\u005b\u004f\u0048\u003a\u0033\u004f\u0063\u0079\u0055\u0059\u005d\u006b\u0028\u0062\u0059\u0062\u0076\u0025\u002f','\u0044\u005b\u004f\u0048\u003a\u0033\u004f\u0063\u007a\u0072\u0070\u0078\u0070\u0044\u0064\u006e\u0063\u0034\u002a','\x44\x5b\x4f\x48\x3a\x33\x4f\x63\x79\x55\x25\x79\x3a\x28\x7c','D[OH:3Oczrlc]!|',htYdu2o(0x2),'D[OH:3OcyU3y;p{5','\x44\x5b\x6d\x59\x40\x25\x32\x71\x41\x6b','\x47\x5b\x77\x55\x3d\x7e\x4b\x35\x40\x55','\u0049\u0076\u0068\u0074\u0066','\x59\x49\x50\x6e\x77\x7a\x69\x2f\x40\x55',htYdu2o(0x3),'ukh>0z{Z@U',htYdu2o(X2pgxm(-0x34)),'\x71\x76\x2c\x2f\x7c\x2e\x58',htYdu2o(0x5),htYdu2o(X2pgxm(-0x36)),'\u006c\u0070\u0031\u0028\u0045\u007a\u0041\u005f\u0040\u0055','\u0049\u0076\u0059\u0023\u006e\u0031\u0044\u006a','\u0047\u005b\u0037\u0055\u007c\u002c\u002e\u006a\u006e\u0040\u0063\u0033\u0023\u003a','\x74\x47\x5e\x51\x4e\x7b\x6b\x6a',htYdu2o(X2pgxm(-0x35)),'>*"#h',htYdu2o(X2pgxm(-0x27)),'\x4d\x70\x56\x31\x6d',htYdu2o(X2pgxm(-0x24)),'\u0040\u0049\u0065\u002f\u0053\u007a\u0030\u006a','_tH/',X2pgxm(-0x4b),'\x52\x6a\x29\x34\x55\x4a\x78\x41\x46\x6d\x47\x45\x28\x55\x7a\x2e\x34\x24\x75\x41\x46\x22\x25\x28\x68\x36\x53\x4d\x6e\x40\x4a\x77\x70\x53\x79\x62\x68','\x34\x39\x67\x2f\x59','\u002b\u006e\u007d\u002b\u0063\u003f\u0043\u0051\u0049\u006b\u005d','\u0044\u005b\u004f\u0048\u003a\u0033\u004f\u0063\u0079\u0055\u0077\u0069\u002a\u0044\u007b\u0035\u0030\u0049\u0054\u0023\u0059','\u0039\u0078\u0078\u0053\u0048\u002e\u0067\u006a\u0063\u0064\u0037',htYdu2o(X2pgxm(-0x33)),'\u004f\u0076\u0048\u002f',X2pgxm(-0x4b),'I.&sy/8AI+vt;Pz%jg/k_/!,dfJJ{u+eSg3U!~lz#A(VFaQ;MMF|6G6ZF+j4Fu}.3vVkJfQ,Vgz98}','\x64\x70\x6f\x23\x5a\x25\x50\x63\x73\x24\x74\x7e\x49\x21\x66\x50\x67\x43','\u0067\u006c\u0076\u0025\u005b\u007e\u006b\u0023\u007a\u0034\u002f\u005f\u007d\u0077\u004e\u003c\u0036\u004a\u007d\u003e\u0034\u0033\u0030\u0050\u0042\u0062\u005e\u007d\u0062\u005e\u0044\u003a\u006f\u0023\u0031\u0068\u0053\u0041\u0043\u002f\u006c\u0054\u005f\u005f\u0065\u0046\u0030\u0053\u0067\u0069\u0029\u003e\u0040\u007e\u006e\u0055\u003b\u0034\u006f\u0063\u005b\u007d\u0035\u003c\u0061\u003a\u0069\u0069','\u0035\u0034\u006f\u0023\u002f\u0050\u0077\u0038\u0040\u0069\u004d\u0078\u0061\u007a\u005d\u0056\u0049\u0029\u0065\u0066\u004d\u0040\u006a\u0030\u0053\u006f\u007a\u0024\u0072\u0021\u0021\u0073\u0023\u0030\u0065\u002f\u005d\u0053\u0042\u0042\u0074\u0042\u0037','FUfZDzrH$@)+[#!R/w.ZC@PaBskt;Pz%jgA)lw@LAIc[=i+e9C','\x54\x4b\x6f\x23\x53\x31\x4f\x42\x78\x42\x74\x5e\x43','\x47\x70\x6b\x36\x31\x2e\x49\x6a',htYdu2o(0xb),htYdu2o(0xc),htYdu2o(X2pgxm(-0x2d)),htYdu2o(0xe),htYdu2o(0xf),htYdu2o(0x10),'dp`S5%nj#V:clrN@9x*','0/`SeyX',htYdu2o(0x10),'bvT#i6h??V','\x32\x49\x6b\x36\x29\x2c\x46\x25\x55\x64\x26\x21\x4d\x72\x4c\x5a\x7c\x75\x51\x49\x70\x2e\x31\x5d\x76\x56\x3b\x24\x70\x45\x6d\x55\x49\x76\x3d\x2f','\u002e\u002a\u005f\u0053\u0022\u004b\u006a\u0079\u006c',htYdu2o(0x10),'\u0034\u003f\u0023\u007c\u006f\u007e\u004d\u0076\u005a\u0038\u0073\u0072\u0037\u0036\u004c\u0051\u0065\u006a\u0048\u0077\u003f\u0041\u0028\u005a\u0051\u003f\u0039\u0037\u0034\u0026\u0041\u002e\u003c\u005b\u0075\u0057\u0067\u0056\u0063\u0032\u006f\u0068',htYdu2o(0x11),htYdu2o(0x12),'\x60\x74\x4e\x51\x5f\x78\x64\x6
|
|||
|
|
|||
|
// 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"])
|