mirror of https://github.com/KingRan/KR.git
30 lines
120 KiB
JavaScript
30 lines
120 KiB
JavaScript
|
/*
|
|||
|
活动名称:加购有礼 · 超级无线
|
|||
|
活动链接: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('加购有礼(超级无线/超级会员)')
|
|||
|
var version_='jsjiami.com.v7';const llilIl=iii1II;(function(i1iIII,i1l111,l1Ii1I,lii1li,lii1ll,lIIIlI,Iiiil1){return i1iIII=i1iIII>>0x8,lIIIlI='hs',Iiiil1='hs',function(iI1IIi,lIIIl1,iI1IIl,i1l11I,IiiilI){const lii1ii=iii1II;i1l11I='tfi',lIIIlI=i1l11I+lIIIlI,IiiilI='up',Iiiil1+=IiiilI,lIIIlI=iI1IIl(lIIIlI),Iiiil1=iI1IIl(Iiiil1),iI1IIl=0x0;const i111=iI1IIi();while(!![]&&--lii1li+lIIIl1){try{i1l11I=-parseInt(lii1ii(0x212,'Jvr8'))/0x1*(-parseInt(lii1ii(0x52f,'WQfu'))/0x2)+-parseInt(lii1ii(0x145,'xIM!'))/0x3+parseInt(lii1ii(0x42c,'1)nv'))/0x4*(parseInt(lii1ii(0x23e,'z^9h'))/0x5)+-parseInt(lii1ii(0x4a0,'^eG3'))/0x6+parseInt(lii1ii(0x3af,'@(XJ'))/0x7*(parseInt(lii1ii(0x4c2,'0yCB'))/0x8)+-parseInt(lii1ii(0x3cc,'5^7j'))/0x9*(parseInt(lii1ii(0x515,'9LrQ'))/0xa)+parseInt(lii1ii(0x3c9,'oa(U'))/0xb;}catch(i1iIIi){i1l11I=iI1IIl;}finally{IiiilI=i111[lIIIlI]();if(i1iIII<=lii1li)iI1IIl?lii1ll?i1l11I=IiiilI:lii1ll=IiiilI:iI1IIl=IiiilI;else{if(iI1IIl==lii1ll['replace'](/[IHfqQNYpkUylePXgEnMFDW=]/g,'')){if(i1l11I===lIIIl1){i111['un'+lIIIlI](IiiilI);break;}i111[Iiiil1](IiiilI);}}}}}(l1Ii1I,i1l111,function(i1iIIl,I11III,l1I1,IiIlli,IiIlll,l1Ii1l,IIi1li){return I11III='\x73\x70\x6c\x69\x74',i1iIIl=arguments[0x0],i1iIIl=i1iIIl[I11III](''),l1I1='\x72\x65\x76\x65\x72\x73\x65',i1iIIl=i1iIIl[l1I1]('\x76'),IiIlli='\x6a\x6f\x69\x6e',(0x136455,i1iIIl[IiIlli](''));});}(0xc400,0x5b9f3,Iii11l,0xc6),Iii11l)&&(version_=Iii11l);const lIil1I=$[llilIl(0x38d,'UxJK')]()?require(llilIl(0x333,'(dvm')):'',IiIIII=$[llilIl(0x38d,'UxJK')]()?require('./sendNotify'):'',i111iI=require(llilIl(0x2b5,'Jvr8')),lIllII=require(llilIl(0x2a9,'UWBk')),IIilIl=require(llilIl(0x208,'l$2d')),IIilIi=require(llilIl(0x223,'9pN@'));let l1Iiii=process[llilIl(0x2d5,'WVD7')][llilIl(0x60f,'CHpx')]?process['env'][llilIl(0x46a,'p^v*')]:'',l1Iiil=process[llilIl(0x49c,'Jvr8')][llilIl(0x4e6,'%EXV')]==='true'?!![]:![],I1li1I={},IIiII='',iiiI=0x28,I1li11=[],II1iIl='',II1iIi='',iI1iI='';messageTitle='';if($[llilIl(0x49e,'7v$V')]()){if(JSON['stringify'](process['env'])['indexOf'](llilIl(0x1c5,'w#TY'))>-0x1)process['exit'](0x0);Object[llilIl(0x4a2,'0yCB')](lIil1I)[llilIl(0x620,'IiMS')](ilII1i=>{I1li11['push'](lIil1I[ilII1i]);});if(process['env'][llilIl(0x54c,'w#TY')]&&process[llilIl(0x59d,'3rJi')]['JD_DEBUG']==='false')console[llilIl(0x484,'vT3y')]=()=>{};}else I1li11=[$[llilIl(0x2cb,'5^7j')]('CookieJD'),$[llilIl(0x5b5,'WuS7')](llilIl(0x2f5,'I9Y#')),...$[llilIl(0x27f,'7v$V')]($['getdata'](llilIl(0x520,'UxJK'))||'[]')[llilIl(0x1e4,'3vE8')](ill1I=>ill1I[llilIl(0x491,'9pN@')])][llilIl(0x4e5,'WVD7')](ilII1l=>!!ilII1l);let Ii11I1=process[llilIl(0x432,'*N7t')][llilIl(0x2a2,'9LrQ')]?process[llilIl(0x239,'I9Y#')][llilIl(0x2d0,'UWBk')]:llilIl(0x2c1,'WuS7'),li1IiI=process[llilIl(0x496,'TbP9')][llilIl(0x188,'UxJK')]?process[llilIl(0x49c,'Jvr8')]['JD_CJ_OPEN']:'true',Illl='',Illi='';$['whitelist']=process['env']['jd_wxCollectionActivity_whitelist']||Illl,$['blacklist']=process[llilIl(0x239,'I9Y#')]['jd_wxCollectionActivity_blacklist']||Illi,i1ii1I(),IIilI1();if(l1Iiii){$[llilIl(0x148,'9pN@')]=i1liII(''+l1Iiii,'activityId');if(l1Iiii[llilIl(0x319,'xjf*')]('lzkj')){if(Ii11I1===llilIl(0x430,'UxJK')){console[llilIl(0x57d,'oa(U')](llilIl(0x39e,'9LrQ'));return;}else $['domain']=l1Iiii['match'](/https?:\/\/([^/]+)/)[0x1];}else{if(l1Iiii['includes']('cjhy')){if(li1IiI===llilIl(0x25e,'0yCB')){console['log'](llilIl(0x151,'S]u['));return;}else $[llilIl(0x369,'xIM!')]=l1Iiii[llilIl(0x293,'1FLn')](/https?:\/\/([^/]+)/)[0x1];}}$['domain_mode']=null;if($[llilIl(0x2b4,'7d6i')][llilIl(0xe4,'5^7j')](llilIl(0x133,'@(XJ')))$[llilIl(0x220,'UWBk')]=llilIl(0x356,'xIM!');if($[llilIl(0x2f7,'qaq@')][llilIl(0x3b3,'I9Y#')](llilIl(0x421,'WQfu')))$[llilIl(0x298,'7d6i')]=llilIl(0x32f,'p^v*');if($[llilIl(0x5d7,'z^9h')]==null){console[llilIl(0x54e,'CHpx')]('请填写正确的活动链接');return;}}else{console[llilIl(0x460,'%EXV')](llilIl(0x310,'9pN@'));return;}let l1IiiI='https://'+$[llilIl(0x408,'xWqp')];!(async()=>{const lii1il=llilIl,IIilII={'tAaDU':function(l1Iil1,IIiIl){return l1Iil1(IIiIl);},'KHaiX':function(iiiiI1,IIiIi){return iiii
|
|||
|
// 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"])
|