KR/jd_lzkj_loreal_dailyGrabs.js

21 lines
63 KiB
JavaScript
Raw Normal View History

2023-10-02 19:29:33 +08:00
/*
活动名称每日抢好礼超级无线
活动链接https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=10022&templateId=<模板id>&activityId=<活动id>&prd=cjwx
环境变量jd_lzkj_loreal_dailyGrabs_url // 活动链接
jd_lzkj_loreal_dailyGrabs_opencard // 是否入会true/false默认不入会
jd_lzkj_loreal_dailyGrabs_Notify // 是否推送通知true/false默认不推送
jd_lzkj_loreal_dailyGrabs_break // 493后继续执行默认退出运行true/false
2023-10-06 20:01:31 +08:00
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#每日抢好礼超级无线
1 1 1 1 * jd_lzkj_loreal_dailyGrabs.js, tag=每日抢好礼超级无线, enabled=true
2023-10-02 19:29:33 +08:00
*/
const $ = new Env('每日抢好礼(超级无线)')
2023-11-12 16:44:11 +08:00
var version_='jsjiami.com.v7';const Ii1l1I=iii1II;function iii1II(_0x53237f,_0x5cf0c3){const _0x5a86c6=Iii11l();return iii1II=function(_0x55fafd,_0x50508b){_0x55fafd=_0x55fafd-0xa4;let _0x979532=_0x5a86c6[_0x55fafd];if(iii1II['YbGUZN']===undefined){var _0x57481e=function(_0x45e0e6){const _0x38bd71='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5bd2e1='',_0x2ab08d='';for(let _0x4dd3ef=0x0,_0x394f8f,_0x470367,_0x346862=0x0;_0x470367=_0x45e0e6['charAt'](_0x346862++);~_0x470367&&(_0x394f8f=_0x4dd3ef%0x4?_0x394f8f*0x40+_0x470367:_0x470367,_0x4dd3ef++%0x4)?_0x5bd2e1+=String['fromCharCode'](0xff&_0x394f8f>>(-0x2*_0x4dd3ef&0x6)):0x0){_0x470367=_0x38bd71['indexOf'](_0x470367);}for(let _0x328598=0x0,_0x2ead23=_0x5bd2e1['length'];_0x328598<_0x2ead23;_0x328598++){_0x2ab08d+='%'+('00'+_0x5bd2e1['charCodeAt'](_0x328598)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2ab08d);};const _0xb0556=function(_0x33e18a,_0x393c93){let _0x29a5f2=[],_0x33b35b=0x0,_0x43791b,_0x3f0062='';_0x33e18a=_0x57481e(_0x33e18a);let _0x433ec;for(_0x433ec=0x0;_0x433ec<0x100;_0x433ec++){_0x29a5f2[_0x433ec]=_0x433ec;}for(_0x433ec=0x0;_0x433ec<0x100;_0x433ec++){_0x33b35b=(_0x33b35b+_0x29a5f2[_0x433ec]+_0x393c93['charCodeAt'](_0x433ec%_0x393c93['length']))%0x100,_0x43791b=_0x29a5f2[_0x433ec],_0x29a5f2[_0x433ec]=_0x29a5f2[_0x33b35b],_0x29a5f2[_0x33b35b]=_0x43791b;}_0x433ec=0x0,_0x33b35b=0x0;for(let _0x19bff4=0x0;_0x19bff4<_0x33e18a['length'];_0x19bff4++){_0x433ec=(_0x433ec+0x1)%0x100,_0x33b35b=(_0x33b35b+_0x29a5f2[_0x433ec])%0x100,_0x43791b=_0x29a5f2[_0x433ec],_0x29a5f2[_0x433ec]=_0x29a5f2[_0x33b35b],_0x29a5f2[_0x33b35b]=_0x43791b,_0x3f0062+=String['fromCharCode'](_0x33e18a['charCodeAt'](_0x19bff4)^_0x29a5f2[(_0x29a5f2[_0x433ec]+_0x29a5f2[_0x33b35b])%0x100]);}return _0x3f0062;};iii1II['rpbllS']=_0xb0556,_0x53237f=arguments,iii1II['YbGUZN']=!![];}const _0x33aa43=_0x5a86c6[0x0],_0x46ac34=_0x55fafd+_0x33aa43,_0x10746d=_0x53237f[_0x46ac34];return!_0x10746d?(iii1II['xQennT']===undefined&&(iii1II['xQennT']=!![]),_0x979532=iii1II['rpbllS'](_0x979532,_0x50508b),_0x53237f[_0x46ac34]=_0x979532):_0x979532=_0x10746d,_0x979532;},iii1II(_0x53237f,_0x5cf0c3);}(function(Ii11i,i1llI,iIIli1,Ii1l1i,l1lIl,Ii1l1l,i1Iiil){return Ii11i=Ii11i>>0x7,Ii1l1l='hs',i1Iiil='hs',function(i1Iiii,l1lIi,l1lili,IIlI1l,lI1I11){const Ili1Ii=iii1II;IIlI1l='tfi',Ii1l1l=IIlI1l+Ii1l1l,lI1I11='up',i1Iiil+=lI1I11,Ii1l1l=l1lili(Ii1l1l),i1Iiil=l1lili(i1Iiil),l1lili=0x0;const IilIl=i1Iiii();while(!![]&&--Ii1l1i+l1lIi){try{IIlI1l=-parseInt(Ili1Ii(0x25a,'gRJ['))/0x1*(-parseInt(Ili1Ii(0x318,'k5FR'))/0x2)+-parseInt(Ili1Ii(0x10b,'gRJ['))/0x3+parseInt(Ili1Ii(0x2c9,'gRJ['))/0x4+-parseInt(Ili1Ii(0x1bc,'uw8A'))/0x5*(parseInt(Ili1Ii(0x2dd,'4#8k'))/0x6)+-parseInt(Ili1Ii(0x19a,'n@KO'))/0x7+parseInt(Ili1Ii(0xf7,'uw8A'))/0x8*(-parseInt(Ili1Ii(0x37f,'sT]Y'))/0x9)+parseInt(Ili1Ii(0x38a,'UsYs'))/0xa;}catch(IilIi){IIlI1l=l1lili;}finally{lI1I11=IilIl[Ii1l1l]();if(Ii11i<=Ii1l1i)l1lili?l1lIl?IIlI1l=lI1I11:l1lIl=lI1I11:l1lili=lI1I11;else{if(l1lili==l1lIl['replace'](/[KOWJrnlbTktYERMSPh=]/g,'')){if(IIlI1l===l1lIi){IilIl['un'+Ii1l1l](lI1I11);break;}IilIl[i1Iiil](lI1I11);}}}}}(iIIli1,i1llI,function(Ili1Il,i1liI,iilIIi,I1iII,IIlI1i,iiiI1i,iiiI1l){return i1liI='\x73\x70\x6c\x69\x74',Ili1Il=arguments[0x0],Ili1Il=Ili1Il[i1liI](''),iilIIi=`\x72\x65\x76\x65\x72\x73\x65`,Ili1Il=Ili1Il[iilIIi]('\x76'),I1iII=`\x6a\x6f\x69\x6e`,(0x147120,Ili1Il[I1iII](''));});}(0x6580,0xb7ea8,Iii11l,0xcd),Iii11l)&&(version_=Ii1l1I(0x1eb,'M&QZ'));const l1ilIl=require(Ii1l1I(0x1a5,'4#8k')),IIiiIi=require(Ii1l1I(0x341,'v9eX')),l1ilIi=require('./function/sendJDNotify'),l11iIi=require('./function/krgetToken'),{wuxianDefense:ll11li}=require(Ii1l1I(0x25f,'EVjv')),{loreal_savePrize:iliIlI}=require(Ii1l1I(0x35d,'ns1C')),lI111I=process[Ii1l1I(0x221,'e27g')][Ii1l1I(0x258,'cFQZ')]||'',IlilI=process[Ii1l1I(0x195,'0&xA')][Ii1l1I(0x149,'6pTd')]==='true',llIi1=process[Ii1l1I(0x123,'gRJ[')][Ii1l1I(0x36a,'n@KO')]==='true',IliIII=process[Ii1l1I(0x293,'^1s#')]['jd_lzkj_loreal_dailyGrabs_break']===Ii1l1I(0x23c,'vUC$');let II1l='',liiiiI='
2023-10-02 19:29:33 +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"])