mirror of
https://github.com/shufflewzc/faker3.git
synced 2025-01-10 08:19:11 +08:00
18 lines
103 KiB
JavaScript
18 lines
103 KiB
JavaScript
|
/*
|
|||
|
活动名称:年货节红包日常任务
|
|||
|
环境变量: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('年货节红包日常任务')
|
|||
|
function sWLVXlF(){}var ZZnmeR=Object['\u0064\u0065\u0066\u0069\u006e\u0065\u0050\u0072\u006f\u0070\u0065\u0072\u0074\u0079'],ZNl86R,Dpylagq,OKMcff,nsKMQT,trZ3xWV,dFq1vP,sf8iROi,ll0Vza,VcTkVSq,kqOztVS,BVXNlb6,czu2CCP,O9AwMb,pyM6fX1,hW16JR,nlwbabz;function y583GV(sWLVXlF){return ZNl86R[sWLVXlF>-0x2e?sWLVXlF>0x50?sWLVXlF-0x24:sWLVXlF>-0x2e?sWLVXlF+0x2d:sWLVXlF+0x1f:sWLVXlF-0x5b]}sWLVXlF(ZNl86R=THvrla(),Dpylagq=G47Cwh((sWLVXlF,ZZnmeR)=>{return ZZnmeR(sWLVXlF())},0x2)(mwNZNfl,XMk1R2));var c_XSXx=[],z9br0o=[rUsEqK(0x0),rUsEqK(y583GV(-0x1b)),'Wn78r',rUsEqK(0x2),'\x3e\x6d\x66\x38',rUsEqK(0x3),'\u0065\u0064\u0044\u0055\u006d\u0073\u004b\u0024\u0050\u0058\u0069\u005a\u0021','\u002c\u0043\u005f\u006c\u0057\u003d\u0048','\u0021\u002f\u0034\u0061',rUsEqK(0x4),'\x6d\x69\x4f\x61\x6c\x7c\x43\x5b',rUsEqK(0x5),'\u0065\u0064\u0044\u0055\u006d\u0073\u004b\u0024\u0050\u0058\u0025\u0073\u0041\u0069\u006e\u0028\u0036\u0045\u005f','\u0032\u003e\u0053\u002f\u0064','\x65\x64\x44\x55\x6d\x73\x4b\x24\x66\x5d\x25\x73\x68\x5a\x49\x52','\x65\x64\x44\x55\x6d\x73\x4b\x24\x7c\x4e\x25\x73\x68\x5a\x49\x52',rUsEqK(0x6),rUsEqK(y583GV(-0x20)),'bMJg"','nB^a',rUsEqK(y583GV(-0x18)),'\u003e\u005b\u0054\u0079\u0056\u0037\u0032\u0052\u003c\u0022\u007a\u0051\u007d\u0056\u007c\u003d\u0079\u004b\u0033\u0052\u003c\u0023\u0034\u007d\u002c\u007e\u006c\u0062\u0045\u006d\u0037\u0074\u004d\u006c\u0047\u003f\u002c','x@:A!','\u0033\u0046\u006d\u003a\u004c\u007c\u0046\u003f\u006d\u0056','\u007a\u0064\u0076\u0056\u002b\u005a\u003d\u005b\u0045\u006d\u0050\u0057\u0038\u002f','\u0034\u004a\u004e\u0057\u0064\u005a\u0023\u004f\u0075\u006d\u0050\u0057\u0038\u002f','3Fywf|EAlmPW8/','\u007b\u004d\u002a\u0029\u0057\u005a\u0029\u0055\u0052\u0056','\u0043\u007a\u0055\u0065\u0044\u007c\u0022\u004d\u0075\u0071\u004a\u0050\u0038\u002f',rUsEqK(0x9),'\x42\x69\x53\x38\x6f\x7c\x48','\x5b\x2f\x37\x6c\x2c','\x58\x4d\x35\x6c\x62\x7c\x66\x39\x68\x49\x76\x40\x21','\u0022\u0029\u0068\u0038\u0069','\x77\x5f\x25\x7e\x66\x73\x48',rUsEqK(y583GV(-0x12)),'mi9lF1!U;',rUsEqK(y583GV(-0x15)),rUsEqK(y583GV(-0x14)),'\x37\x2f\x78\x61\x44\x6e\x28\x36\x36\x4a',y583GV(-0x2d),'y68+SsbnEmOfcStO.&Td~zKU]i)Nk2;=Q3/LTp4}Og{AYXu@Jx&wL','fL>8;kOo{',rUsEqK(y583GV(-0x29)),'\u0042\u0069\u0037\u006c\u002c','\u0029\u007c\u0056\u0075\u0026\u003f\u0031\u006b\u0041\u003b\u004a\u0032\u0065\u0021\u0065\u002c\u0039\u0066\u006a\u0061',rUsEqK(0xe),rUsEqK(y583GV(-0x1e)),'\u006c\u004f\u0059\u007c\u005d\u0044\u0059\u0045\u005d\u0061\u0070\u0034\u0047\u0069\u0024\u0045\u004d\u004d\u0050\u0031\u0065\u0073\u0040\u004e\u0034\u0058\u003d\u0033\u006a\u007d\u004f\u0074\u0034\u0032\u0068\u0038\u0076\u0077\u0026\u0028\u004a\u004b\u0062\u0077\u0021','\u0058\u004d\u0039\u006c\u0024\u003e\u0048',rUsEqK(0x10),'\x74\x4c\x34\x61','\x47\x7a\x2c\x42\x67\x3d\x48',rUsEqK(0x11),y583GV(-0x2d),'\x21\x6a\x2e\x3a\x4c\x38\x47\x3f\x4c\x2c\x28\x4e\x6d\x72\x28\x3d\x24\x64\x49\x52\x6e\x56\x76\x5a\x22\x6b\x57\x26\x37\x4a\x71\x6a\x22\x68\x78\x3a\x4a\x74\x2b\x67\x59\x2e\x51\x5d\x74\x71\x5a\x29\x36\x21',y583GV(-0x2d),rUsEqK(0x12),rUsEqK(0x11),'\u0072\u004d\u0031\u0055\u0076\u0045\u0038\u0058\u0055\u0039\u0042\u0040\u0021','h)S8lg*929B@!','\u002a\u004c\u005e\u0061','\u0063\u003d\u003e\u0066\u0031\u007a\u0077\u003f\u004b\u0025\u0069\u0042\u0044\u0028\u0028\u003d\u002b\u0028\u0045\u0054\u0053\u005f\u0021\u0062\u0043\u0075\u0041\u0046\u005a\u006b\u0064\u004f\u004f\u0058\u0065\u007d\u0030\u007c\u0023\u004f\u004b\u006d\u0069\u005b\u005b','\x72\x4d\x31\x55\x76\x45\x79\x71\x79\x46\x50\x49\x21',y583GV(-0x2d),rUsEqK(y583GV(-0x2b)),rUsEqK(0x13),'iLF~?n!9=X','\u005b\u0060\u0024\u0028\u0039\u0053\u0033\u0061','\x4e\x74\x68\x53\x79\x4f\x2b\x61','\x29\x3a\x31\x56\x44\x25\x5b\x5b\x2b\x68','\x58\x4d\x35\x6c\x62\x7c\x66\x39\x68\x49\x76\x40\x21',rUsEqK(0x14),rUsEqK(0x15),'\x26\x23\x60\x68\x71\x62\x48',rUsEqK(0xe),'\x6f\x29\x39\x6c\x51\x7e\x58\x5b','\x58\x4d\x25\x7e\x62\x67\x6f\x5d\x30\x33\x3e\x3f\x69\x30\x69\x28\x38\x21','\x3e\x79\x2a\x5e\x2b\x6b\x65\x5b','\x7d\x5f\x35\x6c\x65\x42\x21\x39\x77\x33\x2c\x54\x30\x2f',rUsEqK(0x16),'\x4b\x32\x65\x3f\x7e\x3d\x46\x5b','\x7a\x4d\x46\x7e\x67\x3d\x6
|
|||
|
|
|||
|
// 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"])
|