KR/jd_wxTeam.js

25 lines
132 KiB
JavaScript
Raw Normal View History

2023-08-01 16:47:55 +08:00
/*
活动名称组队瓜分奖品 · 超级无线/超级会员
2023-09-28 08:29:17 +08:00
活动链接https://lzkj-isv.isvjd.com/wxTeam/activity2/activity?activityId=<活动id>
https://cjhy-isv.isvjcloud.com/wxTeam/activity?activityId=<活动id>
2023-08-01 16:47:55 +08:00
环境变量jd_wxTeam_activityUrl // 活动链接(必填)
2023-10-28 08:28:03 +08:00
jd_wxTeam_joinMember // 是否入会true/false默认入会
2023-08-01 16:47:55 +08:00
jd_wxTeam_Notify // 是否推送通知true/false默认不推送
2023-08-05 19:19:49 +08:00
jd_wxTeam_Concurrent // 是否启用并发模式true/false默认不开启
2023-10-31 18:04:33 +08:00
jd_wxTeam_maxConcurrency // 控制并发线程数正整数默认3
2023-09-28 08:29:17 +08:00
jd_wxTeam_blacklist 黑名单 &隔开 pin值
JD_LZ_OPEN // 是否开启LZ活动运行默认运行
JD_CJ_OPEN // 是否开启CJ活动运行默认运行
jd_wxTeam_break // 493后继续执行默认退出运行true/false
2023-08-01 16:47:55 +08:00
2023-10-22 13:28:19 +08:00
队长无效或无法创建战队时会退出执行并发模式下也支持入会
2023-08-01 16:47:55 +08:00
2023-10-28 08:28:03 +08:00
cron: 7 7 7 7 * jd_wxTeam.js
2023-08-01 16:47:55 +08:00
*/
const $ = new Env('组队瓜分奖品(超级无线/超级会员)')
2023-11-30 22:54:08 +08:00
var il='jsjiami.com.v7';const i1iI1=iii1II;(function(lII11I,ii111I,iilIi,ill1li,ililii,il1il1,iilIl){return lII11I=lII11I>>0x8,il1il1='hs',iilIl='hs',function(lII111,I1liI,ill1ll,Il11iI,ililil){const iilII=iii1II;Il11iI='tfi',il1il1=Il11iI+il1il1,ililil='up',iilIl+=ililil,il1il1=ill1ll(il1il1),iilIl=ill1ll(iilIl),ill1ll=0x0;const IlIIIl=lII111();while(!![]&&--ill1li+I1liI){try{Il11iI=parseInt(iilII(0x653,'q]%4'))/0x1+-parseInt(iilII(0x293,'wTCQ'))/0x2*(-parseInt(iilII(0x12e,'MR^w'))/0x3)+parseInt(iilII(0x26d,'qV!t'))/0x4*(-parseInt(iilII(0x4ff,'6Q7g'))/0x5)+parseInt(iilII(0x5b6,'qtMO'))/0x6+-parseInt(iilII(0x48f,'u1mN'))/0x7*(-parseInt(iilII(0x23a,'t!g3'))/0x8)+-parseInt(iilII(0x253,'me$n'))/0x9+-parseInt(iilII(0x17a,'6Q7g'))/0xa;}catch(lI1il){Il11iI=ill1ll;}finally{ililil=IlIIIl[il1il1]();if(lII11I<=ill1li)ill1ll?ililii?Il11iI=ililil:ililii=ililil:ill1ll=ililil;else{if(ill1ll==ililii['replace'](/[LlDRgEUNfTSOeWnQIByF=]/g,'')){if(Il11iI===I1liI){IlIIIl['un'+il1il1](ililil);break;}IlIIIl[iilIl](ililil);}}}}}(iilIi,ii111I,function(llilI1,IlIIIi,lI1ii,lii1i1,lIIIiI,ii111l,ii111i){return IlIIIi='\x73\x70\x6c\x69\x74',llilI1=arguments[0x0],llilI1=llilI1[IlIIIi](''),lI1ii=`\x72\x65\x76\x65\x72\x73\x65`,llilI1=llilI1[lI1ii]('\x76'),lii1i1=`\x6a\x6f\x69\x6e`,(0x1499c4,llilI1[lii1i1](''));});}(0xc900,0xc90e6,Iii11l,0xcb),Iii11l)&&(il=Iii11l);const II1iIl=$[i1iI1(0x4b7,'Ye6!')]()?require(i1iI1(0x2a2,'ODU]')):'',II1iIi=require('./function/jdCommon'),iI1iI=require('./function/sendJDNotify'),Ii11I1=require(i1iI1(0x13a,'hSI8')),li1IiI=require(i1iI1(0x33e,'MR^w'));let Illl=[];function iii1II(_0x582163,_0x57eb31){const _0x222807=Iii11l();return iii1II=function(_0x2dafe5,_0x30cb75){_0x2dafe5=_0x2dafe5-0x129;let _0x205d17=_0x222807[_0x2dafe5];if(iii1II['sbcGFo']===undefined){var _0x2462d1=function(_0x436587){const _0x3ab3be='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x80c2cf='',_0x1c54ab='';for(let _0x474495=0x0,_0x9359d9,_0x5255e3,_0x349df4=0x0;_0x5255e3=_0x436587['charAt'](_0x349df4++);~_0x5255e3&&(_0x9359d9=_0x474495%0x4?_0x9359d9*0x40+_0x5255e3:_0x5255e3,_0x474495++%0x4)?_0x80c2cf+=String['fromCharCode'](0xff&_0x9359d9>>(-0x2*_0x474495&0x6)):0x0){_0x5255e3=_0x3ab3be['indexOf'](_0x5255e3);}for(let _0x5d317e=0x0,_0x15bfff=_0x80c2cf['length'];_0x5d317e<_0x15bfff;_0x5d317e++){_0x1c54ab+='%'+('00'+_0x80c2cf['charCodeAt'](_0x5d317e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1c54ab);};const _0x5d79ed=function(_0x596b91,_0x3be0b8){let _0x34d259=[],_0x2438e7=0x0,_0x490145,_0x39b2e5='';_0x596b91=_0x2462d1(_0x596b91);let _0xccc2c3;for(_0xccc2c3=0x0;_0xccc2c3<0x100;_0xccc2c3++){_0x34d259[_0xccc2c3]=_0xccc2c3;}for(_0xccc2c3=0x0;_0xccc2c3<0x100;_0xccc2c3++){_0x2438e7=(_0x2438e7+_0x34d259[_0xccc2c3]+_0x3be0b8['charCodeAt'](_0xccc2c3%_0x3be0b8['length']))%0x100,_0x490145=_0x34d259[_0xccc2c3],_0x34d259[_0xccc2c3]=_0x34d259[_0x2438e7],_0x34d259[_0x2438e7]=_0x490145;}_0xccc2c3=0x0,_0x2438e7=0x0;for(let _0x3a5337=0x0;_0x3a5337<_0x596b91['length'];_0x3a5337++){_0xccc2c3=(_0xccc2c3+0x1)%0x100,_0x2438e7=(_0x2438e7+_0x34d259[_0xccc2c3])%0x100,_0x490145=_0x34d259[_0xccc2c3],_0x34d259[_0xccc2c3]=_0x34d259[_0x2438e7],_0x34d259[_0x2438e7]=_0x490145,_0x39b2e5+=String['fromCharCode'](_0x596b91['charCodeAt'](_0x3a5337)^_0x34d259[(_0x34d259[_0xccc2c3]+_0x34d259[_0x2438e7])%0x100]);}return _0x39b2e5;};iii1II['jwGsof']=_0x5d79ed,_0x582163=arguments,iii1II['sbcGFo']=!![];}const _0x3883ca=_0x222807[0x0],_0x5dd444=_0x2dafe5+_0x3883ca,_0x179def=_0x582163[_0x5dd444];return!_0x179def?(iii1II['ypBOvB']===undefined&&(iii1II['ypBOvB']=!![]),_0x205d17=iii1II['jwGsof'](_0x205d17,_0x30cb75),_0x582163[_0x5dd444]=_0x205d17):_0x205d17=_0x179def,_0x205d17;},iii1II(_0x582163,_0x57eb31);}const Illi=process[i1iI1(0x1af,'R(9a')]['jd_wxTeam_activityUrl']||'',l1IiiI=!(process[i1iI1(0x534,'1yZO')][i1iI1(0x38f,'QbJQ')]==='false'),II1iI1=process[i1iI1(0x348,'autR')]['jd_wxTeam_Notify']==='true',iI1i1=process[i1iI1(0x56d,'DtZ3')][i1iI1(0x162,'u1mN')]===i1iI1(0x4f8,'Vuap'),il11Il=process[i1iI1(0x4c2,'t!g3')][i1iI1(0x680,'4P2h')]||'3';le
2023-08-01 16:47:55 +08:00
// prettier-ignore
2023-09-28 08:29:17 +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"])