faker3/jd_book_draw.js

7 lines
97 KiB
JavaScript
Raw Permalink Normal View History

2024-11-27 09:52:15 +08:00
/*
1 1 * * * jd_book_draw.js
*/
const $ = new Env('图书抽奖');
2025-01-03 11:12:20 +08:00
var dp8ZIb,cq2ifV,oe5QTK,luGq4H,bZxbjd,w5rCFuy,y378qa,xQGPOb1,FkammS,DvLD7Lg,cR6Qac;function jB1Ziw_(dp8ZIb,cq2ifV,oe5QTK){for(oe5QTK=0x0;oe5QTK<cq2ifV;oe5QTK++)dp8ZIb.push(dp8ZIb.shift());return dp8ZIb}const yOX1pL=[0x0,0x1,0x8,0xff,"length",0x18,0x3,"b","f","undefined","c",0x3f,0x6,"fromCodePoint",0x7,0xc,"push","a",0x5b,0x1fff,0x58,0xd,0xe,0x40,0xe7,"i",0x2e,"e",0x77,0x4,0xa8,0xea,0x9,0x82,"d",0x2,0x43,"g",0xa3,0xd1,"h",0x20,0x4f,0x7b,0x5,0x7c,0x7f,0xda,0x80,!0x1,0x86,0x65,0xb3,0x8a,0x8b,0x54,0xf8,0x91,0x42,0x8f,0x9c,0x5d,null,0x10,0x9b,0x9d,0x56,0xe8,"j",0x5a,0xba,0x4e,0x5f,0x49,0xe3,0xad,0xb4,0xb5,!0x0,0xb9,"UA",0xaa,0xb6,0xb8,0xb7," ",0xd0,0xd7,0xd5,0xa,0xbf,0xdf,0x3e8,0x13,0x66,0xe6,0x24,0xef,0xd6,0x7d,0xca,0xf9,0x89,0xa0,0xa4,0xc4,0x102,0x104,0x9a,0x27,0x3d,0xfc,0x10c,";","ua",0x11d,0x57,0x120,void 0x0,0x13b,0xf5,0xa7,0x5e,0xc6,0x33,0x200,0x100,0x1f,0x69,0x31,0xf,0x8d,0xf7,0xf0,0x30,0x2d,0x3ff,0xc0,0xe0,0x12,0x9f,0xb2,0x52,0xffff,0x21,0xc3,0x14f,0xe1,0xc7,0x3c,0xec,0x79,0x6f,0x16f,0xc5,0xb0,0x174,0x17b,0x17c,"\n",0x179,0x186,0x194,0x1a8,0x1a5,0x16,0x3e,0x1a,0x99,0x8c,0xd2,0x1ba,0xc9,0x87,0x7a,0x45,0x1ce,0xd8,0x36,0xe9,0x39,0x6a,0x1f4,0x1c,0xdb,0x1fa,0x1f6,0x1c4,0xf2,0x201,0x207,0x46,0x12a,0x215,"=",0x22c,0x22b,0x22f];PDdy46(cAnAgee(piiQLh),cAnAgee(kZahmFP),cAnAgee(A2VcY43,yOX1pL[0x6]),cAnAgee(S1foXC));function cAnAgee(dp8ZIb,cq2ifV=yOX1pL[0x1]){Object.defineProperty(dp8ZIb,yOX1pL[0x4],{value:cq2ifV,configurable:yOX1pL[0x31]});return dp8ZIb}function vHGEHv(dp8ZIb){var cq2ifV="fd,pAI%X>P;2*Ti0#\":S!{$YK/B5avOC1z8?hu4J6G_7`ywDo3<[q=]E&xVc^R~gH+@9(M)|}rZsFUQLljWetbkNmn.",oe5QTK,luGq4H,bZxbjd,w5rCFuy,y378qa,xQGPOb1,FkammS;PDdy46(oe5QTK=""+(dp8ZIb||""),luGq4H=oe5QTK.length,bZxbjd=[],w5rCFuy=yOX1pL[0x0],y378qa=yOX1pL[0x0],xQGPOb1=-yOX1pL[0x1]);for(FkammS=yOX1pL[0x0];FkammS<luGq4H;FkammS++){var DvLD7Lg=cq2ifV.indexOf(oe5QTK[FkammS]);if(DvLD7Lg===-yOX1pL[0x1])continue;if(xQGPOb1<yOX1pL[0x0]){xQGPOb1=DvLD7Lg}else{PDdy46(xQGPOb1+=DvLD7Lg*yOX1pL[0x12],w5rCFuy|=xQGPOb1<<y378qa,y378qa+=(xQGPOb1&yOX1pL[0x13])>yOX1pL[0x14]?yOX1pL[0x15]:yOX1pL[0x16]);do{PDdy46(bZxbjd.push(w5rCFuy&yOX1pL[0x3]),w5rCFuy>>=yOX1pL[0x2],y378qa-=yOX1pL[0x2])}while(y378qa>yOX1pL[0xe]);xQGPOb1=-yOX1pL[0x1]}}if(xQGPOb1>-yOX1pL[0x1]){bZxbjd.push((w5rCFuy|xQG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Oix!lL0","pg(C,=F%XVg?9)^_j&MaiZOOg*=gAe%u=|&%","R\"gF$xk(y=SMjl@:*gd","[y?v]}&:SP;o+}Yv21<>","G|811Q)Z`&wqeB9\"\"g%P98]w`\"F?)T74k/n%g=(Kx!O8Rhr/X:.[YM;V^\"c","*g6OR^SSF\"6L%WTJJ%{C^VDTMSF?*5wJ6\")q<VF8V~bIK58K^~vA1q`,|VXYd","ZC]EJ?:qR~s2V/M:>?}%]ufKy@YEW3m8^~{A33f","px~FHh[?G!<FVMxGNrx[rEcdH0+>C<+hh|v;/c6:=V})PIaGg~:1tqbY%","_x35,j7gjg3leiq8,^p",",xUCAo<OL0o~nKma9p7vQx3st];Y5Wy5avZ[m<hO~cu{GAJKkyuFNq]kG\"","|[l%7?RYSSw@+o%/5d","LcJA/6SDP\"m1d}t8HpgP.z>qQck<>50","!B{CP~PS8]&qj^Muy%Nqx)5X)V[l\"}wBj[(CI=f","H8wqa?mwIV@UmAPBCd","][DF$4R?2+~&/Ab8I^iX{qcd","z6c1R}q,?*!EH0a_$^.>EWp/!St$J4|CM(FC73mZCgd+QjeGUcV1:","%P?}nQHZ8]Xp0WnGE\"gF)hMYlgYLxTT","$Yk|ij/X9^/Mg0RvD83[kQ_VITgd7BP","W/qv46lweHFg;Iq8K|wE7&NMO:D
2024-11-27 09:52:15 +08:00
function Env(o,t){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((r,i)=>{s.call(this,t,(t,e,s)=>{t?i(t):r(e)})})}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.logLevels={debug:0,info:1,warn:2,error:3},this.logLevelPrefixs={debug:"[DEBUG] ",info:"[INFO] ",warn:"[WARN] ",error:"[ERROR] "},this.logLevel="info",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.encoding="utf-8",this.startTime=(new Date).getTime(),Object.assign(this,e),this.log("",`🔔${this.name}, 开始!`)}getEnv(){return"undefined"!=typeof $environment&&$environment["surge-version"]?"Surge":"undefined"!=typeof $environment&&$environment["stash-version"]?"Stash":"undefined"!=typeof module&&module.exports?"Node.js":"undefined"!=typeof $task?"Quantumult X":"undefined"!=typeof $loon?"Loon":"undefined"!=typeof $rocket?"Shadowrocket":void 0}isNode(){return"Node.js"===this.getEnv()}isQuanX(){return"Quantumult X"===this.getEnv()}isSurge(){return"Surge"===this.getEnv()}isLoon(){return"Loon"===this.getEnv()}isShadowrocket(){return"Shadowrocket"===this.getEnv()}isStash(){return"Stash"===this.getEnv()}toObj(t,e=null){try{return JSON.parse(t)}catch{return e}}toStr(t,e=null,...s){try{return JSON.stringify(t,...s)}catch{return e}}getjson(t,e){let s=e;if(this.getdata(t))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(r=>{this.get({url:t},(t,e,s)=>r(s))})}runScript(a,o){return new Promise(r=>{let t=this.getdata("@chavy_boxjs_userCfgs.httpapi");t=t&&t.replace(/\n/g,"").trim();var e=(e=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"))?+e:20,[s,i]=(e=o&&o.timeout?o.timeout:e,t.split("@"));this.post({url:`http://${i}/v1/scripting/evaluate`,body:{script_text:a,mock_type:"cron",timeout:e},headers:{"X-Key":s,Accept:"*/*"},timeout:e},(t,e,s)=>r(s))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};this.fs=this.fs||require("fs"),this.path=this.path||require("path");var t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),s=this.fs.existsSync(t),r=!s&&this.fs.existsSync(e);if(!s&&!r)return{};r=s?t:e;try{return JSON.parse(this.fs.readFileSync(r))}catch(t){return{}}}writedata(){var t,e,s,r,i;this.isNode()&&(this.fs=this.fs||require("fs"),this.path=this.path||require("path"),t=this.path.resolve(this.dataFile),e=this.path.resolve(process.cwd(),this.dataFile),r=!(s=this.fs.existsSync(t))&&this.fs.existsSync(e),i=JSON.stringify(this.data),!s&&r?this.fs.writeFileSync(e,i):this.fs.writeFileSync(t,i))}lodash_get(t,e,s){let r=t;for(const t of e.replace(/\[(\d+)\]/g,".$1").split("."))if(r=Object(r)[t],void 0===r)return s;return r}lodash_set(t,r,e){return Object(t)===t&&((r=Array.isArray(r)?r:r.toString().match(/[^.[\]]+/g)||[]).slice(0,-1).reduce((t,e,s)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(r[s+1])>>0==+r[s+1]?[]:{},t)[r[r.length-1]]=e),t}getdata(t){let e=this.getval(t);if(/^@/.test(t)){var[,s,r]=/^@(.*?)\.(.*?)$/.exec(t);if(s=s?this.getval(s):"")try{const t=JSON.parse(s);e=t?this.lodash_get(t,r,""):e}catch(t){e=""}}return e}setdata(t,e){let s=!1;if(/^@/.test(e)){var[,r,i]=/^@(.*?)\.(.*?)$/.exec(e),a=this.getval(r),a=r?"null"===a?null:a||"{}":"{}";try{const e=JSON.parse(a);this.lodash_set(e,i,t),s=this.setval(JSON.stringify(e),r)}catch(e){this.lodash_set(a={},i,t),s=this.setval(JSON.stringify(a),r)}}else s=this.setval(t,e);return s}getval(t){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.read(t);case"Quantumult X":return $prefs.valueForKey(t);case"Node.js":return this.data=this.loaddata(),this.data[t];default:return this.data&&this.data[t]||null}}setval(t,e){switch(this.getEnv()){case"Surge":case"Loon":case"Stash":case"Shadowrocket":return $persistentStore.write(t,e);case"Quantumult X":return $prefs.setValueF