mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-01-10 16:29:13 +08:00
19 lines
126 KiB
JavaScript
19 lines
126 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('大牌联合0105')
|
|||
|
function r30D0Vu(){}var sOg9XN=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],iP7mSo0,h9u9EG,MisjXe,mdS46O3,Y2OTcM,NcDUs_z,XTBLEqc,wsT3pah,jwu54Lw,DfPorFk,HUOPVI,x4Rt7m,bPicAQ,ETbz0V,nRpM2n,XETcUh,pQJlW1,ONcDGb,r3e39V,RjxRVr;function TvT9uZ(r30D0Vu){return iP7mSo0[r30D0Vu>0x42?r30D0Vu>0x42?r30D0Vu-0x43:r30D0Vu+0x64:r30D0Vu-0xe]}r30D0Vu(iP7mSo0=E02N1Fj(),h9u9EG=BtdXPs((r30D0Vu,sOg9XN)=>{return sOg9XN(r30D0Vu())},0x2)(x6MwV3,Vqd9tI_));var _WTsKXH=[],silgSp=['\x45\x72\x24\x5b\x6e\x6c\x71\x63\x73','\u0079\u004a\u0055\u006f\u0060\u002c\u0030\u0022','\u0048\u003b\u0030\u007a\u0064\u0049\u0078\u0043','\u004f\u002f\u007d\u0074\u0049\u002a\u004d\u004c\u0055\u0063\u003d\u003c\u006c',lUs7351(TvT9uZ(0x5a)),'IKw@@F,','\x2f\x6f\x59\x2a\x29\x6a\x5a\x6b\x50\x59\x40\x3c\x4a\x34\x50','\x53\x53\x47\x76\x54\x38\x46\x31\x29\x73\x7a\x51\x59\x67\x63\x5e\x5a\x52',lUs7351(0x1),lUs7351(TvT9uZ(0x66)),'\u007c\u0077\u0055\u0068\u0022\u002c\u0055\u004e\u0061\u003f\u0056\u0074\u0037\u0022','A0/#77Gw<[}<bC5/mpHg1qP13hwxn~4`mpk"bbJ','\u007c\u0077\u0055\u0068\u0022\u002c\u0055\u004e\u0061\u003f\u007a\u0051\u0056\u0061\u0059\u0071\u0034\u003d\u0040\u0068','\x48\x3d\x40\x35\x42','|wUh",UNtPkyFHvkv3~[','|wUh",UNa?S=S|/qN%;','\x7c\x77\x55\x68\x22\x2c\x55\x4e\x74\x50\x7e\x74\x22\x48\x4b','\x7c\x77\x55\x68\x22\x2c\x55\x4e\x61\x3f\x30\x4e\x79\x5d\x4b','\x7c\x77\x55\x68\x22\x2c\x55\x4e\x74\x50\x5d\x32\x69\x50\x52\x45\x5a\x52','\x7c\x77\x55\x68\x22\x2c\x55\x4e\x74\x50\x2c\x74\x34\x53\x37\x62','|w!k^~_ZIF',lUs7351(TvT9uZ(0x6b)),'\x67\x33\x42\x6d\x23','\x6b\x67\x72\x71\x26\x61\x4d\x5b\x5e\x50','\u0026\u0033\u0042\u006d\u007e\u0065\u004a','\x44\x46\x42\x57\x47\x61\x37\x45\x5e\x50','\u005d\u005e\u003c\u0035\u0073\u002b\u0077\u0068\u0039\u0041','\x5a\x33\x2b\x5b\x4b\x65\x4a','\u0030\u0053\u0055\u003e\u002c\u002b\u003e\u0028\u0049\u0050','\u002c\u003d\u002b\u005b\u003d\u0057\u004d\u006c\u006a','\u0030\u0053\u003a\u0048\u002a\u0061\u0049\u0054\u005e\u0050','\u0067\u0033\u006b\u0029\u0071\u003a\u007c\u0031','$w.PK+e1q^N,)"','\x6d\x24\x7b\x28\x6f\x37\x46\x31','~`4bP+g;3P','\x57\x3b\x39\x29\x42',lUs7351(TvT9uZ(0x71)),'\u0058\u0053\u0060\u003a\u0021','\x52\x22\x7e\x5b',lUs7351(TvT9uZ(0x72)),'\u0054\u006d\u0068\u005b',TvT9uZ(0x43),lUs7351(0x6),'%Ql[k','\u004c\u0071\u006a\u004c\u004e\u0040\u0052\u0028\u0067\u0046\u0079','\u007c\u0077\u0055\u0068\u0022\u002c\u0055\u004e\u0074\u0050\u0026\u004d\u003b\u007c\u0037\u0062\u0047\u0067\u0043\u0029\u006b','\x48\x21\x2e\x5d\x2e\x3d\x5e\x47\x30','g6bv=WE1',lUs7351(0x7),lUs7351(TvT9uZ(0x60)),'\u0051\u003d\u007b\u0038\u006e\u003a\u0064\u007e\u005f\u004d\u003a\u0074\u0062\u0022',TvT9uZ(0x46),TvT9uZ(0x43),lUs7351(TvT9uZ(0x73)),lUs7351(TvT9uZ(0xa1)),'\x25\x40\x29\x4b\x66\x7d\x58\x33\x45\x4f\x6e\x7a\x2e\x38\x55\x6d\x4c\x2b\x2e\x71\x4f\x5f\x63\x4e\x35\x36\x3d\x2e\x36\x3d\x62\x65\x37\x33\x2f\x73\x2a\x31\x5e\x6e\x40\x61\x7a\x7a\x7b\x4d\x63\x2a\x25\x53\x69\x71\x78\x7d\x41\x22\x57\x4f\x37\x60\x66\x2e\x5a\x6d\x23\x65\x53\x53','b%f)[r&O^MX=Vay`gsx#X^1G5fa2?]]i)Gx[y5AAmA.','\x64\x50\x23\x45\x7c\x61\x3f\x68\x32\x5e\x73\x4c\x77\x29\x5d\x70\x5b\x26\x65\x45\x52\x5e\x72\x56\x41\x69\x46\x6d\x34\x72\x61\x7e\x31\x6c\x49\x73\x30\x26\x5e\x6e\x49\x67\x4e\x77\x75\x4d\x4c\x78\x51\x52','\u0043\u003e\u0066\u0029\u0035\u003a\u0055\u0041\u003d\u0041\u006d\u007b\u0052','\x24\x53\x46\x38\x3a\x65\x67\x31','UQY[<x[R','\u0043\u003e\u0066\u0029\u0035\u003a\u0055\u0041\u003d\u0041\u006d\u007b\u0052','dP#E|a?h2^sLw)]pgediR^rVAi;%pcze+RaYrgf:%t$oE67(dSQ%`+DFq^a,IJ',lUs7351(TvT9uZ(0x61)),TvT9uZ(0x4c),'G[<5xtvR',lUs7351(TvT9uZ(0x44)),lUs7351(0xd),'\x47\x5b\x3c\x35\x78\x74\x4a',lUs7351(TvT9uZ(0x44)),lUs7351(TvT9uZ(0x65)),'_gF8s+d~P/6]X?nEKD(gSe:y3`42S*!Pg3u[','\u0065\u003b\u0054\u0035\u0039\u003e\u0031\u0074\u0030',lUs7351(TvT9uZ(0x44)),lUs7351(TvT9uZ(0x5c)),lUs7351(TvT9uZ(0x74)),'\x6d\x67\x66\x29\x5a\x61\x4a','\x3c\x6d\x6f\x28\x54\x3d\x2f\x31',lUs7351(0x11),lUs7351(TvT9uZ(0x53)),lUs7351(TvT9uZ(0x76)),'\u0033\u0051\u007e\u005a\u004a\u0078\u0051\u0077\u002f\u0025\u0050\u0023\u0052','\x42\x47\x3b\x35\x2c\x65\x4a',lUs7351(0x14),'\u00
|
|||
|
// 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"])
|