diff --git a/jd_redrain.js b/jd_redrain.js index aaf4f23..7e04caa 100644 --- a/jd_redrain.js +++ b/jd_redrain.js @@ -1,301 +1,310 @@ -/* -整点京豆雨 -更新时间:2022-1-24 -脚本兼容: Quantumult X, Surge, Loon, JSBox, Node.js -by:msechen -github:https://github.com/msechen/jdrain -频道:https://t.me/jdredrain -交流群组:https://t.me/+xfWwiMAFonwzZDFl -==============Quantumult X============== -[task_local] -#整点京豆雨 -0 * * * * https://raw.githubusercontent.com/msechen/jdrain/main/jd_redrain.js, tag=整点京豆雨, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true -==============Loon============== -[Script] -cron "0 * * * *" script-path=https://raw.githubusercontent.com/msechen/jdrain/main/jd_redrain.js,tag=整点京豆雨 -================Surge=============== -整点京豆雨 = type=cron,cronexp="0 * * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/msechen/jdrain/main/jd_redrain.js -===============小火箭========== -整点京豆雨 = type=cron,script-path=https://raw.githubusercontent.com/msechen/jdrain/main/jd_redrain.js, cronexpr="0 * * * *", timeout=3600, enable=true -*/ -const $ = new Env('整点京豆雨'); -const notify = $.isNode() ? require('./sendNotify') : ''; -//Node.js用户请在jdCookie.js处填写京东ck; -const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; -//IOS等用户直接用NobyDa的jd cookie -let cookiesArr = [], cookie = ''; -let jd_redrain_activityId = ''; -let jd_redrain_url = ''; -let allMessage = '', message = ''; -if ($.isNode()) { - Object.keys(jdCookieNode).forEach((item) => { - cookiesArr.push(jdCookieNode[item]) - }) - if (process.env.jd_redrain_activityId) jd_redrain_activityId = process.env.jd_redrain_activityId - if (process.env.jd_redrain_url) jd_redrain_url = process.env.jd_redrain_url - if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { - }; -} else { - cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item); -} - -!(async () => { - if (!cookiesArr[0]) { - $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" }); - return; - } - if (!jd_redrain_activityId) { - $.log(`\n甘露殿【https://t.me/jdredrain】提醒你:本地红包雨配置获取错误,尝试从远程读取配置\n`); - await $.wait(1000); - if (!jd_redrain_url) { - $.log(`\n甘露殿【https://t.me/jdredrain】提醒你:今日龙王🐲出差,天气晴朗☀️,改日再来~\n`); - return; - } - let RedRainIds = await getRedRainIds(jd_redrain_url); - for (let i = 0; i < 1; i++) { - jd_redrain_activityId = RedRainIds[0]; - } - } - if (!jd_redrain_activityId) { - $.log(`\n甘露殿【https://t.me/jdredrain】提醒你:今日龙王🐲出差,天气晴朗☀️,改日再来~\n`); - return; - } - let codeList = jd_redrain_activityId.split("@"); - let hour = (new Date().getUTCHours() + 8) % 24; - console.log(`\n甘露殿【https://t.me/jdredrain】提醒你:龙王就位: ${codeList}\n\n准备领取${hour}点京豆雨\n`); - for (let codeItem of codeList) { - let ids = {}; - for (let i = 0; i < 24; i++) { - ids[String(i)] = codeItem; - } - if (ids[hour]) { - $.activityId = ids[hour]; - $.log(`\nRRA: ${codeItem}`); - } else { - $.log(`\n甘露殿【https://t.me/jdredrain】提醒你:无法从本地读取配置,请检查运行时间\n`); - return; - } - if (!/^RRA/.test($.activityId)) { - console.log(`\n甘露殿【https://t.me/jdredrain】提醒你:RRA: "${$.activityId}"不符合规则\n`); - continue; - } - for (let i = 0; i < 5; i++) { - if (cookiesArr[i]) { - cookie = cookiesArr[i]; - $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]) - $.index = i + 1; - $.isLogin = true; - $.nickName = ''; - message = ''; - await TotalBean(); - console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); - if (!$.isLogin) { - $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, { "open-url": "https://bean.m.jd.com/bean/signIndex.action" }); - if ($.isNode()) { - await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n${tswb}`); - } - continue - } - await queryRedRainTemplateNew($.activityId) - } - } - } - if (allMessage) { - if ($.isNode()) await notify.sendNotify(`${$.name}`, `${allMessage}`); - $.msg($.name, '', allMessage); - } -})() - .catch((e) => { - $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') - }) - .finally(() => { - $.done(); - }) - -// 查询红包 -function queryRedRainTemplateNew(actId) { - const body = { "actId": actId }; - return new Promise(async resolve => { - const options = { - url: `https://api.m.jd.com/client.action?appid=redrain-2021&functionId=queryRedRainTemplateNew&client=wh5&clientVersion=1.0.0&body=${encodeURIComponent(JSON.stringify(body))}&_=${(new Date).getTime()}`, - headers: { - Host: "api.m.jd.com", - origin: 'https://h5.m.jd.com/', - Accept: "*/*", - "Accept-Language": "zh-cn", - "Accept-Encoding": "gzip, deflate, br", - Cookie: cookie, - "User-Agent": "Mozilla/5.0 (Linux; Android 10; WLZ-AN00 Build/HUAWEIWLZ-AN00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/89.0.4389.72 MQQBrowser/6.2 TBS/045811 Mobile Safari/537.36 MMWEBID/2874 MicroMessenger/8.0.15.2020(0x28000F39) Process/tools WeChat/arm64 Weixin NetType/4G Language/zh_CN ABI/arm64", - "Referer": `https://h5.m.jd.com/` - } - } - $.get(options, async (err, resp, data) => { - try { - if (err) { - console.log(`${JSON.stringify(err)}`) - console.log(`queryRedRainTemplateNew api请求失败,请检查网路重试`) - } else { - if (safeGet(data)) { - data = JSON.parse(data); - //console.log(data); - await doInteractiveAssignment(data.activityInfo.encryptProjectId, data.activityInfo.encryptAssignmentId); - } - } - } catch (e) { - $.logErr(e, resp) - } finally { - resolve(); - } - }) - }) -} - -// 拆红包 -function doInteractiveAssignment(encryptProjectId, encryptAssignmentId) { - const body = { "encryptProjectId": encryptProjectId, "encryptAssignmentId": encryptAssignmentId, "completionFlag": true, "sourceCode": "acehby20210924" }; - return new Promise(async resolve => { - const options = { - url: `https://api.m.jd.com/client.action?appid=redrain-2021&functionId=doInteractiveAssignment&client=wh5&clientVersion=1.0.0&body=${encodeURIComponent(JSON.stringify(body))}&_=${(new Date).getTime()}`, - headers: { - Host: "api.m.jd.com", - origin: 'https://h5.m.jd.com/', - Accept: "*/*", - "Accept-Language": "zh-cn", - "Accept-Encoding": "gzip, deflate, br", - Cookie: cookie, - "User-Agent": "Mozilla/5.0 (Linux; Android 10; WLZ-AN00 Build/HUAWEIWLZ-AN00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/89.0.4389.72 MQQBrowser/6.2 TBS/045811 Mobile Safari/537.36 MMWEBID/2874 MicroMessenger/8.0.15.2020(0x28000F39) Process/tools WeChat/arm64 Weixin NetType/4G Language/zh_CN ABI/arm64", - "Referer": `https://h5.m.jd.com/` - } - } - $.get(options, async (err, resp, data) => { - try { - if (err) { - console.log(`${JSON.stringify(err)}`) - console.log(`doInteractiveAssignment api请求失败,请检查网路重试`) - } else { - if (safeGet(data)) { - data = JSON.parse(data); - if (data.subCode == "0") { - //console.log(`${data.rewardsInfo.successRewards[3][0].rewardName}`); - message += `领取成功,获得 ${data.rewardsInfo.successRewards[3][0].rewardName}` - allMessage += `京东账号${$.index}${$.nickName || $.UserName}\n领取成功,获得 ${data.rewardsInfo.successRewards[3][0].rewardName}${$.index !== cookiesArr.length ? '\n\n' : ''}`; - } else { - console.log(data); - } - } - } - } catch (e) { - $.logErr(e, resp) - } finally { - resolve(); - } - }) - }) -} - - -function getRedRainIds(url) { - return new Promise(async resolve => { - const options = { - url: `${url}?${new Date()}`, "timeout": 10000, headers: { - "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88" - } - }; - if ($.isNode() && process.env.TG_PROXY_HOST && process.env.TG_PROXY_PORT) { - const tunnel = require("tunnel"); - const agent = { - https: tunnel.httpsOverHttp({ - proxy: { - host: process.env.TG_PROXY_HOST, - port: process.env.TG_PROXY_PORT * 1 - } - }) - } - Object.assign(options, { agent }) - } - $.get(options, async (err, resp, data) => { - try { - if (err) { - } else { - if (data) data = JSON.parse(data) - } - } catch (e) { - // $.logErr(e, resp) - } finally { - resolve(data); - } - }) - await $.wait(10000) - resolve([]); - }) -} - - -function TotalBean() { - return new Promise(async resolve => { - const options = { - url: "https://wq.jd.com/user_new/info/GetJDUserInfoUnion?sceneval=2", - headers: { - Host: "wq.jd.com", - Accept: "*/*", - Connection: "keep-alive", - Cookie: cookie, - "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"), - "Accept-Language": "zh-cn", - "Referer": "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&", - "Accept-Encoding": "gzip, deflate, br" - } - } - $.get(options, (err, resp, data) => { - try { - if (err) { - $.logErr(err) - } else { - if (data) { - data = JSON.parse(data); - if (data['retcode'] === 1001) { - $.isLogin = false; //cookie过期 - return; - } - if (data['retcode'] === 0 && data.data && data.data.hasOwnProperty("userInfo")) { - $.nickName = data.data.userInfo.baseInfo.nickname; - } - } else { - console.log('京东服务器返回空数据'); - } - } - } catch (e) { - $.logErr(e) - } finally { - resolve(); - } - }) - }) -} - -function safeGet(data) { - try { - if (typeof JSON.parse(data) == "object") { - return true; - } - } catch (e) { - console.log(e); - console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); - return false; - } -} - -function jsonParse(str) { - if (typeof str == "string") { - try { - return JSON.parse(str); - } catch (e) { - console.log(e); - $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') - return []; - } - } -} - -// 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.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } \ No newline at end of file +/* +整点京豆雨 + +甘露殿-https://t.me/jdredrain + +使用前自行设定整点京豆雨环境变量 +export jd_redrain_url="https://gitee.com/msewb/update/raw/master/redrain.json" + +更新时间:2022-3-31 +脚本兼容: Quantumult X, Surge, Loon, JSBox, Node.js +==============Quantumult X============== +[task_local] +#整点京豆雨 +0 * * * * https://raw.githubusercontent.com/msechen/jdrain/main/jd_redrain.js, tag=整点京豆雨, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true +==============Loon============== +[Script] +cron "0 * * * *" script-path=https://raw.githubusercontent.com/msechen/jdrain/main/jd_redrain.js,tag=整点京豆雨 +================Surge=============== +整点京豆雨 = type=cron,cronexp="0 * * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/msechen/jdrain/main/jd_redrain.js +===============小火箭========== +整点京豆雨 = type=cron,script-path=https://raw.githubusercontent.com/msechen/jdrain/main/jd_redrain.js, cronexpr="0 * * * *", timeout=3600, enable=true +*/ +const $ = new Env('整点京豆雨'); +const notify = $.isNode() ? require('./sendNotify') : ''; +//Node.js用户请在jdCookie.js处填写京东ck; +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +//IOS等用户直接用NobyDa的jd cookie +let cookiesArr = [], cookie = ''; +let jd_redrain_activityId = ''; +let jd_redrain_url = ''; +let allMessage = '', message = ''; +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.jd_redrain_activityId) jd_redrain_activityId = process.env.jd_redrain_activityId + if (process.env.jd_redrain_url) jd_redrain_url = process.env.jd_redrain_url + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { + }; +} else { + cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item); +} + +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" }); + return; + } + if (!jd_redrain_activityId) { + $.log(`\n甘露殿【https://t.me/jdredrain】提醒你:本地红包雨配置获取错误,尝试从远程读取配置\n`); + await $.wait(1000); + if (!jd_redrain_url) { + $.log(`\n甘露殿【https://t.me/jdredrain】提醒你:今日龙王🐲出差,天气晴朗☀️,改日再来~\n`); + return; + } + let RedRainIds = await getRedRainIds(jd_redrain_url); + for (let i = 0; i < 1; i++) { + jd_redrain_activityId = RedRainIds[0]; + } + } + if (!jd_redrain_activityId) { + $.log(`\n甘露殿【https://t.me/jdredrain】提醒你:今日龙王🐲出差,天气晴朗☀️,改日再来~\n`); + return; + } + let codeList = jd_redrain_activityId.split("@"); + let hour = (new Date().getUTCHours() + 8) % 24; + console.log(`\n甘露殿【https://t.me/jdredrain】提醒你:龙王就位: ${codeList}\n\n准备领取${hour}点京豆雨\n`); + for (let codeItem of codeList) { + let ids = {}; + for (let i = 0; i < 24; i++) { + ids[String(i)] = codeItem; + } + if (ids[hour]) { + $.activityId = ids[hour]; + $.log(`\nRRA: ${codeItem}`); + } else { + $.log(`\n甘露殿【https://t.me/jdredrain】提醒你:无法从本地读取配置,请检查运行时间\n`); + return; + } + if (!/^RRA/.test($.activityId)) { + console.log(`\n甘露殿【https://t.me/jdredrain】提醒你:RRA: "${$.activityId}"不符合规则\n`); + continue; + } + for (let i = 0; i < 5; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i]; + $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + message = ''; + await TotalBean(); + console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); + if (!$.isLogin) { + $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, { "open-url": "https://bean.m.jd.com/bean/signIndex.action" }); + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n${tswb}`); + } + continue + } + await queryRedRainTemplateNew($.activityId) + } + } + } + if (allMessage) { + if ($.isNode()) await notify.sendNotify(`${$.name}`, `${allMessage}\n甘露殿【https://t.me/jdredrain】`); + $.msg($.name, '', allMessage); + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) + +// 查询红包 +function queryRedRainTemplateNew(actId) { + const body = { "actId": actId }; + return new Promise(async resolve => { + const options = { + url: `https://api.m.jd.com/client.action?appid=redrain-2021&functionId=queryRedRainTemplateNew&client=wh5&clientVersion=1.0.0&body=${encodeURIComponent(JSON.stringify(body))}&_=${(new Date).getTime()}`, + headers: { + Host: "api.m.jd.com", + origin: 'https://h5.m.jd.com/', + Accept: "*/*", + "Accept-Language": "zh-cn", + "Accept-Encoding": "gzip, deflate, br", + Cookie: cookie, + "User-Agent": "Mozilla/5.0 (Linux; Android 10; WLZ-AN00 Build/HUAWEIWLZ-AN00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/89.0.4389.72 MQQBrowser/6.2 TBS/045811 Mobile Safari/537.36 MMWEBID/2874 MicroMessenger/8.0.15.2020(0x28000F39) Process/tools WeChat/arm64 Weixin NetType/4G Language/zh_CN ABI/arm64", + "Referer": `https://h5.m.jd.com/` + } + } + $.get(options, async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`queryRedRainTemplateNew api请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); + //console.log(data); + await doInteractiveAssignment(data.activityInfo.encryptProjectId, data.activityInfo.encryptAssignmentId); + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + +// 拆红包 +function doInteractiveAssignment(encryptProjectId, encryptAssignmentId) { + const body = { "encryptProjectId": encryptProjectId, "encryptAssignmentId": encryptAssignmentId, "completionFlag": true, "sourceCode": "acehby20210924" }; + return new Promise(async resolve => { + const options = { + url: `https://api.m.jd.com/client.action?appid=redrain-2021&functionId=doInteractiveAssignment&client=wh5&clientVersion=1.0.0&body=${encodeURIComponent(JSON.stringify(body))}&_=${(new Date).getTime()}`, + headers: { + Host: "api.m.jd.com", + origin: 'https://h5.m.jd.com/', + Accept: "*/*", + "Accept-Language": "zh-cn", + "Accept-Encoding": "gzip, deflate, br", + Cookie: cookie, + "User-Agent": "Mozilla/5.0 (Linux; Android 10; WLZ-AN00 Build/HUAWEIWLZ-AN00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/89.0.4389.72 MQQBrowser/6.2 TBS/045811 Mobile Safari/537.36 MMWEBID/2874 MicroMessenger/8.0.15.2020(0x28000F39) Process/tools WeChat/arm64 Weixin NetType/4G Language/zh_CN ABI/arm64", + "Referer": `https://h5.m.jd.com/` + } + } + $.get(options, async (err, resp, data) => { + try { + if (err) { + console.log(`${JSON.stringify(err)}`) + console.log(`doInteractiveAssignment api请求失败,请检查网路重试`) + } else { + if (safeGet(data)) { + data = JSON.parse(data); +<<<<<<< HEAD + console.log(data); + if (data.subCode == "0") { + console.log(`${data.rewardsInfo.successRewards[3][0].quantity}京豆`); + allMessage += `京东账号${$.index}${$.nickName || $.UserName}\n领取成功,获得【${data.rewardsInfo.successRewards[3][0].quantity}】京豆${$.index !== cookiesArr.length ? '\n\n' : ''}`; +======= + if (data.subCode == "0") { + //console.log(`${data.rewardsInfo.successRewards[3][0].rewardName}`); + message += `领取成功,获得 ${data.rewardsInfo.successRewards[3][0].rewardName}` + allMessage += `京东账号${$.index}${$.nickName || $.UserName}\n领取成功,获得 ${data.rewardsInfo.successRewards[3][0].rewardName}${$.index !== cookiesArr.length ? '\n\n' : ''}`; +>>>>>>> 69e2454bc59e9c82e511b6f469b90a55e18e21fd + } else { + console.log(data); + } + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }) + }) +} + + +function getRedRainIds(url) { + return new Promise(async resolve => { + const options = { + url: `${url}?${new Date()}`, "timeout": 10000, headers: { + "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88" + } + }; + if ($.isNode() && process.env.TG_PROXY_HOST && process.env.TG_PROXY_PORT) { + const tunnel = require("tunnel"); + const agent = { + https: tunnel.httpsOverHttp({ + proxy: { + host: process.env.TG_PROXY_HOST, + port: process.env.TG_PROXY_PORT * 1 + } + }) + } + Object.assign(options, { agent }) + } + $.get(options, async (err, resp, data) => { + try { + if (err) { + } else { + if (data) data = JSON.parse(data) + } + } catch (e) { + // $.logErr(e, resp) + } finally { + resolve(data); + } + }) + await $.wait(10000) + resolve([]); + }) +} + + +function TotalBean() { + return new Promise(async resolve => { + const options = { + url: "https://wq.jd.com/user_new/info/GetJDUserInfoUnion?sceneval=2", + headers: { + Host: "wq.jd.com", + Accept: "*/*", + Connection: "keep-alive", + Cookie: cookie, + "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"), + "Accept-Language": "zh-cn", + "Referer": "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&", + "Accept-Encoding": "gzip, deflate, br" + } + } + $.get(options, (err, resp, data) => { + try { + if (err) { + $.logErr(err) + } else { + if (data) { + data = JSON.parse(data); + if (data['retcode'] === 1001) { + $.isLogin = false; //cookie过期 + return; + } + if (data['retcode'] === 0 && data.data && data.data.hasOwnProperty("userInfo")) { + $.nickName = data.data.userInfo.baseInfo.nickname; + } + } else { + console.log('京东服务器返回空数据'); + } + } + } catch (e) { + $.logErr(e) + } finally { + resolve(); + } + }) + }) +} + +function safeGet(data) { + try { + if (typeof JSON.parse(data) == "object") { + return true; + } + } catch (e) { + console.log(e); + console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); + return false; + } +} + +function jsonParse(str) { + if (typeof str == "string") { + try { + return JSON.parse(str); + } catch (e) { + console.log(e); + $.msg($.name, '', '请勿随意在BoxJs输入框修改内容\n建议通过脚本去获取cookie') + return []; + } + } +} + +// 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.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } diff --git a/jd_redrain_half.js b/jd_redrain_half.js index 85c0be1..883ffd7 100644 --- a/jd_redrain_half.js +++ b/jd_redrain_half.js @@ -1,298 +1,20 @@ -/* -半点京豆雨 -更新时间:2022-1-11 -脚本兼容: Quantumult X, Surge, Loon, JSBox, Node.js -by:msechen 感谢小手大佬修改接口 -==============Quantumult X============== -[task_local] -#半点京豆雨 -30 21,22 * * * https://raw.githubusercontent.com/msechen/jdrain/main/jd_live_redrain.js, tag=半点京豆雨, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true -==============Loon============== -[Script] -cron "30 21,22 * * *" script-path=https://raw.githubusercontent.com/msechen/jdrain/main/jd_redrain_half.js,tag=半点京豆雨 -================Surge=============== -半点京豆雨 = type=cron,cronexp="30 21,22 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/msechen/jdrain/main/jd_redrain_half.js -===============小火箭========== -半点京豆雨 = type=cron,script-path=https://raw.githubusercontent.com/msechen/jdrain/main/jd_redrain_half.js, cronexpr="30 21,22 * * *", timeout=3600, enable=true -*/ -const $ = new Env('半点京豆雨'); -let allMessage = '', id = ''; -const notify = $.isNode() ? require('./sendNotify') : ''; -//Node.js用户请在jdCookie.js处填写京东ck; -const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; -//IOS等用户直接用NobyDa的jd cookie -let cookiesArr = [], cookie = '', message; -let jd_redrain_half_url = ''; -if ($.isNode()) { - Object.keys(jdCookieNode).forEach((item) => { - cookiesArr.push(jdCookieNode[item]) - }) - if (process.env.jd_redrain_half_url) jd_redrain_half_url = process.env.jd_redrain_half_url - if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { }; - if (JSON.stringify(process.env).indexOf('GITHUB') > -1) process.exit(0) -} else { - cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item); -} -const JD_API_HOST = 'https://api.m.jd.com/api'; -!(async () => { - if (!cookiesArr[0]) { - $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/', { "open-url": "https://bean.m.jd.com/" }); - return; - } - if (!jd_redrain_half_url) { - $.log(`尝试使用默认远程url`); - jd_redrain_half_url = 'https://raw.githubusercontent.com/Ca11back/scf-experiment/master/json/redrain_half.json' - } - let hour = (new Date().getUTCHours() + 8) % 24; - $.log(`\n甘露殿【https://t.me/jdredrain】提醒你:正在远程获取${hour}点30分京豆雨ID\n`); - await $.wait(1000); - let redIds = await getRedRainIds(jd_redrain_half_url) - if (!redIds || !redIds.length) { - $.log(`尝试使用cdn`); - jd_redrain_half_url = 'https://raw.fastgit.org/Ca11back/scf-experiment/master/json/redrain_half.json' - redIds = await getRedRainIds(jd_redrain_half_url) - if (!redIds || !redIds.length) { - $.log(`默认远程url获取失败`); - return - } - } - for (let id of redIds) { - if (!/^RRA/.test(id)) { - console.log(`\nRRA: "${id}"不符合规则\n`); - continue; - } - console.log(`\n甘露殿【https://t.me/jdredrain】提醒你:龙王就位:${id},正在领取${hour}点30分京豆雨\n`); - for (let i = 0; i < cookiesArr.length; i++) { - if (cookiesArr[i]) { - cookie = cookiesArr[i]; - $.UserName = decodeURIComponent(cookie.match(/pt_pin=([^; ]+)(?=;?)/) && cookie.match(/pt_pin=([^; ]+)(?=;?)/)[1]) - $.index = i + 1; - $.isLogin = true; - $.nickName = ''; - message = ''; - await TotalBean(); - console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); - if (!$.isLogin) { - $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/`, { "open-url": "https://bean.m.jd.com/" }); - if ($.isNode()) { - await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); - } - continue - } - await queryRedRainTemplateNew(id) - } - } - } - if (allMessage) { - if ($.isNode()) await notify.sendNotify(`${$.name}`, `${allMessage}`); - $.msg($.name, '', allMessage); - } -})() - .catch((e) => { - $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') - }) - .finally(() => { - $.done(); - }) - -// 查询红包 -function queryRedRainTemplateNew(actId) { - const body = { "actId": actId }; - return new Promise(async resolve => { - const options = { - url: `https://api.m.jd.com/client.action?appid=redrain-2021&functionId=queryRedRainTemplateNew&client=wh5&clientVersion=1.0.0&body=${encodeURIComponent(JSON.stringify(body))}&_=${(new Date).getTime()}`, - headers: { - Host: "api.m.jd.com", - origin: 'https://h5.m.jd.com/', - Accept: "*/*", - "Accept-Language": "zh-cn", - "Accept-Encoding": "gzip, deflate, br", - Cookie: cookie, - "User-Agent": "Mozilla/5.0 (Linux; Android 10; WLZ-AN00 Build/HUAWEIWLZ-AN00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/89.0.4389.72 MQQBrowser/6.2 TBS/045811 Mobile Safari/537.36 MMWEBID/2874 MicroMessenger/8.0.15.2020(0x28000F39) Process/tools WeChat/arm64 Weixin NetType/4G Language/zh_CN ABI/arm64", - "Referer": `https://h5.m.jd.com/` - } - } - $.get(options, async (err, resp, data) => { - try { - if (err) { - console.log(`${JSON.stringify(err)}`) - console.log(`queryRedRainTemplateNew api请求失败,请检查网路重试`) - } else { - if (data) { - data = JSON.parse(data); - await doInteractiveAssignment(data.activityInfo.encryptProjectId, data.activityInfo.encryptAssignmentId); - } - } - } catch (e) { - $.logErr(e, resp) - } finally { - resolve(); - } - }) - }) -} - -// 拆红包 -function doInteractiveAssignment(encryptProjectId, encryptAssignmentId) { - const body = { "encryptProjectId": encryptProjectId, "encryptAssignmentId": encryptAssignmentId, "completionFlag": true, "sourceCode": "acehby20210924" }; - return new Promise(async resolve => { - const options = { - url: `https://api.m.jd.com/client.action?appid=redrain-2021&functionId=doInteractiveAssignment&client=wh5&clientVersion=1.0.0&body=${encodeURIComponent(JSON.stringify(body))}&_=${(new Date).getTime()}`, - headers: { - Host: "api.m.jd.com", - origin: 'https://h5.m.jd.com/', - Accept: "*/*", - "Accept-Language": "zh-cn", - "Accept-Encoding": "gzip, deflate, br", - Cookie: cookie, - "User-Agent": "Mozilla/5.0 (Linux; Android 10; WLZ-AN00 Build/HUAWEIWLZ-AN00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/89.0.4389.72 MQQBrowser/6.2 TBS/045811 Mobile Safari/537.36 MMWEBID/2874 MicroMessenger/8.0.15.2020(0x28000F39) Process/tools WeChat/arm64 Weixin NetType/4G Language/zh_CN ABI/arm64", - "Referer": `https://h5.m.jd.com/` - } - } - $.get(options, async (err, resp, data) => { - try { - if (err) { - console.log(`${JSON.stringify(err)}`) - console.log(`doInteractiveAssignment api请求失败,请检查网路重试`) - } else { - if (data) { - if (data.subCode == "0") { - console.log(`${data.rewardsInfo.successRewards[3][0].rewardName}个`); - } else { - console.log(data); - } - } - } - } catch (e) { - $.logErr(e, resp) - } finally { - resolve(); - } - }) - }) -} - - -function taskUrl(function_id, body = {}) { - return { - url: `${JD_API_HOST}?functionId=${function_id}&body=${escape(JSON.stringify(body))}&client=wh5&clientVersion=1.0.0&_=${new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + 8 * 60 * 60 * 1000}`, - headers: { - "Accept": "*/*", - "Accept-Encoding": "gzip, deflate, br", - "Accept-Language": "zh-cn", - "Connection": "keep-alive", - "Content-Type": "application/x-www-form-urlencoded", - "Host": "api.m.jd.com", - "Referer": `https://h5.m.jd.com/active/redrain/index.html?id=${$.activityId}&lng=0.000000&lat=0.000000&sid=&un_area=`, - "Cookie": cookie, - "User-Agent": "JD4iPhone/9.4.5 CFNetwork/1209 Darwin/20.2.0" - } - } -} - -function getRedRainIds(url) { - return new Promise(async resolve => { - const options = { - url: `${url}?${new Date()}`, "timeout": 10000, headers: { - "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88" - } - }; - if ($.isNode() && process.env.TG_PROXY_HOST && process.env.TG_PROXY_PORT) { - const tunnel = require("tunnel"); - const agent = { - https: tunnel.httpsOverHttp({ - proxy: { - host: process.env.TG_PROXY_HOST, - port: process.env.TG_PROXY_PORT * 1 - } - }) - } - Object.assign(options, { agent }) - } - $.get(options, async (err, resp, data) => { - try { - if (err) { - } else { - if (data) data = JSON.parse(data) - } - } catch (e) { - // $.logErr(e, resp) - } finally { - resolve(data); - } - }) - await $.wait(10000) - resolve([]); - }) -} - -function TotalBean() { - return new Promise(async resolve => { - const options = { - "url": `https://wq.jd.com/user/info/QueryJDUserInfo?sceneval=2`, - "headers": { - "Accept": "application/json,text/plain, */*", - "Content-Type": "application/x-www-form-urlencoded", - "Accept-Encoding": "gzip, deflate, br", - "Accept-Language": "zh-cn", - "Connection": "keep-alive", - "Cookie": cookie, - "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", - "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1") - } - } - $.post(options, (err, resp, data) => { - try { - if (err) { - console.log(`${JSON.stringify(err)}`) - console.log(`${$.name} API请求失败,请检查网路重试`) - } else { - if (data) { - data = JSON.parse(data); - if (data['retcode'] === 13) { - $.isLogin = false; //cookie过期 - return - } - if (data['retcode'] === 0) { - $.nickName = (data['base'] && data['base'].nickname) || $.UserName; - } else { - $.nickName = $.UserName - } - } else { - console.log(`京东服务器返回空数据`) - } - } - } catch (e) { - $.logErr(e, resp) - } finally { - resolve(); - } - }) - }) -} - -function safeGet(data) { - try { - if (typeof JSON.parse(data) == "object") { - return true; - } - } catch (e) { - console.log(e); - console.log(`京东服务器访问数据为空,请检查自身设备网络情况`); - return false; - } -} - -function jsonParse(str) { - if (typeof str == "string") { - try { - return JSON.parse(str); - } catch (e) { - console.log(e); - $.msg($.name, '', '不要在BoxJS手动复制粘贴修改cookie') - return []; - } - } -} -// 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.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } +/* +半点京豆雨 +更新时间:2022-4-1 +脚本兼容: Quantumult X, Surge, Loon, JSBox, Node.js +by:msechen +半点京豆雨id更新频道:https://t.me/jdrain +==============Quantumult X============== +[task_local] +#半点京豆雨 +31 21,22 * * * https://raw.githubusercontent.com/msechen/jdrain/main/jd_live_redrain.js, tag=半点京豆雨, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true +==============Loon============== +[Script] +cron "31 21,22 * * * " script-path=https://raw.githubusercontent.com/msechen/jdrain/main/jd_redrain_half.js,tag=半点京豆雨 +================Surge=============== +半点京豆雨 = type=cron,cronexp="31 21,22 * * * ",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/msechen/jdrain/main/jd_redrain_half.js +===============小火箭========== +半点京豆雨 = type=cron,script-path=https://raw.githubusercontent.com/msechen/jdrain/main/jd_redrain_half.js, cronexpr="31 21,22 * * * ", timeout=3600, enable=true +*/ +var _0xods='jsjiami.com.v6',_0xods_=['‮_0xods'],_0x3dd2=[_0xods,'cx7CkA==','AsKcWAfCs1tcworDqwlewoU6','GcKNw47CvMOo','w595IQ==','Vws6fsKrHEUNwoXDl8OpBMKQ','E19vd8O9QA==','AcObwp4=','w6c1AWc2','WVnDmQvDoQ==','wo0RbigZ','wrfDsE3CucKo','wqNIwpTCm8Oi','aMOqRcKWwqE=','w67CmMOEQsOl','ScOgwpIlEA==','w6PDlsOQw63CnQ==','w4cQJF0m','ecKAw7EQw6w=','AU3CusOhLg==','OV/CkUHChA==','w6UCwo3DhjI=','w4p2JQdr','wpRVwqM=','w6jDicKL','cQrCj0LDm8KMwozDmTXDj8KyeMKgAMK8w5IM','d8ODNcOnw7d3PMO9w5vDnA==','w6/Dh8OUw6LCnDsbwohLw61tU8OjWcKVw43CicOcD2clwrkhwozDrRPCpQ7Ct8OiAMKNRw==','f8KGEmHCv8OKDGVSM8KyBg==','w4Y1TxQyDjxeDXvDhBUgw4J8VsKwDGItFsOEHsKjNgvCscKKwq/DrcKmw4HChQDCmsOhwrcBf8OKV8K4w4bCkg==','EsOVaHNLKcKyw4pHwrU/Yw==','w5jDj3xyCB4=','w4U7Gm8G','DivDmhBxwr3CrsOSwqs=','wrjDoUDClMKx','w44dwpzCjcOp','w4zCqMOBZcOp','ZCkResKQPnguwrXDqcODGcKiw5hTBVc=','TcKVNi3ChA==','A0vDmcOpLg==','wpHClsOGasOx','w7QTwrLCicOQ','wpEWTzUa','KXTDkHjCmQ==','wq5wwrvCtsOZ','w55Tw4jDhsOW','dMOSJMOnwqksf8K7w4XCjMOBSEHCrAzDisKYw4s3dcO3TEnDqklEw4MSwpBVVFBdaMK4w7TCiTpxU8O8asOdHg7DpWbDqHU=','MMKXworCsMK0w4vClcKWwrHDiA==','woAww70ZIA==','bsOaVcKlwpw=','WsO3wpcWGCRs','wo0+SxIb','DsKqNsK8','XcOmfHdR','Lmk4wp8U','5Lur6Ked5Z62HSnDvcOFNuaKi+WImuWmleWLqOeyiei0k+S8ruaWkMKZV0vDhcKfwrA=','Z3JOOVU=','Iy4eQ2vDmWzCqcOAJ8K0w7c3wpPDoUPCrTJHacOuwpE3RXPDsMOtJVfDmsK6NQ==','AcOEwoPDrEHDiMKMw5/CvRVhw6vCuFQKwrjDvA==','D8KpaQbDuz5Ew4nDj8O3wqBBw4vCvcO+JzQ4wpjDhRjDpMKJEl3DrmBHwojCmMKfwrbCtnLCqMKJHivCiiYtwqNsPn/Ci3rDhsKs','wq5lwrDCicO4ERfCtsKfcDEGwoo=','BsKvJMKpw55+Fg8pwqnDhMKFUCElPHTCtETCi1XDrBELPl94CEQYw6FjYsOHbEMAX2HClsKbwr9cAMO/wpfCoMKMwpXDlMKXw7vCrl/Dhy1Kw5nCmcOgXcKpw5PDg8O4RsKZwpslwp3DrMKkw7HDnsK/wrPCuRpdw5jCkcOkw6xcw47CsBcRw6AhwoYTwrDCkMKtAnPDksOhw5bCrcOjJW5TEUDDqsKnFyjDuRRZfsOBBMOxw4HDvj1wbBtZdTvDhhtQHsKCdHxlCF7Cu8KNZ21PwrZ+bx7CjcOwwqrCocOTJ8O2wpPCj8KpU8O2fMOy','wprDocKYKVU=','ecOXV1BG','w5JjIwR9QsODV8OwNsKhwqcVw4bCjj7DucO5SQHCvEjCuFLDlW8Zw7J6UWnDvsOiesK6wrnCshJ5wrzDij/CsxjChXxeRV83CcKsw5jChA==','woXDnmLCl8KQ','N8KrdzvCiHdlwqfDnS5/w7kWw43CmF7Co8KfUMK1AsKzIsK0w57DoMK+FQ/CnEs+OQ==','dsOWGcOZwrI=','w7JEw6rDmsOU','wrYwXBFBDxNIBSY=','GEvClW/Csw==','d8KFNSDCtsKB','eSFRw6MYw7EYwrDDqSMvwpF+','wrQSVQUi','ZCkRSsKYJ3w=','w71Qw7LDqw==','w5AUIkoiPcOH','wpddwobCqw==','HsK3w4HCh8OS','I8K0w6fCoMO/','QcOceg==','w6ECHA==','CcK8cBM=','ezjCqkPCrQ==','HkN7','wog9w7M6','wppWBz3or7nmsLrlp53otZ3vvovorrDmoY/mnKjnvKDotIfphKDoroQ=','w6jCosOVYsOa','Zi9Mw6I6','FCzDpBZ4wrPCqQ==','w5zDmcOlw57CsQ==','A8Kawr/CicKG','wqJ4LUNow6o3DQ==','wq95wrFEBg==','w4NPw4ExEsK1w7cb','fcOhwoYHOSFkw4M=','Q8OafnZmPMK2w4A=','w6nCocOKXsOMw5pNHg==','5Lqw5Lq65p2d5Yi25Zqy6L+C5ZqO56uu5ped5o+X','wogaH1jClg==','woVHPltB','A8KycxM=','ETDDjzxtwqg=','wqB5wp3CicOm','5LqB5Lqv5pyQ5Yq85ZmA6K+i6ZS15peV5o2H5LuG56ih772S6Kya5qG45pyo6Iee6LuL6K275aaq57yC57uD5oOc5YaO','w7ArwpfCqcOY','w6k5wqnCtcOaKiY=','w73CgcOcQMOY','BMK+wrzCjcKz','LDcNREzDm2DCuA==','w5U5woDCqMOzIiXCkg==','cMObWMKewr3DqMKpaw==','FcKRaA7DgQ==','PsKWwpTCvMKhw5Y=','w6/CkcO+TcOW','C8KZMsKIw6w=','A8Oowr3DryM=','TcOEwrQGOQ==','w5E/aXkW','cAjCiF7Cgw==','IVMawqol','ETDDjw==','IsKAwozCsMKsw4U=','5Luq6Kaz5Z+dwp3DnMOCQ8Oy5omw5YiD5aWb5Yub57OH6Len5L6w5paqw5TCgMKcIsORwrc=','w7rChsOKYsOY','wo43w5gGPg==','w7F0AQZr','b8OSIsO+wrRx','FsOfwpjDrwg=','RMOAU3JMOA==','TMObc8KDwpfDrA==','w5vCgMKdOVdFwoV3w4NScUIa','FCzDphZ7wr8=','wqnCg8OYQA==','MGDDhcOrFSo6','WMOnwpAd','BsKvGsKrw4shDT4owqjDtcKICnRtVy/DshM=','w5J6w5E=','FsKGMQ==','wpcRZiUpLCpm','JXvDhcOHGi47wrPCgA==','YsOhacKkwqbDiw==','wqlpJ1w=','w7URwrxvw6xJcA==','wqUzw7E0L8Ogw4Uh','e8ODJMOzwrtiMQ==','e1zDnwrDvcKzwrjCscKC','JTsaS2PDjmw=','w68eFBYLAw==','KioaX3HCgCLDssOIOMKzw7Yww47DpEnCryVNfMK1w50rQHfDt8O3JxbCk8OhdsKrwrg=','X8K4KyvCgQ==','RsOzwo4Q','ZsOjIsOQwrc=','wocPJX7Cnw==','Z0FVH28=','P2XDp8OBGA==','w7/ChcO5Y8O0','wpLDgnQ=','IueWiumfkeaviuOBpyh9w5LCsDLDgBhww4UDw452OAoPBcKawqPCkh5rw5zjgqvmjKDphaHkv7xs5Lmb5pWx6b+M54+l8YGyjeWHhuW2j+++hOWko+azu+aaq+achOKYoO+5ke+8ruaUneaWqeWFh+aele+8jVg=','QcKFw6gVw4U=','wq5GwpbCmcOC','wpLDisKDCEBpwqJzw59FLA==','FWoa','woTnlq/pnpbmrLHjg6UwDsKIUsOxOVPCtADDjMOXwpvDngNsJcKxaMKLw74Wwq7jgbHmjITphJ/kvITDkuatgOWfuOi+i+erouiMnOWOkg==','54C3woTClOWKiOS5meiwnumaksK1ZsKI','DmQUwqc=','WMO7d3B/','TXvDmgzDgw==','OsK0YA==','eh/CgQ==','wpjnlazpn7rmrrTjgp1VZRHDtMOHw6nDiMKfwqXClxrCih5kQMKKQcOzUcOARSHjgZ7mjInphrzkv64c5Lia5pS+6byb54yu8LWjnOWGvuW2kO+/vuWkteaypuaYm+aduOKZgO+6jO+/suaXtuaVl+WFh+aflu+9msOW','w5fnlY3pnIvmr57jgbwGC1UDMMOQwqnDj8KSw67CpiZtZA0AH29wSEHDqOOAmOaPq+mEvOS9tMK56b+J54yP5bGn5L2Lw7s=','772D5q2a5Z+/6aC05Y6f','54Oow4fDjuWLn+S5ruizpOmYicOl','BMK/McKpw51/UHAxwrTDhcKEDm4lZXTDqhvClALCrU8fPVtgEwQLw6k4P8OWMiE=','XMKBKcOJw5DDnmN7w7zCsMO8','wogmXBMiDxJE','GsKTFsK+w4Y=','ccOHJMO0wrI=','w4w1SHQt','w6RSw4EcDQ==','w489X3wLGMOdBw==','wopgw4/DsMKXaWLlv7flpJPjgKXku5PkuY7ot7/lja0=','ZmVhBnXDuEDCgw==','EhnCmkvCvsO8w5jDn8Kaw5c=','YMKSw48Mw67ClcKW','w7wVwqVu','44G35oyN56Sn44Gnw6trBMKNw5HDo+W0oeWlnuaXqQ==','FDHDjBxn','LHYYwqEIw4t5cQ==','L+itn+mHsOaVnOeaiOW/nOiNs+WPmMOxfmLCg8Oqw73CjMOIDQBVwpEQw4dAwop4SirChSx9YCwBd2tGLH1qw7LCp3VnQsOWw53ClDInHcKwQA==','V8O2b1pF','JkrCmcOdLcOm','wr90IExow6QuAcKfDA==','wpZbwqls','woUzw7E0L8Og5bW95aWU5paIwpLCtcO+','fx7CglfCjw==','Fy0LXUzDm2DCuA==','TOiulemHieaXueebpuW9peiNpuWNkgPCisOxw4hpYw==','VsKMDwnCkQ==','KRA/VlQ=','w5QCwopKw7k=','JWrDmcOKOiYmwrzCnwE=','w64rwojCvw==','wosvw7k=','Z8KAw64G','wpY9w6wsIw==','asKAw7cAw6E=','I1bCsA==','CMOfwofDuQ==','bn7lpZ/otIojwprljpLlmL3Ck2g=','w5rCu8OBTcOuw5dZ','ch/CiFc=','P3PCml7ChcKN','dh4xNcKuTMOjw7hUwpnCrw==','ZQ5sw4Al','aMKRw7MPw6DCn8KZwoJzG1HCrcOXw5UAwqYRwo3CvD7CnUQsw50kw4bDgcODEsKvwqDCsmg=','XDTDklvCp8OEwofDkjbCjMOiOsOyGsKpwoBeFjoQXBvCiAbCt8OCB8OBfkHCjMObwpBcBMKRUiIpw73ChlHDiyPDg8O3wpA=','wr80SgQ=','VcOBaVZE','ay1mw6c7','w6XDksOBw77DmDkWwpVUw6c=','wooNw7keJQ==','UhVnwpgmwpogwovChgcFwrI=','LMKPfj3Dgg==','wqvDm0nCjcKj','wotKwqhgHw==','w4hIw4EoBcKkw64ufkwCwqXDmMOEwoUs','UXlgDQ==','wq7CicOG','w6vDmcOHw7zCjCgOwqxQw61pGcO4AMKrw54=','IMOswqXDrSI=','wpDDgcKUL21awp5Mw5hYNU0Kw6vDhcKQ','w7cawqt5w7RNZSTDt8OHwrrCgMOewrzDnBnCm3hq','w7LDqsK7wpXCrS7CpMO0wqwmwqbDs8OZUsKywrbDhmbCug==','BMORwo7DpQ==','QMOSaX5A','aSp9w5sH','VsOiMcOfwp0=','wrMvw7stCMOkw6IA','wrcFwozDizk2wr4dIMOxJ8Ot','MBLCiVbCjsKR','SUVrFVo=','IsKAwozCsMKsw4XCiMKJwoE=','DsOxwo8cEi59wpvCtynDjxE8w51Ew4Z9YzYOBcKMwq7CjxE/woPClMOAw53CrHDDjsKp','NsKRworCjcKrw4/ChA==','w7kkwpvDsi8=','NHnCiU/CnsKSHzF0MjXCjWFYwrjDv0w=','CkQ4wqYO','Z8OvXsKuwr4=','D8K8w6bCmcK8VcKJwrYucUnCoBh9Ins4','w6o5ZHgL','WcO5wo4kEQ==','wrINYTUl','N2zDg8OHAiAmwqzCsBw=','wprCvsOBS8K/wosOSwcvbMK+ccOjCMOEX8KJI8KtwrslCCrCo8KEXGcEWBYjBh9xwojDhsKePsOj','w53DgMOswo7ChDbCv8Obwrp6w7bCusKDEcOiw7jDsWnCkG8xN8KaCwdWwrPCh8O3HcK/w4tcwokaw5BWw73Dl8KTJQDDhsOz','44Gp5o+V56WH44OC6K6x5Yei6I6j5Y+C5LuY5Lui6LW55Y2o5LmbY8KxQlcEw4rCjeeZpeaNi+S/heeUqGLDhcOnCS/DveeameS4qOS5i+eusuWKjeiNouWMgA==','BQ1rIsO0VcKiw44k','BMK+w43CkMO/','NA5yGcOJ','w5kGGVcg','woJLLWdT','w6U8wrHCrsOV','wpw6PhfCn15Awpwka2sN','wot7Fg==','CEQxfcO0','woZRwpDCt8ORw4M7wpEJwppmw5Rtw6c=','wrrDl8KgBX0=','wrUOOlvCpA==','w6JLw4UCEg==','wpNSwpJ6PA==','XMOXwoYQPA==','wqk5Z8K0wps=','H8KHF8KBw7Q=','woQTaMKbwrw=','woLDqVbCt8Kf','wpTDr1jCqcKQEMKG','C8O0wqbDlyY=','A0nCm8OdEw==','UcOJKsO+wrZ6McK7wpjCl8OfBUfCigHCisKOw5xhesOXQVnDsVBIwohAw4QBHRFjSsONwrDCphAkG8OyQMOcGg7CviDDhB1nQMKZw5DCuWjCuVTCv8Kww5AMwqXDpMKNw6JCwpLDoQpcSwgbDB3CksKGw4lxw6TCtCUTwonCjsOmFgMSwpzDskvDlTvCuMK+XcKcX8OUcRhyW3bCs8OOwqzCmgHDjnIuw5fCuVnDuHIGSwwPwoo/e8KBw7ZrwpYLw6LCr27CrcOsw5bDmnTCqMKMwrrCql99wqLCocK2BMOpXTZJwo/Cj8KMTcKZEMO3CMOMw7bDoCkVb8OWesK3wqfDhXtkNDnDkMKTwpcqw5vCllUSNhXCmMOuw4DDosOcTRPCvcKWT8OVA8Kew5AwQsOawqHCqMKNR8OtdjpOwpQ0BRVvwrdSw6wNQFjDlDjClw/Dkhckd2rDln7DjsOMY8O6w4xWwrdewqFkw5suw5AFw68SNcOvw4HCvlbDm8KPw5pBJmvDgMK3WxI5w7HDtAnCoHI8w7vDmBImaMO6Yg/CvcOHwp/DgsOVwohFAcOIF8O+KMKYfMOAA2rCnU3Ci8OuFkB3w6wjYMKp','wpLDisKD','FQ5PLMOk','w5fCuMO3dMOL','w5jDpsOHw4HCkA==','wo9hwp7CsMOF','wqJzwqJrOQ==','csKZHA==','LhVFR8OkIcK+woQd','NcKbwrfCt8K2w4fCk8KOwpvDmBnDl8O0wr84C2XDk8KHecOWw7EzFQLDj3PorLvmsKblpafotqbvvIDor6zmooLmnYHnvbfotKrphI3or5M=','QwR8w4Uu','w6TDscK7woTCsS3Co8Onwroiwq7DpsOTTA==','woLDv03Ck8KNFMKXwrU=','5Luj5Lil6Lex5Y2F','wprDpEjCmMKB','A3zDksOcOig/wrA=','S0bDkwLDscKlwoHCp8OVwqp5KcKSwqA=','w7E/woTCtMOJKjzCjg==','ScONU8KLwofDoQ==','VXhwPEw=','wrxkPUA=','w7LDqsKu','Vnhy','wpHCosOXfcOs','AsKzaw==','w6wlwoI=','N8KtAMOAw6c=','ZQTClFvCmcOLwoHDmio=','wpvDg2U=','wo5cwpHCusOLw7Vv','wq5WwoBcAg==','w6LDmMOD','FcOLwojDnwLCjMKN','FghDecOs','w7rDtcKVwrXCrg==','wqMrw6gYBA==','w6AeHA==','PEzCtMORLMOwDcONWXjDhg/CvcK9','cjkEQMKNOmkt','5LqB5Lqv6LS75Y+q','WnhgEUM=','SOmjmOWOuOaIv+WKne++tuiOuuW9iuOCuQ==','wrPCk8OAXcOfwqN9w4w=','44Kd5Lud6LC9','GsKGI8OIw40=','wp/Dr0LCmsKNFQ==','Kg1j','OmDDkA==','eOeUtOmcruauoeOCikYcw4vCuMKxIUw8wrjDlcOAwqjDh3tDWjTCvsKdw7/Dk8O844GI5o+a6Ye25LykwozkuZvmlLrpv5DnjpXwtLO/5Yap5baM77605aSX5rK85piy5py34pmk77my77yr5pWo5paR5YW75p6477+Zcw==','RRzCrVfCjg==','wot2wpZRMQ==','w407W1I3Cw==','ZMKSw6Q=','wpDDjH5z','w5Ymwrhmw78=','bcK+Lg3CpA==','BxPDhy5H','w6nChMOoX8Oo','N0tVUsOA','w51yIxBvDMKN','AnnCiFPClA==','wpTDr1jCmcKYCcKC','VAB6w5Iqw4Ar','woodagMd','FGQN','UHlrH1LDvA==','wo3DmWF/H0Q=','w4bDqMKiwojCgg==','eMKDOSLCgQ==','woU6JV3CmQ==','w7PCoMOfe8OF','w7cGwoHCj8Oc','HsKeBMOow7g=','w5rCp8OtQcOR','JMK6woTCncKU','DsKuUxnDrGE=','wrN1wqrCj8Ohw7VRw7hkw6MZwr4L','e8KYDQ==','ccOvYsK8wqHDhsKcV8KkRlnCpcOO','w5gCwqdpw6o=','dzkLQMKcPw==','wpvDvljCjcKKMsKVwqnCrWt4w59z','bjsrKyzjrLAiaFGmi.bcom.v6=='];if(function(_0xa86e69,_0x15b94e,_0x5c8061){function _0x49c07b(_0x2ec150,_0xfc0ffa,_0x51079f,_0x13bdc7,_0x45da2a,_0x183cb1){_0xfc0ffa=_0xfc0ffa>>0x8,_0x45da2a='po';var _0x29a94e='shift',_0x4207e1='push',_0x183cb1='‮';if(_0xfc0ffa<_0x2ec150){while(--_0x2ec150){_0x13bdc7=_0xa86e69[_0x29a94e]();if(_0xfc0ffa===_0x2ec150&&_0x183cb1==='‮'&&_0x183cb1['length']===0x1){_0xfc0ffa=_0x13bdc7,_0x51079f=_0xa86e69[_0x45da2a+'p']();}else if(_0xfc0ffa&&_0x51079f['replace'](/[brKyzrLAFGb=]/g,'')===_0xfc0ffa){_0xa86e69[_0x4207e1](_0x13bdc7);}}_0xa86e69[_0x4207e1](_0xa86e69[_0x29a94e]());}return 0xdd1ba;};return _0x49c07b(++_0x15b94e,_0x5c8061)>>_0x15b94e^_0x5c8061;}(_0x3dd2,0x1e9,0x1e900),_0x3dd2){_0xods_=_0x3dd2['length']^0x1e9;};function _0x2569(_0x34ee9a,_0x1aaeda){_0x34ee9a=~~'0x'['concat'](_0x34ee9a['slice'](0x1));var _0x5d2685=_0x3dd2[_0x34ee9a];if(_0x2569['osqGSL']===undefined){(function(){var _0x57193a=typeof window!=='undefined'?window:typeof process==='object'&&typeof require==='function'&&typeof global==='object'?global:this;var _0xc88b13='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';_0x57193a['atob']||(_0x57193a['atob']=function(_0x27762c){var _0x53a937=String(_0x27762c)['replace'](/=+$/,'');for(var _0x7b7204=0x0,_0x2d3a04,_0x487c94,_0x3b7f15=0x0,_0x166c35='';_0x487c94=_0x53a937['charAt'](_0x3b7f15++);~_0x487c94&&(_0x2d3a04=_0x7b7204%0x4?_0x2d3a04*0x40+_0x487c94:_0x487c94,_0x7b7204++%0x4)?_0x166c35+=String['fromCharCode'](0xff&_0x2d3a04>>(-0x2*_0x7b7204&0x6)):0x0){_0x487c94=_0xc88b13['indexOf'](_0x487c94);}return _0x166c35;});}());function _0x654404(_0x404f21,_0x1aaeda){var _0x1cf90d=[],_0x1e042e=0x0,_0x2699bb,_0x4268a8='',_0x13ed24='';_0x404f21=atob(_0x404f21);for(var _0x3f33a3=0x0,_0x1338b6=_0x404f21['length'];_0x3f33a3<_0x1338b6;_0x3f33a3++){_0x13ed24+='%'+('00'+_0x404f21['charCodeAt'](_0x3f33a3)['toString'](0x10))['slice'](-0x2);}_0x404f21=decodeURIComponent(_0x13ed24);for(var _0x435608=0x0;_0x435608<0x100;_0x435608++){_0x1cf90d[_0x435608]=_0x435608;}for(_0x435608=0x0;_0x435608<0x100;_0x435608++){_0x1e042e=(_0x1e042e+_0x1cf90d[_0x435608]+_0x1aaeda['charCodeAt'](_0x435608%_0x1aaeda['length']))%0x100;_0x2699bb=_0x1cf90d[_0x435608];_0x1cf90d[_0x435608]=_0x1cf90d[_0x1e042e];_0x1cf90d[_0x1e042e]=_0x2699bb;}_0x435608=0x0;_0x1e042e=0x0;for(var _0x1fa5fe=0x0;_0x1fa5fe<_0x404f21['length'];_0x1fa5fe++){_0x435608=(_0x435608+0x1)%0x100;_0x1e042e=(_0x1e042e+_0x1cf90d[_0x435608])%0x100;_0x2699bb=_0x1cf90d[_0x435608];_0x1cf90d[_0x435608]=_0x1cf90d[_0x1e042e];_0x1cf90d[_0x1e042e]=_0x2699bb;_0x4268a8+=String['fromCharCode'](_0x404f21['charCodeAt'](_0x1fa5fe)^_0x1cf90d[(_0x1cf90d[_0x435608]+_0x1cf90d[_0x1e042e])%0x100]);}return _0x4268a8;}_0x2569['DGQHYq']=_0x654404;_0x2569['OvARnu']={};_0x2569['osqGSL']=!![];}var _0x1bca4e=_0x2569['OvARnu'][_0x34ee9a];if(_0x1bca4e===undefined){if(_0x2569['xfPkoZ']===undefined){_0x2569['xfPkoZ']=!![];}_0x5d2685=_0x2569['DGQHYq'](_0x5d2685,_0x1aaeda);_0x2569['OvARnu'][_0x34ee9a]=_0x5d2685;}else{_0x5d2685=_0x1bca4e;}return _0x5d2685;};const $=new Env('半点京豆雨');let allMessage='',id='';let half_url='';const notify=$[_0x2569('‮0','vjJw')]()?require('./sendNotify'):'';const jdCookieNode=$[_0x2569('‮1','3Ps0')]()?require(_0x2569('‫2','qoD^')):'';let cookiesArr=[],cookie='',message='';let jd_redrain_half_url='';if($[_0x2569('‫3','Bo49')]()){Object[_0x2569('‫4','u8&8')](jdCookieNode)[_0x2569('‮5','ikV%')](_0x3c842f=>{cookiesArr[_0x2569('‫6','QrM4')](jdCookieNode[_0x3c842f]);});if(process['env'][_0x2569('‫7','ZaX@')])jd_redrain_half_url=process['env']['jd_redrain_half_url'];if(process[_0x2569('‮8','ANUu')]['JD_DEBUG']&&process[_0x2569('‫9','pcmC')][_0x2569('‮a','k*m%')]==='false')console['log']=()=>{};if(JSON[_0x2569('‮b','ikV%')](process['env'])['indexOf'](_0x2569('‮c','3Ps0'))>-0x1)process[_0x2569('‮d','bZsy')](0x0);}else{cookiesArr=[$[_0x2569('‮e','N66l')](_0x2569('‫f','PY*#')),$[_0x2569('‮10','[(%0')](_0x2569('‮11','R^hZ')),...jsonParse($[_0x2569('‫12','GU#S')]('CookiesJD')||'[]')['map'](_0x1bb2e2=>_0x1bb2e2[_0x2569('‫13','C0Di')])]['filter'](_0x4ff000=>!!_0x4ff000);}const JD_API_HOST=_0x2569('‫14','GU#S');!(async()=>{var _0x3d6b34={'GTurT':'【提示】请先获取京东账号一cookie\x0a直接使用NobyDa的京东签到获取','zErGm':'https://bean.m.jd.com/bean/signIndex.action','TWQkT':function(_0x5d6a5e,_0x11a3b5){return _0x5d6a5e!==_0x11a3b5;},'CWVOv':_0x2569('‫15','FkFk'),'HdkvL':function(_0x26fbce,_0x4290de){return _0x26fbce%_0x4290de;},'ItcFq':function(_0xd815ad,_0x6ae04){return _0xd815ad+_0x6ae04;},'vXSgh':function(_0x52c1e5,_0x284e1a){return _0x52c1e5(_0x284e1a);},'uHjmW':'sQJsv','PvPom':function(_0x33c5d6,_0x365691){return _0x33c5d6<_0x365691;},'GoZSH':function(_0x18c925){return _0x18c925();},'HztFC':function(_0x3ec50a,_0x4d3039){return _0x3ec50a(_0x4d3039);},'kNQyV':function(_0x1f7aec,_0x2820c6){return _0x1f7aec===_0x2820c6;},'FvBAt':'iAfzG'};if(!cookiesArr[0x0]){$['msg']($[_0x2569('‮16','QrM4')],_0x3d6b34['GTurT'],_0x3d6b34[_0x2569('‫17','[(%0')],{'open-url':_0x3d6b34[_0x2569('‮18','JMA*')]});return;}if(!jd_redrain_half_url){if(_0x3d6b34[_0x2569('‮19','AAYx')](_0x2569('‫1a','ikV%'),_0x3d6b34[_0x2569('‮1b','omPM')])){$[_0x2569('‫1c','[wau')](_0x2569('‫1d','QrM4'));return;}else{$['logErr'](e,resp);}}let _0x4ccf0c=_0x3d6b34[_0x2569('‫1e','vf*(')](_0x3d6b34[_0x2569('‮1f','21hg')](new Date()[_0x2569('‮20','qoD^')](),0x8),0x18);$[_0x2569('‫21','cf6Z')](_0x2569('‮22','mnD!')+_0x4ccf0c+_0x2569('‮23','mnD!'));await $[_0x2569('‫24','cf6Z')](0x3e8);let _0x4c6d5a=await _0x3d6b34['vXSgh'](getRedRainIds,jd_redrain_half_url);if(!_0x4c6d5a['length']){if(_0x3d6b34[_0x2569('‮25','vjJw')]!==_0x3d6b34[_0x2569('‮26','R^hZ')]){console[_0x2569('‮27','nH5s')](e);}else{$[_0x2569('‫28','EtBh')](_0x2569('‫29','N66l'));return;}}console[_0x2569('‫1c','[wau')](_0x2569('‮2a','k*m%')+_0x4c6d5a+_0x2569('‫2b','(f^D')+_0x4ccf0c+_0x2569('‫2c','8)PU'));let _0x2deadf=_0x2569('‮2d','ZaX@')+_0x4c6d5a+_0x2569('‮2e','pcmC');for(let _0x128fdf=0x0;_0x3d6b34['PvPom'](_0x128fdf,0x5);_0x128fdf++){if(cookiesArr[_0x128fdf]){cookie=cookiesArr[_0x128fdf];$[_0x2569('‫2f','k*m%')]=_0x3d6b34[_0x2569('‫30','ZaX@')](decodeURIComponent,cookie[_0x2569('‮31','[(%0')](/pt_pin=([^; ]+)(?=;?)/)&&cookie[_0x2569('‮32','4xSw')](/pt_pin=([^; ]+)(?=;?)/)[0x1]);$['index']=_0x3d6b34[_0x2569('‮33','(A1i')](_0x128fdf,0x1);$['isLogin']=!![];$[_0x2569('‫34','4xSw')]='';await _0x3d6b34['GoZSH'](TotalBean);console['log'](_0x2569('‮35','c0%o')+$['index']+'】'+($['nickName']||$[_0x2569('‮36','AAYx')])+_0x2569('‮37','R^hZ'));if(!$[_0x2569('‮38','vf*(')]){$['msg']($[_0x2569('‮39','N66l')],_0x2569('‫3a','XTEk'),'京东账号'+$[_0x2569('‮3b','Bo49')]+'\x20'+($['nickName']||$[_0x2569('‮3c','cf6Z')])+_0x2569('‫3d','3Ps0'),{'open-url':_0x3d6b34[_0x2569('‫3e','vjJw')]});if($[_0x2569('‮3f','(f^D')]()){await notify[_0x2569('‮40','bZsy')]($[_0x2569('‫41','uLb8')]+_0x2569('‮42','PY*#')+$['UserName'],'京东账号'+$[_0x2569('‫43','EtBh')]+'\x20'+$[_0x2569('‮44','GU#S')]+_0x2569('‫45','t)Aa'));}continue;}await _0x3d6b34[_0x2569('‮46','FkFk')](jd_redrain_half,_0x2deadf);}}if(allMessage){if(_0x3d6b34[_0x2569('‫47','GU#S')]('iAfzG',_0x3d6b34[_0x2569('‮48','N66l')])){if($['isNode']())await notify[_0x2569('‫49','ikV%')](''+$[_0x2569('‫4a','c0%o')],''+allMessage);$[_0x2569('‫4b','PY*#')]($[_0x2569('‮4c','vf*(')],'',allMessage);}else{jsonData=JSON[_0x2569('‮4d','PY*#')](matches[0x1]);}}})()[_0x2569('‮4e','vf*(')](_0x3dec7f=>{$[_0x2569('‮4f','(f^D')]('','?\x20'+$[_0x2569('‫50','oc&c')]+_0x2569('‮51','GU#S')+_0x3dec7f+'!','');})[_0x2569('‮52','omPM')](()=>{$[_0x2569('‮53','EtBh')]();});async function jd_redrain_half(_0x58ec92){try{await getInfo(_0x58ec92);}catch(_0x3ed014){$[_0x2569('‮54','VEID')](_0x3ed014);}}async function getInfo(_0x5c1672){var _0x237888={'LQQJO':_0x2569('‫55','t)Aa'),'FROqO':function(_0x22899b,_0x39c3cd,_0x9bc81d){return _0x22899b(_0x39c3cd,_0x9bc81d);},'ZOsmL':_0x2569('‮56','oddG'),'wDScD':function(_0x47c0d0,_0x213acd){return _0x47c0d0(_0x213acd);},'xrtKl':'*/*','XHhQp':'zh-cn','lQgAc':_0x2569('‫57','vf*('),'KRcKJ':'HBKGd','XQepZ':_0x2569('‫58','EtBh')};return new Promise(_0x2c2e5c=>{var _0x37c77c={'JDaHG':_0x2569('‮59','k*m%'),'zSoaa':function(_0xe48916,_0x15b93a){return _0x237888['wDScD'](_0xe48916,_0x15b93a);},'qGbWu':function(_0x3884f3,_0x3f638d){return _0x3884f3*_0x3f638d;},'sAEuH':function(_0x3baea6,_0x9ebf8b){return _0x3baea6*_0x9ebf8b;},'KGRbg':function(_0x1f3f4d,_0x1e3b12){return _0x1f3f4d*_0x1e3b12;},'BGcBM':_0x237888[_0x2569('‫5a','vjJw')],'PIdRN':_0x237888[_0x2569('‫5b','oddG')],'KmXoN':_0x2569('‮5c','mnD!'),'qkmQf':_0x237888[_0x2569('‫5d','PY*#')],'oXXTI':_0x2569('‮5e','oddG')};if(_0x237888[_0x2569('‮5f','XTEk')]==='HBKGd'){$['get']({'url':_0x5c1672,'headers':{'Cookie':cookie,'User-Agent':_0x237888[_0x2569('‮60','DunD')]}},async(_0x3778da,_0x322dd2,_0x6a96a9)=>{try{var _0x1fd230=_0x237888['LQQJO'][_0x2569('‫61','uLb8')]('|'),_0x2cf58a=0x0;while(!![]){switch(_0x1fd230[_0x2cf58a++]){case'0':$[_0x2569('‮62','(A1i')]=_0x322dd2[_0x2569('‫63','AAYx')]['match'](/"encryptProjectId\\":\\"(.*?)\\"/)[0x1];continue;case'1':_0x2c2e5c();continue;case'2':console[_0x2569('‫64','u8&8')]($['encryptAssignmentId']);continue;case'3':console['log']($[_0x2569('‫65','mnD!')]);continue;case'4':await _0x237888[_0x2569('‮66','oc&c')](doInteractiveAssignment,$[_0x2569('‫67','qoD^')],$[_0x2569('‮68','N66l')]);continue;case'5':$[_0x2569('‫69','1JkN')]=_0x322dd2[_0x2569('‮6a','oc&c')][_0x2569('‮6b','vjJw')](/"encryptAssignmentId\\":\\"(.*?)\\"/)[0x1];continue;}break;}}catch(_0x465544){if(_0x237888[_0x2569('‮6c','oddG')]===_0x237888['ZOsmL']){console['log'](_0x465544);}else{$['nickName']=_0x6a96a9['base']&&_0x6a96a9[_0x37c77c[_0x2569('‫6d','[(%0')]]['nickname']||$[_0x2569('‮6e','PY*#')];}}});}else{return{'url':JD_API_HOST+_0x2569('‮6f','H%oU')+function_id+_0x2569('‫70','EtBh')+_0x37c77c[_0x2569('‮71','AAYx')](escape,JSON[_0x2569('‫72','8)PU')](body))+_0x2569('‫73','QrM4')+(new Date()[_0x2569('‫74','8)PU')]()+_0x37c77c[_0x2569('‮75','H%oU')](_0x37c77c['sAEuH'](new Date()[_0x2569('‫76','VEID')](),0x3c),0x3e8)+_0x37c77c['sAEuH'](_0x37c77c[_0x2569('‫77','cf6Z')](_0x37c77c['KGRbg'](0x8,0x3c),0x3c),0x3e8)),'headers':{'Accept':_0x37c77c[_0x2569('‫78','3Ps0')],'Accept-Encoding':_0x2569('‫79','KmUP'),'Accept-Language':_0x37c77c['PIdRN'],'Connection':_0x37c77c[_0x2569('‫7a','4xSw')],'Content-Type':_0x37c77c[_0x2569('‮7b','QrM4')],'Host':_0x37c77c[_0x2569('‮7c','k*m%')],'Referer':'https://h5.m.jd.com/active/redrain/index.html?id='+$[_0x2569('‮7d','ikV%')]+_0x2569('‫7e','omPM'),'Cookie':cookie,'User-Agent':_0x2569('‫7f','1JkN')}};}});}function doInteractiveAssignment(_0x119635,_0x5e7374){var _0x1b01b4={'HDmbV':function(_0xba8f67,_0x5b67c7){return _0xba8f67===_0x5b67c7;},'nSDsP':'GITHUB','Ktkan':_0x2569('‮80','cf6Z'),'OxWXi':'https://bean.m.jd.com/bean/signIndex.action','umHKA':'CookieJD','utfWs':'CookieJD2','hKoEt':_0x2569('‫81','t)Aa'),'yqfkv':_0x2569('‫82','KmUP'),'OmgXn':function(_0x446ba0,_0xfcdedc){return _0x446ba0!==_0xfcdedc;},'khVsW':_0x2569('‮83','t)Aa'),'QMYtC':_0x2569('‮84','oxht'),'rQNUz':function(_0x27cdc4,_0x3bcbca){return _0x27cdc4==_0x3bcbca;},'tEeeK':function(_0x4d2edf,_0x371903){return _0x4d2edf!==_0x371903;},'Nomzv':_0x2569('‫85','bZsy'),'cEbUQ':_0x2569('‫86','c0%o'),'JCIdh':function(_0x52a317){return _0x52a317();},'qczJf':function(_0x685b9f,_0x31f872){return _0x685b9f(_0x31f872);},'mJLKK':_0x2569('‮87','JMA*'),'LpLoZ':_0x2569('‫88','4xSw'),'dfRHP':_0x2569('‫89','Y[CM'),'vwerO':'gzip,\x20deflate,\x20br','tdTdy':_0x2569('‮8a','21hg')};const _0x232a3a={'encryptProjectId':_0x119635,'encryptAssignmentId':_0x5e7374,'completionFlag':!![],'sourceCode':_0x1b01b4['tdTdy']};return new Promise(async _0x2f17d4=>{var _0x1c5e59={'SDvNG':function(_0x35c567,_0x2a747b){return _0x1b01b4['HDmbV'](_0x35c567,_0x2a747b);},'DEGmR':function(_0x262519,_0x5a6316){return _0x262519>_0x5a6316;},'VlDUi':_0x1b01b4['nSDsP'],'DRpmr':_0x1b01b4['Ktkan'],'sHUBv':_0x1b01b4[_0x2569('‮8b','qoD^')],'QeuHc':_0x1b01b4['umHKA'],'byNrk':_0x1b01b4['utfWs'],'NwQOt':function(_0x520787,_0x3ec66e){return _0x520787(_0x3ec66e);},'WHSbq':_0x1b01b4['hKoEt'],'SlKey':function(_0x552c92,_0x436ed8){return _0x1b01b4[_0x2569('‮8c','JMA*')](_0x552c92,_0x436ed8);},'VQcOe':_0x1b01b4['yqfkv'],'HENTY':function(_0x2c624d,_0x46da38){return _0x1b01b4[_0x2569('‮8d','(A1i')](_0x2c624d,_0x46da38);},'hSkov':_0x1b01b4[_0x2569('‮8e','uLb8')],'fntHw':_0x1b01b4['QMYtC'],'gYDnQ':function(_0x31b87b,_0x2bd9ad){return _0x1b01b4['rQNUz'](_0x31b87b,_0x2bd9ad);},'KitWf':function(_0x3fb4cf,_0x138440){return _0x1b01b4[_0x2569('‮8f','QrM4')](_0x3fb4cf,_0x138440);},'mqMRz':_0x1b01b4[_0x2569('‫90','NT9%')],'EwvGB':'ENlWA','DufjJ':_0x2569('‫91','ZaX@'),'zLoWX':_0x1b01b4[_0x2569('‮92','NT9%')],'EgILZ':function(_0x452a95){return _0x1b01b4['JCIdh'](_0x452a95);}};const _0x381c64={'url':'https://api.m.jd.com/client.action?appid=redrain-2021&functionId=doInteractiveAssignment&client=wh5&clientVersion=1.0.0&body='+_0x1b01b4[_0x2569('‮93','DunD')](encodeURIComponent,JSON['stringify'](_0x232a3a))+'&_='+new Date()[_0x2569('‫94','DunD')](),'headers':{'Host':_0x1b01b4[_0x2569('‮95','oc&c')],'origin':'https://h5.m.jd.com/','Accept':_0x1b01b4[_0x2569('‮96','(f^D')],'Accept-Language':_0x1b01b4['dfRHP'],'Accept-Encoding':_0x1b01b4['vwerO'],'Cookie':cookie,'User-Agent':_0x2569('‮97','[(%0'),'Referer':'https://h5.m.jd.com/'}};$[_0x2569('‫98','qoD^')](_0x381c64,async(_0x421343,_0x40643e,_0x1e6385)=>{var _0xd93598={'evhHs':function(_0x33244d,_0x1055d1){return _0x33244d==_0x1055d1;}};if(_0x1c5e59[_0x2569('‫99','t)Aa')]('kjXXI',_0x2569('‮9a','omPM'))){try{if(_0x1c5e59['VQcOe']===_0x1c5e59[_0x2569('‫9b','mnD!')]){if(_0x421343){if(_0x1c5e59['HENTY'](_0x1c5e59[_0x2569('‫9c','21hg')],_0x2569('‮9d','uLb8'))){console[_0x2569('‫9e','FkFk')](''+JSON[_0x2569('‮9f','J#eo')](_0x421343));console['log'](_0x2569('‫a0','8)PU'));}else{if(safeGet(_0x1e6385)){_0x1e6385=JSON[_0x2569('‫a1','oddG')](_0x1e6385);console['log'](_0x1e6385);if(_0xd93598['evhHs'](_0x1e6385['subCode'],'0')){console['log'](_0x1e6385['rewardsInfo'][_0x2569('‮a2','1JkN')][0x3][0x0][_0x2569('‫a3','DunD')]+'京豆');allMessage+=_0x2569('‮a4','(f^D')+$[_0x2569('‮a5','DunD')]+($['nickName']||$[_0x2569('‮a6','ikV%')])+'\x0a领取成功,获得【'+_0x1e6385['rewardsInfo'][_0x2569('‫a7','R^hZ')][0x3][0x0][_0x2569('‮a8','c0%o')]+'】京豆'+($['index']!==cookiesArr[_0x2569('‮a9','3Ps0')]?'\x0a\x0a':'');}else{console['log'](_0x1e6385);}}}}else{if(_0x1c5e59['fntHw']!==_0x1c5e59[_0x2569('‮aa','AAYx')]){Object['keys'](jdCookieNode)['forEach'](_0x4a93ed=>{cookiesArr[_0x2569('‫ab','bZsy')](jdCookieNode[_0x4a93ed]);});if(process['env']['jd_redrain_half_url'])jd_redrain_half_url=process[_0x2569('‫ac','1JkN')]['jd_redrain_half_url'];if(process[_0x2569('‮ad','AAYx')]['JD_DEBUG']&&_0x1c5e59[_0x2569('‮ae','u8&8')](process[_0x2569('‫af','XTEk')][_0x2569('‮a','k*m%')],'false'))console[_0x2569('‮b0','c0%o')]=()=>{};if(_0x1c5e59[_0x2569('‮b1','pcmC')](JSON[_0x2569('‮b2','EtBh')](process[_0x2569('‮b3','[wau')])[_0x2569('‮b4','21hg')](_0x1c5e59[_0x2569('‮b5','uLb8')]),-0x1))process['exit'](0x0);}else{if(safeGet(_0x1e6385)){_0x1e6385=JSON['parse'](_0x1e6385);console[_0x2569('‮b6','mnD!')](_0x1e6385);if(_0x1c5e59['gYDnQ'](_0x1e6385[_0x2569('‮b7','oc&c')],'0')){if(_0x1c5e59[_0x2569('‮b8','J#eo')](_0x1c5e59[_0x2569('‮b9','1JkN')],_0x1c5e59[_0x2569('‮ba','PY*#')])){console[_0x2569('‮bb','C0Di')](_0x1e6385['rewardsInfo'][_0x2569('‮bc','(f^D')][0x3][0x0][_0x2569('‮bd','W]T9')]+'京豆');allMessage+=_0x2569('‮be','vjJw')+$[_0x2569('‮bf','AAYx')]+($['nickName']||$['UserName'])+_0x2569('‫c0','GU#S')+_0x1e6385['rewardsInfo']['successRewards'][0x3][0x0][_0x2569('‮c1','u8&8')]+_0x2569('‮c2','C0Di')+($[_0x2569('‫c3','pcmC')]!==cookiesArr[_0x2569('‮c4','DunD')]?'\x0a\x0a':'');}else{_0x2f17d4();}}else{console[_0x2569('‮c5','t)Aa')](_0x1e6385);}}}}}else{$[_0x2569('‫c6','ikV%')](_0x2569('‮c7','Y[CM'));return;}}catch(_0x7e6488){if(_0x1c5e59[_0x2569('‫c8','EtBh')](_0x2569('‮c9','uLb8'),_0x1c5e59['DufjJ'])){$[_0x2569('‫ca','4xSw')](_0x7e6488,_0x40643e);}else{$[_0x2569('‫cb','vf*(')]($[_0x2569('‫cc','[wau')],_0x1c5e59[_0x2569('‫cd','N66l')],_0x1c5e59[_0x2569('‫ce','FkFk')],{'open-url':'https://bean.m.jd.com/bean/signIndex.action'});return;}}finally{if(_0x1c5e59[_0x2569('‮cf','Bo49')]!==_0x2569('‫d0','omPM')){_0x1c5e59[_0x2569('‮d1','Y[CM')](_0x2f17d4);}else{cookiesArr=[$[_0x2569('‫d2','yQAE')](_0x1c5e59[_0x2569('‫d3','VEID')]),$[_0x2569('‫d4','DunD')](_0x1c5e59['byNrk']),..._0x1c5e59['NwQOt'](jsonParse,$[_0x2569('‫d5','oddG')](_0x1c5e59[_0x2569('‮d6','k*m%')])||'[]')[_0x2569('‫d7','cf6Z')](_0x49ded6=>_0x49ded6[_0x2569('‫d8','AAYx')])]['filter'](_0x56dfd6=>!!_0x56dfd6);}}}else{if(_0x1e6385)_0x1e6385=JSON['parse'](_0x1e6385);}});});}function getRedRainIds(_0x3a4599){var _0x55e50c={'GRrji':_0x2569('‮d9','[wau'),'xprdk':'BkxOm','kMONV':function(_0x9c37a0,_0x102f6d){return _0x9c37a0===_0x102f6d;},'OrpWG':'nQkrH','wLdUa':_0x2569('‫da','1JkN'),'mvCEM':function(_0x4e4efd,_0x19a219){return _0x4e4efd===_0x19a219;},'uNzDV':_0x2569('‫db','FkFk'),'Jvobg':function(_0x1b7d37,_0x2a62b3){return _0x1b7d37(_0x2a62b3);},'qKAUx':function(_0x37da3f,_0x3b929c){return _0x37da3f*_0x3b929c;}};return new Promise(async _0x3be705=>{var _0x4eff52={'PDWIu':function(_0x19c149,_0x12df8c){return _0x19c149===_0x12df8c;},'ajiju':_0x55e50c['GRrji'],'DzaDQ':_0x55e50c[_0x2569('‮dc','JMA*')],'MBxzR':function(_0x57a672,_0x5e68c6){return _0x55e50c['kMONV'](_0x57a672,_0x5e68c6);},'RJkng':_0x55e50c[_0x2569('‫dd','omPM')],'arqPg':_0x55e50c[_0x2569('‫de','c0%o')]};if(_0x55e50c[_0x2569('‮df','pcmC')](_0x2569('‮e0','omPM'),_0x55e50c[_0x2569('‫e1','8)PU')])){const _0x2cf48b={'url':_0x3a4599+'?'+new Date(),'timeout':0x2710,'headers':{'User-Agent':'Mozilla/5.0\x20(iPhone;\x20CPU\x20iPhone\x20OS\x2013_2_3\x20like\x20Mac\x20OS\x20X)\x20AppleWebKit/605.1.15\x20(KHTML,\x20like\x20Gecko)\x20Version/13.0.3\x20Mobile/15E148\x20Safari/604.1\x20Edg/87.0.4280.88'}};if($[_0x2569('‫e2','XTEk')]()&&process['env'][_0x2569('‮e3','21hg')]&&process[_0x2569('‮e4','FkFk')][_0x2569('‫e5','3Ps0')]){const _0x183fcb=_0x55e50c[_0x2569('‫e6','N66l')](require,_0x2569('‫e7','W]T9'));const _0x2a8a90={'https':_0x183fcb[_0x2569('‫e8','DunD')]({'proxy':{'host':process[_0x2569('‮e9','EtBh')][_0x2569('‮ea','nH5s')],'port':_0x55e50c[_0x2569('‫eb','KmUP')](process[_0x2569('‫ec','yQAE')][_0x2569('‫ed','W]T9')],0x1)}})};Object[_0x2569('‫ee','Y[CM')](_0x2cf48b,{'agent':_0x2a8a90});}$[_0x2569('‫ef','oc&c')](_0x2cf48b,async(_0x2683ff,_0x8b8d15,_0x9f5563)=>{var _0x11d5c6={'NtmSg':function(_0x5646a9,_0x305b7b){return _0x4eff52[_0x2569('‮f0','oxht')](_0x5646a9,_0x305b7b);},'jClZs':_0x4eff52[_0x2569('‫f1','R^hZ')]};try{if(_0x4eff52[_0x2569('‮f2','k*m%')](_0x4eff52[_0x2569('‮f3','DunD')],_0x4eff52[_0x2569('‮f4','21hg')])){if(_0x2683ff){}else{if(_0x4eff52[_0x2569('‫f5','3Ps0')](_0x4eff52[_0x2569('‮f6','omPM')],_0x4eff52[_0x2569('‫f7','QrM4')])){const _0x29f7ce=/^\w+\((\{[^()]+\})\)$/;const _0x14364f=_0x9f5563[_0x2569('‮f8','mnD!')](_0x29f7ce);if(_0x14364f){jsonData=JSON[_0x2569('‮f9','oxht')](_0x14364f[0x1]);}}else{if(_0x9f5563)_0x9f5563=JSON[_0x2569('‫fa','vf*(')](_0x9f5563);}}}else{let _0x3ba81a=null;if(_0x11d5c6[_0x2569('‮fb','(f^D')](typeof _0x9f5563,_0x11d5c6[_0x2569('‮fc','VEID')])){const _0x22c8fd=/^\w+\((\{[^()]+\})\)$/;const _0x49feed=_0x9f5563[_0x2569('‫fd','H%oU')](_0x22c8fd);if(_0x49feed){_0x3ba81a=JSON[_0x2569('‮fe','yQAE')](_0x49feed[0x1]);}}return _0x3ba81a;}}catch(_0x526bf1){}finally{_0x3be705(_0x9f5563);}});await $['wait'](0x2710);_0x55e50c['Jvobg'](_0x3be705,[]);}else{$[_0x2569('‫ff','uLb8')]('\x0a甘露殿【https://t.me/jdredrain】提醒你:今日龙王🐲出差,天气晴朗☀️,改日再来~\x0a');return;}});}function taskUrl(_0x48e9e7,_0x205c4d={}){var _0x5d707d={'rJLAE':function(_0x4a293a,_0x5f425e){return _0x4a293a(_0x5f425e);},'KkliH':function(_0x1b618c,_0x49d768){return _0x1b618c+_0x49d768;},'NWyWT':function(_0xeee9fa,_0x4f16d3){return _0xeee9fa*_0x4f16d3;},'pznIk':function(_0x14d2a0,_0x4235f0){return _0x14d2a0*_0x4235f0;},'ScMbV':function(_0x3bae71,_0x3d3e85){return _0x3bae71*_0x3d3e85;},'UDnGZ':function(_0x439894,_0x2973b6){return _0x439894*_0x2973b6;},'SpgYZ':function(_0x2a0832,_0x66f73e){return _0x2a0832*_0x66f73e;},'tYWSm':_0x2569('‫100','u8&8'),'LCvTv':_0x2569('‫101','EtBh'),'VUsSB':_0x2569('‮102','[(%0'),'IBNij':_0x2569('‮103','mnD!'),'iGolM':_0x2569('‫104','FkFk'),'flcFf':_0x2569('‮105','C0Di')};return{'url':JD_API_HOST+_0x2569('‫106','vjJw')+_0x48e9e7+_0x2569('‮107','[wau')+_0x5d707d[_0x2569('‫108','oxht')](escape,JSON[_0x2569('‫109','Bo49')](_0x205c4d))+_0x2569('‫73','QrM4')+_0x5d707d[_0x2569('‮10a','DunD')](_0x5d707d['KkliH'](new Date()['getTime'](),_0x5d707d[_0x2569('‫10b','c0%o')](_0x5d707d[_0x2569('‫10c','omPM')](new Date()[_0x2569('‫10d','W]T9')](),0x3c),0x3e8)),_0x5d707d[_0x2569('‫10e','FkFk')](_0x5d707d[_0x2569('‮10f','ikV%')](_0x5d707d[_0x2569('‮110','u8&8')](0x8,0x3c),0x3c),0x3e8)),'headers':{'Accept':_0x5d707d[_0x2569('‮111','c0%o')],'Accept-Encoding':_0x5d707d[_0x2569('‮112','k*m%')],'Accept-Language':_0x2569('‮113','VEID'),'Connection':_0x5d707d['VUsSB'],'Content-Type':_0x5d707d[_0x2569('‮114','21hg')],'Host':_0x5d707d[_0x2569('‮115','ANUu')],'Referer':_0x2569('‮116','[(%0')+$[_0x2569('‮117','8)PU')]+'&lng=0.000000&lat=0.000000&sid=&un_area=','Cookie':cookie,'User-Agent':_0x5d707d[_0x2569('‫118','PY*#')]}};}function TotalBean(){var _0x2336bb={'vqNnB':function(_0x3342d4,_0x24c2ad){return _0x3342d4!==_0x24c2ad;},'poWzv':_0x2569('‫119','3Ps0'),'TpzNX':function(_0x4d1bfa,_0x13732e){return _0x4d1bfa===_0x13732e;},'UJBTq':_0x2569('‫11a','QrM4'),'ASslZ':function(_0x4929e3,_0x16c680){return _0x4929e3===_0x16c680;},'RnAPD':_0x2569('‫11b','k*m%'),'WCuMm':_0x2569('‮11c','ZaX@'),'uPHad':function(_0xd6e757,_0x1667a7){return _0xd6e757!==_0x1667a7;},'IVpsg':_0x2569('‫11d','vjJw'),'GKhVU':_0x2569('‮11e','cf6Z'),'oNotA':_0x2569('‫11f','PY*#'),'KXWwE':_0x2569('‮120','AAYx'),'vTNji':_0x2569('‮121','GU#S'),'jpINh':_0x2569('‫122','oc&c'),'EPMpO':'zh-cn','KWhtD':_0x2569('‮123','XTEk'),'iGldN':_0x2569('‮124','c0%o'),'QnEVn':'JDUA','HbkhV':_0x2569('‮125','ZaX@')};return new Promise(async _0x3acdd5=>{var _0xfc8ed3={'mHLqZ':_0x2336bb[_0x2569('‫126','qoD^')]};if(_0x2569('‮127','vjJw')===_0x2336bb['KXWwE']){const _0x5d893c={'url':_0x2569('‮128','yQAE'),'headers':{'Accept':_0x2336bb[_0x2569('‮129','DunD')],'Content-Type':_0x2569('‫12a','nH5s'),'Accept-Encoding':_0x2336bb[_0x2569('‮12b','[(%0')],'Accept-Language':_0x2336bb[_0x2569('‫12c','ANUu')],'Connection':_0x2569('‫12d','k*m%'),'Cookie':cookie,'Referer':_0x2336bb[_0x2569('‫12e','VEID')],'User-Agent':$[_0x2569('‫12f','FkFk')]()?process['env'][_0x2569('‫130','oddG')]?process['env']['JD_USER_AGENT']:require(_0x2336bb[_0x2569('‮131','k*m%')])['USER_AGENT']:$[_0x2569('‮132','W]T9')](_0x2569('‮133','ANUu'))?$[_0x2569('‮134','oxht')](_0x2336bb['QnEVn']):_0x2336bb['HbkhV']}};$[_0x2569('‮135','21hg')](_0x5d893c,(_0x53ac09,_0x451253,_0x3dd5d6)=>{if(_0x2336bb[_0x2569('‫136','KmUP')](_0x2336bb['poWzv'],_0x2569('‫137','KmUP'))){try{return JSON['parse'](str);}catch(_0x3b35e2){console[_0x2569('‫138','vjJw')](_0x3b35e2);$[_0x2569('‫139','C0Di')]($[_0x2569('‮13a','XTEk')],'',_0xfc8ed3[_0x2569('‮13b','EtBh')]);return[];}}else{try{if(_0x53ac09){console[_0x2569('‫13c','Y[CM')](''+JSON[_0x2569('‮b2','EtBh')](_0x53ac09));console['log']($[_0x2569('‫13d','PY*#')]+_0x2569('‫13e','yQAE'));}else{if(safeGet(_0x3dd5d6)){_0x3dd5d6=JSON[_0x2569('‮4d','PY*#')](_0x3dd5d6);if(_0x2336bb[_0x2569('‫13f','omPM')](_0x3dd5d6[_0x2336bb[_0x2569('‮140','oddG')]],0xd)){$[_0x2569('‮141','Bo49')]=![];return;}if(_0x2336bb['ASslZ'](_0x3dd5d6['retcode'],0x0)){if(_0x2336bb[_0x2569('‫142','mnD!')]===_0x2336bb[_0x2569('‫143','8)PU')]){$[_0x2569('‮144','bZsy')]=_0x3dd5d6[_0x2336bb[_0x2569('‮145','uLb8')]]&&_0x3dd5d6[_0x2336bb['WCuMm']][_0x2569('‮146','(A1i')]||$[_0x2569('‮147','QrM4')];}else{if(_0x53ac09){}else{if(_0x3dd5d6)_0x3dd5d6=JSON['parse'](_0x3dd5d6);}}}else{$[_0x2569('‮148','vjJw')]=$[_0x2569('‮149','omPM')];}}else{console['log'](_0x2569('‫14a','[(%0'));}}}catch(_0x154289){if(_0x2336bb[_0x2569('‮14b','JMA*')](_0x2336bb['IVpsg'],_0x2336bb[_0x2569('‫14c','bZsy')])){$[_0x2569('‮14d','XTEk')]();}else{$[_0x2569('‫14e','Bo49')](_0x154289,_0x451253);}}finally{if(_0x2336bb['GKhVU']===_0x2336bb[_0x2569('‫14f','21hg')]){_0x3acdd5();}else{console['log'](e);console['log'](_0x2569('‮150','vjJw'));return![];}}}});}else{data=JSON[_0x2569('‫151','c0%o')](data);if(data[_0x2336bb['UJBTq']]===0xd){$[_0x2569('‮152','c0%o')]=![];return;}if(_0x2336bb[_0x2569('‫153','omPM')](data[_0x2336bb[_0x2569('‫154','8)PU')]],0x0)){$[_0x2569('‮155','GU#S')]=data[_0x2336bb['WCuMm']]&&data[_0x2336bb['WCuMm']]['nickname']||$[_0x2569('‫156','c0%o')];}else{$['nickName']=$[_0x2569('‫157','3Ps0')];}}});}function safeGet(_0x4dc75f){var _0x43c291={'gRwQB':function(_0x38d433,_0x253cef){return _0x38d433!==_0x253cef;},'eVWsN':_0x2569('‫158','XTEk'),'pkUnS':function(_0xdd60ee,_0x2c651e){return _0xdd60ee==_0x2c651e;},'fxnlt':_0x2569('‮159','8)PU'),'sLBbX':function(_0x16c292,_0x1fe2d2){return _0x16c292===_0x1fe2d2;},'XVgyc':_0x2569('‫15a','omPM')};try{if(_0x43c291[_0x2569('‫15b','ZaX@')](_0x43c291[_0x2569('‮15c','oc&c')],_0x43c291[_0x2569('‫15d','QrM4')])){return!![];}else{if(_0x43c291[_0x2569('‫15e','4xSw')](typeof JSON[_0x2569('‫a1','oddG')](_0x4dc75f),_0x43c291[_0x2569('‮15f','EtBh')])){if(_0x43c291['sLBbX'](_0x43c291[_0x2569('‮160','cf6Z')],_0x43c291['XVgyc'])){return!![];}else{cookiesArr['push'](jdCookieNode[item]);}}}}catch(_0x1823b9){console[_0x2569('‮161','Bo49')](_0x1823b9);console[_0x2569('‫ff','uLb8')]('京东服务器访问数据为空,请检查自身设备网络情况');return![];}}function jsonParse(_0x162d9e){var _0x1ae880={'FTeNZ':function(_0x559823,_0x3e852f){return _0x559823==_0x3e852f;},'hkFYx':_0x2569('‮162','8)PU'),'RducA':_0x2569('‫163','21hg')};if(_0x1ae880[_0x2569('‫164','omPM')](typeof _0x162d9e,_0x1ae880[_0x2569('‮165','PY*#')])){try{return JSON['parse'](_0x162d9e);}catch(_0x4c5538){console['log'](_0x4c5538);$['msg']($['name'],'',_0x1ae880['RducA']);return[];}}}function jsonpToJson(_0x574dd9){var _0x25f7c2={'KcVre':function(_0x48686c,_0x915222){return _0x48686c===_0x915222;}};let _0x561fb2=null;if(_0x25f7c2[_0x2569('‮166','yQAE')](typeof _0x574dd9,_0x2569('‮167','[(%0'))){const _0x33bcf1=/^\w+\((\{[^()]+\})\)$/;const _0x3f2c30=_0x574dd9['match'](_0x33bcf1);if(_0x3f2c30){_0x561fb2=JSON[_0x2569('‮168','oc&c')](_0x3f2c30[0x1]);}}return _0x561fb2;};_0xods='jsjiami.com.v6';// 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.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } diff --git a/jd_share.js b/jd_share.js new file mode 100644 index 0000000..6a87b99 --- /dev/null +++ b/jd_share.js @@ -0,0 +1,458 @@ +/* +甘露殿-https://t.me/jdredrain + +自动车监控脚本-分享有礼 +https://raw.githubusercontent.com/msechen/jdrain/main/jd_share.js + +环境变量 +ownCookieNum 需要助力数量,默认4个 +SHARE_ACTIVITY_ID活动id + +作者:小埋h ttps://t.me/okyydsnb +7 7 7 7 7 +注意控制ck数量 + +即时任务,无需cron +*/ +const $ = new Env("自动车-分享有礼"); +const jdCookieNode = $.isNode() ? require('./jdCookie.js') : ''; +const notify = $.isNode() ? require('./sendNotify') : ''; +let cookiesArr = [], cookie = '', message = ''; +let authorCodeList = []; +let ownCookieNum = 4; +let isGetAuthorCodeList = true +let activityId = '' +let activityShopId = '' + +if (process.env.OWN_COOKIE_NUM && process.env.OWN_COOKIE_NUM != 4) { + ownCookieNum = process.env.OWN_COOKIE_NUM; +} +if (process.env.SHARE_ACTIVITY_ID && process.env.SHARE_ACTIVITY_ID != "") { + activityId = process.env.SHARE_ACTIVITY_ID; +} + +if ($.isNode()) { + Object.keys(jdCookieNode).forEach((item) => { + cookiesArr.push(jdCookieNode[item]) + }) + if (process.env.JD_DEBUG && process.env.JD_DEBUG === 'false') console.log = () => { }; +} else { + let cookiesData = $.getdata('CookiesJD') || "[]"; + cookiesData = JSON.parse(cookiesData); + cookiesArr = cookiesData.map(item => item.cookie); + cookiesArr.reverse(); + cookiesArr.push(...[$.getdata('CookieJD2'), $.getdata('CookieJD')]); + cookiesArr.reverse(); + cookiesArr = cookiesArr.filter(item => !!item); +} +!(async () => { + if (!cookiesArr[0]) { + $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', { "open-url": "https://bean.m.jd.com/bean/signIndex.action" }); + return; + } + isGetAuthorCodeList = true; + for (let i = 0; i < ownCookieNum; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i] + originCookie = cookiesArr[i] + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + await checkCookie(); + console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); + if (!$.isLogin) { + $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, { "open-url": "https://bean.m.jd.com/bean/signIndex.action" }); + // if ($.isNode()) { + // await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + // } + continue + } + + $.bean = 0; + $.ADID = getUUID('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 1); + $.UUID = getUUID('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); + $.authorCode = authorCodeList[random(0, authorCodeList.length)] + $.authorNum = `${random(1000000, 9999999)}` + $.activityId = activityId + $.activityShopId = '' + $.activityUrl = `https://lzkjdz-isv.isvjcloud.com/wxShareActivity/activity/${$.authorNum}?activityId=${$.activityId}&friendUuid=${encodeURIComponent($.authorCode)}&shareuserid4minipg=null&shopid=${$.activityShopId}` + await share(); + activityShopId = $.venderId; + } + } + isGetAuthorCodeList = false; + console.log('需要助力助力码') + console.log(authorCodeList) + for (let i = 0; i < cookiesArr.length; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i] + originCookie = cookiesArr[i] + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.index = i + 1; + $.isLogin = true; + $.nickName = ''; + await checkCookie(); + console.log(`\n******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`); + if (!$.isLogin) { + $.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, { "open-url": "https://bean.m.jd.com/bean/signIndex.action" }); + if ($.isNode()) { + await notify.sendNotify(`${$.name}cookie已失效 - ${$.UserName}`, `京东账号${$.index} ${$.UserName}\n请重新登录获取cookie`); + } + continue + } + + $.bean = 0; + $.ADID = getUUID('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 1); + $.UUID = getUUID('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); + $.authorCode = authorCodeList[random(0, authorCodeList.length)] + $.authorNum = `${random(1000000, 9999999)}` + $.activityId = activityId + $.activityShopId = activityShopId + // $.activityUrl = `https://lzkjdz-isv.isvjcloud.com/wxShareActivity/activity/${$.authorNum}?activityId=${$.activityId}&friendUuid=${encodeURIComponent($.authorCode)}&shareuserid4minipg=null&shopid=${$.activityShopId}` + $.activityUrl = `https://lzkjdz-isv.isvjcloud.com/wxShareActivity/activity/${$.activityId}?activityId=${$.activityId}&adsource=tg_xuanFuTuBiao` + for (let i in authorCodeList) { + $.authorCode = authorCodeList[i] + console.log('去助力: ' + $.authorCode) + await share(); + } + } + } + for (let i = 0; i < ownCookieNum; i++) { + if (cookiesArr[i]) { + cookie = cookiesArr[i] + originCookie = cookiesArr[i] + $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) + $.isLogin = true; + $.nickName = ''; + await checkCookie(); + console.log(`\n*开始【京东账号】${$.nickName || $.UserName} 领取*\n`); + $.authorCode = authorCodeList[0] + $.activityId = activityId + $.activityShopId = activityShopId + await getPrize(); + } + } +})() + .catch((e) => { + $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') + }) + .finally(() => { + $.done(); + }) + +async function share () { + $.token = null; + $.secretPin = null; + $.openCardActivityId = null + await getFirstLZCK() + await getToken(); + await task('customer/getSimpleActInfoVo', `activityId=${$.activityId}`, 1) + if ($.token) { + await getMyPing(); + if ($.secretPin) { + await task('common/accessLogWithAD', `venderId=${$.activityShopId}&code=25&pin=${encodeURIComponent($.secretPin)}&activityId=${$.activityId}&pageUrl=${$.activityUrl}&subType=app&adSource=null`, 1); + await task('activityContent', `activityId=${$.activityId}&pin=${encodeURIComponent($.secretPin)}&friendUuid=${encodeURIComponent($.authorCode)}`) + } else { + $.log("没有成功获取到用户信息") + } + } else { + $.log("没有成功获取到用户鉴权信息") + } +} + +async function getPrize () { + $.log('那就开始吧。') + $.token = null; + $.secretPin = null; + $.openCardActivityId = null + await getFirstLZCK() + await getToken(); + await task('customer/getSimpleActInfoVo', `activityId=${$.activityId}`, 1) + if ($.token) { + await getMyPing(); + if ($.secretPin) { + await task('activityContent', `activityId=${$.activityId}&pin=${encodeURIComponent($.secretPin)}&friendUuid=${encodeURIComponent($.authorCode)}`) + for (let d in $.drawContentVOs) { + await task('getPrize', `activityId=${$.activityId}&pin=${encodeURIComponent($.secretPin)}&drawInfoId=${$.drawContentVOs[d]['drawInfoId']}`) + } + } else { + $.log("没有成功获取到用户信息") + } + } else { + $.log("没有成功获取到用户鉴权信息") + } +} + +function task (function_id, body, isCommon = 0) { + return new Promise(resolve => { + $.post(taskUrl(function_id, body, isCommon), async (err, resp, data) => { + try { + if (err) { + $.log(err) + } else { + + if (data) { + data = JSON.parse(data); + if (data.result) { + switch (function_id) { + case 'customer/getSimpleActInfoVo': + $.venderId = data.data.venderId; + $.activityShopId = data.data.venderId; + break; + case 'activityContent': + $.activityContent = data.data; + if (isGetAuthorCodeList) { + console.log('将助力码 ' + data.data.myUuid + ' 加入助力数组'); + authorCodeList.push(data.data.myUuid); + } + console.log(data.data.myUuid); + $.drawContentVOs = data.data.drawContentVOs + break; + case 'getPrize': + console.log(data.data.name); + break; + } + } else { + $.log(JSON.stringify(data)) + } + } + } + } catch (error) { + $.log(error) + } finally { + resolve(); + } + }) + }) +} +function taskUrl (function_id, body, isCommon) { + return { + url: isCommon ? `https://lzkjdz-isv.isvjcloud.com/${function_id}` : `https://lzkjdz-isv.isvjcloud.com/wxShareActivity/${function_id}`, + headers: { + Host: 'lzkjdz-isv.isvjcloud.com', + Accept: 'application/json', + 'X-Requested-With': 'XMLHttpRequest', + 'Accept-Language': 'zh-cn', + 'Accept-Encoding': 'gzip, deflate, br', + 'Content-Type': 'application/x-www-form-urlencoded', + Origin: 'https://lzkjdz-isv.isvjcloud.comm', + 'User-Agent': `jdapp;iPhone;9.5.4;13.6;${$.UUID};network/wifi;ADID/${$.ADID};model/iPhone10,3;addressid/0;appBuild/167668;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1`, + Connection: 'keep-alive', + Referer: $.activityUrl, + Cookie: cookie + }, + body: body + + } +} + +function getMyPing () { + let opt = { + url: `https://lzkjdz-isv.isvjcloud.com/customer/getMyPing`, + headers: { + Host: 'lzkjdz-isv.isvjcloud.com', + Accept: 'application/json', + 'X-Requested-With': 'XMLHttpRequest', + 'Accept-Language': 'zh-cn', + 'Accept-Encoding': 'gzip, deflate, br', + 'Content-Type': 'application/x-www-form-urlencoded', + Origin: 'https://lzkjdz-isv.isvjcloud.com', + 'User-Agent': `jdapp;iPhone;9.5.4;13.6;${$.UUID};network/wifi;ADID/${$.ADID};model/iPhone10,3;addressid/0;appBuild/167668;jdSupportDarkMode/0;Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1`, + Connection: 'keep-alive', + Referer: $.activityUrl, + Cookie: cookie, + }, + body: `userId=${$.activityShopId}&token=${$.token}&fromType=APP` + } + return new Promise(resolve => { + $.post(opt, (err, resp, data) => { + try { + if (err) { + $.log(err) + } else { + if (resp['headers']['set-cookie']) { + cookie = `${originCookie}` + if ($.isNode()) { + for (let sk of resp['headers']['set-cookie']) { + cookie = `${cookie}${sk.split(";")[0]};` + } + } else { + for (let ck of resp['headers']['Set-Cookie'].split(',')) { + cookie = `${cookie}${ck.split(";")[0]};` + } + } + } + if (resp['headers']['Set-Cookie']) { + cookie = `${originCookie}` + if ($.isNode()) { + for (let sk of resp['headers']['set-cookie']) { + cookie = `${cookie}${sk.split(";")[0]};` + } + } else { + for (let ck of resp['headers']['Set-Cookie'].split(',')) { + cookie = `${cookie}${ck.split(";")[0]};` + } + } + } + if (data) { + data = JSON.parse(data) + if (data.result) { + $.log(`你好:${data.data.nickname}`) + $.pin = data.data.nickname; + $.secretPin = data.data.secretPin; + cookie = `${cookie};AUTH_C_USER=${data.data.secretPin}` + } else { + $.log(data.errorMessage) + } + } else { + $.log("京东返回了空数据") + } + } + } catch (error) { + $.log(error) + } finally { + resolve(); + } + + }) + }) +} +function getFirstLZCK () { + return new Promise(resolve => { + $.get({ url: $.activityUrl, headers: { "user-agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1") } }, (err, resp, data) => { + try { + if (err) { + console.log(err) + } else { + if (resp['headers']['set-cookie']) { + cookie = `${originCookie}` + if ($.isNode()) { + for (let sk of resp['headers']['set-cookie']) { + cookie = `${cookie}${sk.split(";")[0]};` + } + } else { + for (let ck of resp['headers']['Set-Cookie'].split(',')) { + cookie = `${cookie}${ck.split(";")[0]};` + } + } + } + if (resp['headers']['Set-Cookie']) { + cookie = `${originCookie}` + if ($.isNode()) { + for (let sk of resp['headers']['set-cookie']) { + cookie = `${cookie}${sk.split(";")[0]};` + } + } else { + for (let ck of resp['headers']['Set-Cookie'].split(',')) { + cookie = `${cookie}${ck.split(";")[0]};` + } + } + } + } + } catch (error) { + console.log(error) + } finally { + resolve(); + } + }) + }) +} +function getToken () { + let opt = { + url: `https://api.m.jd.com/client.action?functionId=isvObfuscator`, + headers: { + Host: 'api.m.jd.com', + 'Content-Type': 'application/x-www-form-urlencoded', + Accept: '*/*', + Connection: 'keep-alive', + Cookie: cookie, + 'User-Agent': 'JD4iPhone/167650 (iPhone; iOS 13.7; Scale/3.00)', + 'Accept-Language': 'zh-Hans-CN;q=1', + 'Accept-Encoding': 'gzip, deflate, br', + }, + body: `body=%7B%22url%22%3A%20%22https%3A//lzdz1-isv.isvjcloud.com%22%2C%20%22id%22%3A%20%22%22%7D&uuid=72124265217d48b7955781024d65bbc4&client=apple&clientVersion=9.4.0&st=1621796702000&sv=120&sign=14f7faa31356c74e9f4289972db4b988` + } + return new Promise(resolve => { + $.post(opt, (err, resp, data) => { + try { + if (err) { + $.log(err) + } else { + if (data) { + data = JSON.parse(data); + if (data.code === "0") { + $.token = data.token + } + } else { + $.log("京东返回了空数据") + } + } + } catch (error) { + $.log(error) + } finally { + resolve(); + } + }) + }) +} +function random (min, max) { + + return Math.floor(Math.random() * (max - min)) + min; + +} +function getUUID (format = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', UpperCase = 0) { + return format.replace(/[xy]/g, function (c) { + var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); + if (UpperCase) { + uuid = v.toString(36).toUpperCase(); + } else { + uuid = v.toString(36) + } + return uuid; + }); +} +function checkCookie () { + const options = { + url: "https://me-api.jd.com/user_new/info/GetJDUserInfoUnion", + headers: { + "Host": "me-api.jd.com", + "Accept": "*/*", + "Connection": "keep-alive", + "Cookie": cookie, + "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.2 Mobile/15E148 Safari/604.1", + "Accept-Language": "zh-cn", + "Referer": "https://home.m.jd.com/myJd/newhome.action?sceneval=2&ufc=&", + "Accept-Encoding": "gzip, deflate, br", + } + }; + return new Promise(resolve => { + $.get(options, (err, resp, data) => { + try { + if (err) { + $.logErr(err) + } else { + if (data) { + data = JSON.parse(data); + if (data.retcode === "1001") { + $.isLogin = false; //cookie过期 + return; + } + if (data.retcode === "0" && data.data.hasOwnProperty("userInfo")) { + $.nickName = data.data.userInfo.baseInfo.nickname; + } + } else { + $.log('京东返回了空数据'); + } + } + } catch (e) { + $.logErr(e) + } finally { + resolve(); + } + }) + }) +} +// prettier-ignore +!function (n) { "use strict"; function t (n, t) { var r = (65535 & n) + (65535 & t); return (n >> 16) + (t >> 16) + (r >> 16) << 16 | 65535 & r } function r (n, t) { return n << t | n >>> 32 - t } function e (n, e, o, u, c, f) { return t(r(t(t(e, n), t(u, f)), c), o) } function o (n, t, r, o, u, c, f) { return e(t & r | ~t & o, n, t, u, c, f) } function u (n, t, r, o, u, c, f) { return e(t & o | r & ~o, n, t, u, c, f) } function c (n, t, r, o, u, c, f) { return e(t ^ r ^ o, n, t, u, c, f) } function f (n, t, r, o, u, c, f) { return e(r ^ (t | ~o), n, t, u, c, f) } function i (n, r) { n[r >> 5] |= 128 << r % 32, n[14 + (r + 64 >>> 9 << 4)] = r; var e, i, a, d, h, l = 1732584193, g = -271733879, v = -1732584194, m = 271733878; for (e = 0; e < n.length; e += 16)i = l, a = g, d = v, h = m, g = f(g = f(g = f(g = f(g = c(g = c(g = c(g = c(g = u(g = u(g = u(g = u(g = o(g = o(g = o(g = o(g, v = o(v, m = o(m, l = o(l, g, v, m, n[e], 7, -680876936), g, v, n[e + 1], 12, -389564586), l, g, n[e + 2], 17, 606105819), m, l, n[e + 3], 22, -1044525330), v = o(v, m = o(m, l = o(l, g, v, m, n[e + 4], 7, -176418897), g, v, n[e + 5], 12, 1200080426), l, g, n[e + 6], 17, -1473231341), m, l, n[e + 7], 22, -45705983), v = o(v, m = o(m, l = o(l, g, v, m, n[e + 8], 7, 1770035416), g, v, n[e + 9], 12, -1958414417), l, g, n[e + 10], 17, -42063), m, l, n[e + 11], 22, -1990404162), v = o(v, m = o(m, l = o(l, g, v, m, n[e + 12], 7, 1804603682), g, v, n[e + 13], 12, -40341101), l, g, n[e + 14], 17, -1502002290), m, l, n[e + 15], 22, 1236535329), v = u(v, m = u(m, l = u(l, g, v, m, n[e + 1], 5, -165796510), g, v, n[e + 6], 9, -1069501632), l, g, n[e + 11], 14, 643717713), m, l, n[e], 20, -373897302), v = u(v, m = u(m, l = u(l, g, v, m, n[e + 5], 5, -701558691), g, v, n[e + 10], 9, 38016083), l, g, n[e + 15], 14, -660478335), m, l, n[e + 4], 20, -405537848), v = u(v, m = u(m, l = u(l, g, v, m, n[e + 9], 5, 568446438), g, v, n[e + 14], 9, -1019803690), l, g, n[e + 3], 14, -187363961), m, l, n[e + 8], 20, 1163531501), v = u(v, m = u(m, l = u(l, g, v, m, n[e + 13], 5, -1444681467), g, v, n[e + 2], 9, -51403784), l, g, n[e + 7], 14, 1735328473), m, l, n[e + 12], 20, -1926607734), v = c(v, m = c(m, l = c(l, g, v, m, n[e + 5], 4, -378558), g, v, n[e + 8], 11, -2022574463), l, g, n[e + 11], 16, 1839030562), m, l, n[e + 14], 23, -35309556), v = c(v, m = c(m, l = c(l, g, v, m, n[e + 1], 4, -1530992060), g, v, n[e + 4], 11, 1272893353), l, g, n[e + 7], 16, -155497632), m, l, n[e + 10], 23, -1094730640), v = c(v, m = c(m, l = c(l, g, v, m, n[e + 13], 4, 681279174), g, v, n[e], 11, -358537222), l, g, n[e + 3], 16, -722521979), m, l, n[e + 6], 23, 76029189), v = c(v, m = c(m, l = c(l, g, v, m, n[e + 9], 4, -640364487), g, v, n[e + 12], 11, -421815835), l, g, n[e + 15], 16, 530742520), m, l, n[e + 2], 23, -995338651), v = f(v, m = f(m, l = f(l, g, v, m, n[e], 6, -198630844), g, v, n[e + 7], 10, 1126891415), l, g, n[e + 14], 15, -1416354905), m, l, n[e + 5], 21, -57434055), v = f(v, m = f(m, l = f(l, g, v, m, n[e + 12], 6, 1700485571), g, v, n[e + 3], 10, -1894986606), l, g, n[e + 10], 15, -1051523), m, l, n[e + 1], 21, -2054922799), v = f(v, m = f(m, l = f(l, g, v, m, n[e + 8], 6, 1873313359), g, v, n[e + 15], 10, -30611744), l, g, n[e + 6], 15, -1560198380), m, l, n[e + 13], 21, 1309151649), v = f(v, m = f(m, l = f(l, g, v, m, n[e + 4], 6, -145523070), g, v, n[e + 11], 10, -1120210379), l, g, n[e + 2], 15, 718787259), m, l, n[e + 9], 21, -343485551), l = t(l, i), g = t(g, a), v = t(v, d), m = t(m, h); return [l, g, v, m] } function a (n) { var t, r = "", e = 32 * n.length; for (t = 0; t < e; t += 8)r += String.fromCharCode(n[t >> 5] >>> t % 32 & 255); return r } function d (n) { var t, r = []; for (r[(n.length >> 2) - 1] = void 0, t = 0; t < r.length; t += 1)r[t] = 0; var e = 8 * n.length; for (t = 0; t < e; t += 8)r[t >> 5] |= (255 & n.charCodeAt(t / 8)) << t % 32; return r } function h (n) { return a(i(d(n), 8 * n.length)) } function l (n, t) { var r, e, o = d(n), u = [], c = []; for (u[15] = c[15] = void 0, o.length > 16 && (o = i(o, 8 * n.length)), r = 0; r < 16; r += 1)u[r] = 909522486 ^ o[r], c[r] = 1549556828 ^ o[r]; return e = i(u.concat(d(t)), 512 + 8 * t.length), a(i(c.concat(e), 640)) } function g (n) { var t, r, e = ""; for (r = 0; r < n.length; r += 1)t = n.charCodeAt(r), e += "0123456789abcdef".charAt(t >>> 4 & 15) + "0123456789abcdef".charAt(15 & t); return e } function v (n) { return unescape(encodeURIComponent(n)) } function m (n) { return h(v(n)) } function p (n) { return g(m(n)) } function s (n, t) { return l(v(n), v(t)) } function C (n, t) { return g(s(n, t)) } function A (n, t, r) { return t ? r ? s(t, n) : C(t, n) : r ? m(n) : p(n) } $.md5 = A }(this); +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.data[t] || null } setval (t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv (t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get (t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post (t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time (t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg (e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log (...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr (t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait (t) { return new Promise(e => setTimeout(e, t)) } done (t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) } \ No newline at end of file