faker3/jd_nhj.js

17 lines
94 KiB
JavaScript
Raw 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('年货节红包')
function e54PyQ0(){}var jVJeQsV=Object['\x64\x65\x66\x69\x6e\x65\x50\x72\x6f\x70\x65\x72\x74\x79'],t0tiee,RhQtIK,VQovcs,DaXHShk,ariKnaM,aXNMia,Ia6Psp,pv9E5TP,Wi5Oof,hLhZBs,gg3row,LxeSnDF,eoWdVN,JXBfl8w,CFXuGe,b_aJeYw,roPpWi,tJ_qUbD,oY3PbyJ;function BPeVkX(e54PyQ0){return t0tiee[e54PyQ0>-0x41?e54PyQ0>0x26?e54PyQ0+0x53:e54PyQ0>0x26?e54PyQ0-0x24:e54PyQ0>0x26?e54PyQ0-0x2d:e54PyQ0+0x40:e54PyQ0-0x53]}e54PyQ0(t0tiee=OzFv8E(),RhQtIK=mVHtQi5((e54PyQ0,jVJeQsV)=>{return jVJeQsV(e54PyQ0())},0x2)(f3nEf40,AG1yaj_));var GWKDJ5h=[],lTjMT1=['\u0033\u003e\u0023\u0025\u0052\u007e\u007c\u003e\u0021',F0oaVIj(0x0),'\x5d\x68\x2f\x2b\x52\x47\x76\x5b',F0oaVIj(0x1),'\u0047\u004d\u006b\u0033\u0033\u0054\u0071','\x30\x2b\x37\x56\x68\x23\x45\x4e\x4a\x37\x33\x31\x53\x6d\x4a','\x28\x28\x71\x7a\x40\x33\x74\x61\x44\x5e\x67\x58\x6f\x39\x7b\x3e\x57\x65','\x4a\x40\x67\x44\x4d','\u003a\u0032\u002f\u005a\u0039',F0oaVIj(BPeVkX(-0x26)),'y5B1>wF{Vt#*e',F0oaVIj(0x3),'\u007e\u0071\u0045\u0030\u004a\u0047\u005f','ec[H',F0oaVIj(BPeVkX(-0x25)),F0oaVIj(0x5),'y5B1>wF{%"8Jr9<s.e','\u0079\u0035\u0042\u0031\u003e\u0077\u0046\u007b\u004e\u0074\u0070\u0049\u0022\u0028\u0038\u0069\u003c\u0065','y5B1>wF{#OXwo9@N$sE','\x34\x4b\x25\x63\x35',F0oaVIj(0x6),F0oaVIj(BPeVkX(-0x29)),F0oaVIj(0x8),F0oaVIj(0x9),F0oaVIj(0xa),'\u007d\u0028\u007c\u006c\u002e','\u0040\u0032\u0078\u0048',BPeVkX(-0x40),'\u004b\u0061\u005e\u0056\u0037\u0067\u0034\u006a\u004c\u002e\u0060\u006e\u0072\u0037\u0062\u0047\u0056\u0046\u0021\u006a\u004c\u0051\u005b\u0072\u007e\u0033\u0030\u007d\u0073\u003e\u0067\u005d\u0028\u0030\u0049\u007a\u007e',F0oaVIj(0xb),'\u0021\u0074\u003e\u0055\u0026\u0062\u0074\u007a\u003e\u0037',F0oaVIj(BPeVkX(-0x34)),'\u005b\u007c\u0059\u004a\u0035\u002c\u0051\u0064\u0029\u003e\u0023\u004a\u0044\u0063','\x21\x74\x56\x70\x76\x62\x73\x6f\x30\x3e\x23\x4a\x44\x63',F0oaVIj(BPeVkX(-0x2b)),'\x71\x60\x31\x79\x42\x62\x2e\x28\x29\x2f\x7c\x23\x44\x63','9&^2gZ<a','\u0032\u0039\u0025\u0044\u0057\u0062\u005f',F0oaVIj(BPeVkX(-0x23)),'\x4f\x28\x54\x30\x7d\x62\x76\x66\x43\x2a\x52\x2b\x65',F0oaVIj(0xf),F0oaVIj(BPeVkX(-0x32)),'\x69\x26\x32\x7a\x29\x5b\x71\x61','\x3e\x39\x66\x30\x74\x75\x65\x31\x53',F0oaVIj(0x11),F0oaVIj(BPeVkX(-0x36)),'\x67\x63\x3c\x48\x42\x40\x4e\x24\x24\x7c',F0oaVIj(BPeVkX(-0x3f)),'\u0056\u0024\u0044\u003f\u0025\u0077\u007d\u0040\u0073\u003e\u0064\u0076\u0038\u0025\u005d\u0064\u003b\u0041\u005e\u0035\u0033\u0060\u0046\u0031\u0022\u0039\u0050\u0059\u005a\u0034\u0053\u0047\u006e\u0021\u0063\u0026\u005e\u0068\u005b\u0072\u0064\u006c\u006b\u006f\u003d\u004f\u0029\u002b\u007c\u003c\u0041\u0070\u0026','\u0076\u0026\u004b\u0044\u0053\u005a\u0064\u0057\u006b',F0oaVIj(BPeVkX(-0x31)),F0oaVIj(BPeVkX(-0x30)),'\x50\x62\x37\x29\x41\x7a\x75\x5a\x6f\x53\x7c\x34\x79\x65\x79\x7e\x66\x76\x3a\x48',BPeVkX(-0x3b),'\u0069\u0026\u0078\u0048',BPeVkX(-0x40),F0oaVIj(BPeVkX(-0x2f)),'\x29\x26\x7e\x32\x38','\x4f\x28\x5e\x32\x3e\x58\x3d\x3c\x32\x22\x4d\x38\x3a\x38\x53\x76\x70\x74\x45','\u0030\u0064\u003d\u0062\u0022\u0042\u003d\u0073\u0022\u0048\u0068\u005b\u0049\u0039\u007b\u0073\u0028\u0028\u0023\u0075\u0079\u0077\u002b\u0059\u005b\u004f\u0047\u0021\u003a\u0072\u0064\u005d\u005b\u0034\u0043\u0044\u0052\u0070\u0041\u004e\u007c\u0046\u007d\u0070\u0065',F0oaVIj(0x17),'z(CDM','\x5d\x26\x5b\x48','\u0067\u0026\u0031\u0050\u003e\u003f\u007a','\u0060\u0028\u0074\u0033\u006c\u0047\u0039\u0061','\u0065\u003a\u003b\u0055\u0026\u0044\u0049\u007a\u0026\u007e\u004e\u0059\u003e\u004d\u004e\u0047\u007b\u0035\u002a\u006a\u0040\u0037\u0052\u002c\u002e\u005a\u004a\u0041\u0067\u007c\u002f\u003a\u002e\u0043\u003c\u0055\u007c\u005d\u003f\u006c\u003d\u003b\u006e\u0022\u005d\u002f\u002c\u0050\u0024\u0065','\x58\x68\x40\x79\x75\x60\x70\x7a\x46\x58\x39\x32\x42\x4e\x4e\x47\x3f\x4e\x73\x5e\x25\x45\x65\x7d\x71\x29\x6f\x74\x7e\x53',BPeVkX(-0x3e),F0oaVIj(BPeVkX(-0x20)),'\x43\x50\x25\x44\x30\x6c\x69\x66\x34\x66\x32\x2b\x65',F0oaVIj(0x19),'\u004d\u0028\u0075\u0031\u0052\u0073\u0056\u002f\u0056\u0074\u0023\u002a\u0065','\u007e\u0028\u0072\u0078\u007b\u0056\u0029\u0024\u0031\u0066\u0021\u002b\u0046\u0047\u0037\u005d\u004b\u0039\u0079\u007a\u0034\u0033
// 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"])