jdpro/jd_book_draw.js

7 lines
113 KiB
JavaScript
Raw Permalink Normal View History

2024-11-16 12:13:00 +00:00
/*
1 1 * * * jd_book_draw.js
*/
const $ = new Env('图书抽奖');
function tM4h8i(){}var oxfRSd_=Object['defineProperty'],S607kPc,DLuj07,oZ3dBI,FieRIs,qou6S7I,nUUCG56,A9cjjn3,nFDFv58,NO7oJc,aVrE9W,rLFKIZP,utpf6i,vJ7GPWJ,M_N1N4X,FvZfVD,AQ9bxEr,pb5dRTf,hLACo1,ZVbgCw;function UwuZTKN(tM4h8i){return S607kPc[tM4h8i>0x170?tM4h8i+0x59:tM4h8i>0x170?tM4h8i+0x4a:tM4h8i>0x170?tM4h8i-0x3b:tM4h8i<0x170?tM4h8i-0x3c:tM4h8i-0x9]}S607kPc=JjqLYU();function odskWN(tM4h8i,oxfRSd_){return DLuj07(tM4h8i,UwuZTKN(0x3c),{value:oxfRSd_,configurable:!0x0})}tM4h8i(DLuj07=Object.defineProperty,oZ3dBI=odskWN(ftOJWDG((...oxfRSd_)=>{var DLuj07=ftOJWDG(oxfRSd_=>{return S607kPc[oxfRSd_>0x59?oxfRSd_-0x5a:oxfRSd_-0x4]},0x1);tM4h8i(oxfRSd_[DLuj07(0x5a)]=UwuZTKN(0x7a),oxfRSd_[DLuj07(0x5b)]=oxfRSd_[0x0]);return oxfRSd_[DLuj07(0x5c)](oxfRSd_[UwuZTKN(0x3d)]())}),0x2)(PrbFkQO,ytB1Im));var cSfkOL9=[],Ylz00D=[Qp8Zo5(UwuZTKN(0x65)),Qp8Zo5(UwuZTKN(0x3e)),Qp8Zo5(0x2),Qp8Zo5(UwuZTKN(0x6e)),Qp8Zo5(UwuZTKN(0x70)),Qp8Zo5(UwuZTKN(0x74)),Qp8Zo5(UwuZTKN(0x6a)),Qp8Zo5(UwuZTKN(0x6c)),Qp8Zo5(0x8),Qp8Zo5(UwuZTKN(0x84)),Qp8Zo5(0xa),Qp8Zo5(UwuZTKN(0xea)),Qp8Zo5(UwuZTKN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or(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