mirror of
https://github.com/shufflewzc/faker3.git
synced 2024-11-10 09:39:18 +08:00
19 lines
41 KiB
JavaScript
19 lines
41 KiB
JavaScript
|
/*
|
|||
|
活动名称:幸运大转盘 · 无线营销
|
|||
|
活动链接:https://gzsl-isv.isvjcloud.com/wuxian/user/getLottery/<活动id>
|
|||
|
环境变量:jd_gzsl_getLottery_activityUrl // 活动链接
|
|||
|
|
|||
|
7 7 7 7 * jd_gzsl_getLottery.js
|
|||
|
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env('幸运大转盘(无线营销)')
|
|||
|
const notify = $.isNode() ? require('./sendNotify') : ''
|
|||
|
const jdCookieNode = $.isNode() ? require('./jdCookie') : ''
|
|||
|
const getToken = require('./function/getToken')
|
|||
|
|
|||
|
var version_='jsjiami.com.v7';const iillllIl=iIIll1Il;(function(I11I1lIi,IlI1IIiI,IlIlil1i,i1Ill1ll,Ii1llIii,I1ll1,l111iiil){return I11I1lIi=I11I1lIi>>0x6,I1ll1='hs',l111iiil='hs',function(ilIlli,IIl11lII,llilii1,iiill1Ii,Il11ilI1){const I1ill1I=iIIll1Il;iiill1Ii='tfi',I1ll1=iiill1Ii+I1ll1,Il11ilI1='up',l111iiil+=Il11ilI1,I1ll1=llilii1(I1ll1),l111iiil=llilii1(l111iiil),llilii1=0x0;const llIiIilI=ilIlli();while(!![]&&--i1Ill1ll+IIl11lII){try{iiill1Ii=-parseInt(I1ill1I(0x242))/0x1+-parseInt(I1ill1I(0x205))/0x2+parseInt(I1ill1I(0x2ae))/0x3+-parseInt(I1ill1I(0x1df))/0x4*(parseInt(I1ill1I(0x1ee))/0x5)+-parseInt(I1ill1I(0x2e4))/0x6*(parseInt(I1ill1I(0x2ba))/0x7)+parseInt(I1ill1I(0x2d2))/0x8+parseInt(I1ill1I(0x1c2))/0x9;}catch(iiIIi1II){iiill1Ii=llilii1;}finally{Il11ilI1=llIiIilI[I1ll1]();if(I11I1lIi<=i1Ill1ll)llilii1?Ii1llIii?iiill1Ii=Il11ilI1:Ii1llIii=Il11ilI1:llilii1=Il11ilI1;else{if(llilii1==Ii1llIii['replace'](/[FtuhePHQWlRqpbyXUrK=]/g,'')){if(iiill1Ii===IIl11lII){llIiIilI['un'+I1ll1](Il11ilI1);break;}llIiIilI[l111iiil](Il11ilI1);}}}}}(IlIlil1i,IlI1IIiI,function(lI11i,Ii1IlI1,i1IIi11l,Iii1lIi1,ilI111il,i111lli,lIIi11i){return Ii1IlI1='\x73\x70\x6c\x69\x74',lI11i=arguments[0x0],lI11i=lI11i[Ii1IlI1](''),i1IIi11l=`\x72\x65\x76\x65\x72\x73\x65`,lI11i=lI11i[i1IIi11l]('\x76'),Iii1lIi1=`\x6a\x6f\x69\x6e`,(0x135e1f,lI11i[Iii1lIi1](''));});}(0x3180,0xd0f88,IiI1i,0xc8),IiI1i)&&(version_=IiI1i);let cookiesArr=[],cookie='',allMessage='',activityUrl=process[iillllIl(0x2a8)][iillllIl(0x23c)]?process[iillllIl(0x2a8)][iillllIl(0x23c)]:'';if($[iillllIl(0x1c8)]()){Object[iillllIl(0x1f3)](jdCookieNode)[iillllIl(0x2b6)](i11lliIl=>{const i1lli1li=iillllIl;cookiesArr[i1lli1li(0x1e4)](jdCookieNode[i11lliIl]);});if(process[iillllIl(0x2a8)][iillllIl(0x1b3)]&&process[iillllIl(0x2a8)][iillllIl(0x1b3)]===iillllIl(0x2b8))console[iillllIl(0x1be)]=()=>{};}else cookiesArr=[$[iillllIl(0x2e0)](iillllIl(0x2b4)),$[iillllIl(0x2e0)](iillllIl(0x265)),...jsonParse($[iillllIl(0x2e0)](iillllIl(0x222))||'[]')[iillllIl(0x2d5)](IlIIiIil=>IlIIiIil[iillllIl(0x2b7)])][iillllIl(0x24b)](lIIlIIIi=>!!lIIlIIIi);if(activityUrl)activityId=getQueryString(''+activityUrl,iillllIl(0x1ca)),$[iillllIl(0x2ab)]=activityUrl[iillllIl(0x1fa)](/https?:\/\/([^/]+)/)[0x1];else{console[iillllIl(0x1be)](iillllIl(0x1cf));return;}let domains=iillllIl(0x29a)+$[iillllIl(0x2ab)];!(async()=>{const l1i1Ill=iillllIl,l11ll1I={'sbwIR':function(I1i1l1Ii,il1i11I1){return I1i1l1Ii+il1i11I1;},'YdNRz':function(Il1ilIiI,illil1ii){return Il1ilIiI+illil1ii;},'wvFGe':l1i1Ill(0x1c7),'VXUoL':l1i1Ill(0x2ce),'hgaRY':function(lili1l1,I1iIl11){return lili1l1!=I1iIl11;},'grPly':function(liiI1IIl,iii1111I){return liiI1IIl(iii1111I);},'ZCibp':l1i1Ill(0x279),'egzLq':l1i1Ill(0x1fb),'RCsBL':function(iIiII1II,IiiIlli1){return iIiII1II+IiiIlli1;},'yuEMQ':l1i1Ill(0x250),'eOEPI':function(lilliiII,lillIlll){return lilliiII<lillIlll;},'JKZFP':function(i1I11IiI,lIl1lli1){return i1I11IiI!==lIl1lli1;},'nYrsp':l1i1Ill(0x298),'nWKlH':function(lI1lIIll,ii11l1I1){return lI1lIIll(ii11l1I1);},'vLZgc':function(l1l1ll11){return l1l1ll11();},'sKxLj':l1i1Ill(0x2b9),'xpZFn':l1i1Ill(0x2ea)};if(!cookiesArr[0x0]){$[l1i1Ill(0x1ea)]($[l1i1Ill(0x1f1)],l11ll1I[l1i1Ill(0x2a5)],l11ll1I[l1i1Ill(0x291)],{'open-url':l11ll1I[l1i1Ill(0x291)]});return;}console[l1i1Ill(0x1be)](l11ll1I[l1i1Ill(0x29c)](l11ll1I[l1i1Ill(0x1d2)],activityUrl));for(let il1Iiii=0x0;l11ll1I[l1i1Ill(0x1f7)](il1Iiii,cookiesArr[l1i1Ill(0x2c3)]);il1Iiii++){if(l11ll1I[l1i1Ill(0x2c5)](l11ll1I[l1i1Ill(0x2ee)],l11ll1I[l1i1Ill(0x2ee)]))return l1ill1l[l1i1Ill(0x2df)](IliIIli);else{if(cookiesArr[il1Iiii]){cookie=cookiesArr[il1Iiii],originCookie=cookiesArr[il1Iiii],$[l1i1Ill(0x26d)]=l11ll1I[l1i1Ill(0x247)](decodeURIComponent,cookie[l1i1Ill(0x1fa)](/pt_pin=([^; ]+)(?=;?)/)&&cookie[l1i1Ill(0x1fa)](/pt_pin=([^; ]+)(?=;?)/)[0x1]),$[l1i1Ill(0x1aa)]=l11ll1I[l1i1Ill(0x267)](il1Iiii,0x1),$[l1i1Ill(0x221)]=!![],$[l1i1Ill(0x1f9)]='',message='',console[l1i1Ill(0x1be)](l1i1Ill(0x22e)+$[l1i1Ill(0x1aa)]+'】'+($[l1i1Ill(0x1f9)]||$[l1i1Ill(0x26d)])+l1i1Ill(0x2a1));if(!$[l1i1Ill(0x221)]){$[l1i1Ill(0x1ea)]($[l1
|
|||
|
|
|||
|
// 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
|