KR/jd_wxMcLevelAndBirthGifts.js

24 lines
103 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
活动名称生日礼包/会员等级礼包 · 超级无线
活动链接https://cjhy-isv.isvjcloud.com/mc/wxMcLevelAndBirthGifts/activity?activityId=<活动id>
必须条件配置文件或者环境变量中添加变量
## CJ店铺生日和等级礼包-jd_wxMcLevelAndBirthGifts.js
//export jd_wxMcLevelAndBirthGifts_activityUrl // 活动链接
//export jd_wxMcLevelAndBirthGifts_num //运行账号数量默认运行前7
//export jd_wxMcLevelAndBirthGifts_openCard //是否开卡,需要开卡变量值为 true默认不开卡
//export JD_CJ_OPEN="false" //关闭CJ相关活动运行
//export jd_wxMcLevelAndBirthGifts_blacklist //黑名单 用&隔开 pin值
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#CJ店铺生日和等级礼包-加密
1 1 1 1 * jd_wxMcLevelAndBirthGifts.js, tag=CJ店铺生日和等级礼包-加密, enabled=true
*/
const $ = new Env("生日礼包和会员等级礼包");
var version_='jsjiami.com.v7';const iIlIII=iii1II;(function(iIiI1l,iIiI1i,lIili,II1I1I,iIlIIi,ilIl1i,ilIIIi){return iIiI1l=iIiI1l>>0x4,ilIl1i='hs',ilIIIi='hs',function(iIiI11,IIi1l,IIi1i,iIlII1,ilIIIl){const iIiI1I=iii1II;iIlII1='tfi',ilIl1i=iIlII1+ilIl1i,ilIIIl='up',ilIIIi+=ilIIIl,ilIl1i=IIi1i(ilIl1i),ilIIIi=IIi1i(ilIIIi),IIi1i=0x0;const iii=iIiI11();while(!![]&&--II1I1I+IIi1l){try{iIlII1=-parseInt(iIiI1I(0x12a,'!N08'))/0x1+-parseInt(iIiI1I(0xcd,'28uz'))/0x2+-parseInt(iIiI1I(0x4d8,'fJ&t'))/0x3*(parseInt(iIiI1I(0x162,'Y)Hy'))/0x4)+parseInt(iIiI1I(0x488,'oqFg'))/0x5*(-parseInt(iIiI1I(0x205,'3I[!'))/0x6)+-parseInt(iIiI1I(0x293,'Z6ww'))/0x7+-parseInt(iIiI1I(0x1dd,'DX]M'))/0x8*(-parseInt(iIiI1I(0x2a4,'1%7K'))/0x9)+parseInt(iIiI1I(0x364,'2%BO'))/0xa;}catch(lIlI){iIlII1=IIi1i;}finally{ilIIIl=iii[ilIl1i]();if(iIiI1l<=II1I1I)IIi1i?iIlIIi?iIlII1=ilIIIl:iIlIIi=ilIIIl:IIi1i=ilIIIl;else{if(IIi1i==iIlIIi['replace'](/[RChwxlTYdqXfQPgynrGFpM=]/g,'')){if(iIlII1===IIi1l){iii['un'+ilIl1i](ilIIIl);break;}iii[ilIIIi](ilIIIl);}}}}}(lIili,iIiI1i,function(liIiIi,iil,IlIii1,i1li1I,lIl1,i1li11,lII1l1){return iil='\x73\x70\x6c\x69\x74',liIiIi=arguments[0x0],liIiIi=liIiIi[iil](''),IlIii1='\x72\x65\x76\x65\x72\x73\x65',liIiIi=liIiIi[IlIii1]('\x76'),i1li1I='\x6a\x6f\x69\x6e',(0x136688,liIiIi[i1li1I](''));});}(0xc60,0xbfed2,Iii11l,0xc8),Iii11l)&&(version_=Iii11l);const iiii11=$['isNode']()?require(iIlIII(0x2c4,'pin4')):'',iIl1II=$[iIlIII(0x1d8,'ALSE')]()?require(iIlIII(0xf3,'[rv]')):'',il1lIi=require(iIlIII(0x479,'*pJm')),Ili1=require(iIlIII(0x341,'*pJm')),ii11iI=require('./function/krgetua');let i1IIl1={},I1IIl='';$['activityEnd']=![];let i1iiIi=['未开始',iIlIII(0x30f,'UW^B'),iIlIII(0x4ed,'xVNE'),'非法操作',iIlIII(0x1e6,'ALSE'),iIlIII(0x112,'T(nr'),iIlIII(0x107,'2sZv'),'已发完',iIlIII(0x24b,'*pJm'),iIlIII(0x12b,'#t2I'),'全部被领取',iIlIII(0x25c,'xVNE')],iiliII=[],i1iiIl='',I11llI='',I1IIi='',iiii1I=0x7;process[iIlIII(0x32c,'68rT')][iIlIII(0x467,'pvuh')]&&process[iIlIII(0x27c,'28uz')]['jd_wxMcLevelAndBirthGifts_num']!=0x7&&(iiii1I=process[iIlIII(0x4a7,'0jky')][iIlIII(0xb9,'VIr4')]);let lIlIi1=$[iIlIII(0x235,'wrZ0')]()?process[iIlIII(0x12e,'j%yC')][iIlIII(0x345,'SS7f')]?process[iIlIII(0x48d,'7iuV')][iIlIII(0x29e,'Pg1R')]:![]:$[iIlIII(0x171,'oqFg')](iIlIII(0x150,'QWp#'))?$[iIlIII(0x27a,'G3HU')](iIlIII(0x47f,'DX]M')):![],l1II1l=process['env'][iIlIII(0x248,'KVik')]?process[iIlIII(0x210,'XkSy')]['jd_wxMcLevelAndBirthGifts_activityUrl']:'';if($['isNode']()){if(JSON[iIlIII(0x411,'wrZ0')](process[iIlIII(0x481,'jIBV')])['indexOf'](iIlIII(0x355,'#t2I'))>-0x1)process[iIlIII(0x473,'wrZ0')](0x0);Object[iIlIII(0x1af,'r@P(')](iIl1II)['forEach'](I1l11=>{const iIIll=iIlIII;iiliII[iIIll(0x2b3,'QWp#')](iIl1II[I1l11]);});if(process[iIlIII(0x48d,'7iuV')][iIlIII(0x3be,'8p8%')]&&process[iIlIII(0x481,'jIBV')][iIlIII(0x192,'2%BO')]===iIlIII(0x263,'ALSE'))console['log']=()=>{};}else iiliII=[$[iIlIII(0x33e,'X$)Q')](iIlIII(0x520,'7iuV')),$[iIlIII(0x16a,'zcMr')]('CookieJD2'),...$[iIlIII(0x125,'fJ&t')]($[iIlIII(0x16a,'zcMr')](iIlIII(0x3dc,'Y)Hy'))||'[]')[iIlIII(0x49b,'4aPs')](lIl11I=>lIl11I[iIlIII(0x493,'28uz')])][iIlIII(0x28f,'G3HU')](lIiIIi=>!!lIiIIi);let i1IIlI=typeof $request!==iIlIII(0x18d,']FPv');i1IIlI&&(GetCookie(),$[iIlIII(0x38f,'SS7f')]());let ii11il=process[iIlIII(0x48d,'7iuV')][iIlIII(0x2c5,'0jky')]?process[iIlIII(0x525,'4aPs')]['JD_CJ_OPEN']:iIlIII(0x3e4,'ALSE'),il1lII='',iIi111='';$[iIlIII(0x2e9,'4aPs')]=process['env']['jd_wxMcLevelAndBirthGifts_whitelist']||il1lII,$[iIlIII(0x466,'2%BO')]=process[iIlIII(0x14e,'#t2I')][iIlIII(0x447,'!N08')]||iIi111,ii11l1(),i1IIll();if(l1II1l)activityId=ilI1l(''+l1II1l,'activityId'),$[iIlIII(0x23a,'Pg1R')]=l1II1l[iIlIII(0x212,'0jky')](/https?:\/\/([^/]+)/)[0x1];else{console[iIlIII(0x41c,'2sZv')]('请填写活动链接');return;}function Iii11l(){const I11=(function(){return[version_,'CdyljnsjriYwaQmFpPi.cCoQfmgR.vT7XxhXMqrG==','WRL/jCosW4S','WPJcUSoAFmkp','WQqHcIJcLW','WQ7cM18hcq','psLnWR/cKq','nWhcJa','W6ZdStVcSxHgW7/cHuFdQ8kfW5JdTf/dJYpcTCkWW7JcLCkrW63cUSkqW7ZcO34tCCkADvKowx0','WOirtY0lWPXXmM9gW6xdMa','WQ7dQCkfq8k6A
// 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"])