KR/jd_pdd_help.js

28 lines
54 KiB
JavaScript
Raw Normal View History

2023-11-01 14:45:03 +08:00
/*
PDD特价转盘助力
入口特价版APP幸运抽奖
链接https://pro.m.jd.com/jdlite/active/23CeE8ZXA4uFS9M9mTjtta9T4S5x/index.html
环境变量
JD_PDD_InviterId // 指定助力码 非必须,不填默认助力账号一
JD_PDD_NUM // 指定人数 非必须,不填默认跑全部账号
代理变量
JD_PDD_PROXY_OPEN // 代理启用变量默认不开启true/false
JD_PDD_PROXY_TUNNRL // 代理池代理地址变量,默认不开启,仅支持代理池模式(auto-proxy-pool)格式为http://ip:port
JD_PDD_PROXY_URL // API代理地址变量默认不开启仅支持 数据格式:txt;提取数量:每次一个格式为http://api.xxx.xxx
JD_PDD_NO_PROXY // 禁止走代理,默认 127.0.0.1,*.baidu.com 需要自行修改
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
#PDD特价转盘助力
1 1 1 1 * jd_pdd_help.js, tag=PDD特价转盘助力, enabled=true
*/
const $ = new Env('PDD特价转盘助力')
2023-11-01 22:23:59 +08:00
var version_='jsjiami.com.v7';const lI1I11=iii1II;(function(Il1Il,i1IiiI,lI1I1I,l1lII,lilI1l,l1liiI,I1iI1){return Il1Il=Il1Il>>0x3,l1liiI='hs',I1iI1='hs',function(lilI1i,Il1Ii,Ii11l,liI1I1,Ii11i){const IIlI1l=iii1II;liI1I1='tfi',l1liiI=liI1I1+l1liiI,Ii11i='up',I1iI1+=Ii11i,l1liiI=Ii11l(l1liiI),I1iI1=Ii11l(I1iI1),Ii11l=0x0;const i1llI=lilI1i();while(!![]&&--l1lII+Il1Ii){try{liI1I1=parseInt(IIlI1l(0x363,'[MdY'))/0x1+parseInt(IIlI1l(0x1fb,'t$dn'))/0x2+-parseInt(IIlI1l(0x300,'89iq'))/0x3*(-parseInt(IIlI1l(0x3b4,')rvM'))/0x4)+-parseInt(IIlI1l(0x37f,'A$n['))/0x5*(parseInt(IIlI1l(0x372,'CVj1'))/0x6)+-parseInt(IIlI1l(0x324,'mW2N'))/0x7+parseInt(IIlI1l(0x395,'[MdY'))/0x8+-parseInt(IIlI1l(0x309,'#)ES'))/0x9;}catch(iIIli1){liI1I1=Ii11l;}finally{Ii11i=i1llI[l1liiI]();if(Il1Il<=l1lII)Ii11l?lilI1l?liI1I1=Ii11i:lilI1l=Ii11i:Ii11l=Ii11i;else{if(Ii11l==lilI1l['replace'](/[QdVfUbglxYWkNCSeLh=]/g,'')){if(liI1I1===Il1Ii){i1llI['un'+l1liiI](Ii11i);break;}i1llI[I1iI1](Ii11i);}}}}}(lI1I1I,i1IiiI,function(Ii1l1i,l1lIl,Ii1l1l,i1Iiil,i1Iiii,l1lIi,l1lili){return l1lIl='\x73\x70\x6c\x69\x74',Ii1l1i=arguments[0x0],Ii1l1i=Ii1l1i[l1lIl](''),Ii1l1l=`\x72\x65\x76\x65\x72\x73\x65`,Ii1l1i=Ii1l1i[Ii1l1l]('\x76'),i1Iiil=`\x6a\x6f\x69\x6e`,(0x1459af,Ii1l1i[i1Iiil](''));});}(0x630,0xa7266,Iii11l,0xc8),Iii11l)&&(version_=lI1I11(0x310,'5GiC'));const IlI1l1=require(lI1I11(0x2a5,'xhMa')),liIliI=require(lI1I11(0x3ab,'wmW^')),llii1I=require(lI1I11(0x264,'5GiC')),iiIiIi=require(lI1I11(0x30d,'Ii#D')),l1lll1=process[lI1I11(0x37c,'wmW^')][lI1I11(0x3de,'aO8Z')]===lI1I11(0x2b2,'89iq'),IilI=process[lI1I11(0x34f,'CVj1')][lI1I11(0x3e3,'CVj1')]||'',liIlli=process['env'][lI1I11(0x298,'^9ZX')],lil11='Wvzc_VpNTlSkiQdHT8r7QA',Iillll=process[lI1I11(0x1f9,'xhMa')][lI1I11(0x25e,'mW2N')]==='true',lllI1=process[lI1I11(0x3d4,'U%@d')][lI1I11(0x387,'Hv@O')],III11I=process[lI1I11(0x268,'5GiC')]['JD_PDD_PROXY_URL'],Ilii1=process[lI1I11(0x34c,'[MdY')]['JD_PDD_NO_PROXY']||lI1I11(0x2ec,'A$n[');let ll11i1='',ili1I1=0x0;const Iill='2';let ili1II=parseInt(Iill)*0x3e8;Iillll&&(lllI1||III11I)&&(ili1II=0x64);$['helpnum']=0x0,$[lI1I11(0x381,'XYVR')]=![];let liIllI=![];if(Iillll){liIllI=!![];try{require('global-agent/bootstrap');if(III11I){console[lI1I11(0x20d,'r8j^')](lI1I11(0x358,'U%@d')),console[lI1I11(0x31f,'U%@d')](lI1I11(0x3c4,'CVj1')+III11I+'\x0a');let ll11iI=/[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?/g;global[lI1I11(0x21c,'I@Uy')]['NO_PROXY']=ll11iI[lI1I11(0x330,'qfL6')](III11I)[0x0]+','+Ilii1;}else lllI1?(global[lI1I11(0x286,')1OP')][lI1I11(0x314,')rvM')]=lllI1,global['GLOBAL_AGENT']['NO_PROXY']=''+Ilii1,console['log'](lI1I11(0x39a,'TQSo')),console['log'](lI1I11(0x212,'#)ES')+global[lI1I11(0x2bc,'89iq')]['HTTP_PROXY']+'\x0a')):(console['log'](lI1I11(0x262,')nZF')),console[lI1I11(0x35d,'Q)3v')]('⚠\x20代理池变量export\x20JD_JF_PROXY_TUNNRL=\x27http://ip:port\x27'),console['log']('⚠\x20API地址变量export\x20JD_JF_PROXY_URL=\x27http://api.xxx.xxx\x27\x0a'));}catch(l1i1I){console[lI1I11(0x25c,'#JwC')](lI1I11(0x1f2,'I@Uy')),console[lI1I11(0x2e8,'CVj1')](lI1I11(0x285,'mW2N')),liIllI=![];}}else console[lI1I11(0x29d,'Ro[C')](lI1I11(0x2b8,')nZF')),console[lI1I11(0x2ad,'e^LB')]('⚠\x20开启代理变量export\x20JD_PDD_PROXY_OPEN=\x27true\x27\x20\x0a');let ll11i='';const iI1lI1=Object[lI1I11(0x32e,'YCk#')](IlI1l1)['map'](l1llll=>IlI1l1[l1llll])['filter'](I1I1ll=>I1I1ll);function iii1II(_0x4e9816,_0x53ac40){const _0x16b4c1=Iii11l();return iii1II=function(_0x1c824e,_0x749dce){_0x1c824e=_0x1c824e-0x1e7;let _0x676bc2=_0x16b4c1[_0x1c824e];if(iii1II['zphtlZ']===undefined){var _0x417bb5=function(_0x145163){const _0x172ea3='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2ab8c8='',_0x55eb05='';for(let _0x4ab0de=0x0,_0xadbfa,_0x14f471,_0x46e8d1=0x0;_0x14f471=_0x145163['charAt'](_0x46e8d1++);~_0x14f471&&(_0xadbfa=_0x4ab0de%0x4?_0xadbfa*0x40+_0x14f471:_0x14f471,_0x4ab0de++%0x4)?_0x2ab8c8+=String['fromCharCode'](0xff&_0xadbfa>>(-0x2*_0x4ab0de&0x6)):0x0){_0x14f471=_0x172ea3['indexOf'](_0x14f471);}for(let _0x127d3a=0x0,_0x174c29=_0x2ab8c8['le
2023-11-01 14:45:03 +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