KR/jd_shopSign.js

29 lines
102 KiB
JavaScript
Raw Normal View History

2023-08-06 19:11:07 +08:00
/*
活动名称店铺签到 · 超级无线/超级会员/lorealjdcampaign
活动链接https://lzkj-isv.isvjd.com/sign/sevenDay/signActivity?activityId=<活动id>
https://lzkj-isv.isvjd.com/sign/signActivity2?activityId=<活动id>
https://cjhy-isv.isvjcloud.com/sign/sevenDay/signActivity?activityId=<活动id>
https://cjhy-isv.isvjcloud.com/sign/signActivity?activityId=<活动id>
https://lorealjdcampaign-rc.isvjcloud.com/prod/cc/cjwx/sign/signActivity2?activityId=<活动id>
2023-09-27 09:24:23 +08:00
环境变量jd_shopSign_activityUrl // 活动链接
jd_shopSign_joinMember // 是否入会true/false默认不入会
jd_shopSign_notify // 是否推送通知true/false默认不推送
jd_shopSign_blacklist 黑名单 &隔开 pin值
JD_LZ_OPEN // 是否开启LZ活动运行默认运行
JD_CJ_OPEN // 是否开启CJ活动运行默认运行
jd_shopSign_break // 493后继续执行默认退出运行true/false
此脚本主要监控使用,部分活动需要加入会员才能签到
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#无线店铺签到
1 1 1 1 * jd_shopSign.js, tag=无线店铺签到, enabled=true
2023-08-06 19:11:07 +08:00
*/
const $ = new Env('无线店铺签到(超级无线/超级会员)')
2023-09-30 18:00:56 +08:00
var version_='jsjiami.com.v7';const Iliilli=ilIIiI1i;(function(illiIIi,il11llI1,i111i1Il,i1i1i1l,liilillI,Iil1i11l,I1IllliI){return illiIIi=illiIIi>>0x6,Iil1i11l='hs',I1IllliI='hs',function(ii1lilIl,I11lI1l,Il111li1,Ii1l1IiI,iI1l1i1){const Ilil1III=ilIIiI1i;Ii1l1IiI='tfi',Iil1i11l=Ii1l1IiI+Iil1i11l,iI1l1i1='up',I1IllliI+=iI1l1i1,Iil1i11l=Il111li1(Iil1i11l),I1IllliI=Il111li1(I1IllliI),Il111li1=0x0;const iiili11=ii1lilIl();while(!![]&&--i1i1i1l+I11lI1l){try{Ii1l1IiI=parseInt(Ilil1III(0x313,'RltQ'))/0x1+-parseInt(Ilil1III(0x247,'k7g8'))/0x2*(parseInt(Ilil1III(0x2b3,'kl#w'))/0x3)+parseInt(Ilil1III(0x35d,'7%]P'))/0x4+parseInt(Ilil1III(0x120,'cYOz'))/0x5+-parseInt(Ilil1III(0x232,'oLI4'))/0x6+-parseInt(Ilil1III(0x4d2,'Ry$A'))/0x7+-parseInt(Ilil1III(0x1b2,'%I7g'))/0x8;}catch(llIlilII){Ii1l1IiI=Il111li1;}finally{iI1l1i1=iiili11[Iil1i11l]();if(illiIIi<=i1i1i1l)Il111li1?liilillI?Ii1l1IiI=iI1l1i1:liilillI=iI1l1i1:Il111li1=iI1l1i1;else{if(Il111li1==liilillI['replace'](/[TBJbQhwLgEDeGdUkWXOMY=]/g,'')){if(Ii1l1IiI===I11lI1l){iiili11['un'+Iil1i11l](iI1l1i1);break;}iiili11[I1IllliI](iI1l1i1);}}}}}(i111i1Il,il11llI1,function(lIill11i,i1llili,Il1I1l1i,illIIIIl,ll1lillI,Ii11l,I1lllli){return i1llili='\x73\x70\x6c\x69\x74',lIill11i=arguments[0x0],lIill11i=lIill11i[i1llili](''),Il1I1l1i=`\x72\x65\x76\x65\x72\x73\x65`,lIill11i=lIill11i[Il1I1l1i]('\x76'),illIIIIl=`\x6a\x6f\x69\x6e`,(0x14080d,lIill11i[illIIIIl](''));});}(0x30c0,0x2c242,iil11Il,0xc5),iil11Il)&&(version_=iil11Il);const l1iI11=$[Iliilli(0x39a,'ZZ]m')]()?require(Iliilli(0x346,'dOK[')):'',IiI1Iii=require('./function/jdCommon'),iIil1l1l=require(Iliilli(0x157,'k7g8')),l1liIiII=require(Iliilli(0xdf,'5E1u')),{wuxian_savePrize:iII11ll1}=require(Iliilli(0x2a9,'VxsX')),il1IlliI=require('crypto-js');let lii1l1II=[];const illlIili=process['env'][Iliilli(0x1b6,'PXxi')]||'',iiII11il=process[Iliilli(0x4ac,'4lFa')][Iliilli(0x3ca,'btHp')]===Iliilli(0x2e5,'Hyk5'),Ii1I1Ill=process[Iliilli(0x103,'04mp')][Iliilli(0x227,'4h%W')]===Iliilli(0x337,'@hti');let i1I11il1='',iliIlI1='',IIIi1ii='';if($[Iliilli(0x559,'oLI4')]()){if(JSON[Iliilli(0x3ed,'J58v')](process[Iliilli(0x396,'4im5')])[Iliilli(0x1b8,'%RQ&')]('GITHUB')>-0x1)process[Iliilli(0x449,'dOK[')](0x0);Object[Iliilli(0x255,'AL%o')](l1iI11)[Iliilli(0x44a,'Ry$A')](liI11111=>{const liiI11l=Iliilli;lii1l1II[liiI11l(0x387,'cR]h')](l1iI11[liI11111]);});if(process[Iliilli(0x1ab,'*Rmk')][Iliilli(0x405,'AL%o')]&&process[Iliilli(0x4f3,'Ry$A')][Iliilli(0x405,'AL%o')]===Iliilli(0x115,'PXxi'))console['log']=()=>{};}else lii1l1II=[$[Iliilli(0x234,'Dn!5')](Iliilli(0x421,'O9s0')),$[Iliilli(0x191,'cR]h')]('CookieJD2'),...$[Iliilli(0x263,'8&hp')]($[Iliilli(0x3e8,'4lFa')](Iliilli(0x306,'MKb0'))||'[]')[Iliilli(0x27b,'hOiI')](ilii1i1I=>ilii1i1I[Iliilli(0x3a0,'MKb0')])]['filter'](I1iIIli1=>!!I1iIIli1);!lii1l1II[0x0]&&($['msg']($['name'],Iliilli(0x1e7,'*Rmk')),process[Iliilli(0x432,'O]Ai')](0x1));const iilIIi=process[Iliilli(0x141,'hOiI')][Iliilli(0xf3,'04mp')]==='true';function iil11Il(){const lIilili=(function(){return[...[version_,'XeBYjhsMJGjEDJiQBakmi.TdOcbkoUgmDLE.Wvw7==','sXhcO8oZiM3cGxG','a8kjWP8','WQ/dOCkjWQvKeCkSWQldT2xcQfu','WQVdPrLBh217q8oV','WRyGWRTvWRW','WPZcPqNdRCoIBSoLWRK','rSkvztFcNCkZW5PZWOG','W6ZcNfC','etCvWPZcQa','lSkLWQ7dKSk/Emk7Dq','BMtcV8kYfsdcQa','A8kqW7XKtmoHW5fQWQO8','d8o6W50gW4e','i8k4WQ/dICkJvmkZy8kdW6NdN8kE','W5K9kG','xsHhW79N','WRJdRmoJ','W4WFiXyM','WRNdOWy','FvKhBmop','W6HQW7GojG','paZdIXVdPW','WPxdLsLPmq','aqtcKvqE','krGOW6Wf','ArxdGdhcMmku','WRVdQarIa1f7xSo8','gNOCW5RdMq','W7nKda','6i+k5y6mmmoAhttcM8onwwlcHSo25AAE6lso','WP3dPSohWPZdNx3dR8knWQi','ohb/WRNdMGXb','cwCRW7BdQW','WQ8mWRTDWPVcPh/cJG','nsZdSwddPq','AHJdJrhcICks','W7CerCo9ta','pSktdSo6WRpdVSo7WO4u','WQxdGX9FiG','WRhdMmkmWOqMW6xdUJ8','fdqpW48m','W4zHW4KweSkqmmkU','zXhcLCkRwCkpWP9ZW64Toa','W6zOgSosmMZcNmo5WQKv','mIpdOX/dUq','WOhdJNBdISoJ','ya1EW412','CXRdRtHgW6RcMNbTDHJdGW','WPXGW6D4zCkXba','WPZdJKJdVSoDWRu','5P+26iky6i2R5y+L55EG5OUN6yMK5P695lYT5Ocf77+q','WR7dI8k0WRHS','trVcSCoUgMxcMgtdHN41WQu','xX3cPSo1cxJcVhtdPq','W5ZdPCofWRW','WPtdR8kSh8kGW7tcKmodW5K8p2a','W7ldIdvdruxcS8oCW6K2W7rk'
2023-08-06 19:11:07 +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"])