mirror of https://github.com/KingRan/KR.git
18 lines
45 KiB
JavaScript
18 lines
45 KiB
JavaScript
|
/**
|
|||
|
收藏大师-幸运抽奖
|
|||
|
|
|||
|
必须条件:配置文件或者环境变量中添加变量:
|
|||
|
//export jd_lottery_activityUrl="活动链接"
|
|||
|
|
|||
|
|
|||
|
cron:1 1 1 1 *
|
|||
|
============Quantumultx===============
|
|||
|
[task_local]
|
|||
|
#收藏大师-幸运抽奖
|
|||
|
1 1 1 1 * jd_txzj_lottery.js, tag=收藏大师-幸运抽奖, enabled=true
|
|||
|
*/
|
|||
|
|
|||
|
const $ = new Env("收藏大师-幸运抽奖");
|
|||
|
var OO0$='jsjiami.com.v6',OO0$_=['OO0$'],O00O=[OO0$,'cwVdWMKB','wrUpbgs4w4zDhjjDvBI=','w5vChcK/w6w=','KkTDsFhXw7nDvMKrw4ksw5pMdMOuwqV8MMK6Wh4Qf8Kq6K2N5rGz5aaD6LWc77+g6K2Z5qK45p6i57+a6La96YaP6K2g','wqvCpSs0','woPCt1pUO8KKwpbDt8OhAn7DiwDorZzmsq/lpZfot6Lvva3or7jmoLfmnJrnv6/otJXphLrorrA=','woTDsykQOTUMw67Ctl5jwrhkw6vCiQgMw5J9wroBdXHCl1A=','w50/BW/CnA==','LsOUw6zDosKA','JAXCkC3CvsO0','aHw3TMOn','wpnCocO1wqEp','wpcdKmkK','LsK1w6zCncKe','RcKNwpfCpTA=','X159Ww==','wrU4aE81w4TDgDXDrA==','w5vCm8OewpPDvQ==','wqvDmis0WA==','wpTDtAgIbA==','bRs8RsO+','w4PClH1Ww74=','w73Din/DoMOP','wpnCs0MRRw==','w6jCpcOWw6TDnA==','w4PClH03w74=','w51eBRDDvQ==','ZcKAHsKhUcK5aBPCow==','w4tMXUTCshQ=','w65Hwrhhwqs=','w6R9fsOvAw==','w4HDsEzDnMO0YA==','wqXCkh9IAw==','w5zDlsO+K3/DkMO3','cMO8PT1FOw==','TyQBYMK6','woLDhy94w67CsSo=','CHLDjVA=','UcOzwqbCukI=','Q8OGS8KG','55aP5a6v5Lq8','5oiP5aeT5pyU5L61','wofDkjxuOA==','w54bYEHCi213w5lCbmIHw7I6woTDp8KSw53CijrDpMKP6Kyx5rCb5aSS6Le6776R6K+d5qGK5pyV57+M6LSh6YWO6K6d','GHbCqcOvw6A=','w7rCuVPDpsOA','TMK5EAEB','AMKIwoXDpA==','MMOUw6zDosOh','AMO3w6TChcOF','YSM4wpXCmQ==','w4XDoAfDqw==','IAXCiDw=','eMKzwqE=','cBRQRF4=','VHzCqsKuRMOJwrzDtsOu','YMKZYw==','f1w4wovCmQ==','c8OoLT1U','wofCsyJwJg==','wqUjfkM=','MkbChBMo','UcKSwqbDm1w=','w4PCin0pwp8=','DmTDkw==','RcKTwpfCu1E=','5bec5a6f5oiY','asOnPCJELcKYSA==','HzvDiwfCnw==','wpjDnSppw6PCjQ==','VSYoHcKv','VC1zH8OA','wpXDrcO0wodu','LMKcYMKWwoh5LltIw77Ck2k9w4XCrMKYw7zDicOjw5xeSMKi6K2z5rOt5aWg6LeI77+n6KyQ5qGB5p2w57+46LeK6YeO6K2X','DMKbw543ORwBXMOaBMK8R8O5w7bCp3XCisOIOyHDosO+6K6x5rOx5aej6LSz772q6K2R5qK75p+2576O6LSk6YWw6K6g','wq5iwrwndgA=','w7LCinoQ','5bee6aCR5Y2R','w4NeenE=','w7rDt8OVfjc=','wofDkjwRJg==','fyNHw7TDuA==','dnxWLcKY','w7BHwrgewrU=','wrXDmkoqWA==','R8K7I8KHDw==','w6TDt8KqflY=','6YC+5Yuk5L2p5ZG5','w6TDt8Kqfkg=','w48Ywpol','w4MhenHCnA==','w7rDhizCh8Oe','WcK7I8KZcA==','wr93wqMTw7HCsw==','w6nDkivCjcKx','TSpm','wqB+wq4=','w4XDtDYa','wpIAZg==','Vy1qGQ==','wojDgMOCakQ=','wqrDncOXwqU7','w5sFw4Yhwo4=','QiplEQ==','BnbCt8KQw74=','JcKNUMOz','w73ClBscJQ==','TMOqf8Okw6U=','wqlswr02','w4LDliM3D1wvw5QWKg==','wp/DkDt4','wqFiwq4=','8Janme+7l8On5Lyy5oGO5Y6i','w6TCiMOVH0g=','8Ja+gcO4','SMKWw4Ui','w48FwoArwoFOw7jCpcOZw6U=','w7nxg5K7','woLDhz94w7HCjC0e','w4tMXQ==','8Y6vhTrnp4nliZ0=','w7NsZsOn','wqrDjsOMwqw7BVLCrAHChg==','w75QwqU1w4PCrBMJwoNeTg==','w5sWwp0w','D8KWwrXCqMK0w4vCkAvCoH4=','w7tbw7QVwp7CixjCgw==','W2HCpDcU','R8OEI8O4cA==','fMKEbcKzwp5SKEdLw44=','JSnCgQ==','w7TDgD4=','UDsK','8JSyuyjDpOerk+awkg==','wpxCwpgGSA==','wrrDphpMw4c=','w7wPR1PCqA==','w59zw7x/w7c=','b8K1KA==','6aK/5Y6a5aS26LWZ776y','w7lGw7A=','UcKMw4fCuiM=','RcKTwpfDhFE=','HsKIw6TDpMOF','E8KLwrs=','w71Wwr4mw4jClA4Gwo4=','w5nDpgQ=','wojCv8K9FSU=','w6UAVkzCuMK5QcK2','w6tQwr48','TMOYDgEB','w7nCvsKPwqjDmcOv','D3jDk2ZqSw==','44OvT+acq+iDj+iNl+WPpOa0v+WImeS/jOaBsQ==','AnXDl0d9Xzlrw4rCkxbDosOkwqNqwpU=','w6jCu8K3w7o=','wqwCWlTCucK4VsK8FsOcJz9n6K2y5rGy5aeD6Lam776s6K6T5qCX5p66572O6LW+6YWC6K2b','wol8VRY=','EMO7wpxtMA==','wqPCqUMSw5vCix7CuhbChMKHw77Du1pPKQ==','dh7ClCPCtcKnLg==','JAXCkC3Cvg==','w4PDtRwpwp/Dng==','w4PDtRwpw6DCoQ==','wqvCpUo0Rk8=','XyF9JMOaUQ==','w7Zya07CkTc=','aB1WM8KYwqQ=','dnw3M8O5w5s=','wrXDmjUqWFE=','5Luj5Lub5p645Ym15Zu86Lyc5ZqC5peQ5o+o5LiA56qb','w7tidQ==','ASXCtBnDoMKY','X8KDw4MqIx4aQ8O8','IcKmw5jCsQ==','w4PDtX03w77Cvw==','H1rCqnjDoMO5','wokDVWk=','cxsiRg==','YgFV','QT99RcOE','w6PClBsCWg==','w6fCq8Kawr/DhA==','PQvCjyvCuA==','TCR1F2c=','w5jDqBfCtcO5','TcKUw4UqOxAHXMOAHcKx','w6bCpcKJ','W8OswpfCpTAF','wqstbkUz','wpXCjMO0woduCw==','w7Zya07CkSk=','ASXCtHjCgcO5','w4jDvBbDjsKFw7s=','wqBswrY/w63Cpg==','w6TCpQpPZw4=','QV4CW8OETw==','PA/ClS/CpMKh','R8K7I8O4D8KR','w4RLW3PCgRI=','UcKMwrjDm0LDvQ==','wqjDncOLwrIxNw==','wqTDuARMw4c=','TcOnw7fDlSI/OioLbSHClMKVNWpHw5Jmw78PAcK5dlbDj8Oqd2HCkgNhwrluwqQcBFDChlc8LxV8w5QPOQ==','aRRbZMKnPsKnScK+w63CtcKYwolXwr3CqsKz','YsO5LyJYKsKcT1BVw7fDlU3Cl8KAw5d9YhMHwrEAw4fCkcO0wpHCqD03w6bDtMKxcMO8w6Eew6/CgiAQEQRVQcKuw6cYwo4=','GAnCqcOxwoHCtw==','w53CimNWw6DCvw==','WcOEPcO4bsKP','w4PDtX0pwp/Dng==','O8OFwr5dCMOn','KMK9w5zCpMK4w6g4w4XDoFbCgMO6KXDCjyjCvw==','wqnDmcORw7s9NVTCqQ7CjA==','w53DrALCssO0L8Ot
|
|||
|
// 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
|