jdpro/jd_getRed.js

20 lines
233 KiB
JavaScript
Raw Normal View History

2024-10-14 05:28:14 +00:00
/*
变量REDCODE='7位字母'
export REDCODE="xxxxxxx"
每次领取红包次数
export RedCount="5"
每个账号之间延时单位毫秒
export RedTimes="5000"
代理api
export DY_PROXY='url'
59 59 23,19 * * * jd_getRed.js
*/
const $ = new Env('11领大鹅红包');
2024-10-26 12:42:04 +00:00
function KjOOCNb(){}var mnW6rQ=Object['defineProperty'],rZn8__,lLN8sOG,HkH0Ncf,fF5aZ9s,z9YW_g,eqtlM3K,q7wESN1,SePDR0,cyPmxBn,aIQOIh,jFtgTi,NfX32XT,wsf6wSY,UZzgMx,bs5K23_,Xzlbtvl,uGIEQK5,GXbSaO,uTqkUS,wUkN2eK,OzIu9Up,rGOgyL;function onw7U1a(KjOOCNb){return rZn8__[KjOOCNb<-0x1c?KjOOCNb+0x1e:KjOOCNb<0x286?KjOOCNb+0x1b:KjOOCNb+0x42]}rZn8__=I_5rSHo();function ThwxkQ(KjOOCNb,mnW6rQ){lLN8sOG(KjOOCNb,'length',{value:mnW6rQ,configurable:onw7U1a(0x67)});return KjOOCNb}KjOOCNb(lLN8sOG=Object.defineProperty,HkH0Ncf=TB_twjR((KjOOCNb,mnW6rQ)=>{return mnW6rQ(KjOOCNb())},0x2)(gesPLCL,kbW0PN));var SZotl5=[],dsiowj5=['8{+W|/>`',hxb0JpT(onw7U1a(0x3e)),'~=~qmU|5x',hxb0JpT(onw7U1a(0x3d)),hxb0JpT(onw7U1a(0x3a)),hxb0JpT(0x3),hxb0JpT(0x4),hxb0JpT(0x5),onw7U1a(-0x12),hxb0JpT(0x6),hxb0JpT(onw7U1a(0x56)),hxb0JpT(onw7U1a(0x55)),hxb0JpT(0x9),hxb0JpT(onw7U1a(0x66)),hxb0JpT(onw7U1a(0x136)),hxb0JpT(0xc),hxb0JpT(0xd),hxb0JpT(0xe),hxb0JpT(onw7U1a(0x4b)),hxb0JpT(onw7U1a(0x4e)),hxb0JpT(0x11),hxb0JpT(0x12),hxb0JpT(0x13),hxb0JpT(onw7U1a(-0x19)),hxb0JpT(onw7U1a(0x68)),hxb0JpT(onw7U1a(-0x1b)),hxb0JpT(onw7U1a(0x5a)),hxb0JpT(onw7U1a(0x11)),hxb0JpT(0x13),hxb0JpT(0x12),hxb0JpT(0x13),hxb0JpT(onw7U1a(-0x1b)),hxb0JpT(0x10),hxb0JpT(0x17),hxb0JpT(0x18),hxb0JpT(onw7U1a(-0x15)),hxb0JpT(0x1a),hxb0JpT(0x1b),hxb0JpT(0x1c),hxb0JpT(onw7U1a(-0x1a)),hxb0JpT(0x1e),hxb0JpT(0x1f),hxb0JpT(onw7U1a(0x70)),hxb0JpT(0x21),hxb0JpT(onw7U1a(0x10)),hxb0JpT(0x23),'k|c/C76F?Bgy&',hxb0JpT(0x24),hxb0JpT(onw7U1a(-0x1a)),hxb0JpT(onw7U1a(0x5c)),hxb0JpT(0x26),hxb0JpT(onw7U1a(0x79)),hxb0JpT(onw7U1a(0x7a)),'.|c/QVJPrd9y&',hxb0JpT(onw7U1a(0x52)),hxb0JpT(onw7U1a(0x7b)),hxb0JpT(0x2b),hxb0JpT(0x2c),hxb0JpT(0x2d),hxb0JpT(onw7U1a(0x8c)),hxb0JpT(0x2f),':0)KxMYGv[*FT0"T|&',hxb0JpT(0x30),hxb0JpT(onw7U1a(0x4d)),hxb0JpT(0x32),hxb0JpT(0x33),'|=yk@V1&',hxb0JpT(0x34),hxb0JpT(0x35),hxb0JpT(onw7U1a(0x4c)),hxb0JpT(onw7U1a(0x80)),'|0dw_%le',hxb0JpT(0x38),hxb0JpT(onw7U1a(0x9)),hxb0JpT(onw7U1a(-0x14)),hxb0JpT(0x38),hxb0JpT(onw7U1a(0x7e)),hxb0JpT(onw7U1a(0x29)),hxb0JpT(0x3d),'.|Gk_%L',hxb0JpT(0x14),'9~N!?|DQ]9lk533%`3U#)Y&',hxb0JpT(0x3e),hxb0JpT(0x3f),hxb0JpT(0x40),hxb0JpT(0x41),'ge#4"$us+^|jm"V%4]Zs+i&',hxb0JpT(0x42),'d0C9(;]M>.{uK8|',hxb0JpT(onw7U1a(0x10e)),hxb0JpT(0x44),'raApE2"]&o|O@.vZ|^0JaPO7c=s',hxb0JpT(onw7U1a(0xa6)),hxb0JpT(onw7U1a(-0x3)),hxb0JpT(0x41),hxb0JpT(onw7U1a(0x43)),'9~N!|A0kih,kNcy%k=FdUQ&',hxb0JpT(0x47),hxb0JpT(onw7U1a(0x7f)),hxb0JpT(onw7U1a(-0x18)),hxb0JpT(onw7U1a(0x137)),hxb0JpT(0x4b),hxb0JpT(onw7U1a(-0x19)),'PsE^|_Mnf',hxb0JpT(onw7U1a(-0x5)),hxb0JpT(onw7U1a(0x47)),'.|c/QVJPnB8&}h`','.|c/QVJPnBi|RvL|%uY',hxb0JpT(onw7U1a(-0x18)),hxb0JpT(0x4a),'$6Qk|yg','.|c/QVx&',hxb0JpT(0x4e),hxb0JpT(0x4f),hxb0JpT(0x50),hxb0JpT(onw7U1a(-0x1)),hxb0JpT(onw7U1a(0x81)),hxb0JpT(0x53),hxb0JpT(0x54),'w$Px|8!r*G|2W[b|6fUlve^DL{`{Z#^T]~jV',hxb0JpT(onw7U1a(0x83)),hxb0JpT(onw7U1a(-0x16)),'t$]x|8!rspI<g',hxb0JpT(0x57),hxb0JpT(0x58),hxb0JpT(onw7U1a(-0x17)),hxb0JpT(0x59),hxb0JpT(onw7U1a(0x85)),'mjuoP`Pmzo@H%|IuN:}tI',hxb0JpT(onw7U1a(-0x17)),hxb0JpT(onw7U1a(0x53)),hxb0JpT(0x5c),hxb0JpT(onw7U1a(0x4)),hxb0JpT(0x5e),hxb0JpT(0x5f),hxb0JpT(0x60),hxb0JpT(onw7U1a(0xe)),hxb0JpT(onw7U1a(0x19d)),hxb0JpT(onw7U1a(0x87)),hxb0JpT(0x64),hxb0JpT(onw7U1a(0x210)),hxb0JpT(onw7U1a(0x1be)),hxb0JpT(onw7U1a(0x88)),onw7U1a(-0x4),hxb0JpT(onw7U1a(-0xe)),hxb0JpT(onw7U1a(0x1aa)),hxb0JpT(onw7U1a(0x41)),hxb0JpT(0x51),'.|c/QV{&',hxb0JpT(onw7U1a(0x3b)),hxb0JpT(onw7U1a(-0x11)),hxb0JpT(0x6d),hxb0JpT(0x6e),hxb0JpT(onw7U1a(0x73)),hxb0JpT(onw7U1a(0x75)),hxb0JpT(0x71),hxb0JpT(0x72),'Cn,T8|m35c#>PA',hxb0JpT(onw7U1a(0x72)),hxb0JpT(0x73),hxb0JpT(0x74),hxb0JpT(onw7U1a(0x89)),hxb0JpT(0x14),hxb0JpT(0x76),hxb0JpT(0x77),hxb0JpT(0x78),hxb0JpT(onw7U1a(0x8a)),hxb0JpT(0x7a),'^}qJk+~30j@i^)S<>w.NH]NvKNoDi1~9sB,T?ye@:eH2^)^;F}T7;[,d_6Cv`0uI;#21|sps{G(}`1_Sc%=B4.i@t6?>^)$#T}Pb9EHb|N>iGsNq',hxb0JpT(onw7U1a(0x8b)),hxb0JpT(onw7U1a(-0x8)),hxb0JpT(0x7d),hxb0JpT(0x7e),hxb0JpT(onw7U1a(0x8e)),'F|yTi]Fa',hxb0JpT(onw7U1a(0x42)),'|91q',hxb0JpT(0x81),hxb0JpT(0x82),hxb0JpT(onw7U1a(-0x7)),hxb0JpT(0x84),hxb0JpT(onw7U1a(0xcd)),hxb0JpT(onw7U1a(0x1f4)),'|0dw_%le',hxb0JpT(0x87),'i#[NK&m3|GO','i#[NK&m
2024-10-14 05:28:14 +00: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