KR/jd_wxCollectionActivity.js

30 lines
130 KiB
JavaScript
Raw Normal View History

2023-07-27 16:14:01 +08:00
/*
活动名称加购有礼 · 超级无线
活动链接https://lzkj-isv.isvjcloud.com/wxCollectionActivity/activity?activityId=<活动id>
https://cjhy-isv.isvjcloud.com/wxCollectionActivity/activity?activityId=<活动id>
https://lzkj-isv.isvjd.com/wxCollectionActivity/activity2/activity?activityId=<活动id>
https://cjhy-isv.isvjd.com/wxCollectionActivity/activity2/activity?activityId=<活动id>
环境变量
jd_wxCollectionActivity_activityUrl // 活动链接
jd_wxCollectionActivity_openCard // 默认不开卡
jd_wxCollectionActivity_blacklist 黑名单 &隔开 pin值
JD_LZ_OPEN // 是否开启LZ活动运行默认运行
JD_CJ_OPEN // 是否开启CJ活动运行默认运行
需要安装依赖 ds
支持缓存token 需要在容器安装依赖
npm install -g ds 或者直接在青龙面板-依赖管理-添加依赖-类型 nodejs -名称ds 安装即可使用
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#加购有礼通用-加密
1 1 1 1 * jd_wxCollectionActivity.js, tag=加购有礼通用-加密, enabled=true
*/
const $ = new Env('加购有礼(超级无线/超级会员)')
2023-10-29 10:39:53 +08:00
var version_='jsjiami.com.v7';const I1lIl1i=ilIiIIl;(function(III1111,lIl1iill,I11IIii,liiIlili,I1llli1l,iii1II1i,lIill1I1){return III1111=III1111>>0x7,iii1II1i='hs',lIill1I1='hs',function(IlIiIIll,IIli1ii,iii1lIIl,iiIIII1,ll1li){const lIiiilli=ilIiIIl;iiIIII1='tfi',iii1II1i=iiIIII1+iii1II1i,ll1li='up',lIill1I1+=ll1li,iii1II1i=iii1lIIl(iii1II1i),lIill1I1=iii1lIIl(lIill1I1),iii1lIIl=0x0;const lI1IlIIi=IlIiIIll();while(!![]&&--liiIlili+IIli1ii){try{iiIIII1=-parseInt(lIiiilli(0x659,'45%m'))/0x1+parseInt(lIiiilli(0x4a3,'Gykh'))/0x2*(parseInt(lIiiilli(0x2f7,'Axo*'))/0x3)+-parseInt(lIiiilli(0x4c0,'m0je'))/0x4+parseInt(lIiiilli(0x688,'@S%#'))/0x5+-parseInt(lIiiilli(0x542,'@f6t'))/0x6*(-parseInt(lIiiilli(0x46b,'Ua)6'))/0x7)+-parseInt(lIiiilli(0x4e6,'Axo*'))/0x8+parseInt(lIiiilli(0x4d9,'@S%#'))/0x9;}catch(I11iiIi){iiIIII1=iii1lIIl;}finally{ll1li=lI1IlIIi[iii1II1i]();if(III1111<=liiIlili)iii1lIIl?I1llli1l?iiIIII1=ll1li:I1llli1l=ll1li:iii1lIIl=ll1li;else{if(iii1lIIl==I1llli1l['replace'](/[KJdMHqTRxPAYCQrgDeXtN=]/g,'')){if(iiIIII1===IIli1ii){lI1IlIIi['un'+iii1II1i](ll1li);break;}lI1IlIIi[lIill1I1](ll1li);}}}}}(I11IIii,lIl1iill,function(lli11l,Ill1lll,lIii1IIl,i1i1IIil,lili1iII,ilIiiIIl,lIlI1l){return Ill1lll='\x73\x70\x6c\x69\x74',lli11l=arguments[0x0],lli11l=lli11l[Ill1lll](''),lIii1IIl=`\x72\x65\x76\x65\x72\x73\x65`,lli11l=lli11l[lIii1IIl]('\x76'),i1i1IIil=`\x6a\x6f\x69\x6e`,(0x144ea3,lli11l[i1i1IIil](''));});}(0x5e80,0x678f5,i111IIiI,0xbf),i111IIiI)&&(version_=I1lIl1i(0x1a4,'Axo*'));const l1ililIl=$[I1lIl1i(0x50a,'Ua)6')]()?require('./jdCookie'):'',l1lI1iil=$[I1lIl1i(0x272,'JgwR')]()?require('./sendNotify'):'',IIIiIi1i=require(I1lIl1i(0x2cf,'z6uJ')),l1Il1Il=require(I1lIl1i(0x510,'m0je')),I11lIIII=require('./function/jdCommon'),i1I1lI1=require('./function/krwxSavePrize');let Illl1ll=process[I1lIl1i(0x5c3,'cF(P')][I1lIl1i(0x651,'V707')]?process[I1lIl1i(0x574,'@S%#')]['jd_wxCollectionActivity_activityUrl']:'',I11i1IlI=process[I1lIl1i(0x292,'kwfk')]['jd_wxCollectionActivity_openCard']===I1lIl1i(0x59c,'z6uJ')?!![]:![],i111l111={},i11II='',ili1l1li=0x28,IIiiIliI=[],ilIl1ll='',Il1IiI11='',lIiI1Il1='';messageTitle='';if($['isNode']()){if(JSON['stringify'](process[I1lIl1i(0x6a6,'%ww]')])[I1lIl1i(0x44f,'bt@H')](I1lIl1i(0x335,'Hb&f'))>-0x1)process['exit'](0x0);Object[I1lIl1i(0x46c,'MRbk')](l1ililIl)[I1lIl1i(0x433,'cF(P')](l1liilI=>{const lIIiili=I1lIl1i;IIiiIliI[lIIiili(0x691,'ZrSQ')](l1ililIl[l1liilI]);});if(process[I1lIl1i(0x6f3,'45%m')][I1lIl1i(0x353,'Hb&f')]&&process[I1lIl1i(0x35a,'oaAS')]['JD_DEBUG']===I1lIl1i(0x3fb,'@f6t'))console[I1lIl1i(0x61b,'lB%d')]=()=>{};}else IIiiIliI=[$[I1lIl1i(0x529,'@S%#')](I1lIl1i(0x2db,'z6uJ')),$[I1lIl1i(0x634,'z6uJ')]('CookieJD2'),...$[I1lIl1i(0x2b8,'Bh)i')]($[I1lIl1i(0x1dc,'Si2B')](I1lIl1i(0x344,'Ua)6'))||'[]')['map'](IlIi1II=>IlIi1II['cookie'])]['filter'](iIl11iii=>!!iIl11iii);let li11l11l=process[I1lIl1i(0x454,'I&iB')][I1lIl1i(0x396,'%ww]')]?process[I1lIl1i(0x29e,'z(M!')][I1lIl1i(0x3da,'Si2B')]:'true',Il1ii1lI=process[I1lIl1i(0x29e,'z(M!')]['JD_CJ_OPEN']?process[I1lIl1i(0x69b,'z6uJ')]['JD_CJ_OPEN']:'true',IliIIIlI='',iIi11I11='';$[I1lIl1i(0x37a,'MRbk')]=process[I1lIl1i(0x524,'Si2B')][I1lIl1i(0x241,'oKOZ')]||IliIIIlI,$[I1lIl1i(0x43d,'jci9')]=process['env'][I1lIl1i(0x5f4,'MW^)')]||iIi11I11,IiIii1ll(),l11il1I();if(Illl1ll){const Ii11Iiii=I1lIl1i(0x623,'bt@H')[I1lIl1i(0x700,'qD&$')]('|');let IIIliIi1=0x0;while(!![]){switch(Ii11Iiii[IIIliIi1++]){case'0':if($[I1lIl1i(0x6b5,'z(M!')]['includes'](I1lIl1i(0x385,'GPan')))$['domain_mode']=I1lIl1i(0x65e,'45%m');continue;case'1':$['errMsg']=null;continue;case'2':$[I1lIl1i(0x6b5,'z(M!')]['includes']('lzkj')&&($['domain_mode']='lzkj',$[I1lIl1i(0x1f9,'oKOZ')]='lzkj-isv.isvjd.com');continue;case'3':if($[I1lIl1i(0x35c,'p6$X')]==null){console['log']('请填写正确的活动链接');return;}continue;case'4':if(Illl1ll[I1lIl1i(0x2b3,'gVvc')](I1lIl1i(0x35d,'@f6t'))){if(li11l11l===I1lIl1i(0x49c,'qibj')){console['log'](I1lIl1i(0x285,'Bh)i'));return;}else $[I1lIl1i(0x489,'jm#D')]=Illl1ll['match'](/https?:\/\/([^/]+)/)[0x1];}else{if(Illl1ll[I1lIl1i(0x2f0,'qibj')]('cjhy')){if(I
2023-07-27 16:14:01 +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"])