KR/jd_jinggeng_floor.js

18 lines
66 KiB
JavaScript
Raw Normal View History

2023-07-28 10:10:43 +08:00
/*
活动名称盖楼有礼 · 京耕
活动链接https://jinggeng-isv.isvjcloud.com/ql/front/floor?id=<活动id>&user_id=<店铺id>
环境变量jd_jinggeng_floor_activityUrl // 活动链接
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#盖楼有礼
1 1 1 1 * jd_jinggeng_floor.js, tag=盖楼有礼, enabled=true
*/
const $ = new Env('盖楼有礼(京耕)')
2023-07-28 10:29:22 +08:00
var version_='jsjiami.com.v7';const i1IiIl=iii1II;(function(i1IiI1,l1lIII,iII11i,l1iI1i,lIlllI,III1lI,I11i){return i1IiI1=i1IiI1>>0x7,III1lI='hs',I11i='hs',function(ll1IlI,I11l,Ili1l1,iilIil,illI1i){const ll1Ili=iii1II;iilIil='tfi',III1lI=iilIil+III1lI,illI1i='up',I11i+=illI1i,III1lI=Ili1l1(III1lI),I11i=Ili1l1(I11i),Ili1l1=0x0;const i1IiII=ll1IlI();while(!![]&&--l1iI1i+I11l){try{iilIil=-parseInt(ll1Ili(0x223,'0fAa'))/0x1+parseInt(ll1Ili(0x21b,'esP@'))/0x2*(-parseInt(ll1Ili(0x42e,'9phT'))/0x3)+-parseInt(ll1Ili(0x1cc,'C3k&'))/0x4*(parseInt(ll1Ili(0x22a,'0fAa'))/0x5)+-parseInt(ll1Ili(0x2b2,'&OMN'))/0x6+parseInt(ll1Ili(0x365,'^]]['))/0x7+-parseInt(ll1Ili(0x2d3,'O58['))/0x8*(-parseInt(ll1Ili(0x2ce,'Dd1L'))/0x9)+parseInt(ll1Ili(0x363,'1x6L'))/0xa*(parseInt(ll1Ili(0x3a6,'KYc5'))/0xb);}catch(illI1l){iilIil=Ili1l1;}finally{illI1i=i1IiII[III1lI]();if(i1IiI1<=l1iI1i)Ili1l1?lIlllI?iilIil=illI1i:lIlllI=illI1i:Ili1l1=illI1i;else{if(Ili1l1==lIlllI['replace'](/[YEqtbrTWVHUdCSfwGBugP=]/g,'')){if(iilIil===I11l){i1IiII['un'+III1lI](illI1i);break;}i1IiII[I11i](illI1i);}}}}}(iII11i,l1lIII,function(l1ll1I,i1lI1,l1ll11,I1I111,lIllli,lIllll,I11I){return i1lI1='\x73\x70\x6c\x69\x74',l1ll1I=arguments[0x0],l1ll1I=l1ll1I[i1lI1](''),l1ll11='\x72\x65\x76\x65\x72\x73\x65',l1ll1I=l1ll1I[l1ll11]('\x76'),I1I111='\x6a\x6f\x69\x6e',(0x1368b6,l1ll1I[I1I111](''));});}(0x5e00,0x9970f,Iii11l,0xbe),Iii11l)&&(version_=Iii11l);const iiiI1l=$['isNode']()?require(i1IiIl(0x3ec,'(BeR')):'',Ili1Ii=$[i1IiIl(0x3c8,']2xR')]()?require(i1IiIl(0x24c,'k[kC')):'',Ii1l1I=require('./function/krgetToken'),iilII1=require('./function/krh5st'),iiiI11=require(i1IiIl(0x42d,'3%Hu')),l1lilI=require('jsdom'),{JSDOM:i1Iil1}=l1lilI;let liI1Ii={},l1lil1=[],i1lil='',I1iIl='';$[i1IiIl(0x1f1,'ON[p')]=![];let IilII=0x2,ili1l=![],i1lii=[],iilIII='',liI1Il='',I1iIi='';if($[i1IiIl(0x353,'3%Hu')]()){if(JSON['stringify'](process['env'])['indexOf'](i1IiIl(0x2c2,'7eR2'))>-0x1)process[i1IiIl(0x3e0,'lgD@')](0x0);Object[i1IiIl(0x2ea,'n[wP')](Ili1Ii)['forEach'](l1lill=>{i1lii['push'](Ili1Ii[l1lill]);});if(process[i1IiIl(0x2dd,'!)7u')]['JD_DEBUG']&&process[i1IiIl(0x287,'KYc5')][i1IiIl(0x313,'n[wP')]===i1IiIl(0x42f,'^]]['))console[i1IiIl(0x36b,'ON[p')]=()=>{};}else i1lii=[$[i1IiIl(0x227,'(BeR')]('CookieJD'),$[i1IiIl(0x253,'&OMN')](i1IiIl(0x383,'OzwO')),...$['toObj']($[i1IiIl(0x295,'#r$5')](i1IiIl(0x37f,'6J24'))||'[]')['map'](i1li1=>i1li1[i1IiIl(0x221,'^]][')])][i1IiIl(0x315,'7eR2')](iIIllI=>!!iIIllI);function iii1II(_0x5598c4,_0x429331){const _0x15f0a6=Iii11l();return iii1II=function(_0x528fc6,_0x3bfad5){_0x528fc6=_0x528fc6-0x1c8;let _0x45fbf6=_0x15f0a6[_0x528fc6];if(iii1II['nEVmfe']===undefined){var _0x2ffe93=function(_0x250cbc){const _0x4d352b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x56839e='',_0x83ec58='';for(let _0x5b0ea1=0x0,_0x3b734e,_0x24e0c3,_0x76e371=0x0;_0x24e0c3=_0x250cbc['charAt'](_0x76e371++);~_0x24e0c3&&(_0x3b734e=_0x5b0ea1%0x4?_0x3b734e*0x40+_0x24e0c3:_0x24e0c3,_0x5b0ea1++%0x4)?_0x56839e+=String['fromCharCode'](0xff&_0x3b734e>>(-0x2*_0x5b0ea1&0x6)):0x0){_0x24e0c3=_0x4d352b['indexOf'](_0x24e0c3);}for(let _0x3facb4=0x0,_0x49578c=_0x56839e['length'];_0x3facb4<_0x49578c;_0x3facb4++){_0x83ec58+='%'+('00'+_0x56839e['charCodeAt'](_0x3facb4)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x83ec58);};const _0x5adfe0=function(_0x15548c,_0xfcec9a){let _0x2b1d02=[],_0x36b9a4=0x0,_0x524116,_0x4b0035='';_0x15548c=_0x2ffe93(_0x15548c);let _0x309ee5;for(_0x309ee5=0x0;_0x309ee5<0x100;_0x309ee5++){_0x2b1d02[_0x309ee5]=_0x309ee5;}for(_0x309ee5=0x0;_0x309ee5<0x100;_0x309ee5++){_0x36b9a4=(_0x36b9a4+_0x2b1d02[_0x309ee5]+_0xfcec9a['charCodeAt'](_0x309ee5%_0xfcec9a['length']))%0x100,_0x524116=_0x2b1d02[_0x309ee5],_0x2b1d02[_0x309ee5]=_0x2b1d02[_0x36b9a4],_0x2b1d02[_0x36b9a4]=_0x524116;}_0x309ee5=0x0,_0x36b9a4=0x0;for(let _0x26b9cd=0x0;_0x26b9cd<_0x15548c['length'];_0x26b9cd++){_0x309ee5=(_0x309ee5+0x1)%0x100,_0x36b9a4=(_0x36b9a4+_0x2b1d02[_0x309ee5])%0x100,_0x524116=_0x2b1d02[_0x309ee5],_0x2b1d02[_0x309ee5]=_0x2b1d02[_0x36b9a4],_0x2b1d02[_0x36b9a4]=_0x524116,_0x4b00
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"])