KR/jd_jinggeng_loadBlindBox.js

20 lines
84 KiB
JavaScript
Raw Normal View History

2023-07-28 10:10:43 +08:00
/*
活动名称惊喜开盲盒 · 京耕
活动链接https://jinggeng-isv.isvjcloud.com/ql/front/loadBlindBox?id=<活动id>&user_id=<店铺id>
环境变量jd_jinggeng_loadBlindBox_activityUrl // 活动链接
请使用本地IP环境 请使用本地IP环境 请使用本地IP环境
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#惊喜开盲盒
1 1 1 1 * jd_jinggeng_loadBlindBox.js, tag=惊喜开盲盒, enabled=true
*/
const $ = new Env('惊喜开盲盒(京耕)')
2023-07-28 10:29:22 +08:00
var version_='jsjiami.com.v7';const li1ll1=iii1II;(function(iI1iIi,iI1iIl,lili1i,iI1Ii,IiIIIl,IiIIIi,lI11l){return iI1iIi=iI1iIi>>0x1,IiIIIi='hs',lI11l='hs',function(iI1Il,i111il,i111ii,lI11i,ilI11){const lI1i1l=iii1II;lI11i='tfi',IiIIIi=lI11i+IiIIIi,ilI11='up',lI11l+=ilI11,IiIIIi=i111ii(IiIIIi),lI11l=i111ii(lI11l),i111ii=0x0;const li1llI=iI1Il();while(!![]&&--iI1Ii+i111il){try{lI11i=-parseInt(lI1i1l(0x285,'**)@'))/0x1*(parseInt(lI1i1l(0x152,'3wQK'))/0x2)+-parseInt(lI1i1l(0x2c1,'VY6]'))/0x3*(-parseInt(lI1i1l(0x2de,'QnkB'))/0x4)+-parseInt(lI1i1l(0x3c6,'YT)y'))/0x5*(parseInt(lI1i1l(0x3ff,'3wQK'))/0x6)+-parseInt(lI1i1l(0x1bb,'cYiP'))/0x7*(parseInt(lI1i1l(0x157,'HSAb'))/0x8)+parseInt(lI1i1l(0x1c8,'gG[1'))/0x9*(-parseInt(lI1i1l(0x3ee,'8S!N'))/0xa)+parseInt(lI1i1l(0x184,'3wQK'))/0xb+parseInt(lI1i1l(0x3eb,'Xk3W'))/0xc;}catch(lIil11){lI11i=i111ii;}finally{ilI11=li1llI[IiIIIi]();if(iI1iIi<=iI1Ii)i111ii?IiIIIl?lI11i=ilI11:IiIIIl=ilI11:i111ii=ilI11;else{if(i111ii==IiIIIl['replace'](/[NUQtHRxMEAnrhLgJu=]/g,'')){if(lI11i===i111il){li1llI['un'+IiIIIi](ilI11);break;}li1llI[lI11l](ilI11);}}}}}(lili1i,iI1iIl,function(iIilII,lIlI1,lIllI1,Ill1,lI1i1i,il1IiI,il1Ii1){return lIlI1='\x73\x70\x6c\x69\x74',iIilII=arguments[0x0],iIilII=iIilII[lIlI1](''),lIllI1='\x72\x65\x76\x65\x72\x73\x65',iIilII=iIilII[lIllI1]('\x76'),Ill1='\x6a\x6f\x69\x6e',(0x1368b8,iIilII[Ill1](''));});}(0x180,0x868c3,Iii11l,0xc2),Iii11l)&&(version_=Iii11l);const lIilI1=$['isNode']()?require('./sendNotify'):'',Il1I1l=$[li1ll1(0x143,'[PT(')]()?require('./jdCookie'):'',Ii1Il1=require(li1ll1(0x314,'Mpy0')),iIIIli=require(li1ll1(0x39b,'%syj')),I1IIll=require(li1ll1(0x373,'YctL'));let i1Ii1={},lIilII='',ilIlli='';function iii1II(_0x326c11,_0x4c4b03){const _0x39c498=Iii11l();return iii1II=function(_0xcc7f2,_0x221c85){_0xcc7f2=_0xcc7f2-0x6b;let _0x43515a=_0x39c498[_0xcc7f2];if(iii1II['QNrMHw']===undefined){var _0x50ef67=function(_0x224634){const _0x16d185='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5eef6a='',_0x364ee7='';for(let _0x18539b=0x0,_0x5e1766,_0x2cc477,_0x188e70=0x0;_0x2cc477=_0x224634['charAt'](_0x188e70++);~_0x2cc477&&(_0x5e1766=_0x18539b%0x4?_0x5e1766*0x40+_0x2cc477:_0x2cc477,_0x18539b++%0x4)?_0x5eef6a+=String['fromCharCode'](0xff&_0x5e1766>>(-0x2*_0x18539b&0x6)):0x0){_0x2cc477=_0x16d185['indexOf'](_0x2cc477);}for(let _0x5242e2=0x0,_0x539ac6=_0x5eef6a['length'];_0x5242e2<_0x539ac6;_0x5242e2++){_0x364ee7+='%'+('00'+_0x5eef6a['charCodeAt'](_0x5242e2)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x364ee7);};const _0x597fd0=function(_0x3f2286,_0x52b3a0){let _0x35c142=[],_0x15ed54=0x0,_0x534846,_0x3015d9='';_0x3f2286=_0x50ef67(_0x3f2286);let _0x387287;for(_0x387287=0x0;_0x387287<0x100;_0x387287++){_0x35c142[_0x387287]=_0x387287;}for(_0x387287=0x0;_0x387287<0x100;_0x387287++){_0x15ed54=(_0x15ed54+_0x35c142[_0x387287]+_0x52b3a0['charCodeAt'](_0x387287%_0x52b3a0['length']))%0x100,_0x534846=_0x35c142[_0x387287],_0x35c142[_0x387287]=_0x35c142[_0x15ed54],_0x35c142[_0x15ed54]=_0x534846;}_0x387287=0x0,_0x15ed54=0x0;for(let _0x424627=0x0;_0x424627<_0x3f2286['length'];_0x424627++){_0x387287=(_0x387287+0x1)%0x100,_0x15ed54=(_0x15ed54+_0x35c142[_0x387287])%0x100,_0x534846=_0x35c142[_0x387287],_0x35c142[_0x387287]=_0x35c142[_0x15ed54],_0x35c142[_0x15ed54]=_0x534846,_0x3015d9+=String['fromCharCode'](_0x3f2286['charCodeAt'](_0x424627)^_0x35c142[(_0x35c142[_0x387287]+_0x35c142[_0x15ed54])%0x100]);}return _0x3015d9;};iii1II['DtnNmr']=_0x597fd0,_0x326c11=arguments,iii1II['QNrMHw']=!![];}const _0x8a087=_0x39c498[0x0],_0x1c2ef3=_0xcc7f2+_0x8a087,_0x280365=_0x326c11[_0x1c2ef3];return!_0x280365?(iii1II['EnEVqq']===undefined&&(iii1II['EnEVqq']=!![]),_0x43515a=iii1II['DtnNmr'](_0x43515a,_0x221c85),_0x326c11[_0x1c2ef3]=_0x43515a):_0x43515a=_0x280365,_0x43515a;},iii1II(_0x326c11,_0x4c4b03);}$[li1ll1(0x150,'R8q$')]=![];let I1IIlI=0x2,ilIlll=![],Ii1Iii=[],Ii1Iil='',ll1IiI='',li1li='';if($['isNode']()){if(JSON[li1ll1(0x398,'[I%x')](process[li1ll1(0x26e,'ZPRq')])[li1ll1(0x339,'Yxx0')](li1ll1(0x3fe,'TqgT'))>-0x1)process['exit'](0x0);Object[li1ll1(0x1ea,'QB
2023-07-28 10:10:43 +08:00
// 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"])