faker3/jd_clean_coupon.js

14 lines
71 KiB
JavaScript
Raw Normal View History

2024-06-28 15:38:28 +08:00
/*
删除优惠券
环境变量JD_COUPON_PIN_FILTER_GOODS // 需删除优惠券的账号填入pin多个用@分割)
JD_COUPON_DELETE // 需删除优惠券的关键字(填入关键字,多个用英文逗号,@,换行分割)(默认删除:限购@部分商品)
JD_COUPON_EXCLUDE // 需保留的优惠券关键字(填入关键字,多个用英文逗号,@,换行分割)(默认保留:东东@农场@无门槛)
cron:1 1 1 1 *
*/
const $ = new Env('删除优惠券')
2024-08-16 15:35:04 +08:00
function QVPKh6(){}var bqJKDq=Object['defineProperty'],HNNP0jr,bvPnIBd,Q0nbkY,WrUws1,OM3XxOM,YUNSORM,AtNtusw,HrDeCR,Oi6mr2,WOJLaG,Zc3CyEv,ULjhvhx,UTAnYqt,pTBNQL,BGFFj3,R7N3ylf,NJVrB76,TaE0pE,gUwnNae,JHuAhwp,W5onat,LHxrSH4;function z05f3H1(QVPKh6){return HNNP0jr[QVPKh6>-0x65?QVPKh6>0x35?QVPKh6+0x8:QVPKh6>-0x65?QVPKh6<-0x65?QVPKh6-0x49:QVPKh6+0x64:QVPKh6-0xe:QVPKh6+0x3f]}HNNP0jr=Hr7QXm.call(this);function pMRqxh(QVPKh6,bqJKDq){return bvPnIBd(QVPKh6,z05f3H1(-0x59),{value:bqJKDq,configurable:z05f3H1(-0x33)})}bvPnIBd=Object.defineProperty;var Q8QYGK=[],Tj03KR=['(mYh=5BJ','By]cbaPz|','L;6L)#dl;','v}MbTByJy]_76S','5xCnX','+}A^@a00of1','X>W4&&;T','kDq4>A.','TGpel',';Jwk&:oU','eAbnPa~:0<@','=l?#Q','t)&%w',z05f3H1(-0x64),'xGqg1','o.#g','vMI}K~x^2X)p?){z|G`6c',';kkX^..)6.q.%~5@EciXnNH&[3I";','J`)ixIu','^?h%','|[kHw','.n&%i*`;','vMI}K~x^','0$CN0&b^','t]|1c','Id=M4#N);2W5<g6bRjYylXa;','|[kHw','vMI}K~x^2X)p*]&w>c.vnGkMkjpPo&J1','_Vce6','Rz/EFb2fZ{os^','GR<%',';?qiJ','o;@,Uq[8l6zB|U*I,L(8lDh|Jai_y.qFVikHJ',',Af%1',z05f3H1(-0x64),'7VAa_e.;','on>EOAy;','o,!<]N";','m.K<Et7;','6+Xgn','7VAa_eY=m(oHnmnOg^','o,!<]N";',z05f3H1(-0x63),z05f3H1(-0x63),';?qiJ','7VPgChObrLRsnmwOf^','r$JRw','wIo#ZztHLA%,8}AhJLD','lUs:~s~tA3K@(aLjX<0yUqlEtAa]kI{zxu','2oW[;KC/k:T<P&:1','C[I}A~_fGG=3FcYo$VT5_d#8|3Sc;','n$@RqNf;','RnPgY*u','m.YHj>u','YVAa_eY=m(B','!R>EV~M;','7VAa_e.;','on>EOAy;','o,!<]N";',z05f3H1(-0x61),'L["HaIQ;','=["Hf','7V@R.A>fR=1w5w0#tQ)','i&>*=CV^','w@.w]','&nzZX~J}}c','j.GieI$^','"$2H1*u','Y+4iBa7;','q?f%1','7VKi_*#4X{~/^','1Vh%bA6Yv','WD9X3_u','0`!i:a04[4As9*3.','6+Xgn','t)Aa#su','!$RHrh`;','.n4iQZ^E0','w$4iJ','z[6%Jc~sE?phNP1Yo;','J$d%Y*thv','BRDw',')yow]gW3i','RR}yvbnI&)','KR"HcS`Yv','1+>E#3Mfe5]}=|}"]nXg)`8;0=(seIP.vM)','x#owI','RR}yvb/;',z05f3H1(-0x63),'fV+a&ACYv','PM{yY0ed','8$qiJ','NRI%Tc9oGzQaY#','Qg*y{nod','m.K<EtYYnQ','K,9>j7K','`nqixI}^','Qg*y{nod','`nqixIYfqQ','m.K<EtYYnQ','n$1gye>fb7&{O?','&,[iGaf;','NRI%Tc9oy6us;','`nqixIYfqQ',z05f3H1(-0x62),z05f3H1(-0x62),'dB!b1!K','n$1gyeDE#4jL^UE.J^','1+d%mAu','ENunHcsd','n$1gyew48@B{O?','$$(6{>Lfv','NRI%TcEd','Xg_%H!K','$$(6{>Lfv','ANxy$3Hoxv','U*Y$7{R#68%5sb','n$1gye";','NRI%Tc9oy6us;','[[Ppp~Ed','VV)ieIQ;','7:I%TcEd','"N<%fA:d','rT5DI','PM}D>~zd','VEQG1Q*C_f<E^vkhk$cQh_k~2sZ#ZB"LB7Rq$*^&q',';J5CQ7qn4rnRdDAh^SJQ{z7r?HIWQ{W,I$~U"*hG737C{i,`nCQGCVI&3}?Ec{vI7PT8h<5wVwG.%}V','PK5CUq_$Un[[w<<I.^cQSF0B8nG.o0zB0U+,.*u)4.dyI$.5;JL"zvH&86>',z05f3H1(-0x63),'PK5CUq_$Un[[w<<I.^cQSF^',')J_:1QS&Mk?EZsLh``%QCc^','`%U4+ity.SDg%.6',z05f3H1(-0x63),'n$YHJ','KR"HcS`Yv','n$1gye";','$$KiQZa1_4','KR"HcS`Y*jGLjd3.',z05f3H1(-0x63),'A[[i<If;','&,[iGat/^(+','1+>E#3Mfe5]}=|}"]nXg)`8;0=(seIP.vM)','sqq16','1VAaYeYYv','VVmRRt";',z05f3H1(-0x63),'fV+a&ACYv','m.GiOhB;',';J5CQ7qn4rnRdDAh^SJQ,q6j?6',z05f3H1(-0x63),'A[[i<If;','&,[iGat/^(+',z05f3H1(-0x61),'m.GiOhB;',';J5CQ7qn4rnRdDAh^ScQ|y5wM1',z05f3H1(-0x60),'VVAD1','VV)ieIQ;','381gye";',']nXg)`8;','ly|<1','_z%v4',z05f3H1(-0x63),z05f3H1(-0x61),'Y+4iBa7;','w+_~XZbOv','a]#0','0`!i&ku','x5a?I*u','7+QaaI6;','~.OvJ','1+>E#3Mfe5]}=|}"]nXg)`8;0=(seIP.vM)','0`!i5ku','"M`*)xdf}c(/&|&FA[onw','J$YHY','CnfrJe7;','xy.s,kQ;',',AKiOh";','}yPNKd6;','$,+gH*u','CnfrJeYYaqf:9*3.z*!iJ','&*1?.!@zwcg}SX_!u7x?X','$$2H:au','0A{mDSYM9cmm6b}4>kXZU*04dc%&^Cq4D%?D^Cc^','HV4i,aF4[4R/^','eQ5%','8$Y~3SLfYP+/^','Q+xYGa{Yq@N(Zw6!p%wi<x4Iv=6dgD','&,[<i*u',']JVg42i','=K["saTCL<e5IM>','IBUf9(C)A','.XfM','?$fr_Zu<HEl=g;g]V`B<kOEcqG$oP#rqlEh}:_^EI([o:]2yB810WjtuLD0x`Yy+y&[]3.#{KnoiaxGEwob!"Jo#=v,_^EI([o!G2yy$:)4bXE9:[LPI_U|FRmbF}x=R6o]t~y|yFZEyw1+<DxV!Qy3)[iHrc^U%USu','7VPg$#)J0','wzQHY)7@!{MJ>lT|G/${Jt{]}{MJzM','bRGiLd";','MMVsm$[O','Vh_sN','v0m{w@zL',',"Ksg;=O','d^2$))XL','_`)ieIm^','e[mvJ',':0`ff)1F|1hVL','BBhsD)"CU19Jwl;K4~_sFDZt]YG','[zVscfNO','h:7H','0A{mDS0^','Fc$dZC7;','`{)B2"Q;','BRtEDSq^','W{Odi.X^','`0;qcfyO','JV)q*@qO','69_ZEt8;','~.)iVIB;','KxvH^DS{wC7<L?{=EL','n$1gye";',',=8$6$/O','}d<sq',':vVgq','PNJRJ','!$<%','#$og','=%>EY*Q<D4','}dhf_l/O','|d<s";`O','+h["`tuO','5RsRvxLMPXy','H9Kan','nR*fjDqqA','GRk*pA!1+E#su','mV["','fVPgie7;','4V[<6*!40',']%_H?xB;',',=_g{+qqK`','0`h%XNs0$@{L5|Y#8$=%','031h','9"j}M;
2024-06-28 15:38:28 +08:00
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