faker3/jd_clean_cart.js

14 lines
70 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
2024-08-17 19:41:53 +08:00
活动名称清空购物车
环境变量jd_clean_cart_interval // 自定义运行间隔时长整数单位毫秒默认2500
jd_clean_cart_notify // 是否推送通知true/false默认不推送
jd_clean_cart_pinFilter // 账号pin过滤多个用@进行分割
2024-06-28 15:38:28 +08:00
2024-08-17 19:41:53 +08:00
cron:1 1 1 1 *
2024-06-28 15:38:28 +08:00
2024-08-17 19:41:53 +08:00
*/
const $ = new Env('清空购物车');
2024-08-22 23:38:06 +08:00
function UPjYIoy(){}var Vth0ihp=Object['defineProperty'],ToIe3L,o3tx7_,jqStE5f,hXsvR3,MOTsBR,h4eV4KL,QuqFCa7,MbhEcG6,ZAw1IjQ,ymJoxFG,pcm40H,hY7RAg,YsdOPn,X46h0M,r5gD9SH,p2Y0VA,tkkw6v,n2KW_4,t2fsyX,GSkinAt;function pAhVmeH(UPjYIoy){return ToIe3L[UPjYIoy<-0x32?UPjYIoy+0x24:UPjYIoy>0x5e?UPjYIoy+0x3:UPjYIoy<-0x32?UPjYIoy-0x1a:UPjYIoy+0x31]}ToIe3L=y6zwV_P.call(this);function P6F4OAk(UPjYIoy,Vth0ihp){return o3tx7_.call(pAhVmeH(0x2c),UPjYIoy,'length',{value:Vth0ihp,configurable:pAhVmeH(0x1c)})}UPjYIoy(o3tx7_=Object.defineProperty,jqStE5f=iUa2Z1((UPjYIoy,Vth0ihp)=>{return Vth0ihp(UPjYIoy())},0x2)(BSqfjY5,nWpcRQe));var l_KVSR=[],wydI4RP=[ywotuJQ(0x0),ywotuJQ(0x1),ywotuJQ(pAhVmeH(-0x1c)),ywotuJQ(0x3),ywotuJQ(0x4),ywotuJQ(0x5),ywotuJQ(pAhVmeH(-0x27)),ywotuJQ(0x7),ywotuJQ(pAhVmeH(-0x16)),ywotuJQ(pAhVmeH(-0x5)),ywotuJQ(pAhVmeH(-0x7)),'LQp|&3NA',ywotuJQ(0xb),ywotuJQ(0xc),ywotuJQ(pAhVmeH(-0xe)),ywotuJQ(pAhVmeH(-0x17)),ywotuJQ(0xf),ywotuJQ(0x10),ywotuJQ(0x11),ywotuJQ(pAhVmeH(-0x2d)),ywotuJQ(0x13),ywotuJQ(0x14),ywotuJQ(pAhVmeH(-0x23)),ywotuJQ(pAhVmeH(-0x20)),ywotuJQ(pAhVmeH(0x5)),ywotuJQ(0x18),ywotuJQ(0x19),ywotuJQ(0x1a),ywotuJQ(0x1b),'p(U2ft6opEe018|C#C+AHXc)o',ywotuJQ(0x1c),ywotuJQ(0x1d),ywotuJQ(0x1e),ywotuJQ(pAhVmeH(0x3)),ywotuJQ(0x20),ywotuJQ(0x21),ywotuJQ(0x22),ywotuJQ(0x23),ywotuJQ(0x24),ywotuJQ(pAhVmeH(-0x22)),ywotuJQ(0x26),ywotuJQ(0x27),ywotuJQ(0x28),ywotuJQ(0x29),ywotuJQ(pAhVmeH(0x6)),ywotuJQ(0x2b),ywotuJQ(pAhVmeH(0x7)),ywotuJQ(0x2d),ywotuJQ(0x2e),ywotuJQ(0x2f),ywotuJQ(pAhVmeH(0x58)),ywotuJQ(0x31),pAhVmeH(-0x30),ywotuJQ(pAhVmeH(0x8)),ywotuJQ(0x33),'ZR)D#O|ythYP9',ywotuJQ(0x34),ywotuJQ(0x35),ywotuJQ(0x36),ywotuJQ(pAhVmeH(0xf)),ywotuJQ(0x38),'iH?@|mM2D{w)_Ln#Y8pW46QQH,',ywotuJQ(pAhVmeH(-0x31)),ywotuJQ(0x2a),'+k<#*otWle|)oCyb{2d.N=cpY1wOVEkLlp%:{}RsS}',ywotuJQ(0x34),ywotuJQ(0x39),ywotuJQ(pAhVmeH(-0x18)),ywotuJQ(0x3b),ywotuJQ(0x3c),ywotuJQ(0x3d),ywotuJQ(pAhVmeH(0xc)),ywotuJQ(0x3f),ywotuJQ(0x40),ywotuJQ(0x41),ywotuJQ(0x42),ywotuJQ(0x2b),ywotuJQ(0x2c),ywotuJQ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ywotuJQ(pAhVmeH(0x22)),'=!$4m|tH',ywotuJQ(pAhVmeH(0x10)),ywotuJQ(0x6d),ywotuJQ(0x6e),ywotuJQ(0x6f),ywotuJQ(0x70),ywotuJQ(0x71),';Cxv3|RLjQ8(zE/.{WOv^',ywotuJQ(pAhVmeH(0x52)),ywotuJQ(0x73),ywotuJQ(pAhVmeH(-0x24)),ywotuJQ(pAhVmeH(0x26)),ywotuJQ(0x76),ywotuJQ(0x77),ywotuJQ(pAhVmeH(0x28)),ywotuJQ(pAhVmeH(0x29)),ywotuJQ(0x7a),ywotuJQ(0x7b),ywotuJQ(0x7c),ywotuJQ(0x7d),ywotuJQ(0x7e),ywotuJQ(pAhVmeH(-0x29)),ywotuJQ(0x80),ywotuJQ(0x81),ywotuJQ(0x82),'H]t~/z(lQAP#ZTz9S66J#&9Ts{OjG2|','02tc:Q;P|R`EQC]2*?U85,Lt}4?l>mb','hA04IbMwq2x(Pnpiie$<|ZggBL^S9]I',ywotuJQ(0x83),ywotuJQ(0x84),ywotuJQ(pAhVmeH(0x2a)),ywotuJQ(0x86),ywotuJQ(0x87),ywotuJQ(0x88),ywotuJQ(0x89),',KJc"UsiBYumM%|',ywotuJQ(0x8a),ywotuJQ(pAhVmeH(-0x1a)),ywotuJQ(0x8c),ywotuJQ(0x8d),ywotuJQ(0x8e),ywotuJQ(pAhVmeH(-0x1e)),ywotuJQ(pAhVmeH(-0x2e)),ywotuJQ(pAhVmeH(0x50)),ywotuJQ(pAhVmeH(0x2d)),ywotuJQ(0x92),ywotuJQ(pAhVmeH(0x2e)),ywotuJQ(0x94),ywotuJQ(0x95),ywotuJQ(0x96),ywotuJQ(0x97),ywotuJQ(pAhVmeH(0x2f)),ywotuJQ(0x99),ywotuJQ(0x9a),ywotuJQ(0x9b
2024-06-28 15:38:28 +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.d