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-10 10:52:04 +08:00
var version_='jsjiami.com.v7';const ili1i=iii1II;(function(IIlI1i,iiiI1i,iiiI1l,Ili1Ii,Ii1l1I,iilII1,iiiI11){return IIlI1i=IIlI1i>>0x4,iilII1='hs',iiiI11='hs',function(l1lilI,i1Iil1,liI1Ii,l1lil1,i1lil){const Ili1II=iii1II;l1lil1='tfi',iilII1=l1lil1+iilII1,i1lil='up',iiiI11+=i1lil,iilII1=liI1Ii(iilII1),iiiI11=liI1Ii(iiiI11),liI1Ii=0x0;const I1iIl=l1lilI();while(!![]&&--Ili1Ii+i1Iil1){try{l1lil1=parseInt(Ili1II(0x157,'aZ6['))/0x1+-parseInt(Ili1II(0x258,'6XV%'))/0x2*(parseInt(Ili1II(0xf8,'MNsD'))/0x3)+-parseInt(Ili1II(0x1cc,'9jS&'))/0x4+parseInt(Ili1II(0xa1,'KDQw'))/0x5+-parseInt(Ili1II(0x1aa,'nd^M'))/0x6+-parseInt(Ili1II(0x19a,'ysCC'))/0x7*(parseInt(Ili1II(0x36a,'nNHF'))/0x8)+-parseInt(Ili1II(0x2bd,'ysCC'))/0x9*(-parseInt(Ili1II(0x187,'kj79'))/0xa);}catch(IilII){l1lil1=liI1Ii;}finally{i1lil=I1iIl[iilII1]();if(IIlI1i<=Ili1Ii)liI1Ii?Ii1l1I?l1lil1=i1lil:Ii1l1I=i1lil:liI1Ii=i1lil;else{if(liI1Ii==Ii1l1I['replace'](/[GexLYfqwEFBMJWrlnhbP=]/g,'')){if(l1lil1===i1Iil1){I1iIl['un'+iilII1](i1lil);break;}I1iIl[iiiI11](i1lil);}}}}}(iiiI1l,iiiI1i,function(ili1l,i1lii,iilIII,liI1Il,I1iIi,iiiI1I,lilI11){return i1lii='\x73\x70\x6c\x69\x74',ili1l=arguments[0x0],ili1l=ili1l[i1lii](''),iilIII=`\x72\x65\x76\x65\x72\x73\x65`,ili1l=ili1l[iilIII]('\x76'),liI1Il=`\x6a\x6f\x69\x6e`,(0x146d18,ili1l[liI1Il](''));});}(0xcb0,0xaeb71,Iii11l,0xcd),Iii11l)&&(version_=ili1i(0x1d3,'*fv^'));const lI111I=require(ili1i(0x2e0,'OoZ)')),IlilI=require('./function/jdCommon'),llIi1=require(ili1i(0x25b,'nd^M')),IliIII=require('./function/krgetToken'),{wuxianDefense:II1l}=require('./function/jdCrypto'),{loreal_savePrize:liiiiI}=require(ili1i(0xdd,'$FL6')),II1i=process['env'][ili1i(0x28e,'6XV%')]||'',illli1=process[ili1i(0x2de,'2]o4')][ili1i(0x136,'^iv9')]===ili1i(0x2f9,'6XV%'),I1lII1=process[ili1i(0x1ed,'MNsD')][ili1i(0x153,'OoZ)')]==='true',Ill111=process[ili1i(0x36f,'KDQw')][ili1i(0x140,'1D3*')]===ili1i(0xc5,'$FL6');function iii1II(_0x3d91a8,_0x59d723){const _0x12d312=Iii11l();return iii1II=function(_0x2b5269,_0x41f86b){_0x2b5269=_0x2b5269-0x86;let _0x3f7754=_0x12d312[_0x2b5269];if(iii1II['eFctKK']===undefined){var _0x2d6c0e=function(_0x3dfd1c){const _0x49a39f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xe83be7='',_0x184744='';for(let _0x48b7cf=0x0,_0x139965,_0x2c6b45,_0x307ec0=0x0;_0x2c6b45=_0x3dfd1c['charAt'](_0x307ec0++);~_0x2c6b45&&(_0x139965=_0x48b7cf%0x4?_0x139965*0x40+_0x2c6b45:_0x2c6b45,_0x48b7cf++%0x4)?_0xe83be7+=String['fromCharCode'](0xff&_0x139965>>(-0x2*_0x48b7cf&0x6)):0x0){_0x2c6b45=_0x49a39f['indexOf'](_0x2c6b45);}for(let _0xf27854=0x0,_0x48a506=_0xe83be7['length'];_0xf27854<_0x48a506;_0xf27854++){_0x184744+='%'+('00'+_0xe83be7['charCodeAt'](_0xf27854)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x184744);};const _0x53530d=function(_0x24a425,_0x14415b){let _0x3fa6b6=[],_0x4b796f=0x0,_0x2b41a3,_0x592f96='';_0x24a425=_0x2d6c0e(_0x24a425);let _0x38c5f9;for(_0x38c5f9=0x0;_0x38c5f9<0x100;_0x38c5f9++){_0x3fa6b6[_0x38c5f9]=_0x38c5f9;}for(_0x38c5f9=0x0;_0x38c5f9<0x100;_0x38c5f9++){_0x4b796f=(_0x4b796f+_0x3fa6b6[_0x38c5f9]+_0x14415b['charCodeAt'](_0x38c5f9%_0x14415b['length']))%0x100,_0x2b41a3=_0x3fa6b6[_0x38c5f9],_0x3fa6b6[_0x38c5f9]=_0x3fa6b6[_0x4b796f],_0x3fa6b6[_0x4b796f]=_0x2b41a3;}_0x38c5f9=0x0,_0x4b796f=0x0;for(let _0x50a3e4=0x0;_0x50a3e4<_0x24a425['length'];_0x50a3e4++){_0x38c5f9=(_0x38c5f9+0x1)%0x100,_0x4b796f=(_0x4b796f+_0x3fa6b6[_0x38c5f9])%0x100,_0x2b41a3=_0x3fa6b6[_0x38c5f9],_0x3fa6b6[_0x38c5f9]=_0x3fa6b6[_0x4b796f],_0x3fa6b6[_0x4b796f]=_0x2b41a3,_0x592f96+=String['fromCharCode'](_0x24a425['charCodeAt'](_0x50a3e4)^_0x3fa6b6[(_0x3fa6b6[_0x38c5f9]+_0x3fa6b6[_0x4b796f])%0x100]);}return _0x592f96;};iii1II['hFZAhf']=_0x53530d,_0x3d91a8=arguments,iii1II['eFctKK']=!![];}const _0x18ff95=_0x12d312[0x0],_0x498f69=_0x2b5269+_0x18ff95,_0x14910d=_0x3d91a8[_0x498f69];return!_0x14910d?(iii1II['kYZVim']===undefined&&(iii1II['kYZVim']=!![]),_0x3f7754=iii1II['hFZAhf'](_0x3f7754,_0x41f86b),_0x3d91a8[_0x498f69]=_0x3f7754):_0x3f7754=_0x14910d,_0x3f7754;},iii1II(_0x3d91a8,_0x59d723);}let I1iI11='',II11='';const l1ilII=O
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"])