faker3/jd_beanday.js

16 lines
61 KiB
JavaScript
Raw Normal View History

2024-10-25 14:18:33 +08:00
/*
活动名称天天领豆
环境变量jd_beanday_interval // 自定义运行间隔时长整数单位毫秒默认1500
jd_beanday_notify // 是否推送通知true/false默认不推送
jd_beanday_pinFilter // 账号pin过滤多个用@进行分割
cron:15 1,14 * * *
*/
const $ = new Env('天天领豆')
function NkdcwSC(){}var oHwt0Wy=Object['defineProperty'],Ay90Tb,NiksIpC,IVEF7ej,OjXEON,JweoAf,ko7ivO,P1SCUi6,Sqaztt,XA8tmYb,NXNZJXc,LIYs6dA,MnI_QYW,thL8zM,avy8Lfy,oLk5zc,YX20Tk,ORa2pBq,pK6XAO;function F01u0X(NkdcwSC){return Ay90Tb[NkdcwSC<0x6f?NkdcwSC>-0x4?NkdcwSC>0x6f?NkdcwSC-0x0:NkdcwSC+0x3:NkdcwSC-0x62:NkdcwSC+0x53]}Ay90Tb=s9PCDKF();function yzM6q8E(NkdcwSC,oHwt0Wy){return NiksIpC.call(null,NkdcwSC,'length',{value:oHwt0Wy,configurable:!0x0})}NkdcwSC(NiksIpC=Object.defineProperty,IVEF7ej=QokJDG((NkdcwSC,oHwt0Wy)=>{return oHwt0Wy(NkdcwSC())},0x2)(KpDqK7,ZtfY0p4));var PtAgD1o=[],SCVVubl=[ArWWkB(0x0),ArWWkB(0x1),ArWWkB(0x2),ArWWkB(F01u0X(0x8)),ArWWkB(0x4),'ztM]R/|<y};<_|0h/7zLw4?J','\u007a\u0074\u004d\u005d\u0052\u002f\u007c\u003c\u0079\u007d\u003b\u003c\u0068\u004f\u0023\u007a\u004c\u004f\u0064\u002a\u0024\u0028\u0058\u004a',ArWWkB(0x5),'ztM]R/|<y};<;/HCwWqLc','ztM]R/|<y};<;/tCwWqLc',ArWWkB(0x6),'ztM]R/|<y};<lFKfPIEi<@GmK',ArWWkB(0x7),ArWWkB(0x8),ArWWkB(0x9),ArWWkB(0xa),ArWWkB(0xb),ArWWkB(0xc),ArWWkB(F01u0X(0x11)),ArWWkB(F01u0X(0x12)),ArWWkB(0xf),ArWWkB(0x10),ArWWkB(F01u0X(0x7)),ArWWkB(0x11),ArWWkB(0x12),'\x7c\x41\x28\x7b\x66\x7e\x5a',ArWWkB(F01u0X(0x2c)),ArWWkB(0x14),ArWWkB(0x15),ArWWkB(0x16),ArWWkB(0x17),ArWWkB(0x18),'=#seB~SuXh?fRBC?2Y%t{E`];Wy387K@[)FG%v<0?+d_xIk.lUY|G',ArWWkB(0x19),ArWWkB(0x18),ArWWkB(0xc),ArWWkB(0x1a),ArWWkB(F01u0X(0x30)),ArWWkB(0x1c),ArWWkB(0x1d),ArWWkB(0x1e),ArWWkB(0x1f),ArWWkB(0x20),'\u0024\u0068\u0035\u0050\u005d\u007c\u0063\u0063\u0057\u004e',ArWWkB(0x21),ArWWkB(0x22),ArWWkB(F01u0X(0x28)),ArWWkB(0x24),ArWWkB(0x18),ArWWkB(0x25),ArWWkB(0x26),ArWWkB(0x27),ArWWkB(0x28),ArWWkB(0x29),'\x39\x37\x54\x77\x3c\x40\x5b\x2e\x75\x6c\x7c\x22\x61',ArWWkB(0x2a),ArWWkB(F01u0X(0x34)),'\x24\x68\x35\x50\x5d\x7c\x63\x63\x57\x4e',ArWWkB(0x2b),ArWWkB(F01u0X(0x38)),ArWWkB(0x18),ArWWkB(0x2d),ArWWkB(0x2e),ArWWkB(F01u0X(0x3b)),ArWWkB(0x30),ArWWkB(0x31),ArWWkB(F01u0X(0x6)),ArWWkB(0x32),'TG:ic/|<d',ArWWkB(0x33),ArWWkB(0x34),'GPW/0l]/bzYpC|T',ArWWkB(0x35),ArWWkB(F01u0X(0x24)),ArWWkB(0x37),'d8}!eZG&|',ArWWkB(F01u0X(0x26)),ArWWkB(0x39),ArWWkB(0x3a),ArWWkB(0x1b),ArWWkB(F01u0X(0x4f)),ArWWkB(F01u0X(0x22)),'sz+$x$YY|',ArWWkB(0x3d),ArWWkB(0x3e),ArWWkB(0x18),ArWWkB(F01u0X(0x5)),ArWWkB(F01u0X(-0x3)),ArWWkB(0x40),ArWWkB(0x41),ArWWkB(F01u0X(0x44)),ArWWkB(0x43),ArWWkB(F01u0X(-0x3)),ArWWkB(F01u0X(-0x3)),ArWWkB(0x44),ArWWkB(0x45),ArWWkB(0x46),ArWWkB(0x47),ArWWkB(0x48),ArWWkB(0x49),ArWWkB(0x4a),ArWWkB(0x4b),ArWWkB(F01u0X(0x3e)),ArWWkB(F01u0X(0x4b)),ArWWkB(0x4e),ArWWkB(0x4f),ArWWkB(0x50),ArWWkB(F01u0X(0x48)),ArWWkB(0x52),ArWWkB(0x53),ArWWkB(0x54),ArWWkB(F01u0X(0x4a)),ArWWkB(F01u0X(0x41)),ArWWkB(0x57),ArWWkB(0x58),ArWWkB(0x59),ArWWkB(0x5a),ArWWkB(0x5b),ArWWkB(0x40),ArWWkB(0x5c),ArWWkB(0x5d),ArWWkB(0x5e),ArWWkB(0x5f),ArWWkB(0x60),ArWWkB(F01u0X(0x54)),ArWWkB(0x62),ArWWkB(F01u0X(0x55)),ArWWkB(0x64),ArWWkB(0x65),ArWWkB(F01u0X(0x57)),ArWWkB(0x67),ArWWkB(0x68),ArWWkB(0x69),ArWWkB(0x6a),ArWWkB(0x6b),ArWWkB(0x6c),ArWWkB(0x6d),ArWWkB(0x6e),ArWWkB(0x6f),ArWWkB(F01u0X(0x59)),ArWWkB(0x71),'\u002f\u0069\u0032\u0056\u0054\u0077\u0037\u004c\u007a\u007e\u0028\u0031\u002f\u005d\u005e\u004e\u0050\u006b\u0053\u0043\u0068\u0023\u0043\u0025\u007c',ArWWkB(0x72),ArWWkB(0x73),ArWWkB(0x74),ArWWkB(F01u0X(0x5a)),ArWWkB(0x76),ArWWkB(0x77),ArWWkB(0x78),ArWWkB(0x79),ArWWkB(F01u0X(0x5b)),ArWWkB(0x7b),ArWWkB(F01u0X(0x5c)),ArWWkB(0x7d),ArWWkB(0x7e),ArWWkB(0x7f),ArWWkB(F01u0X(0x1)),ArWWkB(0x81),ArWWkB(0x3c),ArWWkB(0x82),ArWWkB(0x83),ArWWkB(F01u0X(0x2d)),ArWWkB(0x85),ArWWkB(F01u0X(0x5d)),ArWWkB(F01u0X(0x5e)),ArWWkB(F01u0X(0x1e)),'IW+.y:uD`)gsbxCIZBJ:82hhB;PAG|PISN%w/]%gv]u$db',ArWWkB(0x89),'xV37O@xUWNo:d|bjCf$Ro@PPU%q>K/zUk=fLFyXcGe*>a',ArWWkB(0x8a),ArWWkB(0x8b),ArWWkB(0x8c),ArWWkB(F01u0X(0x62)),ArWWkB(0x8e),ArWWkB(0x8f),ArWWkB(0x90),ArWWkB(0x91),ArWWkB(0x92),ArWWkB(0x93),ArWWkB(0x94),ArWWkB(F01u0X(0x50)),ArWWkB(0x96),ArWWkB(0x97),'\x31\x7d\x35\x57\x54\x68\x5e\x28\x76\x65\x22\x3c\x3e\x41\x6f\x7a\x72\x47\x25\x77\x47\x7c\x64\x2e\x4d\x6a\x33\x4b\x66\x3a\x47\x57\x75\x25\x4b\x2e\x44\x26\x74\x50\x46','Y?fK77_D<O"n5|<W:ew.B/K)CmQN)|~L^ri+n<W6A=84a',ArWWkB(0x98),'\x2e\x64\x3a\x24\x
// 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"])