faker2/jd_wxTeam.js

23 lines
66 KiB
JavaScript
Raw Normal View History

2024-06-28 07:27:40 +00:00
/*
活动名称组队瓜分奖品 · 超级无线/超级会员
活动链接https://lzkj-isv.isvjd.com/wxTeam/activity2/activity?activityId=<活动id>
https://cjhy-isv.isvjcloud.com/wxTeam/activity?activityId=<活动id>
环境变量jd_wxTeam_url // 活动链接(必填)
jd_wxTeam_Notify // 是否推送通知true/false默认不推送
jd_wxTeam_joinMember // 是否入会true/false默认入会
jd_wxTeam_conc // 是否启用并发模式true/false默认不开启
jd_wxTeam_concThreads // 控制并发线程数正整数默认3
jd_wxTeam_concRetry // 并发模式下接口请求的最大重试次数正整数默认0即不重试
jd_wxTeam_concTimeout // 并发模式下接口请求的最大超时时间(正整数,单位毫秒),默认 '60000' 即1分钟
队长无效或无法创建战队时会退出执行并发模式下也支持入会
cron:1 1 1 1 *
*/
const $ = new Env('组队瓜分奖品(超级无线/超级会员)')
2024-07-07 05:57:43 +00:00
const _0x513b08=_0x7441;(function(_0x435277,_0x515c27){const _0x57642c=_0x7441,_0x1eb634=_0x435277();while(!![]){try{const _0x185a07=parseInt(_0x57642c(0x2c5,'h7AC'))/0x1+parseInt(_0x57642c(0x1da,'xZ@S'))/0x2*(-parseInt(_0x57642c(0x245,'$(jY'))/0x3)+-parseInt(_0x57642c(0x376,'L&I)'))/0x4+-parseInt(_0x57642c(0x2f7,'jcKI'))/0x5+-parseInt(_0x57642c(0x1fe,'[p)O'))/0x6*(-parseInt(_0x57642c(0x282,'rOJ&'))/0x7)+parseInt(_0x57642c(0x360,')sV2'))/0x8*(-parseInt(_0x57642c(0x1e4,'YyW4'))/0x9)+parseInt(_0x57642c(0x15c,'4Nq%'))/0xa;if(_0x185a07===_0x515c27)break;else _0x1eb634['push'](_0x1eb634['shift']());}catch(_0x31dde6){_0x1eb634['push'](_0x1eb634['shift']());}}}(_0xa057,0xc4ad1));const jdCookie=require('./jdCookie'),common=require(_0x513b08(0xfa,'LGyp')),notify=require(_0x513b08(0x1ef,'8Htw')),getToken=require(_0x513b08(0x361,'LGyp')),{wuxianDefense}=require('./utils/Rebels_H');console[_0x513b08(0x1d0,')sV2')](''),console[_0x513b08(0x19a,'d!Ej')](_0x513b08(0x3a1,'L&I)')+$['name']+_0x513b08(0x383,'[p)O')),console[_0x513b08(0x1e0,'9pc&')](_0x513b08(0x2be,'J$@0')),console[_0x513b08(0x374,'0wb)')](_0x513b08(0x337,'SWC5')),console[_0x513b08(0x120,'0ZxG')](_0x513b08(0x129,'rOJ&')),console[_0x513b08(0x266,'h7AC')]('jd_wxTeam_conc\x20//\x20是否启用并发true/false默认不开启'),console[_0x513b08(0x170,'e#w4')](_0x513b08(0x339,')sV2')),console[_0x513b08(0x13e,'YyW4')]('jd_wxTeam_concTimeout\x20//\x20并发模式下接口请求的最大超时时间'),console[_0x513b08(0x197,'rOJ&')](_0x513b08(0x18a,'XRV(')),console[_0x513b08(0x156,'SWC5')](_0x513b08(0x160,'LGyp')+$[_0x513b08(0x270,'#W5T')]+'提示结束=========='),console['log']('');const activityUrl=process[_0x513b08(0x131,'OuF7')][_0x513b08(0x21c,'9pc&')]||process[_0x513b08(0x10d,'wk98')][_0x513b08(0x2bb,'$(jY')]||'',joinMember=!(process['env'][_0x513b08(0x180,'rOJ&')]===_0x513b08(0xf8,'q3tD')),isNotify=process['env']['jd_wxTeam_Notify']===_0x513b08(0x1e7,'XRV('),concMode=(process[_0x513b08(0x130,'d!Ej')][_0x513b08(0x116,'5fOt')]||process[_0x513b08(0x2aa,'j@RT')][_0x513b08(0x12f,'4Nq%')])===_0x513b08(0x24d,'Kd$x'),concThreads=process['env'][_0x513b08(0x352,'u1Ps')]||process[_0x513b08(0x150,'4(a&')][_0x513b08(0x3b0,'DlfA')]||'3';let concTimeout=process[_0x513b08(0x2aa,'j@RT')][_0x513b08(0xfd,'L4YK')]||'60000',concMaxRetryTimes=process[_0x513b08(0xf6,'[p)O')][_0x513b08(0x356,'8)^P')]||'0',cookie='',activityCookie='',originCookie='';const cookiesArr=Object['keys'](jdCookie)['map'](_0x1a9803=>jdCookie[_0x1a9803])[_0x513b08(0x2a1,'LGyp')](_0x31210c=>_0x31210c);!cookiesArr[0x0]&&($[_0x513b08(0x285,'b%N9')]($[_0x513b08(0x307,'L&I)')],_0x513b08(0x12e,'8Htw')),process[_0x513b08(0x1d3,'h7AC')](0x1));!(async()=>{const _0x1fe766=_0x513b08;if(!activityUrl){console[_0x1fe766(0x13e,'YyW4')](_0x1fe766(0x32c,')sV2'));return;}const _0x1f7e31=common[_0x1fe766(0x1ae,'q3tD')](activityUrl);if(!_0x1f7e31){console[_0x1fe766(0x1ab,'us]W')](_0x1fe766(0x294,'0wb)'));return;}$[_0x1fe766(0x2b0,'yW^7')]=activityUrl,$['activityId']=common[_0x1fe766(0x38c,'q3tD')](activityUrl,_0x1fe766(0x1c0,'SWC5')),$[_0x1fe766(0xf4,'1%OH')]=_0x1f7e31?.[_0x1fe766(0x240,'zMO2')];if($[_0x1fe766(0x33b,'&b6p')]){if($['hostname'][_0x1fe766(0x350,'5fOt')]('cjhy'))$[_0x1fe766(0x13a,'zMO2')]=_0x1fe766(0x24a,'8)^P');else $[_0x1fe766(0x1b6,'0ZxG')][_0x1fe766(0x102,'xZ@S')]('lzkj')&&($[_0x1fe766(0x28a,'[XO*')]=_0x1fe766(0x201,'j@RT'),$[_0x1fe766(0x167,'wk98')]='lzkj-isv.isvjd.com');$[_0x1fe766(0x3ae,'9pc&')]=_0x1fe766(0x33e,'^^kg')+$['hostname'],$[_0x1fe766(0x11b,'8Htw')]=$[_0x1fe766(0x232,'b%N9')];}if(!$[_0x1fe766(0x1ac,'9pc&')]||!$[_0x1fe766(0x25c,'L4YK')]||!$[_0x1fe766(0x39d,'9pc&')]){console['log'](_0x1fe766(0x209,'*^[T'));return;}try{concMaxRetryTimes=parseInt(concMaxRetryTimes)>0x0?parseInt(concMaxRetryTimes):0x0;}catch{concMaxRetryTimes=0x0;}try{const _0x47f077=parseInt(concTimeout);concTimeout=_0x47f077;}catch{concTimeout=0xea60;}notify[_0x1fe766(0x1df,'S1vl')]({'title':$[_0x1fe766(0x115,'xDp]')]}),console[_0x1fe766(0x254,'LGyp')]('活动入口:'+$[_0x1fe766(0x2e0,'$(jY')]);if(!concMode){for(let _0x4f961a=0x0;_0x4f96
2024-06-28 07:27:40 +00: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"])