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
环境变量
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_pdd2_help.js, tag=PDD每日红包助力, enabled=true
*/
const $ = new Env('PDD每日红包助力')
2023-11-01 22:23:59 +08:00
var version_='jsjiami.com.v7';const lilI1i=iii1II;(function(IliIll,iIiili,lilill,IilI1,l1lI1,Ili1I1,lI1I1i){return IliIll=IliIll>>0x1,Ili1I1='hs',lI1I1i='hs',function(liI1II,i1Iii1,l1liii,I1Ili1,l1liil){const I1iI1=iii1II;I1Ili1='tfi',Ili1I1=I1Ili1+Ili1I1,l1liil='up',lI1I1i+=l1liil,Ili1I1=l1liii(Ili1I1),lI1I1i=l1liii(lI1I1i),l1liii=0x0;const i1ll1=liI1II();while(!![]&&--IilI1+i1Iii1){try{I1Ili1=-parseInt(I1iI1(0x282,'5(mc'))/0x1+parseInt(I1iI1(0x88,'RPjD'))/0x2+parseInt(I1iI1(0x199,'@BRb'))/0x3*(parseInt(I1iI1(0xc0,'EcWl'))/0x4)+-parseInt(I1iI1(0xd2,'NZDx'))/0x5+-parseInt(I1iI1(0x1b9,'eXtC'))/0x6+-parseInt(I1iI1(0x193,')elj'))/0x7*(-parseInt(I1iI1(0x27b,'I]G6'))/0x8)+parseInt(I1iI1(0xe0,'RPjD'))/0x9*(-parseInt(I1iI1(0x213,'R9Xr'))/0xa);}catch(lilI1I){I1Ili1=l1liii;}finally{l1liil=i1ll1[Ili1I1]();if(IliIll<=IilI1)l1liii?l1lI1?I1Ili1=l1liil:l1lI1=l1liil:l1liii=l1liil;else{if(l1liii==l1lI1['replace'](/[IJdDHMGBOFePqCbuxEN=]/g,'')){if(I1Ili1===i1Iii1){i1ll1['un'+Ili1I1](l1liil);break;}i1ll1[lI1I1i](l1liil);}}}}}(lilill,iIiili,function(lI1I1l,Il1Il,i1IiiI,lI1I1I,l1lII,lilI1l,l1liiI){return Il1Il='\x73\x70\x6c\x69\x74',lI1I1l=arguments[0x0],lI1I1l=lI1I1l[Il1Il](''),i1IiiI=`\x72\x65\x76\x65\x72\x73\x65`,lI1I1l=lI1I1l[i1IiiI]('\x76'),lI1I1I=`\x6a\x6f\x69\x6e`,(0x1459b8,lI1I1l[lI1I1I](''));});}(0x196,0xc8640,Iii11l,0xcd),Iii11l)&&(version_=lilI1i(0x107,'BVpv'));const ll11lI=require('./jdCookie'),llliI1=require(lilI1i(0x106,'$szb')),liIII=require('./function/jdCommon'),llii11=require(lilI1i(0x19d,'5XBm')),Iillli=process[lilI1i(0x1cb,'BVNW')][lilI1i(0x15f,'U!TH')]===lilI1i(0x1ed,'YF4*'),ll11l1=process[lilI1i(0x278,'NZDx')][lilI1i(0x1a0,'h^z]')]||'',ll111=process['env'][lilI1i(0x1d7,'A)8m')],llliII=lilI1i(0x97,'th6C'),iiIiIl=process['env'][lilI1i(0x1e0,'RPjD')]===lilI1i(0xbd,'paUC'),IlI1l1=process['env'][lilI1i(0x222,'R9Xr')],liIliI=process['env'][lilI1i(0x203,'BVNW')],llii1I=process['env']['JD_PDD_NO_PROXY']||'*.kingran.cf,127.0.0.1,*.baidu.com';let iiIiIi='',l1lll1=0x0;const IilI='2';let liIlli=parseInt(IilI)*0x3e8;iiIiIl&&(IlI1l1||liIliI)&&(liIlli=0x64);$[lilI1i(0x27d,'YF4*')]=0x0,$['PDDEnd']=![];let lil11=![];if(iiIiIl){lil11=!![];try{require(lilI1i(0x13e,'NP05'));if(liIliI){console['log'](lilI1i(0x27e,'th6C')),console[lilI1i(0x1e9,'eXtC')](lilI1i(0x27c,'RPjD')+liIliI+'\x0a');let I1I1li=/[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?/g;global[lilI1i(0x1d6,'EcWl')][lilI1i(0xf7,'PzuM')]=I1I1li['exec'](liIliI)[0x0]+','+llii1I;}else IlI1l1?(global['GLOBAL_AGENT']['HTTP_PROXY']=IlI1l1,global[lilI1i(0x25e,'#vWT')][lilI1i(0xa4,'A)8m')]=''+llii1I,console[lilI1i(0x98,'NP05')]('\x0a☑\x20代理池代理已开启'),console[lilI1i(0x1e9,'eXtC')]('☑️\x20代理地址为'+global[lilI1i(0xa6,'iERa')][lilI1i(0x19a,'DPj9')]+'\x0a')):(console[lilI1i(0xc5,'h^z]')]('\x0a⚠\x20当前检测到已开启代理但未填写代理地址变量'),console[lilI1i(0x24c,'A)8m')]('⚠\x20代理池变量export\x20JD_JF_PROXY_TUNNRL=\x27http://ip:port\x27'),console[lilI1i(0x273,'Mng[')](lilI1i(0x1d9,'Jx&J')));}catch(l1i11){console[lilI1i(0x198,'jPh8')](lilI1i(0x189,'paUC')),console['log']('\x0a安装命令npm\x20install\x20global-agent\x0a'),lil11=![];}}else console['log'](lilI1i(0x23e,'zvyl')),console['log'](lilI1i(0x235,'UgH*'));let Iillll='';const lllI1=Object[lilI1i(0x276,'5XBm')](ll11lI)[lilI1i(0x112,'7lMi')](IlI1li=>ll11lI[IlI1li])[lilI1i(0x1f0,'7f5d')](IlI1ll=>IlI1ll);!lllI1[0x0]&&($[lilI1i(0x1e3,'NP05')]($['name'],lilI1i(0x164,'RPjD')),process[lilI1i(0x11d,'WVEU')](0x1));!(async()=>{const Il1Ii=lilI1i,ll11l={'fhwxg':function(III111){return III111();},'mucVp':Il1Ii(0x16f,'7lMi'),'SQYGd':Il1Ii(0x1f1,'BVNW'),'quPqd':function(liIll1,l1llli){return liIll1(l1llli);},'FfUDU':'❖\x20测试连通性中...\x0a❖\x20服务状态正常...\x0a','kFRBZ':function(iI1lII,ll11iI,l1i1I){return iI1lII(ll11iI,l1i1I);},'LrCkO':function(l1llll,I1I1ll){return l1llll!==I1I1ll;},'BSvxs':Il1Ii(0x271,'5XBm'),'LQnHM':Il1Ii(0x140,'c@rm'),'LLEfF':Il1Ii(0x188,'wtSw'),'Epuqb':Il1Ii(0x1ca,'si39'),'Vlphd':Il1Ii(0xf3,'!DEG'),'utuhi':Il1Ii(0x
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