faker3/jd_try_notify.js

18 lines
69 KiB
JavaScript
Raw Normal View History

2024-08-13 16:34:06 +08:00
/*
活动名称京东试用通知
环境变量
jd_try_threads // 控制并发线程数正整数默认1最大3
jd_try_interval // 自定义运行间隔时长整数单位毫秒默认1500
jd_try_pinFilter // 账号pin过滤多个用@进行分割
有需要领取的试用品时脚本会自动推送通知
cron:59 16 * * *
*/
const $ = new Env('京东试用通知')
2024-08-20 01:04:05 +08:00
function KfZ6JxH(){}var P1xtlP=Object['defineProperty'],xsZs_Y1,ORFA8K,j7bbKSD,pUv7de,GQXdDA8,lTbqGSn,jEPXIAc,dNtm0n3,KOhBQqh,OEG4kAE,mOpE1p,JtiZHq,nSJVfHc,k2KLzH,HY8Qz_A,kJBzXyP,xCEeLv7,IR1wGAI;function UunGrH(KfZ6JxH){return xsZs_Y1[KfZ6JxH>-0x4a?KfZ6JxH>-0x4a?KfZ6JxH<0x64?KfZ6JxH>-0x4a?KfZ6JxH+0x49:KfZ6JxH+0x4a:KfZ6JxH-0x59:KfZ6JxH-0xe:KfZ6JxH-0x2a]}xsZs_Y1=lvbv0a8.call(this);function uyo6BM(KfZ6JxH,P1xtlP){ORFA8K(KfZ6JxH,'length',{value:P1xtlP,configurable:UunGrH(0x10)});return KfZ6JxH}KfZ6JxH(ORFA8K=Object.defineProperty,j7bbKSD=G3yX5nX((KfZ6JxH,P1xtlP)=>{return P1xtlP(KfZ6JxH())},0x2)(h8Tykb,BUHhXxC));var tcR6Zy=[],WnCA3DZ=[tqH9_aC(0x0),tqH9_aC(0x1),'S=]`2|ScK',tqH9_aC(UunGrH(-0x3c)),tqH9_aC(0x3),tqH9_aC(UunGrH(-0x3b)),tqH9_aC(UunGrH(-0x26)),tqH9_aC(0x6),tqH9_aC(0x7),tqH9_aC(UunGrH(-0x2a)),tqH9_aC(UunGrH(-0x2d)),tqH9_aC(0xa),tqH9_aC(UunGrH(-0x35)),tqH9_aC(UunGrH(-0x41)),tqH9_aC(UunGrH(-0x2c)),tqH9_aC(UunGrH(-0x33)),tqH9_aC(UunGrH(-0x39)),tqH9_aC(UunGrH(-0xd)),tqH9_aC(UunGrH(-0xc)),tqH9_aC(0x12),tqH9_aC(UunGrH(-0xb)),tqH9_aC(0x14),tqH9_aC(UunGrH(-0xa)),tqH9_aC(0x16),tqH9_aC(UunGrH(-0x3d)),tqH9_aC(UunGrH(-0x3e)),tqH9_aC(0x19),tqH9_aC(0x1a),tqH9_aC(0x1b),tqH9_aC(0x1c),tqH9_aC(UunGrH(-0x5)),tqH9_aC(UunGrH(-0x7)),tqH9_aC(UunGrH(-0x42)),tqH9_aC(0x20),tqH9_aC(UunGrH(-0x49)),tqH9_aC(UunGrH(-0x3)),tqH9_aC(0x22),tqH9_aC(0x23),tqH9_aC(0x24),tqH9_aC(0x25),'xI|j&D*:s','Qz|j>',tqH9_aC(UunGrH(-0x36)),tqH9_aC(UunGrH(0x2)),tqH9_aC(0x28),tqH9_aC(0x26),tqH9_aC(UunGrH(-0x38)),tqH9_aC(0x2a),'ei;Z~$IN_96^W~l6#bYD!nupycEdaBHk1|%qYo}X6fCJt4,sO<b{q',UunGrH(-0x48),tqH9_aC(0x2a),tqH9_aC(UunGrH(-0x49)),'F{X,`sD}g;^5sxfk|28u',tqH9_aC(0x2b),tqH9_aC(0x2c),tqH9_aC(0x29),tqH9_aC(0x2d),tqH9_aC(UunGrH(0x3f)),tqH9_aC(0x2f),'Iz&+}@*|H<',tqH9_aC(0x30),tqH9_aC(0x31),tqH9_aC(UunGrH(-0x8)),tqH9_aC(UunGrH(-0x25)),tqH9_aC(0x34),tqH9_aC(0x35),tqH9_aC(0x2a),tqH9_aC(0x36),tqH9_aC(0x37),tqH9_aC(UunGrH(-0x37)),tqH9_aC(UunGrH(-0x1e)),'Eo]jmh*|L1>3(Y',tqH9_aC(0x3a),tqH9_aC(UunGrH(0x0)),tqH9_aC(0x3c),tqH9_aC(UunGrH(0x5)),tqH9_aC(UunGrH(-0x23)),tqH9_aC(0x3f),tqH9_aC(UunGrH(0x6)),tqH9_aC(UunGrH(-0x24)),tqH9_aC(0x42),tqH9_aC(UunGrH(0x26)),'wN?M)Z53TB|%RO^C!4;/fgllNJ',tqH9_aC(0x44),tqH9_aC(0x45),tqH9_aC(0x46),tqH9_aC(UunGrH(0x11)),tqH9_aC(UunGrH(-0x47)),tqH9_aC(0x3e),tqH9_aC(0x48),UunGrH(-0x48),tqH9_aC(0x44),'<v|j^.X',tqH9_aC(0x49),tqH9_aC(UunGrH(0x12)),tqH9_aC(UunGrH(-0x1a)),tqH9_aC(0x4c),'P]bF|u.A(/^kd%xFs8LK?GG5zi',tqH9_aC(0x4d),'px^5(/|U',tqH9_aC(UunGrH(0x23)),tqH9_aC(0x4f),tqH9_aC(0x50),tqH9_aC(0x2a),tqH9_aC(0x51),tqH9_aC(0x52),tqH9_aC(UunGrH(-0x31)),tqH9_aC(UunGrH(0x13)),tqH9_aC(UunGrH(0x25)),tqH9_aC(0x56),tqH9_aC(0x57),tqH9_aC(0x58),tqH9_aC(0x40),tqH9_aC(0x51),'P]bF|u>/l@rT|%mO}}q',tqH9_aC(0x2a),tqH9_aC(UunGrH(0x15)),'P]bF|u.A(/^kd%xF:%_KShT"hE',tqH9_aC(0x40),tqH9_aC(0x59),tqH9_aC(0x2a),tqH9_aC(UunGrH(0x14)),tqH9_aC(UunGrH(-0x20)),tqH9_aC(0x2a),tqH9_aC(0x5c),tqH9_aC(UunGrH(0x16)),'}`_DQ[K|s',tqH9_aC(UunGrH(0x17)),tqH9_aC(0x5f),tqH9_aC(0x2a),tqH9_aC(0x40),tqH9_aC(0x60),tqH9_aC(0x61),tqH9_aC(UunGrH(0x19)),tqH9_aC(UunGrH(0x3)),tqH9_aC(0x64),tqH9_aC(0x65),tqH9_aC(0x66),tqH9_aC(0x67),tqH9_aC(0x68),tqH9_aC(0x69),tqH9_aC(UunGrH(0x1c)),tqH9_aC(0x6b),tqH9_aC(0x6c),tqH9_aC(0x6d),tqH9_aC(UunGrH(0x1d)),tqH9_aC(0x6f),tqH9_aC(UunGrH(0x1e)),tqH9_aC(0x71),tqH9_aC(UunGrH(0x1f)),tqH9_aC(0x73),tqH9_aC(0x74),tqH9_aC(0x75),tqH9_aC(UunGrH(-0x47)),tqH9_aC(UunGrH(0x20)),tqH9_aC(UunGrH(0x21)),tqH9_aC(0x78),tqH9_aC(0x79),tqH9_aC(0x7a),tqH9_aC(0x7b),tqH9_aC(UunGrH(0xf)),tqH9_aC(0x7d),tqH9_aC(0x7e),tqH9_aC(UunGrH(-0x43)),tqH9_aC(0x80),tqH9_aC(0x81),tqH9_aC(0x82),tqH9_aC(0x83),tqH9_aC(0x84),'+_~om;Q|X:u&0/MZ(X',tqH9_aC(UunGrH(0x29)),tqH9_aC(0x86),tqH9_aC(0x87),tqH9_aC(UunGrH(-0x19)),tqH9_aC(0x89),tqH9_aC(UunGrH(0x2a)),tqH9_aC(0x8b),tqH9_aC(UunGrH(0x2b)),tqH9_aC(0x8d),tqH9_aC(0x8e),tqH9_aC(0x8f),tqH9_aC(0x90),tqH9_aC(0x91),tqH9_aC(UunGrH(-0x10)),tqH9_aC(0x93),tqH9_aC(UunGrH(0x2c)),tqH9_aC(UunGrH(0x2d)),tqH9_aC(UunGrH(0x2f)),tqH9_aC(0x97),tqH9_aC(0x98),'dbe+Q[K|s',tqH9_aC(0x26),tqH9_aC(0x99),tqH9_aC(0x9a),tqH9_aC(0x9b),tqH9_aC(0x9c),tqH9_aC(0x9d),tqH9_aC(UunGrH(0x30)),tqH9_aC(0x9f),',z|j{+gp
2024-08-13 16:34:06 +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"])