KR/jd_909.js

17 lines
34 KiB
JavaScript
Raw Normal View History

/*
909
2023-09-10 12:32:25 +08:00
每天抽奖一次
cron:35 23 9 9 *
============Quantumultx===============
[task_local]
#909
2023-09-10 12:32:25 +08:00
35 13 9-20 9 * jd_909.js, tag=909, enabled=true
*/
const $ = new Env('909');
var version_='jsjiami.com.v7';function I1liIII(_0x2775a7,_0x3b0256){const _0x557463=iI1ii1li();return I1liIII=function(_0x265ef5,_0x3bc3f0){_0x265ef5=_0x265ef5-0x9c;let _0x533002=_0x557463[_0x265ef5];if(I1liIII['BCHBrg']===undefined){var _0x5f4810=function(_0xd29764){const _0x59f4e0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x201936='',_0x33328d='';for(let _0x5e69f8=0x0,_0x2694ca,_0x57ba7a,_0x533da4=0x0;_0x57ba7a=_0xd29764['charAt'](_0x533da4++);~_0x57ba7a&&(_0x2694ca=_0x5e69f8%0x4?_0x2694ca*0x40+_0x57ba7a:_0x57ba7a,_0x5e69f8++%0x4)?_0x201936+=String['fromCharCode'](0xff&_0x2694ca>>(-0x2*_0x5e69f8&0x6)):0x0){_0x57ba7a=_0x59f4e0['indexOf'](_0x57ba7a);}for(let _0x509eb0=0x0,_0x5bb227=_0x201936['length'];_0x509eb0<_0x5bb227;_0x509eb0++){_0x33328d+='%'+('00'+_0x201936['charCodeAt'](_0x509eb0)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x33328d);};const _0x3674ad=function(_0x412c24,_0x5a77c2){let _0x3b28a4=[],_0x3ccda4=0x0,_0x3a6e21,_0x3dc0a2='';_0x412c24=_0x5f4810(_0x412c24);let _0x5452f2;for(_0x5452f2=0x0;_0x5452f2<0x100;_0x5452f2++){_0x3b28a4[_0x5452f2]=_0x5452f2;}for(_0x5452f2=0x0;_0x5452f2<0x100;_0x5452f2++){_0x3ccda4=(_0x3ccda4+_0x3b28a4[_0x5452f2]+_0x5a77c2['charCodeAt'](_0x5452f2%_0x5a77c2['length']))%0x100,_0x3a6e21=_0x3b28a4[_0x5452f2],_0x3b28a4[_0x5452f2]=_0x3b28a4[_0x3ccda4],_0x3b28a4[_0x3ccda4]=_0x3a6e21;}_0x5452f2=0x0,_0x3ccda4=0x0;for(let _0x297b31=0x0;_0x297b31<_0x412c24['length'];_0x297b31++){_0x5452f2=(_0x5452f2+0x1)%0x100,_0x3ccda4=(_0x3ccda4+_0x3b28a4[_0x5452f2])%0x100,_0x3a6e21=_0x3b28a4[_0x5452f2],_0x3b28a4[_0x5452f2]=_0x3b28a4[_0x3ccda4],_0x3b28a4[_0x3ccda4]=_0x3a6e21,_0x3dc0a2+=String['fromCharCode'](_0x412c24['charCodeAt'](_0x297b31)^_0x3b28a4[(_0x3b28a4[_0x5452f2]+_0x3b28a4[_0x3ccda4])%0x100]);}return _0x3dc0a2;};I1liIII['NGderK']=_0x3674ad,_0x2775a7=arguments,I1liIII['BCHBrg']=!![];}const _0x57558f=_0x557463[0x0],_0x542e19=_0x265ef5+_0x57558f,_0x577fd4=_0x2775a7[_0x542e19];return!_0x577fd4?(I1liIII['LinCMy']===undefined&&(I1liIII['LinCMy']=!![]),_0x533002=I1liIII['NGderK'](_0x533002,_0x3bc3f0),_0x2775a7[_0x542e19]=_0x533002):_0x533002=_0x577fd4,_0x533002;},I1liIII(_0x2775a7,_0x3b0256);}const lI1lIl1i=I1liIII;(function(iIiill1i,Il1111iI,iiIll1il,iII1I1l,li11i111,lIIl1lli,iIii11Ii){return iIiill1i=iIiill1i>>0x1,lIIl1lli='hs',iIii11Ii='hs',function(lilli1i1,IIlll1lI,IiilIIIi,I1I1l1l,ll1lI1li){const i1ii1I1l=I1liIII;I1I1l1l='tfi',lIIl1lli=I1I1l1l+lIIl1lli,ll1lI1li='up',iIii11Ii+=ll1lI1li,lIIl1lli=IiilIIIi(lIIl1lli),iIii11Ii=IiilIIIi(iIii11Ii),IiilIIIi=0x0;const I11lI1iI=lilli1i1();while(!![]&&--iII1I1l+IIlll1lI){try{I1I1l1l=-parseInt(i1ii1I1l(0xd9,'GkwV'))/0x1+parseInt(i1ii1I1l(0xf4,'GkwV'))/0x2+-parseInt(i1ii1I1l(0x157,'Sb2d'))/0x3+parseInt(i1ii1I1l(0xae,'#r6%'))/0x4+parseInt(i1ii1I1l(0xbd,'d(c5'))/0x5*(parseInt(i1ii1I1l(0xea,'9[9p'))/0x6)+parseInt(i1ii1I1l(0x14b,'O*JM'))/0x7+-parseInt(i1ii1I1l(0x12f,'lf%#'))/0x8*(-parseInt(i1ii1I1l(0x18a,'O*JM'))/0x9);}catch(iliIIliI){I1I1l1l=IiilIIIi;}finally{ll1lI1li=I11lI1iI[lIIl1lli]();if(iIiill1i<=iII1I1l)IiilIIIi?li11i111?I1I1l1l=ll1lI1li:li11i111=ll1lI1li:IiilIIIi=ll1lI1li;else{if(IiilIIIi==li11i111['replace'](/[kYuFfVDTMtIryhBCQlOb=]/g,'')){if(I1I1l1l===IIlll1lI){I11lI1iI['un'+lIIl1lli](ll1lI1li);break;}I11lI1iI[iIii11Ii](ll1lI1li);}}}}}(iiIll1il,Il1111iI,function(I1liI11I,Ii1Illil,lII111lI,l1IlIl1l,Ili11iIi,IliliiIl,il1IlIi1){return Ii1Illil='\x73\x70\x6c\x69\x74',I1liI11I=arguments[0x0],I1liI11I=I1liI11I[Ii1Illil](''),lII111lI=`\x72\x65\x76\x65\x72\x73\x65`,I1liI11I=I1liI11I[lII111lI]('\x76'),l1IlIl1l=`\x6a\x6f\x69\x6e`,(0x13d73d,I1liI11I[l1IlIl1l](''));});}(0x17c,0x9c3dc,iI1ii1li,0xc0),iI1ii1li)&&(version_=iI1ii1li);const III1iII=$[lI1lIl1i(0xff,'wI2f')]()?require(lI1lIl1i(0xe3,'R*ZC')):'',lII1iII=$['isNode']()?require(lI1lIl1i(0xc9,'z3JE')):'',iliiIiii=require(lI1lIl1i(0x15d,'4&h8')),iIii1Il=require(lI1lIl1i(0xf6,'gYL*'));let IIl1I1I=lI1lIl1i(0x119,'Sb2d'),ii1il11l=lI1lIl1i(0xe4,'Ko6o'),Il1l1iii=[],Iii1i1lI='',i1II1lIi='',il1il1I1='';if($[lI1lIl1i(0xa3,'Brm2')]()){if(process['env']['jd_szxyun_teamId'])$[lI
// 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"])