KR/jd_lzkj_loreal_draw.js

28 lines
114 KiB
JavaScript
Raw Normal View History

2023-09-08 09:56:36 +08:00
/*
活动名称幸运抽奖超级无线
活动链接https://lzkj-isv.isvjcloud.com/prod/cc/interactsaas/index?activityType=<10020/10021/10026/10041/10042/10046/10062/10063/10073/10080>&templateId=<模板id>&activityId=<活动id>&nodeId=<nodeid>&prd=cjwx
环境变量jd_lzkj_loreal_draw_url // 活动链接
jd_lzkj_loreal_draw_Notify // 是否推送通知true/false默认不推送
jd_lzkj_loreal_draw_opencard // 是否入会true/false默认不入会
jd_lzkj_loreal_draw_break // 493后继续执行默认退出运行true/false
jd_lzkj_loreal_draw_Interval // 自定义抽奖间隔正整数默认1秒
jd_lzkj_loreal_draw_Number // 连续无次数跳出,默认 7 次,火爆账号请设置黑名单,否则也会占用次数
jd_lzkj_loreal_draw_MaxMiss // 最大连续未抽中次数(正整数),达到此次数后会跳过运行对应账号,默认不启用此功能
注释
2023-07-28 21:29:02 +08:00
请使用本地IP环境 请使用本地IP环境 请使用本地IP环境
2023-09-08 09:56:36 +08:00
需要链接中的三个必要参数才能正常访问活动页运行脚本至少需要提供 activityId 参数
只有在没有抽奖次数的前提下才会做任务做任务静默运行没有打印日志
2023-07-27 16:14:01 +08:00
cron:1 1 1 1 *
============Quantumultx===============
[task_local]
2023-09-08 09:56:36 +08:00
#幸运抽奖超级无线
1 1 1 1 * jd_lzkj_loreal_draw.js, tag=幸运抽奖超级无线, enabled=true
2023-07-28 23:36:10 +08:00
2023-09-08 09:56:36 +08:00
*/
const $ = new Env('幸运抽奖(超级无线)');
2023-09-27 09:26:33 +08:00
var version_='jsjiami.com.v7';const iiIlii1I=ii11lI1i;(function(I1ll1IIl,ii1IIii,lIIlil1I,lIi111l,iIi1iII1,Iliii1I,IilIi){return I1ll1IIl=I1ll1IIl>>0x5,Iliii1I='hs',IilIi='hs',function(liI1i1I,iIiiliI,iiI1iiI,ilIlllI1,iliIlllI){const l111IIi=ii11lI1i;ilIlllI1='tfi',Iliii1I=ilIlllI1+Iliii1I,iliIlllI='up',IilIi+=iliIlllI,Iliii1I=iiI1iiI(Iliii1I),IilIi=iiI1iiI(IilIi),iiI1iiI=0x0;const iIIill1i=liI1i1I();while(!![]&&--lIi111l+iIiiliI){try{ilIlllI1=parseInt(l111IIi(0x2c8,'JtRX'))/0x1+-parseInt(l111IIi(0x32d,'pzst'))/0x2+-parseInt(l111IIi(0x2d9,'D9fZ'))/0x3+parseInt(l111IIi(0x386,'yplB'))/0x4*(-parseInt(l111IIi(0x595,'%alB'))/0x5)+-parseInt(l111IIi(0x12c,'Gzj['))/0x6+-parseInt(l111IIi(0x36b,'v8PT'))/0x7+parseInt(l111IIi(0x53a,'qm[z'))/0x8;}catch(ilIiliI){ilIlllI1=iiI1iiI;}finally{iliIlllI=iIIill1i[Iliii1I]();if(I1ll1IIl<=lIi111l)iiI1iiI?iIi1iII1?ilIlllI1=iliIlllI:iIi1iII1=iliIlllI:iiI1iiI=iliIlllI;else{if(iiI1iiI==iIi1iII1['replace'](/[kQphLRPtGnXMHwlubUeF=]/g,'')){if(ilIlllI1===iIiiliI){iIIill1i['un'+Iliii1I](iliIlllI);break;}iIIill1i[IilIi](iliIlllI);}}}}}(lIIlil1I,ii1IIii,function(lIlili,lIiIiiII,ll11l11,lli1Ii1l,l11I1iI1,Il1iIl1I,i1lil1li){return lIiIiiII='\x73\x70\x6c\x69\x74',lIlili=arguments[0x0],lIlili=lIlili[lIiIiiII](''),ll11l11=`\x72\x65\x76\x65\x72\x73\x65`,lIlili=lIlili[ll11l11]('\x76'),lli1Ii1l=`\x6a\x6f\x69\x6e`,(0x1401fa,lIlili[lli1Ii1l](''));});}(0x1860,0xaf557,liIIIlI1,0xc5),liIIIlI1)&&(version_=liIIIlI1);const ii11l111=$['isNode']()?require(iiIlii1I(0x535,'gW(%')):'',IlI1II1=require(iiIlii1I(0x3ab,'va[R')),llIiiiii=require('./function/sendJDNotify'),iiIilIll=require(iiIlii1I(0x379,'r6zS')),lIiiII1I=require('./function/krgetToken'),{loreal_savePrize:lI111il1}=require('./function/krsavePrize'),llllIlli=require('crypto-js');let Iill1iii=[];const Ii11lii1=process[iiIlii1I(0x374,')d72')]['jd_lzkj_loreal_draw_url']||'',il1lIlIi=process[iiIlii1I(0x293,'Tqhd')][iiIlii1I(0x57f,'VTuX')]===iiIlii1I(0x537,'$8fE'),iiIii1II=process['env']['jd_lzkj_loreal_draw_Notify']===iiIlii1I(0x573,'pzst'),Iil1lIlI=process['env'][iiIlii1I(0x2b9,'Gzj[')]===iiIlii1I(0x5b4,'zm$Q'),IIIIll1=process[iiIlii1I(0x47d,'D9fZ')][iiIlii1I(0x395,'db3h')]||'';let lllI11il=process['env']['jd_lzkj_loreal_draw_MaxMiss']||'',liliIiii=!![],il1I1l1i=process['env'][iiIlii1I(0x393,'db3h')]?process['env'][iiIlii1I(0x5da,'J2xl')]:'7',Illi1l='',iI1ii1I1='';if($[iiIlii1I(0x211,'yplB')]()){if(JSON['stringify'](process['env'])[iiIlii1I(0x5f3,'Cwq$')]('GITHUB')>-0x1)process[iiIlii1I(0x27d,')wVJ')](0x0);Object[iiIlii1I(0x1b0,'l$[Q')](ii11l111)[iiIlii1I(0x33f,')wVJ')](iiIIilil=>{Iill1iii['push'](ii11l111[iiIIilil]);});if(process[iiIlii1I(0x502,'IkhF')]['JD_DEBUG']&&process[iiIlii1I(0x1c6,'%a]b')]['JD_DEBUG']==='false')console[iiIlii1I(0x55b,'(dG1')]=()=>{};}else Iill1iii=[$['getdata'](iiIlii1I(0x2be,'gW(%')),$['getdata'](iiIlii1I(0x3fe,'J2xl')),...$[iiIlii1I(0x165,'0E#b')]($[iiIlii1I(0x524,'l$[Q')]('CookiesJD')||'[]')['map'](iiliiIil=>iiliiIil[iiIlii1I(0x588,'%a]b')])]['filter'](IiIllIiI=>!!IiIllIiI);function ii11lI1i(_0x1d4dcc,_0x433a56){const _0x564679=liIIIlI1();return ii11lI1i=function(_0x22bd08,_0x3871c8){_0x22bd08=_0x22bd08-0x11c;let _0x58da93=_0x564679[_0x22bd08];if(ii11lI1i['JFwYtZ']===undefined){var _0x499c34=function(_0x1e7660){const _0x41b36d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2d701c='',_0x5c788c='';for(let _0x4f807f=0x0,_0x5036cb,_0x21d8df,_0x12f6ad=0x0;_0x21d8df=_0x1e7660['charAt'](_0x12f6ad++);~_0x21d8df&&(_0x5036cb=_0x4f807f%0x4?_0x5036cb*0x40+_0x21d8df:_0x21d8df,_0x4f807f++%0x4)?_0x2d701c+=String['fromCharCode'](0xff&_0x5036cb>>(-0x2*_0x4f807f&0x6)):0x0){_0x21d8df=_0x41b36d['indexOf'](_0x21d8df);}for(let _0x29d4b8=0x0,_0x35ff09=_0x2d701c['length'];_0x29d4b8<_0x35ff09;_0x29d4b8++){_0x5c788c+='%'+('00'+_0x2d701c['charCodeAt'](_0x29d4b8)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x5c788c);};const _0x474c91=function(_0x4360cb,_0xefb769){let _0x58f36a=[],_0x48c76b=0x0,_0x363e1b,_0x30d860='';_0x4360cb=_0x499c34(_0x4360cb);let _0x2c61e8;for(_0x2c61e8=0x0;_0x2c61e8<0x100;_0x2c61e8++){_0x58f36a[_0x2c
2023-07-27 16:14:01 +08:00
// prettier-ignore
2023-09-08 09:56:36 +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