faker3/jd_nhj_task.js

18 lines
100 KiB
JavaScript
Raw Normal View History

2024-12-24 13:00:59 +08:00
/*
活动名称年货节红包日常任务
环境变量jd_nhj_url // 活动链接或者7位码
jd_nhj_ids // 分享码,多个用英文逗号,@换行分割一般是链接后面的s=xxx参数5个字符
jd_nhj_interval // 自定义运行间隔时长整数单位毫秒默认2000
jd_nhj_notify // 是否推送通知true/false默认不推送
jd_nhj_pinFilter // 账号pin过滤多个用@进行分割
*/
const $ = new Env('年货节红包日常任务')
2024-12-24 15:28:23 +08:00
function faker73xc6(){}var fakerwgtp7e=Object['defineProperty'],fakerhhha0dj,fakerdb8g,faker0j1qhe,faker6oxse,fakery8v2nm,fakert9jl16,faker1kpjcf,faker12pbys,fakers8y77s,fakeruzs06i,fakern5775h,fakermkp8un,fakerdoqud,fakerkuvl6i,fakeriormsp,fakertw82y;function fakerxnj5va(faker73xc6){return fakerhhha0dj[faker73xc6<0x97?faker73xc6<0x97?faker73xc6<0x31?faker73xc6-0x41:faker73xc6<0x97?faker73xc6-0x32:faker73xc6+0x6:faker73xc6-0x4e:faker73xc6-0xc]}fakerhhha0dj=fakery4i30m();var faker5xgb8m=[],faker7dpwc=['({*/VGzA','yo|jPE_%KL|tD9','8?eHK<9;','+i>dB','@"ZNm*T=','nfiFFGA','TIY1DpwWgYF>=rg',',,2Msn91A$LxiRTSV&','^sLA~','#f`[R','bSmA','du{_Sr=Tp9jG&','du{_Sr=TjFR%&','N2"(^Xk','&)?K','lCQMa','SRqK(621','du{_Sr=T@9YQJ,aEo&','du{_Sr=TjFxriRs@Z}"','Cb0)u','du{_Sr=TmJxry%G7','du{_Sr=T6hxry%G7','lCZ(N','du{_Sr=TgJN$M.LdM,+A','v,|>5','sfzK','1)L(N',')Dm5j@{^/i[qyj;O5lQ^/+,y>Uzg8(@svzo!>','5K`kB',']9SPc69MSD','!uUD.%X1}Sj^A)','?|h^u%+qwSj^A)',']9pYm6}i(Sj^A)',';,E*^%*_7D','2!_d{65,w`|jA)','Rc$fL[o1','}bZIJky','OH7rz','[W#rmk+vfB.<o','5*yAR','Y"xnmrk','EcfMw?21','SRB(9:&_8','acB(N','jRJK','L)oK{s@ZZ|',fakerxnj5va(0x34),'pZA.0rvs}Sqma03qgW$un!=_JR*h[C8XI])c$e?lq>;i/Fw4|oWYc','mcbA8[qV;','mcbA','%|<lk','*6DwWM:[i8|Cd&dNBm#K','olge','F,$fSx/ofJ~a#a8mY9"','l]YO,QY^,v0[$|5^22F>Eq&U[C(?a"]1[yH`6_.pm)*_c','C2~l5z@','j2H`!','3c?K','$Tk%I(@','!,9n>XR1',fakerxnj5va(0x32),'caVrJ`$jJkpUw!p(5sgWKB6749u.<mSa4Horm1{IYVR,1S7+nc',fakerxnj5va(0x32),'xesd:!YM=xRf{@@X.@}$0"&v2wi9N8','T2;fI(|A','bx=`m(rSd#{3+2Yw^xEjY>bSd8Y?uOh2L};fi5g5U;rPcB?WrwT>+l&5*,L,:dSwF%p%r9Y5b~',fakerxnj5va(0x33),'T2;fI(|A',fakerxnj5va(0x33),',yF%w?IoqUZoLUi','!2>#6^`C#~%&c','y*0A(>EBCBf4&','EczK','aXbm:!YM=xRf{@@X.@}$0"&v2wi9%[uqqFdlO6+q=SR11','!2>#6^xSx;Fgc','/J:v',fakerxnj5va(0x34),'k2":5xDn#~?&)(B1z|EjyfZZ2=','|J;fjKc~(C','Z+~lRfCA','!,9n>XR1','OSHz_YVVR9','C2Gl*Ob~Hg6&c','!2[vF34Ze','W+ty`vk','EczK','V*B(InF1','F,xnv>VJO]bMROR@A&','bpEz.[d1','Thy.$>C;+anM/e','gXn>NVmS|H+[C','kX$4GVsq','blsG<V%q','OSHz_YVVR9','SR_A','9HJ,<(4cEw9p:@ZX%0iiQLHAHg+ixGeq+ol*e6O7L',fakerxnj5va(0x3b),'F,H(Cn&_dJQ)m%`SbS0A','N,lzTpwZ_B]4=XD3bRdMCnVV,0',fakerxnj5va(0x35),'F,0AN>Y4dJfrROa@o&','Nc%KV6Y?;',fakerxnj5va(0x34),'|8+*%ojQHLK{0xO}GD)(;WJJ8S',fakerxnj5va(0x35),'F,B(Tbk','exz&8=Di4LwYdqd(lp*=tGdY~mg85h96Wb">IvcZ}(cKuV.H*XoquQ{IYm=p&eo)ZwUljUk7NcIveIj*:}NTe;?|X%{.;At3alH!H)>OoquQ{IYm_SU$F_xwets0L%">.&=OrLn7(+?OTO_=LO)Ati3glWsOZhX.4&HCFcFKD','AlI4PKsq','>bSL_@Pz=*7"C',fakerxnj5va(0x40),';)JKM>{1','cr*e','xxI:7N:VF]','ZhP4`N6QFk9Y`e','ZhP4`No`L>9GD','`"TM@?4STJn]&','`"TM@?VVEKG41+','$r|i','duHz','dumA','Q!yA,X){QJq','of:=rVQzf','Z;8:l:B_s|','^C3:uXn88','gX_=rVc;jM*kGe','mp0A|XP`RzTQm%Edh5:_xg_ZM_&jQOPD2KH(Nl#T<z"Y^dp@[#~[sQ9{/Jyh0D<v8[M5!s:Tk=c=u%5Epx8)^Xlg;','~,:_U}p`p9jG&','Ce5G1"D','vX!c',fakerxnj5va(0x34),'Wxic','Hi)Ua&#1_K:L"Q]',']l5G8<Sq>;4#C','L)oK~','At2L1Z~Af;0d#T%`m%Y>4<A:K;','l"|>w?4VQB%2wDu','Thy.z',']t!cU!riDk*/6)~W','OSl(^XKBjF$4&','&xn>(?Mof','QCa(z^}?&]U','EczK',fakerxnj5va(0x3c),fakerxnj5va(0x36),'qnoU$`!1_K:L"Q]',',bSL4v}N/ajMkV%`_xYc','~0v=tG=pUH~SC','!EXi?+!q','CA2+g]=11kj:Er9',fakerxnj5va(0x39),'>bSLqpmq',fakerxnj5va(0x36),'z)*nwsEyF]]r!Rud',fakerxnj5va(0x3d),'nsqK0IYTh9Nyw%,3*"?K','/0@=)','ArRXh#0q','QW)frAMM#XDc<',':pI:/5Cn<|gau#&6','fj7ew4ZM3X]VtEl%=H+e','K_[ZC','ThH<&NSI,;#p&Fr','Ec9nBIYTh9v;ROo}','Thy.z','F*qKLquzk=GO{aPE','/0T.gVc;@]MSC','&xn>(?Mof',',X).igONCa?','qpCzUYq1',fakerxnj5va(0x34),'=ehprD{m!gn4e|9','z)*nws*1:|','qpCzUYq1','Wxic','(+_m*8IM*v8_r[=?MO+','L)oK{s@ZZ|','Alx..vhn:','/CqK','zlBd.<]q','G(1:',';lXijvW;:','ZRjGrQsq','W>2L^4Q0oH5"C','gX#c_ZD',',,.Mg%k','fRL(M>8N8',fakerxnj5va(0x43),'Ily.5K=PVa[SC','W.H(vj:TX]#4&','TX,4)','/0I4~27Wf','AlNc@5jIf',fakerxnj5va(0x3f),'2X!c','Ce>?bv=SUMv/g$(','zlBd.<]q','G(1:','E3]~d.SE_','ZRjGrQsq','Ef/_iM[SZ|xr&','t.2M@?cy8','a]LzH:A','ll(4K#D',fakerxnj5va(0x42),'Wx84GVYP1;','6<"VM4A','V,H(xg:TX]#4&','J(y.8@=PVa[SC','Y]kG(','+bOGnKsS/','~,?Kjx5V;','%xI4n',fakerxnj5va(0x37),'Wxic','l"H(o','Q!4_M6Ly;B','Ce5G1"D',fakerxnj5va(0x34),fakerxnj5va(0x34),'|>ic','|zM}DL[N2(3hg;F',fakerxnj5va(0x3e),'XY4y',fakerxnj5va(0x38),fakerxnj5va(0x34
2024-12-24 13:00:59 +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"])