KR/jd_xyhby.js

13 lines
31 KiB
JavaScript
Raw Normal View History

2023-10-31 20:36:28 +08:00
/*
#京东晚八点红包雨
[task_local]
#京东晚八点红包雨
11 11 11 11 * jd_xyhby.js, tag=京东晚八点红包雨, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true*/
const $ = new Env("京东晚八点红包雨");
var version_='jsjiami.com.v7';const liI1i1=iii1II;(function(llI11i,i1iIi1,l1l1il,I11i1I,iliIi1,l1l1ii,Il1i1I){return llI11i=llI11i>>0x9,l1l1ii='hs',Il1i1I='hs',function(Ii1iii,iIIilI,il1l1,Ii1iil,Ilil1i){const lill11=iii1II;Ii1iil='tfi',l1l1ii=Ii1iil+l1l1ii,Ilil1i='up',Il1i1I+=Ilil1i,l1l1ii=il1l1(l1l1ii),Il1i1I=il1l1(Il1i1I),il1l1=0x0;const iili1=Ii1iii();while(!![]&&--I11i1I+iIIilI){try{Ii1iil=parseInt(lill11(0xfa,'7[3w'))/0x1*(parseInt(lill11(0xfe,'hBUv'))/0x2)+parseInt(lill11(0x17d,'suNm'))/0x3+-parseInt(lill11(0x169,'jq8N'))/0x4*(-parseInt(lill11(0xf0,'aa)V'))/0x5)+-parseInt(lill11(0x1a8,'^Joy'))/0x6*(parseInt(lill11(0x117,'MOmy'))/0x7)+-parseInt(lill11(0x10f,'ynyI'))/0x8+-parseInt(lill11(0x1a4,'^Joy'))/0x9*(-parseInt(lill11(0x146,'ze(d'))/0xa)+-parseInt(lill11(0x1af,'jq8N'))/0xb;}catch(II11ii){Ii1iil=il1l1;}finally{Ilil1i=iili1[l1l1ii]();if(llI11i<=I11i1I)il1l1?iliIi1?Ii1iil=Ilil1i:iliIi1=Ilil1i:il1l1=Ilil1i;else{if(il1l1==iliIi1['replace'](/[qHWVdFTSAyJuCQXgUpnK=]/g,'')){if(Ii1iil===iIIilI){iili1['un'+l1l1ii](Ilil1i);break;}iili1[Il1i1I](Ilil1i);}}}}}(l1l1il,i1iIi1,function(Iil1iI,II11il,iIIil1,IlllII,I1il1I,II111,lI1l1I){return II11il='\x73\x70\x6c\x69\x74',Iil1iI=arguments[0x0],Iil1iI=Iil1iI[II11il](''),iIIil1=`\x72\x65\x76\x65\x72\x73\x65`,Iil1iI=Iil1iI[iIIil1]('\x76'),IlllII=`\x6a\x6f\x69\x6e`,(0x14547e,Iil1iI[IlllII](''));});}(0x19200,0x3275a,Iii11l,0xcb),Iii11l)&&(version_=liI1i1(0xf6,'K79L'));const illIil=$[liI1i1(0x1b6,'x]6x')]()?require(liI1i1(0x1a6,'%hxK')):'',Ill1I=$['isNode']()?require('./jdCookie'):'',i11iiI=require(liI1i1(0x14f,'7CnZ'));let lIli11=[],lllI1I='',lillI1,IlIlii,i1l1i1={};if($[liI1i1(0x14a,']lH5')]()){Object[liI1i1(0x174,'@64&')](Ill1I)['forEach'](II1il=>{const I11i11=liI1i1;lIli11[I11i11(0x176,'D@2[')](Ill1I[II1il]);});if(process['env'][liI1i1(0x118,'n8wP')]&&process[liI1i1(0x120,'&vyA')][liI1i1(0x11f,'gy%O')]==='false')console[liI1i1(0x135,'H#Gj')]=()=>{};}else lIli11=[$[liI1i1(0x127,'7njW')](liI1i1(0x14e,'gy%O')),$[liI1i1(0x152,'s]Zr')](liI1i1(0xed,'iZOp')),...llI1I1($[liI1i1(0x1b4,'Cv^J')](liI1i1(0x112,'@64&'))||'[]')[liI1i1(0x116,'MOmy')](lllI11=>lllI11[liI1i1(0x137,'ze(d')])]['filter'](I1lIll=>!!I1lIll);!(async()=>{const I1llII=liI1i1,I1lIli={'TxOLf':function(II1ii,IIIIII){return II1ii||IIIIII;},'yQXil':I1llII(0x13b,'!E5l'),'Zbjer':function(lillII,ii1ilI){return lillII<ii1ilI;},'ETVsR':I1llII(0x10c,'d@mj'),'WZlQP':I1llII(0x11d,')OQ2'),'RDukE':function(lI1ll1,iIiI1){return lI1ll1<iIiI1;},'xsDPA':function(liil1I,i11ii1){return liil1I!==i11ii1;},'mZvtG':I1llII(0x192,'iZOp'),'aRLJa':I1llII(0x19e,'4BSw'),'ehKqU':'6|3|2|7|0|1|5|4','lgBah':function(IlIliI,l1iII1){return IlIliI+l1iII1;},'rNGvC':function(iiill1,lIli1i){return iiill1(lIli1i);}};if(!lIli11[0x0]){$[I1llII(0x12b,'Cv^J')]($[I1llII(0x197,'Cv^J')],I1lIli['ETVsR'],I1lIli[I1llII(0x168,'s]Zr')],{'open-url':I1llII(0x19c,'7[3w')});return;}for(let IIIII1=0x0;I1lIli['RDukE'](IIIII1,lIli11['length']);IIIII1++){if(lIli11[IIIII1]){if(I1lIli['xsDPA'](I1lIli[I1llII(0x1b8,'z!s!')],I1lIli['aRLJa'])){const I1lIlI=I1lIli[I1llII(0x196,'Rxug')][I1llII(0x17f,'Axi#')]('|');let ii1ill=0x0;while(!![]){switch(I1lIlI[ii1ill++]){case'0':console[I1llII(0x107,'d9#K')]('');continue;case'1':console[I1llII(0x1b7,'Cz7R')](I1lIli[I1llII(0xf1,'gy%O')](I1lIli['lgBah'](I1llII(0x13f,'@64&'),$[I1llII(0x186,'hBUv')])+'】'+($[I1llII(0x148,'!6k7')]||$['UserName']),'******\x0a'));continue;case'2':$[I1llII(0x157,'suNm')]=I1lIli[I1llII(0x15d,'hBUv')](IIIII1,0x1);continue;case'3':$[I1llII(0x15f,'Axi#')]=I1lIli['rNGvC'](decodeURIComponent,lllI1I[I1llII(0x10d,'!6k7')](/pt_pin=([^; ]+)(?=;?)/)&&lllI1I['match'](/pt_pin=([^; ]+)(?=;?)/)[0x1]);continue;case'4':await $[I1llII(0x1ad,'M9e!')](0x1f4);continue;case'5':await iiillI();continue;case'6':lllI1I=lIli11[IIIII1];continue;case'7':$[I1llII(0x1a7,'4BSw')]=0x0;continue;}break;}}else{IiiiI=I1lIli[I1llII(0x199,'iZOp')](llIlli,0x20);let llI1II=I1lIli[I1llII(0x160,'aa)V')],lIli1l=llI1II[I1llII(0xec,'jdgY')],lillIi='';for(let illIi1=0x0;I1lIli[I1llII(0x1a2,'d@mj')](illIi1,lIIili);illIi1++)lillIi+=llI1II['charAt'](IiiIil[I1llII(0x105,'
// 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"])