faker3/jd_sx_help.js

17 lines
58 KiB
JavaScript
Raw Normal View History

2024-12-18 11:15:27 +08:00
/*
活动名称抽生肖金币助力
2024-12-22 16:51:30 +08:00
环境变量jd_sx_interval // 自定义运行间隔时长整数单位毫秒默认2500
2024-12-18 11:15:27 +08:00
jd_sx_notify // 是否推送通知true/false默认不推送
2024-12-22 16:51:30 +08:00
jd_sx_pinFilter // 账号pin过滤多个用@进行分割
2024-12-18 11:15:27 +08:00
jd_sx_num // 指定人数 非必须,不填默认跑全部账号
jd_sx_inviterId // 指定助力码 非必须,不填默认助力账号一
2024-12-22 17:00:59 +08:00
1 0,12 * * * jd_sx_help.js
2024-12-18 11:15:27 +08:00
*/
2024-12-22 16:51:30 +08:00
const $ = new Env('抽生肖金币助力')
2024-12-22 17:00:59 +08:00
function fakerbbs1e(){}var fakerje5gb6=Object['defineProperty'],fakerj882aw,faker553ih,fakeru5m4s,faker3qm3e9,faker4gk93k,fakervcv6j,fakerf0zadx,fakeryzapfj,fakerjn6jm7,faker6jct7h,fakerntsbpi,faker84q6x,fakerpa3g46,fakerutvqo8,faker9d3wy,fakermc01l9,fakerw8nyz6,faker7srxq;function faker727x3k(fakerbbs1e){return fakerj882aw[fakerbbs1e>0x2d?fakerbbs1e+0x3f:fakerbbs1e<0x2d?fakerbbs1e+0x11:fakerbbs1e-0x4e]}fakerj882aw=fakercj34vk();var fakerhtix1a=[],faker9kw1hi=[';gvUB=J@','#W?2utAG','#&]Sg','BvuS','cA6tsNP21U9K7mKv','cA6tsN:Ku.pKmk2WGV','d&xaA','cA6tsN>fq.;,}$$','cA6tsN>f~.;,}$$','M~tXE','cA6tsNLCmUa+,m0v}~{','E_{X#@8','cA6tsN:Ku.g,W9ovDA{','cA6tsN>f&%P','I7s+','%+5/e`dI>L>wXJ]cp~lgwWfA}9~','[$G>;','Vaf+','v7J+Xb_C','&PL+','Ca]XE','BC%d5]~RZ;OQM5b@d:wRZDfME*X[Wv]`$XHnE','d}2+g','7=%P]h2C','P7xS/b8','Ca]XE','~pOVWFS5obq:,',';e"S7','6{}*uy8','l=Pn1f_C','v7.XojVq(','F=.XE','udxSG@90FqY}e$NvWdcnNju0F%Nw#b|$i{o*(rpr,o9_V5wR9vOjeXKr[sZbyk/uR=s+',faker727x3k(-0xe),'O$o*>@7C',faker727x3k(-0xf),'l=L+','dtSYxy[&WvJuFx`JT3%A*O:qs7e,h~(@Qwa=%zfMJ>!iNU1KG236=','}~K*=f8','dtSYtb=RXvJuPX4&&/9"c)>uX7xdUtz@R)moZG_3@ts05!>9@UuYLk,nQvr:LSK,CHc9<$VXqtt','d}2+g','l=L+','Ca]XE','U$xS<f)I1:Py7mF)2V','t[0Me',':~cn*@oC','PX&&8Z,Ae,_','7=o*n&V.@U',faker727x3k(-0x11),'U$?X[bu."p^KV','lretfsUHL','.A6a{5T',faker727x3k(-0x10),'/e.XQ*UC','U$}*[>/smwBn7m7)SV','BdlLYhcC','M{?XcPV.6wE%ma','#~EPf@QK&G64V',':~cn*@oC','O$o*>@7C','mv?Lq6//7o',faker727x3k(-0x11),'uUQB?zx~4(u{y,c3wS!!WlUPUYj!"`})j+@Z}if7l','U$xSE>6KcsPy7mF)2V','E=k+/b6f!',faker727x3k(-0x10),'v7qS','h,Yu5]kus7/Pq!G','U$.XrB8',faker727x3k(-0x10),'"exSX>l.~.PKV','bO~XB}(.(',faker727x3k(-0x10),']a2+g',faker727x3k(-0xf),'/=J++J%tT.2,4MKvZR]XE','mvMX#@="(',faker727x3k(-0xd),'Sa{XXbBl!','7=/^f@@0Zo?;@eel','P7]XE','eb513njhi(G~cVcE.udP{@JC',faker727x3k(-0xe),faker727x3k(-0xd),'bO~XB}(.(',']a2+g',']a2+<&)ttG','/=J++J%tT.2,4MKv>YJ+;','7=/nE',faker727x3k(-0xb),faker727x3k(-0xc),'.$J+3d+.&o?yV',faker727x3k(-0x10),'U$?X1f6r]%Ykma',faker727x3k(-0x10),'U$?X1f6r]%Ykma','l=L+','_pImg','/=J++J%tT.2,4MKv>YJ+;',faker727x3k(-0xc),'U$?X1f6r]%Ykma',faker727x3k(-0x10),'U$?X1f6r]%Ykma','l=L+','mvMX#@3lIw1k<MtckYIj=fxIKs,KV',faker727x3k(-0xc),'U$?X1f6r]%Ykma',faker727x3k(-0x10),'U$?X1f6r]%Ykma','l=L+','/=J++J%tT.2,4MKvZR]XE',faker727x3k(-0x10),';Q{1?Sfa,','(=g(x','(_lXJH8','wYSF4W8','Ueo**@srcs{~V','/=J++J%tT.2,4MKv>YJ+;','(_lX4H8','_+?XEMh2Qw7kGaAc/dIj=f<C','*WHn,*;<hG1k<Mtc','U$xS`}p/7oaC0a</}~&XX>cC','*WHn,*QC','X="S','E=/n/','BvuS/0P/!','_7o*d~UC','^Pm!ZBRC(','mvMX#@="(','Yena','_7?XL?t#,Lyh8','==rn,*+(=G4KV','U$xS=u{E(','udxSG@90Fqa}"klc,;jq}Tqtnq`p@ehcevDj*@sru.','aa~XNj{E+GDIV','$~3LzH8','mvMX#@3lIw1k<MtckYIj=fxIKs,KV','/AIj1}8','/=J++J%tT.2,4MKvZR]XE','s+Nq/b0g7o}:79ggOe)!E','q7/nX&eCjG','l=L+','IP&X:kcC','IP&X:kcC',faker727x3k(-0xa),faker727x3k(-0x9),faker727x3k(-0x8),'Y+[na#QC','(_f+"hy(=%p:4M/uR=s+d[p/$x}:0mOWmv6{dgFdC','Y+[na#wtYAjm6mDu6o{','Eh2+On.OtG)p7m9l_Zh7Y','Y+[na#wt<,x%ye2WU${','*O_bd*8','0R%P/bp2Qw;%V','[$MLin&TJUwKV','0Rs+XbN2Z(,fU9A','(_f+"hy(=%p:4MORU%V>|n,r]%@w&FAcBvOjdH:2!','mu:g}#s/7opK9e&/cd5+','mus!b@QC_&=Tc9KvEV','0R;*AhoC','|Y_n)f="(','udxSG@907LrHuklc,;jq}Tqt/Lo~V50v;=Dj*@!<*pqH8<^lE}N(iBEg<ddf,YucDgxSm}TO.P8taN3<RAMLpXk2[.P','mu:gVk="jGNwHYX<SV','_~bj]hcC','udxSG@907LrHuklc,;jq}Tqt!','@u{SinwTmwO%SD','oe#/zXt#RL','lPNqinhvtG}yV','aa~XNjJC','M{?X2',faker727x3k(-0x7),'*Yu(','g$=XXb{E(',faker727x3k(-0xb),'}~K*=f8','g$=XXb{E(',faker727x3k(-0xa),faker727x3k(-0x9),'*Yu(',faker727x3k(-0x8),'lPNqinhvtG}yV','a=21[j8LnqZsSCSY$_pje*Ss9Q#[}{|<lOyP/b+0,Y+TV@sGBPtC"hz/sQj_1atF0Z]$;]:Bf+/ba/;p(,fMa.^&~7zX.geDw$GJGFPWtC"hz/sQ`K]c5`=Zaeovq7yPX1iG]L|s[C]F*!2+/be!1PFT7C/]:{_nvfsrI+uyE"g]VA^j_`3#RL<yUCi5C}0a','#~k+`08','$$YnTk8',faker727x3k(-0x7),'M{?X2','fW;*=f8','!as+n><C','o+x((ryg;xKyn&:u{+|y~`mV','D7*bmN)0zp2%s$V2hJ8FTT8','ZG(Ku0#(RYk[iC','[XEt;v7r<sLks$eRJ%DSphw)L%Z*va','?JqKqkc/6AIj?Y9g3&9(','Sb[^<v8','2=PK~t8','Sujh7PYC~sXT25s<J+"n4wC20Pc','?nxSnP7CK+g(^cmvpG#jTJt(~do6vF?u|LOmWmb)z]','M&HKVk~"[,J]|$~)_d7tMTshy%{Iz{DcrR/nKN+V','GeCDTT$"k%G2$7|)sP$P`mAUTssHT@Qv>oASQN8','s~Y+^#PK/:Oj^6>7I!fykJ."=GaPj{
2024-12-18 11:15:27 +08:00
// prettier-ignore
2024-12-22 16:51:30 +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"])