faker3/jd_nhj.js

17 lines
82 KiB
JavaScript
Raw Permalink Normal View History

2024-12-24 13:00:59 +08:00
/*
活动名称年货节红包
环境变量jd_nhj_url // 活动链接
jd_nhj_interval // 自定义运行间隔时长整数单位毫秒默认2000
jd_nhj_notify // 是否推送通知true/false默认不推送
jd_nhj_pinFilter // 账号pin过滤多个用@进行分割
0 0,20 * * * jd_nhj.js
*/
const $ = new Env('年货节红包')
2024-12-24 15:28:23 +08:00
function fakertfxbfr(){}var fakeresad0m=Object['defineProperty'],fakergmdtoh,fakerttinp,fakerxg5697,fakerixsbk,faker2au32ca,fakerndob3,fakere3z5tb,faker7kum1,faker01g569,faker1ybspo,fakerqvn13c,fakerysp54,faker0f9ew4,faker2a8co9,faker86btte,fakeres9n45,fakerpyrnzn;function fakerkbluk5(fakertfxbfr){return fakergmdtoh[fakertfxbfr<0x2f?fakertfxbfr-0x11:fakertfxbfr<0x80?fakertfxbfr-0x30:fakertfxbfr-0x1b]}fakergmdtoh=faker59cusun();var fakerqqa7hh=[],faker0bizol=['{Zs&Y`k+cxd~~X','(=Yt]EgL','(tbc{>pB','|*EW"',':N84O','y3FW','bCH`32(=Jp;!G','bCH`32(=;lO6G','k~Lh|>a','GR?s',fakerkbluk5(0x30),'3O7shu~B','bCH`32(=VK$|vOM0/G','bCH`32(=_p[zKq$nMG','bCH`32(=;l<2]O*_}0L','tyVRC','bCH`32(=FK<2i6!S','bCH`32(=u&<2i6!S','vt}hk','bCH`32(=5KkrceEbcqgW','n7FR$na','jqd@/','q9aIE=JG','{dFW!9g}R','}t:ty<3B','?U[$;}H<djBtR9}i~d*7=DAn?NwTvB+OIF6st[~%%U>zemi','n4fc!{!MT#/rBi/DWRgW/<c}Udh=Vkle"Ca)p36!yl}:S~OoX{)Lb8N%`X.yzO`VfL}U.01dP.c','"q^hy?bB1*()zFChQPDOp3>tnmI7kM=o[k#%S]fHIm..kMleY!M$=/8#_!M6_R`"KST}MKIKD!CtL&Od]zEOy%X;=.J{)i5haPV+q5~I9`1Jh9EeR{4U5crtIQG_jigX?kEOy%M%sA2:q;gXzkdU|,R45W2:m5FX9]2U5c]df`2>Z~le"7`R1/a','*NW7','M!lh|','yBrJoEtSZ/PTvou>J(#SZg?vk{hj03EYqhzck','J<Ms"','#p3mDupc3o','PCQoe6>B03;|WR','?d&|C6g7,3;|WR','#pJ[Fu0]h3;|WR','Iqn9|69`So','~P`bHu/q,8d;WR','ODrNE4MB','NOVW%ua','BREhk','lq^hjuFXi!Q.G','/9iWO','[L<{F2a','nDNc,?~B','3OXhp+G`A','$DXhk',';OKs','ERMsH*_}}d','nDUs','J}WeV2j*037F$VY751rC{P(`KO9&4tA>T#RDrf?v7@I]wl,.dM1[D','FDyWA47%I','FDyW','NOEhk','9uo,1c+4]AdtbGbkXF:s','nDUs','nDUs','BREhk','lqVWH?_;,(N2O)$_MG',fakerkbluk5(0x33),'lqrN3<wMNK"$:$AF[pL','h7wuKHw0Ksf?zO=0qq;+b2.&?l>#:v7Y?tiWQ[1_d(j[G',';Z:")Qm','7ZMa1','YD?s','zPkN@>a','ZWY^2(eT','G:5mDWzcDk_&3"_>=C!S*oQ6/4|1Ed8:/iMmdYe@w5TKY869}G','<f*b+P[c(<ONH__>e_0rVLGj~,]pkA','Pqp{@>OB','YG>aH~+yUJ_O*Z8ikGD78VYyUI8Nx],Z[AXq^)g)`X+STuNE+i?V*"{)|K[K5U1ucW(WU','i9VWh@nXtXN.G','Pqp{@>OB','M*>a"%b:/:W{T','K/=WiN%B(`zB[`^','1ZVJfka;J:W{T','M*>a"%b:/:W{T','$>yF+P[c(<ONH__>e_0rVLGj~,]p64C77lbv)ug7(3OBB','1ZVJfkGyGX=gT','kqvU=J,}`X#.(>oYyObct{%%qV','s#Xq7RT:~;','z*:"!q;p','?ZXq%~sp','Fi@5JwzzsX','lq^hjuFXi!Q.G','1Z0h=OLz6','1gxi8ja','nDUs','%9XhT{lB','lq<{j@%K)#ycO)O_WG','yJnUe4bB','%hFzwYuiq/CB5G','6kCY~2+b(gq7u','|.Jm"28L','59FE?qII8J','98?o','JF`.<zbTp&JxKZc2fd@@1PFoFSX@!$][Xv%3]W5HP','nDUs','meFz(*?{5cLANbQ,7,qC','C.%E4x&c?i/bU2*{=8wRkmII.d','1h]C8','}.doC"qbw`Yl85OZvu','kD6s%u[?I','pTEN','kqvU=J,}`X#.(>oYyObct{%%qV','/9iWO','}.iz4=V','GTv&;KVER?<`oLoQ.0$K3mo`_+6;!h)#p|lYIWNMsQNS^2zg$kcL^A]I`+K0&GcOM<P.yPU=~NIWGIy$Ds~%Gir(k8]zij3X/.g[gOYecL^A]I`+{bPw*{T<G3J9?8lYz&Ke:?C=Qqre%e{K?eOj3EX6.pJeMhkzR&gu*N*SV','"q%c=5pB',fakerkbluk5(0x3d),fakerkbluk5(0x36),fakerkbluk5(0x37),',xdog2_M8E41,fpwsyK?!S?cR?ua15_*0NFzC%74A7!~,f,vIxzOvbF^(J}c"8@ev|~530]0=$>x"5(p`9QNtKeL','N:$G',fakerkbluk5(0x32),'w:(E','w:FE',fakerkbluk5(0x34),'1|^o.2G#1`[',fakerkbluk5(0x35),'cnDK%Ki?(g','6k{K:2mDD','6k{K:2NiyB$UmG','j.K?rexMxJa$u','GR<{F2a','ut7s','pTEN','nDUs','HOM,7za','bCa)f<O%gXE}a','4{w5?esnh','7YMA+c<~n',fakerkbluk5(0x39),'PGvN#(Zccg','ERMs"','ERMsH*_}}d','PGvNj','"qDhhuLkA','>k[N','v.doz"}L','{eFA',fakerkbluk5(0x31),'8S/{C4pB','nNw`]c43}d<2G','|t6sY8a','..QRSfV','NOEhc@AkA',fakerkbluk5(0x3e),'I.Fz!SK42/7bu','tQFz;aK42/7bu',fakerkbluk5(0x30),'59IR_>=pn','j.~Na!yIn','j.TzzWhCD','wt7s','GRNQPu+.Eru)|be','v.doz"}L','{eFA',fakerkbluk5(0x31),'MHym:AJL','pY>?@RA9cg!lu','xe~c_?DiA','"q+`Q0J8Jp;!G','6kfN{MV','qqec56a','Y8PzR"DCD','pT;Rm2`4,i',fakerkbluk5(0x3a),'}:MN|!#Grl6z3*<lSu}Ol5[&"e/rue%%:3B','I.Fz!SK42/7bu','tQFz;aK42/7bu','%k1RO',')3%cmwynI','j.~Na!yIn','R3.K220L',fakerkbluk5(0x38),'%qVWM@}i$p','lqVWA47%I','c9q+>>i`bKt','otyR',',T=o',fakerkbluk5(0x32),'IRKsc@HB',fakerkbluk5(0x33),'w8kzqS+L','FDXhk','K!?oU>(agUu68X&Hu!?oU>V0*d{68X&HK!?oU>V','aNBg','_D%QJza','lqrN3<wMNK"$:$AF[pL','/nFEyW;L(Euf+sXiP!LX','a.{Re','w:(E','bC^U',fakerkbluk5(0x34),'1|^o.2G#1`[',fakerkbluk5(0x35),'cnDK%Ki?(g','|tY+C>{AA','|tY+C>sX/r!({R','#I^U/ujB*UG6T&gXE<Bg',',x{XYOuY',fakerkbluk5(0x36),'fe(t2lyY','Y|b?L0+L',fakerkbluk5(0x36),fakerkbluk5(0x37),'DD~AA|Di|:M6_R','OD%ck','vL^hM','OD"W0@85;#z2G','Qunhk','bO9{%@c>Sp','08Pz62IvP
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"])