KR/jd_daily.js

25 lines
92 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
活动名称每日抢好礼 · 超级无线/超级会员
2023-09-27 09:22:52 +08:00
活动链接https://lzkj-isv.isvjd.com/activity/daily/wx/indexPage?activityId=<活动id>
https://cjhy-isv.isvjcloud.com/activity/daily/wx/indexPage?activityId=<活动id>
环境变量jd_daily_activityUrl // 活动链接
jd_daily_joinMember // 是否开卡,默认不开卡
jd_daily_notify // 是否推送通知,默认不推送
jd_daily_blacklist 黑名单 &隔开 pin值
JD_LZ_OPEN // 是否开启LZ活动运行默认运行
JD_CJ_OPEN // 是否开启CJ活动运行默认运行
jd_daily_break // 493后继续执行默认退出运行true/false
2023-07-27 16:14:01 +08:00
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
2023-09-27 09:22:52 +08:00
#每日抢好礼通用活动
1 1 1 1 * jd_daily.js, tag=每日抢好礼通用活动, enabled=true
2023-07-27 16:14:01 +08:00
*/
const $ = new Env('每日抢好礼(超级无线/超级会员)')
2023-10-21 11:11:51 +08:00
var version_='jsjiami.com.v7';const iiill1lI=IIIi11l1;(function(ii1l1li,l11iiII,IIillil,liiI11,il1iI1ii,ii1iii1,IIiI1ill){return ii1l1li=ii1l1li>>0x7,ii1iii1='hs',IIiI1ill='hs',function(liIII1II,l1I1IIIi,Ii1I1l1i,i1ii1iI1,iIillli){const lliIIlli=IIIi11l1;i1ii1iI1='tfi',ii1iii1=i1ii1iI1+ii1iii1,iIillli='up',IIiI1ill+=iIillli,ii1iii1=Ii1I1l1i(ii1iii1),IIiI1ill=Ii1I1l1i(IIiI1ill),Ii1I1l1i=0x0;const ll1lI1l1=liIII1II();while(!![]&&--liiI11+l1I1IIIi){try{i1ii1iI1=parseInt(lliIIlli(0x3bd,'4k7z'))/0x1+parseInt(lliIIlli(0x22d,'c#iq'))/0x2+parseInt(lliIIlli(0x395,'e8Rz'))/0x3+parseInt(lliIIlli(0x38e,'dLZd'))/0x4*(-parseInt(lliIIlli(0x55a,'fKGQ'))/0x5)+parseInt(lliIIlli(0x4b1,'dLZd'))/0x6+parseInt(lliIIlli(0x4c0,'qc78'))/0x7+-parseInt(lliIIlli(0x3a1,'KbuF'))/0x8;}catch(iI1l1ilI){i1ii1iI1=Ii1I1l1i;}finally{iIillli=ll1lI1l1[ii1iii1]();if(ii1l1li<=liiI11)Ii1I1l1i?il1iI1ii?i1ii1iI1=iIillli:il1iI1ii=iIillli:Ii1I1l1i=iIillli;else{if(Ii1I1l1i==il1iI1ii['replace'](/[CUuTXtpYRdewDJybxGLHOBh=]/g,'')){if(i1ii1iI1===l1I1IIIi){ll1lI1l1['un'+ii1iii1](iIillli);break;}ll1lI1l1[IIiI1ill](iIillli);}}}}}(IIillil,l11iiII,function(lIl1iIli,IIlI1II,l11i1IlI,llii1l1i,i1lilIII,lilI1li1,I1Il1IIl){return IIlI1II='\x73\x70\x6c\x69\x74',lIl1iIli=arguments[0x0],lIl1iIli=lIl1iIli[IIlI1II](''),l11i1IlI=`\x72\x65\x76\x65\x72\x73\x65`,lIl1iIli=lIl1iIli[l11i1IlI]('\x76'),llii1l1i=`\x6a\x6f\x69\x6e`,(0x143ae7,lIl1iIli[llii1l1i](''));});}(0x5e80,0xd1469,I1ilIli,0xbf),I1ilIli)&&(version_=I1ilIli);const l1l111Ii=$[iiill1lI(0x491,'eDOM')]()?require('./jdCookie'):'',Ii11IIII=require(iiill1lI(0x3db,'#H*i')),IIlli1I1=require(iiill1lI(0x3c8,'!Q9B')),lIiIilli=require(iiill1lI(0x1f6,'pDeT')),{wuxian_savePrize:li11IIII}=require(iiill1lI(0x4b4,'@8yq')),iiil1Il1=require('crypto-js');let lllili1i=[];function I1ilIli(){const i111IIi1=(function(){return[...[version_,'RXUCjsyjHOeixTGabxmDYwiJpL.tBucOHohdm.v7==','CXNcOfFdIa','gmk4WOPwdq','lmkKxWldVq','8jwvLGm','amkNDG','e8kqWQu','kvNdUmoke8ooWRLqmCoBWPb7W7vQWOJdQG','W5CoWO4uW7JdJq','fmoSW7yEW6e','W50WzW','WRj7b3NdQCoYzdSNWQddT8oI','m1dcLCkjWQhdK8koW4i','W5eBBa','tCo6W4PjW5ZcMHKQqCk4t8kxW5tdSq','WR1Ht8kd','g8k9WQnhdG','qr9agH7dVc4m','lr3cVhpdTG','tebMfhfnW6vr','jgVdH8ovnG','W5pdLmkSc8oObxBcQmk0iJSqW4O','W5pcKmo2W5BcKG','W6eDBqK','CetcV37dOmkLv8oRWQHfF8o5W4ZcK8kyga7dHCo8W7tcO8k3','gSkZWQPbdW','WQCRWQldVSkL','tSkmFSo7WRyMW5m','WQ/dTCktbMu','sSoEWOjOWRm','W7tdSMFdQ8kbW5ddQf/cQCk3Amko','W7VcT8oQW7W','5yUX5yEt5BIL6zkQ5l6y5zoL5OIM5yM7','WR3cLmk8WRNdP8ol','W7fVW7pcRSonW4BdJmosW4uZ','WRr9bW','gmkIW4qEW483lWNdSqDNnNm','jeyUWR7cMW','W6eaBWhdTq','W6m7xmkgiSoXq8kPga','l8kkW44po8k7bgO','oCkmW5i2nCkKmw3cMW','W6tdNLtdRSkM','DoIVJUAYSEMgSoE+GEwnSoAwK+MwVUIVTo+/G+IUOEIbR+EYIUw9RUwmHUIdI+I/IUIINEwpL+MLN++9OSknAstcJSo8WRJcKmkBymkDWOLXW5zK','WRu4W4hdUSkq','WR93fa','nmk5hMlcQbVdLKmIyMVdLmoc','dshcL8k1WRO','W45aW47cNmo8W6FdUSoSW6S','WQ7ORB3MSzNLPzNOTBtVVP3cKZpdUmk+oCoZW4RcS1pcKI7cJSo8WRq','n1BcNmkwWOBdLW','mG7cT2ZdUSkU','WQdcGCk9WQldOCokg8ozW5nF','eSkAWRfxcSo9pq','vmkWqhdcUSoYW6pdGKXkBfm','W4NdQeeEpG','W64TEmotW50','W7iAtSoUW4ldNCk4pa','tmo1W5PQW57cKcWR','WRZcGCk0WQxdSa','gmotW6i','6zYA5Rg65PoX5l61','bfJdHSodcG','WQ4LW7ZdQmksAq','aCk8BWFdL8oSmJ0','W6K7xSoSW60','lxRdMSowdG','WQPXbbpdKW','lgymWQ/cHG','WOxcNSoXq8o2fcRcImk0kIGoW6pcQKBdMSoq','jeZcGmkv','jCkUW5/dJNiqoSkXW7LNxSoMyCk3lSkxW6ldVxXKDSkDqwPcW5LhW6/cVmo+WO1NlG5dWO83W4ZdPcRcMCkwW7y','WQtcT8knWPBdVq','dCkdWQHbW70','WODypYhdNG','lCkHWQ97W6e','77Yl5BEo5OMx5yMr6isr5yUD55QR6k2O5Ps56lws5z6U5z+NW4tdHa','uerXe1XlW75tia','W4e0WRGiW4e','WO9yCmkUmG','pSoJWO4Ina','W7tcVCo2W6JcKKS','W4mxWO8+W6q','omo1jGRdMW','ySoSxJ7dU17cJW','EtncWRtcSCkiW5pdJLH5WRicWQpcHeGflZFcGSoVFMSdW7ZcHH56DmoDW79iWRRcRa','W4BINltcPWhLTPdORABNV67LH7VLS7VLH4lPLlKlWPpNMjZLHllMTBlLIQjW','bSkhWRDbW7K5ba','l1VdQCoekCozWRDu','WPBMJk/LJyBLKRdLU57MLzFMJyZOPAFMN4pLPBROTOxcVCol','cSoUaZxdOCkLW6BdSG','WQ4SW55ukq','WOOHW5iLiW','W4BdM1iena','W4O7ySoFW6VdQW','WQ0yW4e','keCCW5eVke7dU3C','mcjAgCkL','W7ldPgFdPmkI','W70lECoqW43dSmkumh0ZWQXOWQhcS8oMt8kUWOdcJ8kWorbpmSkQW47cSCkBW5amDmoQWONcTCo/jhnsnghdGwO1WQpdKcipaI19afVcOmkdW4XNwSk/BcOEWObzW4pdMCkWWPbTWQ9mbSk3yql
2023-07-27 16:14:01 +08:00
// prettier-ignore
2023-09-27 09:22:52 +08:00
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"])