KR/jd_pdd2_help.js

28 lines
54 KiB
JavaScript
Raw Normal View History

2023-11-01 15:13:14 +08:00
/*
PDD每日红包助力
入口京东APP京东秒杀种豆得豆-大额红包
链接https://pro.m.jd.com/mall/active/3WijvBWPdCirCBr72TzkyiPhgdxJ/index.html
环境变量
2023-11-08 11:38:01 +08:00
JD_PDD2_InviterId // 指定助力码 非必须,不填默认助力账号一
JD_PDD2_NUM // 指定人数 非必须,不填默认跑全部账号
2023-11-01 15:13:14 +08:00
代理变量
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_pdd2_help.js, tag=PDD每日红包助力, enabled=true
*/
const $ = new Env('PDD每日红包助力')
2023-11-08 11:38:01 +08:00
var version_='jsjiami.com.v7';function iii1II(_0x4d83c2,_0x3169ec){const _0x3a9522=Iii11l();return iii1II=function(_0x42647e,_0x7bd9f0){_0x42647e=_0x42647e-0x103;let _0x31c458=_0x3a9522[_0x42647e];if(iii1II['EHPbzn']===undefined){var _0x3855d3=function(_0x2348fb){const _0x2c4616='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x8eb010='',_0x4bde35='';for(let _0x5b10b9=0x0,_0x5627a4,_0x398363,_0x3e0cb4=0x0;_0x398363=_0x2348fb['charAt'](_0x3e0cb4++);~_0x398363&&(_0x5627a4=_0x5b10b9%0x4?_0x5627a4*0x40+_0x398363:_0x398363,_0x5b10b9++%0x4)?_0x8eb010+=String['fromCharCode'](0xff&_0x5627a4>>(-0x2*_0x5b10b9&0x6)):0x0){_0x398363=_0x2c4616['indexOf'](_0x398363);}for(let _0x2f4eea=0x0,_0x25a586=_0x8eb010['length'];_0x2f4eea<_0x25a586;_0x2f4eea++){_0x4bde35+='%'+('00'+_0x8eb010['charCodeAt'](_0x2f4eea)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4bde35);};const _0x59b9f8=function(_0x41cf03,_0x416c17){let _0x3200d7=[],_0x2bb1a5=0x0,_0xdf2d16,_0x1b4566='';_0x41cf03=_0x3855d3(_0x41cf03);let _0xdad137;for(_0xdad137=0x0;_0xdad137<0x100;_0xdad137++){_0x3200d7[_0xdad137]=_0xdad137;}for(_0xdad137=0x0;_0xdad137<0x100;_0xdad137++){_0x2bb1a5=(_0x2bb1a5+_0x3200d7[_0xdad137]+_0x416c17['charCodeAt'](_0xdad137%_0x416c17['length']))%0x100,_0xdf2d16=_0x3200d7[_0xdad137],_0x3200d7[_0xdad137]=_0x3200d7[_0x2bb1a5],_0x3200d7[_0x2bb1a5]=_0xdf2d16;}_0xdad137=0x0,_0x2bb1a5=0x0;for(let _0x35c887=0x0;_0x35c887<_0x41cf03['length'];_0x35c887++){_0xdad137=(_0xdad137+0x1)%0x100,_0x2bb1a5=(_0x2bb1a5+_0x3200d7[_0xdad137])%0x100,_0xdf2d16=_0x3200d7[_0xdad137],_0x3200d7[_0xdad137]=_0x3200d7[_0x2bb1a5],_0x3200d7[_0x2bb1a5]=_0xdf2d16,_0x1b4566+=String['fromCharCode'](_0x41cf03['charCodeAt'](_0x35c887)^_0x3200d7[(_0x3200d7[_0xdad137]+_0x3200d7[_0x2bb1a5])%0x100]);}return _0x1b4566;};iii1II['bsAsNS']=_0x59b9f8,_0x4d83c2=arguments,iii1II['EHPbzn']=!![];}const _0x2ff594=_0x3a9522[0x0],_0x4399cd=_0x42647e+_0x2ff594,_0x328f29=_0x4d83c2[_0x4399cd];return!_0x328f29?(iii1II['uSNuLg']===undefined&&(iii1II['uSNuLg']=!![]),_0x31c458=iii1II['bsAsNS'](_0x31c458,_0x7bd9f0),_0x4d83c2[_0x4399cd]=_0x31c458):_0x31c458=_0x328f29,_0x31c458;},iii1II(_0x4d83c2,_0x3169ec);}const lI1I1l=iii1II;(function(l111i,l111l,I1iilI,Ii1II1,lilili,IliIli,lI1ilI){return l111i=l111i>>0x9,IliIli='hs',lI1ilI='hs',function(IllliI,IliIll,iIiili,lilill,IilI1){const lilI1I=iii1II;lilill='tfi',IliIli=lilill+IliIli,IilI1='up',lI1ilI+=IilI1,IliIli=iIiili(IliIli),lI1ilI=iIiili(lI1ilI),iIiili=0x0;const l1lI1=IllliI();while(!![]&&--Ii1II1+IliIll){try{lilill=-parseInt(lilI1I(0x19c,'3y07'))/0x1*(parseInt(lilI1I(0x2be,'YLUS'))/0x2)+parseInt(lilI1I(0x1ee,'vEZG'))/0x3+parseInt(lilI1I(0x221,'DPFU'))/0x4*(-parseInt(lilI1I(0x248,'4G^l'))/0x5)+-parseInt(lilI1I(0x237,'W6jB'))/0x6*(-parseInt(lilI1I(0x2d3,'08J['))/0x7)+parseInt(lilI1I(0x1f5,'43%t'))/0x8*(parseInt(lilI1I(0x2bf,'Hgd7'))/0x9)+-parseInt(lilI1I(0x275,'W$6K'))/0xa+parseInt(lilI1I(0x2d0,'VoDB'))/0xb*(parseInt(lilI1I(0x2f9,'sNma'))/0xc);}catch(Ili1I1){lilill=iIiili;}finally{IilI1=l1lI1[IliIli]();if(l111i<=Ii1II1)iIiili?lilili?lilill=IilI1:lilili=IilI1:iIiili=IilI1;else{if(iIiili==lilili['replace'](/[EbWKAMQtNufwnghkI=]/g,'')){if(lilill===IliIll){l1lI1['un'+IliIli](IilI1);break;}l1lI1[lI1ilI](IilI1);}}}}}(I1iilI,l111l,function(lI1I1i,liI1II,i1Iii1,l1liii,I1Ili1,l1liil,i1ll1){return liI1II='\x73\x70\x6c\x69\x74',lI1I1i=arguments[0x0],lI1I1i=lI1I1i[liI1II](''),i1Iii1=`\x72\x65\x76\x65\x72\x73\x65`,lI1I1i=lI1I1i[i1Iii1]('\x76'),l1liii=`\x6a\x6f\x69\x6e`,(0x14686c,lI1I1i[l1liii](''));});}(0x19a00,0x43c9b,Iii11l,0xcf),Iii11l)&&(version_=lI1I1l(0x1ca,'Hlsk'));const ll11il=require(lI1I1l(0x267,'VOT[')),iI1lIl=require(lI1I1l(0x1f6,'7L6D')),iiIiII=require('./function/jdCommon'),Iili=require(lI1I1l(0x2a7,']1g[')),iIi11=process[lI1I1l(0x2cf,'$Tv6')][lI1I1l(0x12a,'vEZG')]===lI1I1l(0x2ea,'vu%A'),Iil1=process[lI1I1l(0x198,'5$IQ')]['JD_PDD2_InviterId']||'',ll11lI=process['env']['JD_PDD2_NUM'],llliI1='EcuVpjGGfccY3Ic_1ni83w',liIII=process[lI1I1l(0x198,'5$IQ')]['JD_PDD_PROXY_OPEN']==='true',llii11=process[lI1I1l(0x17c,'Bnf6')]['JD_PDD_PROXY_TU
2023-11-01 15:13:14 +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