diff --git a/zippo会员签到.js b/zippo会员签到.js new file mode 100644 index 0000000..cfe2442 --- /dev/null +++ b/zippo会员签到.js @@ -0,0 +1,516 @@ +/** + * + * zippo + * + * cron 0 0,7 * * * zippo.js + * 多账号并行执行任务模板 + * 抓域名wx-center.zippo.com.cn/下 请求authorization + * export zippo= 多账号换行或者& + */ +//=====================================================// +const $ = new Env("zippo"); +const notify = $.isNode() ? require("./sendNotify") : ""; +const Notify = 1 +const debug = 0 +const axios = require("axios"); +let ckStr = ($.isNode() ? process.env.zippo : $.getdata('zippo')) || ''; //检测CK 外部 +let msg, ck; +let host = 'wx-center.zippo.com.cn'; +let hostname = 'https://' + host; +let scriptVersionNow = "1.0.1"; +//---------------------------------------------------// +async function tips(ckArr) { + //DoubleLog(`当前脚本版本${Version}\n📌,如果脚本版本不一致请及时更新`); + console.log("完成积分签到与收藏任务"); + DoubleLog(`\n========== 共找到 ${ckArr.length} 个账号 ==========`); + debugLog(`【debug】 这是你的账号数组:\n ${ckArr}`); +} +!(async () => { + let ckArr = await checkEnv(ckStr, "zippo"); //检查CK + await getNotice(); //远程通知 + await getVersion("yang7758258/ohhh154@main/zippo会员签到.js"); + await tips(ckArr); //脚本提示 + await start(); //开始任务 + await SendMsg(msg); //发送通知 + +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()); + + +//---------------------------------------------------------------------------------封装循环测试 +async function newstart(name, taskname, time) { //任务名 函数名 等待时间 + let ckArr = await checkEnv(ckStr, "zippo"); //检查CK + console.log("\n📌📌📌📌📌📌📌📌" + name + "📌📌📌📌📌📌📌📌"); + for (i = 0; i < ckArr.length; i++) { + ck = ckArr[i].split("&"); //单账号多变量分割符,如果一个账号需要user和token两个变量,那么则输入user1&token1@user2&token2... + //let CK = ckArr[i] + await taskname(); + await $.wait(time * 1000); + } +} +//-------------------------------------------------------------------------------封装循环测试 + +async function start() { + await newstart("登录/CK检测", userinfo, 1); + await newstart("开始签到", dailySign, 1); + await newstart("开始收藏任务", shoucang, 1); + await newstart("开始领取", lingjiang, 1); + await newstart("当前积分查询", jifen, 1); +} + + + + +//------------------------------------------------------------------------------------------ +//用户信息查询 +async function userinfo() { + try { + let url = { + url: `${hostname}/api/users/profile`, + headers: { + 'x-app-id': 'zippo', + 'x-platform-id': 'wxaa75ffd8c2d75da7', + 'x-platform-env': 'release', + 'x-platform': 'wxmp', + 'authorization': ck[0], + 'xweb_xhr': 1, + 'sec-fetch-site': 'cross-site', + 'sec-fetch-mode': 'cors', + 'sec-fetch-dest': 'empty', + 'referer': 'https://servicewechat.com/wxaa75ffd8c2d75da7/76/page-frame.html', + 'accept-language': 'zh-CN,zh;q=0.9', + }, + + }; + let result = await httpGet(url, `用户信息查询`); + + //console.log(result); + if (result?.code != 401) { + DoubleLog(`账号[` + Number(i + 1) + `]` + `当前用户为🌸[${result.phone}]🎉`); + //let phone = result.data.phone + //let jifen = result?.data.memberInfo.totalScore + } if (result?.code == 401) { + DoubleLog(`账号[` + Number(i + 1) + `]` + `查询失败,可能是CK失效!`); + //console.log(result); + } + + } catch (error) { + //console.log(error); + console.log("服务器卡爆啦"); + } + +} + +//积分查询 +async function jifen() { + try { + let url = { + url: `${hostname}/api/users/points?withoutList=1`, + headers: { + 'x-app-id': 'zippo', + 'x-platform-id': 'wxaa75ffd8c2d75da7', + 'x-platform-env': 'release', + 'x-platform': 'wxmp', + 'authorization': ck[0], + 'xweb_xhr': 1, + 'sec-fetch-site': 'cross-site', + 'sec-fetch-mode': 'cors', + 'sec-fetch-dest': 'empty', + 'referer': 'https://servicewechat.com/wxaa75ffd8c2d75da7/76/page-frame.html', + 'accept-language': 'zh-CN,zh;q=0.9', + }, + + }; + let result = await httpGet(url, `当前积分查询`); + if (result?.balance != 0) { + DoubleLog(`账号[` + Number(i + 1) + `]` + `当前积分为💰[${result.balance}]🎉`); + }if (result?.code == 401) { + DoubleLog(`账号[` + Number(i + 1) + `]` + `查询失败,可能是CK失效!`); + } + + + + + + } catch (error) { + console.log("请检查环境变量是否正确"); + + } + +} + + + + + + +//用户签到 POST +async function dailySign() { + try { + let url = { + url: `${hostname}/api/daily-signin`, + headers: { + 'x-app-id': 'zippo', + 'x-platform-id': 'wxaa75ffd8c2d75da7', + 'x-platform-env': 'release', + 'x-platform': 'wxmp', + 'authorization': ck[0], + 'xweb_xhr': 1, + 'sec-fetch-site': 'cross-site', + 'sec-fetch-mode': 'cors', + 'sec-fetch-dest': 'empty', + 'referer': 'https://servicewechat.com/wxaa75ffd8c2d75da7/76/page-frame.html', + 'accept-language': 'zh-CN,zh;q=0.9', + }, + }; + let result = await httpPost(url, `签到`); + + //console.log(result); + if (result?.code != 'already_signed') { + DoubleLog(`账号[` + Number(i + 1) + `]` + `签到成功,获得积分:${result.count}🎉`); + await wait(2); + } if (result?.code == 'already_signed') { + DoubleLog(`账号[` + Number(i + 1) + `]` + `签到失败:${result.message}`); + } + + + + } catch (error) { + //console.log(error); + console.log("好像出了点小问题"); + } + +} +//用户收藏任务 POST +async function shoucang() { + try { + let host = 'wx-center.zippo.com.cn'; + let hostname = 'https://' + host; + let url = `${hostname}/api/favorites` + let body = { + "targetType": "sku", + "targetId": "265", + "favorited": true + } + + const result = await axios.post(url, body, { + headers: { + 'x-app-id': 'zippo', + 'x-platform-id': 'wxaa75ffd8c2d75da7', + 'x-platform-env': 'release', + 'x-platform': 'wxmp', + 'authorization': ck[0], + 'xweb_xhr': '1', + 'sec-fetch-site': 'cross-site', + 'sec-fetch-mode': 'cors', + 'sec-fetch-dest': 'empty', + 'referer': 'https://servicewechat.com/wxaa75ffd8c2d75da7/76/page-frame.html', + 'accept-language': 'zh-CN,zh;q=0.9', + } + }) + const r = result.data; + //console.log(result); + if (r?.favorited == true) { + DoubleLog(`账号[` + Number(i + 1) + `]` + `任务成功,id编号:${result.data.targetId}🎉`); + await wait(2); + }if (r?.code == 400) { + DoubleLog(`账号[` + Number(i + 1) + `]` + `任务失败:${result.data.message}`); + } + }catch (error) { + //console.log(error); + console.log("好像出了点小问题"); + } +} + +//用户领奖 POST +async function lingjiang() { + try { + let url = { + url: `${hostname}/api/missions/5/rewards`, + headers: { + 'x-app-id': 'zippo', + 'x-platform-id': 'wxaa75ffd8c2d75da7', + 'x-platform-env': 'release', + 'x-platform': 'wxmp', + 'authorization': ck[0], + 'xweb_xhr': 1, + 'sec-fetch-site': 'cross-site', + 'sec-fetch-mode': 'cors', + 'sec-fetch-dest': 'empty', + 'referer': 'https://servicewechat.com/wxaa75ffd8c2d75da7/76/page-frame.html', + 'accept-language': 'zh-CN,zh;q=0.9', + }, + body: JSON.stringify({"id":5}), + }; + let result = await httpPost(url, `领取奖励`); + + //console.log(result); + if (result?.rewardValue == 5) { + DoubleLog(`账号[` + Number(i + 1) + `]` + `领取成功,获得积分💰:${result.rewardValue}🎉`); + await wait(2); + } if (result?.code == 400) { + DoubleLog(`账号[` + Number(i + 1) + `]` + `领取失败:${result.message}`); + } + + + + } catch (error) { + //console.log(error); + console.log("好像出了点小问题"); + } + +} + + + +// #region ******************************************************** 固定代码 ******************************************************** +/** + * 变量检查 + */ +async function checkEnv(ck, Variables) { + return new Promise((resolve) => { + let ckArr = [] + if (ck) { + if (ck.indexOf("@") !== -1) { + + ck.split("@").forEach((item) => { + ckArr.push(item); + }); + } else if (ck.indexOf("\n") !== -1) { + + ck.split("\n").forEach((item) => { + ckArr.push(item); + }); + } else { + ckArr.push(ck); + } + resolve(ckArr) + } else { + console.log(` ${$.neme}:未填写变量 ${Variables} ,请仔细阅读脚本说明!`) + } + } + ) +} +/** + * 发送消息 + */ +async function SendMsg(message) { + if (!message) return; + if (Notify > 0) { + if ($.isNode()) { + var notify = require("./sendNotify"); + //let text = '仅完成积分签到\n@auth:Mist\n@date:2024-05-29\n注: 本脚本仅用于个人学习和交流请勿用于非法用途。用户应当遵守所有适用的法律和规定。在任何情况下,脚本的开发者或贡献者均不对任何直接或间接使用本脚本而产生的结果负责。' + await notify.sendNotify($.name, message); + } else { + // $.msg(message); + $.msg($.name, '', message) + } + } else { + console.log(message); + } +} + +/** + * 双平台log输出 + */ +function DoubleLog(data) { + if ($.isNode()) { + if (data) { + console.log(`${data}`); + msg += `\n${data}`; + } + } else { + console.log(`${data}`); + msg += `\n${data}`; + } + +} +/** +* 等待 X 秒 +*/ +function wait(n) { + return new Promise(function (resolve) { + setTimeout(resolve, n * 1000); + }); +} + +/** + * get请求 + */ +async function httpGet(getUrlObject, tip, timeout = 3) { + return new Promise((resolve) => { + let url = getUrlObject; + if (!tip) { + let tmp = arguments.callee.toString(); + let re = /function\s*(\w*)/i; + let matches = re.exec(tmp); + tip = matches[1]; + } + if (debug) { + console.log(`\n 【debug】=============== 这是 ${tip} 请求 url ===============`); + console.log(url); + } + + $.get( + url, + async (err, resp, data) => { + try { + if (debug) { + console.log(`\n\n 【debug】===============这是 ${tip} 返回data==============`); + console.log(data); + console.log(`\n 【debug】=============这是 ${tip} json解析后数据============`); + console.log(JSON.parse(data)); + } + let result = JSON.parse(data); + if (result == undefined) { + return; + } else { + resolve(result); + } + + } catch (e) { + //console.log(err, resp); + console.log(`\n ${tip} 失败了!请稍后尝试!!`); + msg = `\n ${tip} 失败了!请稍后尝试!!` + console.log("服务器卡爆啦"); + } finally { + resolve(); + } + }, + timeout + ); + }); +} + +/** + * post请求 + */ +async function httpPost(postUrlObject, tip, timeout = 3) { + return new Promise((resolve) => { + let url = postUrlObject; + if (!tip) { + let tmp = arguments.callee.toString(); + let re = /function\s*(\w*)/i; + let matches = re.exec(tmp); + tip = matches[1]; + } + if (debug) { + console.log(`\n 【debug】=============== 这是 ${tip} 请求 url ===============`); + console.log(url); + } + + $.post( + url, + async (err, resp, data) => { + try { + if (debug) { + console.log(`\n\n 【debug】===============这是 ${tip} 返回data==============`); + console.log(data); + console.log(`\n 【debug】=============这是 ${tip} json解析后数据============`); + console.log(JSON.parse(data)); + } + let result = JSON.parse(data); + if (result == undefined) { + return; + } else { + resolve(result); + } + + } catch (e) { + //console.log(err, resp); + console.log(`\n ${tip} 失败了!请稍后尝试!!`); + msg = `\n ${tip} 失败了!请稍后尝试!!` + console.log("服务器卡爆啦"); + } finally { + resolve(); + } + }, + timeout + ); + }); +} + +/** + * 网络请求 (get, post等) + */ +function httpRequest(options, timeout = 1 * 1000) { + method = options.method ? options.method.toLowerCase() : options.body ? "post" : "get"; + return new Promise(resolve => { + setTimeout(() => { + $[method](options, (err, resp, data) => { + try { + if (err) { + console.log(JSON.stringify(err)); + $.logErr(err); + } else { + try { data = JSON.parse(data); } catch (error) { } + } + } catch (e) { + console.log(e); + $.logErr(e, resp); + } finally { + resolve(data); + } + }) + }, timeout) + }) +} + + +/** + * debug调试 + */ +function debugLog(...args) { + if (debug) { + console.log(...args); + } +} +//获取远程通知 +async function getNotice() { + try { + const urls = [ + "https://gitee.com/ohhhooh/jd_haoyangmao/raw/master/Notice.json", + + ]; + let notice = null; + for (const url of urls) { + const options = { url, headers: { "User-Agent": "" }, }; + const result = await httpRequest(options); + if (result && "notice" in result) { + notice = result.notice.replace(/\\n/g, "\n"); + break; + } + } + if (notice) { $.DoubleLog(notice); } + } catch (e) { + console.log(e); + } +} + +/** + * 获取远程版本 + */ +function getVersion(scriptUrl, timeout = 3 * 1000) { + return new Promise((resolve) => { + const options = { url: `https://fastly.jsdelivr.net/gh/${scriptUrl}` }; + $.get(options, (err, resp, data) => { + try { + const regex = /scriptVersionNow\s*=\s*(["'`])([\d.]+)\1/; + const match = data.match(regex); + const scriptVersionLatest = match ? match[2] : ""; + console.log(`\n====== 当前版本:${scriptVersionNow} 📌 最新版本:${scriptVersionLatest} ======`); + } catch (e) { + $.logErr(e, resp); + } + resolve(); + }, timeout); + }); +} + + + + +// 完整 API +function Env(t, e) { 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, a) => { s.call(this, t, (t, s, r) => { t ? a(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.userList = []; this.userIdx = 0; (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.encoding = "utf-8"), (this.startTime = new Date().getTime()), Object.assign(this, e), this.log("", `🔔${this.name},开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } 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 a = this.getdata(t); if (a) 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, a) => e(a)) }) } runScript(t, e) { return new Promise((s) => { let a = this.getdata("@chavy_boxjs_userCfgs.httpapi"); a = a ? a.replace(/\n/g, "").trim() : a; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); (r = r ? 1 * r : 20), (r = e && e.timeout ? e.timeout : r); const [i, o] = a.split("@"), n = { url: `http://${o}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": i, Accept: "*/*" }, timeout: r, }; this.post(n, (t, e, a) => s(a)) }).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), a = !s && this.fs.existsSync(e); if (!s && !a) return {}; { const a = s ? t : e; try { return JSON.parse(this.fs.readFileSync(a)) } 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), a = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : a ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const a = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of a) 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, a) => Object(t[s]) === t[s] ? t[s] : (t[s] = Math.abs(e[a + 1]) >> 0 == +e[a + 1] ? [] : {}), t)[e[e.length - 1]] = s), t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, a] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, a, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, a, r] = /^@(.*?)\.(.*?)$/.exec(e), i = this.getval(a), o = a ? ("null" === i ? null : i || "{}") : "{}"; try { const e = JSON.parse(o); this.lodash_set(e, r, t), (s = this.setval(JSON.stringify(e), a)) } catch (e) { const i = {}; this.lodash_set(i, r, t), (s = this.setval(JSON.stringify(i), a)) } } else s = this.setval(t, e); return s } getval(t) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.read(t); case "Quantumult X": return $prefs.valueForKey(t); case "Node.js": return (this.data = this.loaddata()), this.data[t]; default: return (this.data && this.data[t]) || null } } setval(t, e) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.write(t, e); case "Quantumult X": return $prefs.setValueForKey(t, e); case "Node.js": return ((this.data = this.loaddata()), (this.data[e] = t), this.writedata(), !0); default: return (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 = () => { }) { switch ((t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"], delete t.headers["content-type"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let s = require("iconv-lite"); 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: a, statusCode: r, headers: i, rawBody: o, } = t, n = s.decode(o, this.encoding); e(null, { status: a, statusCode: r, headers: i, rawBody: o, body: n, }, n) }, (t) => { const { message: a, response: r } = t; e(a, r, r && s.decode(r.rawBody, this.encoding)) }) } } post(t, e = () => { }) { const s = t.method ? t.method.toLocaleLowerCase() : "post"; switch ((t.body && t.headers && !t.headers["Content-Type"] && !t.headers["content-type"] && (t.headers["content-type"] = "application/x-www-form-urlencoded"), t.headers && (delete t.headers["Content-Length"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient[s](t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": (t.method = s), this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let a = require("iconv-lite"); this.initGotEnv(t); const { url: r, ...i } = t; this.got[s](r, i).then((t) => { const { statusCode: s, statusCode: r, headers: i, rawBody: o, } = t, n = a.decode(o, this.encoding); e(null, { status: s, statusCode: r, headers: i, rawBody: o, body: n }, n) }, (t) => { const { message: s, response: r } = t; e(s, r, r && a.decode(r.rawBody, this.encoding)) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date(); let a = { "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 a) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? a[e] : ("00" + a[e]).substr(("" + a[e]).length))); return t } queryStr(t) { let e = ""; for (const s in t) { let a = t[s]; null != a && "" !== a && ("object" == typeof a && (a = JSON.stringify(a)), (e += `${s}=${a}&`)) } return (e = e.substring(0, e.length - 1)), e } msg(e = t, s = "", a = "", r) { const i = (t) => { switch (typeof t) { case void 0: return t; case "string": switch (this.getEnv()) { case "Surge": case "Stash": default: return { url: t }; case "Loon": case "Shadowrocket": return t; case "Quantumult X": return { "open-url": t }; case "Node.js": return }case "object": switch (this.getEnv()) { case "Surge": case "Stash": case "Shadowrocket": default: { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } case "Loon": { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } case "Quantumult X": { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl, a = t["update-pasteboard"] || t.updatePasteboard; return { "open-url": e, "media-url": s, "update-pasteboard": a, } } case "Node.js": return }default: return } }; if (!this.isMute) switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: $notification.post(e, s, a, i(r)); break; case "Quantumult X": $notify(e, s, a, i(r)); break; case "Node.js": }if (!this.isMuteLog) { let t = ["", "==============📣系统通知📣==============",]; t.push(e), s && t.push(s), a && t.push(a), 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) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: this.log("", `❗️${this.name},错误!`, t); break; case "Node.js": this.log("", `❗️${this.name},错误!`, t.stack) } } wait(t) { return new Promise((e) => setTimeout(e, t)) } DoubleLog(d) { if (this.isNode()) { if (d) { console.log(`${d}`); msg += `\n ${d}` } } else { console.log(`${d}`); msg += `\n ${d}` } } async SendMsg(m) { if (!m) return; if (Notify > 0) { if (this.isNode()) { var notify = require("./sendNotify"); await notify.sendNotify(this.name, m) } else { this.msg(this.name, "", m) } } else { console.log(m) } } done(t = {}) { const e = new Date().getTime(), s = (e - this.startTime) / 1e3; switch ((this.log("", `🔔${this.name},结束!🕛${s}秒`), this.log(), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: $done(t); break; case "Node.js": process.exit(1) } } })(t, e) } +//Env rewrite:smallfawn Update-time:23-6-30 newAdd:DoubleLog & SendMsg \ No newline at end of file diff --git a/临期批发_.py b/临期批发_.py new file mode 100644 index 0000000..7af9b63 --- /dev/null +++ b/临期批发_.py @@ -0,0 +1,43 @@ +# --------------------------------注释区-------------------------------- +# 入口:微信扫码:https://gitee.com/HuaJiB/yuanshen34/raw/master/lqpf.jpg +# 变量:yuanshen_lqpf +# 多号分割方式 [ @ 或 换行 或 新建同名变量 ] +# 抓取shop.linqishop.com下任意请求头的token的值填入 +# corn: 每日21点运行即可 +# 一日出三单 一天3r 1r起提现 无自动提现 +# --------------------------------一般不动区-------------------------------- +# _ooOoo_ +# o8888888o +# 88" . "88 +# (| -_- |) +# O\ = /O +# ____/`---'\____ +# . ' \\| |// `. +# / \\||| : |||// \ +# / _||||| -:- |||||- \ +# | | \\\ - /// | | +# | \_| ''\---/'' | | +# \ .-\__ `-` ___/-. / +# ___`. .' /--.--\ `. . __ +# ."" '< `.___\_<|>_/___.' >'"". +# | | : `- \`.;`\ _ /`;.`/ - ` : | | +# \ \ `-. \_ __\ /__ _/ .-` / / +# ======`-.____`-.___\_____/___.-`____.-'====== +# `=---=' +# +# ............................................. +# 佛祖保佑 永无BUG +# 佛祖镇楼 BUG辟邪 +#佛曰: +# 写字楼里写字间,写字间里程序员; +# 程序人员写程序,又拿程序换酒钱。 +# 酒醒只在网上坐,酒醉还来网下眠; +# 酒醉酒醒日复日,网上网下年复年。 +# 但愿老死电脑间,不愿鞠躬老板前; +# 奔驰宝马贵者趣,公交自行程序员。 +# 别人笑我忒疯癫,我笑自己命太贱; +# 不见满街漂亮妹,哪个归得程序员? +# +# --------------------------------代码区-------------------------------- +import bz2, base64 +exec(bz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+fg+DdrZ9HnjKBct08Aqg6vx1T87NAizFOr6vTZC+WNb61YOTRvFs+e9RO1p2/gew6jwgJqRbeLSYMYSOt/Ffx3zQW9lbQPykzHj4yvzUD1SgJj0zh5XfjNu4SLNn88HlmVNXNfyQg08KdGseqOg9I8X88ci9UKj4mt31MvHMKrBpiJ7Ljszc4zAoDbflwAHnKz2BjbjiIu2xxAtGxdu0Ss3uS8fK6Kuk8UXwse0yFtaOwYL7pb1tDSYFXOKGxb0Hq2olhQwudahU5tAknlMgf7B3oLdYcPzNvLTDHEohFnUovtDunnn6a1REggQgkNzzJpHwMhMDsTQZ0J1I04PbNdo3gejHGzriWzsS/0GvjP3y7CtexeKNbAV7/fNTr0Ek+PrH4GG0cwJo95PZ6P6V1GbgWPAsyNYtqKDhUBvjgFr6NIkF2Xv/F3JFOFCQGE6PCQ'))) \ No newline at end of file diff --git a/今日一句.js b/今日一句.js index 83aebc4..f1d65ea 100644 --- a/今日一句.js +++ b/今日一句.js @@ -1,6 +1,6 @@ /* ------------------------------------------ -@Author: smallfawn 860562056 +@Author: smallfawn @Date: 2024.06.10 21:00 @Description: 每日一句 小程序 一天大概2毛 满3提 ------------------------------------------ diff --git a/代挂布局.js b/代挂布局.js new file mode 100644 index 0000000..23f16c3 --- /dev/null +++ b/代挂布局.js @@ -0,0 +1,5 @@ +https://star.kaiershuzi.com/#/pages/login/register?code=LQKD1EM6 + +https://nyshare.igmdns.com/index.html?inviteCode=23108 + +注册好加QQ1151268390带挂0鲁 \ No newline at end of file diff --git a/华硕商城每日抽奖.js b/华硕商城每日抽奖.js index f4d9470..0056c00 100644 --- a/华硕商城每日抽奖.js +++ b/华硕商城每日抽奖.js @@ -1,6 +1,6 @@ /* ------------------------------------------ -@Author: smallfawn 860562056 +@Author: smallfawn @Date: 2024.06.11 16:43 @Description: 华硕商城APP 基础任务 浏览[好像有BUG]5分 + 签到5分 = 抽奖9分 ------------------------------------------ diff --git a/卡池.js b/卡池.js index 3f9743b..71164f6 100644 --- a/卡池.js +++ b/卡池.js @@ -1,6 +1,6 @@ /* ------------------------------------------ -@Author: smallfawn 860562056 +@Author: smallfawn @Date: 2024.06.11 18:52 @Description: 卡池权益会员店 小程序 一周签到大概50积分 500换5花费 ------------------------------------------ diff --git a/古井贡酒.js b/古井贡酒.js index 82d6a57..fed1e80 100644 --- a/古井贡酒.js +++ b/古井贡酒.js @@ -1,6 +1,6 @@ /* ------------------------------------------ -@Author: smallfawn 860562056 +@Author: smallfawn @Date: 2024.06.09 12.40 @Description: 古井贡酒会员中心小程序 ------------------------------------------ diff --git a/富士instax玩拍由我俱乐部.js b/富士instax玩拍由我俱乐部.js new file mode 100644 index 0000000..db3b9b0 --- /dev/null +++ b/富士instax玩拍由我俱乐部.js @@ -0,0 +1,216 @@ +/* +------------------------------------------ +@Author: smallfawn +@Date: 2024.06.11 19:19 +@Description: 富士instax玩拍由我俱乐部 小程序 每日签到+抽奖 +------------------------------------------ +变量名instax +变量值 https://instax.app.xcxd.net.cn/ 域名Headers请求头的Authorization 去掉Bearer 多账号&或换行或新增同名变量 +[Script] +http-response + +[MITM] +hostname = + +⚠️【免责声明】 +------------------------------------------ +1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 +2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 +3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 +4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 +5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 +6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 +7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 +*/ + +const $ = new Env("富士instax玩拍由我俱乐部"); +let ckName = `instax`; +let userCookie = checkEnv( + ($.isNode() ? process.env[ckName] : $.getdata(ckName)) || "" +); +const notify = $.isNode() ? require("./sendNotify") : ""; + +!(async () => { + console.log( + `==================================================\n 脚本执行 - 北京时间(UTC+8): ${new Date( + new Date().getTime() + + new Date().getTimezoneOffset() * 60 * 1000 + + 8 * 60 * 60 * 1000 + ).toLocaleString()} \n==================================================` + ); + //console.log(userCookie) + if (!userCookie?.length) return console.log(`没有找到CK哦`); + let index = 1; + let strSplitor = "#"; + + for (let user of userCookie) { + $.log(`\n🚀 user:【${index}】 start work\n`); + index++ + $.token = user + $.ckStatus = true; + $.userId = null + await me() + await $.wait(3000) + if ($.userId) { + await signIn() + await $.wait(3000) + await chance() + } + + } + + await $.sendMsg($.logs.join("\n")); +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); +async function me() { + let config = { + url: `https://instax.app.xcxd.net.cn/api/me`, + method: `GET`, + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-CN,zh;q=0.9", + "Authorization": "Bearer " + $.token, + "Connection": "keep-alive", + "Content-Type": "application/json", + "Host": "instax.app.xcxd.net.cn", + "Referer": "https://servicewechat.com/wx3cb572fbf3aa30c8/134/page-frame.html", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "cross-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x6309092b) XWEB/8555", + "xweb_xhr": "1" + }, + } + let { data: result } = await Request(config); + + if (result?.error == false) { + $.userId = result.data.user.id + $.log(`[${result.data.user.nickname}] 当前积分[${result.data.user.credit}] 等级[${result.data.user.user_level_id}]`); + } else { + $.log(`获取信息 失败[${result.message}]`); + } +} +async function signIn() { + let config = { + url: `https://instax.app.xcxd.net.cn/api/user/${$.userId}/sign-activity/23/sign`, + method: `POST`, + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-CN,zh;q=0.9", + "Authorization": "Bearer " + $.token, + "Connection": "keep-alive", + "Content-Type": "application/json", + "Host": "instax.app.xcxd.net.cn", + "Referer": "https://servicewechat.com/wx3cb572fbf3aa30c8/134/page-frame.html", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "cross-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x6309092b) XWEB/8555", + "xweb_xhr": "1" + }, + data: JSON.stringify({}) + } + let { data: response } = await Request(config); + if (response?.error == false) { + $.log(`签到成功`); + } else { + $.log(`签到失败[${response}]`); + } +} +async function chance() { + let config = { + url: `https://instax.app.xcxd.net.cn/api/user/${$.userId}/draw-activities/41/chance`, + method: `GET`, + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-CN,zh;q=0.9", + "Authorization": "Bearer " + $.token, + "Connection": "keep-alive", + "Content-Type": "application/json", + "Host": "instax.app.xcxd.net.cn", + "Referer": "https://servicewechat.com/wx3cb572fbf3aa30c8/134/page-frame.html", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "cross-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x6309092b) XWEB/8555", + "xweb_xhr": "1" + } + } + let { data: result } = await Request(config); + if (result?.error == false) { + $.log(`查询抽奖次数 [${result.data}]`); + for (let i = 0; i < result.data; i++) { + await $.wait(3000) + await draw() + } + } else { + $.log(`查询抽奖次数 失败[${result.message}]`); + } +} +async function draw() { + let config = { + url: `https://instax.app.xcxd.net.cn/api/user/${$.userId}/draw-activities/41/draw`, + method: `POST`, + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-CN,zh;q=0.9", + "Authorization": "Bearer " + $.token, + "Connection": "keep-alive", + "Content-Type": "application/json", + "Host": "instax.app.xcxd.net.cn", + "Referer": "https://servicewechat.com/wx3cb572fbf3aa30c8/134/page-frame.html", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "cross-site", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x6309092b) XWEB/8555", + "xweb_xhr": "1" + }, + data: JSON.stringify({}) + } + let { data: result } = await Request(config); + if (result?.error == false) { + $.log(`抽奖成功 [${result.data.record.desc}]`); + } else { + $.log(`抽奖失败[${result.message}]`); + } +} +function checkEnv(userCookie) { + const envSplitor = ["&", "\n"]; + //console.log(userCookie); + let userList = userCookie + .split(envSplitor.find((o) => userCookie.includes(o)) || "&") + .filter((n) => n); + console.log(`共找到${userList.length}个账号`); + return userList; +} +// prettier-ignore +function Env(t, s) { return new (class { constructor(t, s) { this.name = t; this.logs = []; this.logSeparator = "\n"; this.startTime = new Date().getTime(); Object.assign(this, s); this.log("", `\ud83d\udd14${this.name},\u5f00\u59cb!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } queryStr(options) { return Object.entries(options).map(([key, value]) => `${key}=${typeof value === "object" ? JSON.stringify(value) : value}`).join("&") } getURLParams(url) { const params = {}; const queryString = url.split("?")[1]; if (queryString) { const paramPairs = queryString.split("&"); paramPairs.forEach((pair) => { const [key, value] = pair.split("="); params[key] = value }) } return params } isJSONString(str) { try { return JSON.parse(str) && typeof JSON.parse(str) === "object" } catch (e) { return false } } isJson(obj) { var isjson = typeof obj == "object" && Object.prototype.toString.call(obj).toLowerCase() == "[object object]" && !obj.length; return isjson } async sendMsg(message) { if (!message) return; if (this.isNode()) { await notify.sendNotify(this.name, message) } else { this.msg(this.name, "", message) } } randomNumber(length) { const characters = "0123456789"; return Array.from({ length }, () => characters[Math.floor(Math.random() * characters.length)]).join("") } randomString(length) { const characters = "abcdefghijklmnopqrstuvwxyz0123456789"; return Array.from({ length }, () => characters[Math.floor(Math.random() * characters.length)]).join("") } uuid() { return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { var r = (Math.random() * 16) | 0, v = c == "x" ? r : (r & 0x3) | 0x8; return v.toString(16) }) } time(t) { let s = { "M+": new Date().getMonth() + 1, "d+": new Date().getDate(), "H+": new Date().getHours(), "m+": new Date().getMinutes(), "s+": new Date().getSeconds(), "q+": Math.floor((new Date().getMonth() + 3) / 3), S: new Date().getMilliseconds(), }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (new Date().getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in s) { new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? s[e] : ("00" + s[e]).substr(("" + s[e]).length))) } return t } msg(title = t, subtitle = "", body = "", options) { const formatOptions = (options) => { if (!options) { return options } else if (typeof options === "string") { if (this.isQuanX()) { return { "open-url": options } } else { return undefined } } else if (typeof options === "object" && (options["open-url"] || options["media-url"])) { if (this.isQuanX()) { return options } else { return undefined } } else { return undefined } }; if (!this.isMute) { if (this.isQuanX()) { $notify(title, subtitle, body, formatOptions(options)) } } let logs = ["", "==============📣系统通知📣=============="]; logs.push(title); subtitle ? logs.push(subtitle) : ""; body ? logs.push(body) : ""; console.log(logs.join("\n")); this.logs = this.logs.concat(logs) } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, s) { const e = !this.isQuanX(); e ? this.log("", `\u2757\ufe0f${this.name},\u9519\u8bef!`, t.stack) : this.log("", `\u2757\ufe0f${this.name},\u9519\u8bef!`, t) } wait(t) { return new Promise((s) => setTimeout(s, t)) } done(t = {}) { const s = new Date().getTime(), e = (s - this.startTime) / 1e3; this.log("", `\ud83d\udd14${this.name},\u7ed3\u675f!\ud83d\udd5b ${e}\u79d2`); this.log(); if (this.isNode()) { process.exit(1) } if (this.isQuanX()) { $done(t) } } })(t, s) } + +async function Request(options) { + if ($.isNode()) { + const axios = require("axios"); + Request = async (options) => { + try { + return await axios.request(options); + } catch (error) { + //console.log(error.response.data) + return error && error.response ? error.response.data : "请求失败"; + } + }; + } + if ($.isQuanX()) { + Request = async (options) => { + try { + return await $task.fetch(options); + } catch (error) { + return error && error.error ? error.error : "请求失败"; + } + }; + } + return await Request(options); +} \ No newline at end of file diff --git a/小猴工具小程序.js b/小猴工具小程序.js index cdd8673..9601343 100644 --- a/小猴工具小程序.js +++ b/小猴工具小程序.js @@ -1,6 +1,6 @@ /* ------------------------------------------ -@Author: smallfawn 860562056 +@Author: smallfawn @Date: 2024.06.08 13.21 @Description: 小猴工具小程序 ------------------------------------------ diff --git a/心喜小程序.js b/心喜小程序.js new file mode 100644 index 0000000..e86c32b --- /dev/null +++ b/心喜小程序.js @@ -0,0 +1,652 @@ +/** + * cron 9 9 * * * xx.js + * 变量名: xinxi + * 每天运行一次就行 + * 报错是正常情况 + * 变量值:api.xinc818.com 请求头中sso的值 多账户&或者换行 + * scriptVersionNow = "0.0.1"; + */ + +const $ = new Env("心喜"); +const notify = $.isNode() ? require('./sendNotify') : ''; +let ckName = "xinxi"; +let envSplitor = ["&", "\n"]; //多账号分隔符 +let strSplitor = "#"; //多变量分隔符 +let userIdx = 0; +let userList = []; +class Task { + constructor(str) { + this.index = ++userIdx; + this.ck = str.split(strSplitor)[0]; //单账号多变量分隔符 + this.ckStatus = true; + this.userId = null + this.artList = [] + this.goodsList = [] + } + async main() { + + await this.user_info(); + if (this.ckStatus == true) { + await this.task_signin(); + await this.task_lottery() + await this.task_share() + await this.task_goods() + await this.art_list() + if (this.artList.length > 0) { + await this.task_follow(this.artList[0]) + } + await this.goods_list() + if (this.goodsList.length > 0) { + await this.task_like(this.goodsList[0]) + } + + } + + } + + async task_signin() { + try { + let result = await this.taskRequest("get", `https://api.xinc818.com/mini/sign/in?dailyTaskId=`) + //console.log(result); + if (result.code == 0) { + $.log(`✅账号[${this.index}] 签到状态【${result.data.flag}】获得积分【${result.data.integral}】🎉`) + } else { + console.log(`❌账号[${this.index}] 签到状态【false】`); + console.log(result); + } + } catch (e) { + console.log(e); + } + } + async user_info() { + try { + let result = await this.taskRequest("get", `https://api.xinc818.com/mini/user`) + //console.log(options); + console.log(result); + if (result.code == 0) { + $.log(`✅账号[${this.index}] 【${result.data.nickname}】积分【${result.data.integral}】🎉`) + this.userId = result.data.id + } else { + console.log(`❌账号[${this.index}] 用户查询【false】`); + console.log(result); + } + } catch (e) { + console.log(e); + } + } + //浏览30sAPI + async task_goods() { + try { + let result = await this.taskRequest("get", `https://api.xinc818.com/mini/dailyTask/browseGoods/22`) + //console.log(options); + console.log(result); + if (result.code == 0) { + if (result.data !== null) { + $.log(`✅账号[${this.index}] 完成浏览30s成功 获得【${result.data.singleReward}】`) + + } else { + console.log(`❌账号[${this.index}] 完成浏览30s任务失败`); + } + + } else { + console.log(`❌账号[${this.index}] 完成浏览30s任务失败`); + + console.log(result); + } + } catch (e) { + console.log(e); + } + } + + //想要任务API + async task_like(id) { + console.log(`https://api.xinc818.com/mini/integralGoods/${id}?type=`) + try { + let goodsResult = await this.taskRequest("get", `https://api.xinc818.com/mini/integralGoods/${id}?type=`) + if (goodsResult.data) { + let likeResult = await this.taskRequest("post", `https://api.xinc818.com/mini/live/likeLiveItem`, { "isLike": true, "dailyTaskId": 20, "productId": Number(goodsResult.data.outerId) }) + //console.log(options); + console.log(likeResult); + if (likeResult.code == 0) { + if (likeResult.data !== null) { + $.log(`✅账号[${this.index}] 完成点击想要任务成功 获得【${likeResult.data.singleReward}】`) + + } else { + console.log(`❌账号[${this.index}] 完成点击想要任务失败`); + } + } else { + console.log(`❌账号[${this.index}] 完成点击想要任务失败`); + console.log(likeResult); + } + } + + + } catch (e) { + console.log(e); + } + } + + //关注用户API + async task_follow(pusherId) { + console.log(pusherId) + try { + let result = await this.taskRequest("post", `https://api.xinc818.com/mini/user/follow`, { "decision": true, "followUserId": pusherId }) + //console.log(options); + console.log(result); + if (result.code == 0) { + if (result.data !== null) { + $.log(`✅账号[${this.index}] 完成关注用户任务成功 获得【${result.data.singleReward}】`) + } else { + console.log(`❌账号[${this.index}] 完成关注用户任务失败`); + } + } else { + console.log(`❌账号[${this.index}] 完成关注用户任务失败`); + console.log(result); + } + } catch (e) { + console.log(e); + } + } + + //抽奖API + async task_lottery() { + try { + let result = await this.taskRequest("post", `https://api.xinc818.com/mini/lottery/draw`, { "activity": 61, "batch": false, "isIntegral": false, "userId": Number(this.userId), "dailyTaskId": 9 }) + //console.log(options); + console.log(result); + if (result.code == 0) { + if (result.data !== null) { + $.log(`✅账号[${this.index}] 完成抽奖成功 获得【${result.data.taskResult.singleReward}】积分 奖品【${result.data.lotteryResult.integral}】`) + + } else { + console.log(`❌账号[${this.index}] 完成抽奖失败`); + } + } else { + console.log(`❌账号[${this.index}] 完成抽奖失败`); + console.log(result); + } + } catch (e) { + console.log(e); + } + } + + //分享API + async task_share() { + try { + let result = await this.taskRequest("get", `https://api.xinc818.com/mini/dailyTask/share`) + //console.log(options); + console.log(result); + if (result.code == 0) { + if (result.data !== null) { + $.log(`✅账号[${this.index}] 完成分享成功 获得【${result.data.singleReward}】`) + + } else { + console.log(`❌账号[${this.index}] 完成分享失败`); + } + } else { + console.log(`❌账号[${this.index}] 完成分享失败`); + console.log(result); + } + } catch (e) { + console.log(e); + } + } + + //获取帖子列表API(包含用户和帖子) + async art_list() { + try { + let result = await this.taskRequest("get", `https://cdn-api.xinc818.com/mini/posts/sorts?sortType=COMMENT&pageNum=1&pageSize=10&groupClassId=0`) + //console.log(options); + console.log(result); + if (result.code == 0) { + if (result.data.list.length > 0) { + for (let i = 0; i < 2; i++) + this.artList.push(result.data.list[i].publisherId) + } + } else { + + console.log(result); + } + } catch (e) { + console.log(e); + } + } + //获取商品API + async goods_list() { + try { + let result = await this.taskRequest("get", `https://cdn-api.xinc818.com/mini/integralGoods?orderField=sort&orderScheme=DESC&pageSize=10&pageNum=1`) + //console.log(options); + console.log(result); + if (result.code == 0) { + if (result.data.list.length > 0) { + for (let i = 0; i < 2; i++) + this.goodsList.push(result.data.list[i].id) + } + } else { + + console.log(result); + } + } catch (e) { + console.log(e); + } + } + + async taskRequest(method, url, body = "") { + // + let headers = { + //"Host": "api.xinc818.com", + "Connection": "keep-alive", + "charset": "utf-8", + "User-Agent": "Mozilla/5.0 (Linux; Android 10; MI 8 Lite Build/QKQ1.190910.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36 XWEB/1160027 MMWEBSDK/20231002 MMWEBID/2585 MicroMessenger/8.0.43.2480(0x28002B51) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android", + "content-type": "application/json", + "Accept-Encoding": "gzip,compress,br,deflate", + "sso": this.ck, + "Referer": "https://servicewechat.com/wx673f827a4c2c94fa/253/page-frame.html" + } + const reqeuestOptions = { + url: url, + method: method, + headers: headers + } + if (method !== "get") { + if (headers["Content-Type"] == "application/json") { + reqeuestOptions["body"] = JSON.stringify(body); + } else { + reqeuestOptions["body"] = body + } + } + let { body: result } = await $.httpRequest(reqeuestOptions) + return result + } +} + + + +!(async () => { + if (!(await checkEnv())) return; + if (userList.length > 0) { + let taskall = []; + for (let user of userList) { + if (user.ckStatus) { + taskall.push(user.main()); + } + } + await Promise.all(taskall); + } + await $.sendMsg($.logs.join("\n")) +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); + +//******************************************************** +/** + * 变量检查与处理 + * @returns + */ +async function checkEnv() { + let userCookie = ($.isNode() ? process.env[ckName] : $.getdata(ckName)) || ""; + if (userCookie) { + let e = envSplitor[0]; + for (let o of envSplitor) + if (userCookie.indexOf(o) > -1) { + e = o; + break; + } + for (let n of userCookie.split(e)) n && userList.push(new Task(n)); + } else { + console.log(`未找到CK【${ckName}】`); + return; + } + return console.log(`共找到${userList.length}个账号`), true; //true == !0 +} +function Env(t, s) { + return new (class { + constructor(t, s) { + this.name = t; + this.data = null; + this.dataFile = "box.dat"; + this.logs = []; + this.logSeparator = "\n"; + this.startTime = new Date().getTime(); + Object.assign(this, s); + this.log("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`); + } + 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; + } + 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), + s = this.path.resolve(process.cwd(), this.dataFile), + e = this.fs.existsSync(t), + i = !e && this.fs.existsSync(s); + if (!e && !i) return {}; + { + const i = e ? t : s; + 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), + s = this.path.resolve(process.cwd(), this.dataFile), + e = this.fs.existsSync(t), + i = !e && this.fs.existsSync(s), + o = JSON.stringify(this.data); + e ? this.writeFileSync(t, o) : i ? this.fs.writeFileSync(s, o) : this.fs.writeFileSync(t, o); + } + } + lodash_get(t, s, e) { + const i = s.replace(/\[(\d+)\]/g, ".$1").split("."); + let o = t; + for (const t of i) if (((o = Object(o)[t]), void 0 === o)) return e; + return o; + } + lodash_set(t, s, e) { + return Object(t) !== t + ? t + : (Array.isArray(s) || (s = s.toString().match(/[^.[\]]+/g) || []), + (s + .slice(0, -1) + .reduce( + (t, e, i) => + Object(t[e]) === t[e] + ? t[e] + : (t[e] = Math.abs(s[i + 1]) >> 0 == +s[i + 1] ? [] : {}), + t + )[s[s.length - 1]] = e), + t); + } + getdata(t) { + let s = this.getval(t); + if (/^@/.test(t)) { + const [, e, i] = /^@(.*?)\.(.*?)$/.exec(t), + o = e ? this.getval(e) : ""; + if (o) + try { + const t = JSON.parse(o); + s = t ? this.lodash_get(t, i, "") : s; + } catch (t) { + s = ""; + } + } + return s; + } + setdata(t, s) { + let e = !1; + if (/^@/.test(s)) { + const [, i, o] = /^@(.*?)\.(.*?)$/.exec(s), + h = this.getval(i), + a = i ? ("null" === h ? null : h || "{}") : "{}"; + try { + const s = JSON.parse(a); + this.lodash_set(s, o, t), (e = this.setval(JSON.stringify(s), i)); + } catch (s) { + const h = {}; + this.lodash_set(h, o, t), (e = this.setval(JSON.stringify(h), i)); + } + } else e = this.setval(t, s); + return e; + } + getval(t) { + if (this.isSurge() || this.isLoon()) { + return $persistentStore.read(t); + } else if (this.isQuanX()) { + return $prefs.valueForKey(t); + } else if (this.isNode()) { + this.data = this.loaddata(); + return this.data[t]; + } else { + return this.data && this.data[t] || null; + } + } + setval(t, s) { + if (this.isSurge() || this.isLoon()) { + return $persistentStore.write(t, s); + } else if (this.isQuanX()) { + return $prefs.setValueForKey(t, s); + } else if (this.isNode()) { + this.data = this.loaddata(); + this.data[s] = t; + this.writedata(); + return true; + } else { + return this.data && this.data[s] || 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(); + if (t) { + t.headers = t.headers ? t.headers : {}; + if (typeof t.headers.Cookie === "undefined" && typeof t.cookieJar === "undefined") { + t.cookieJar = this.ckjar; + } + } + } + /** + * @param {Object} options + * @returns {String} 将 Object 对象 转换成 queryStr: key=val&name=senku + */ + queryStr(options) { + return Object.entries(options) + .map(([key, value]) => `${key}=${typeof value === 'object' ? JSON.stringify(value) : value}`) + .join('&'); + } + //从url获取参数组成json + getURLParams(url) { + const params = {}; + const queryString = url.split('?')[1]; + if (queryString) { + const paramPairs = queryString.split('&'); + paramPairs.forEach(pair => { + const [key, value] = pair.split('='); + params[key] = value; + }); + } + return params; + } + isJSONString(str) { + try { + var obj = JSON.parse(str); + if (typeof obj == 'object' && obj) { + return true; + } else { + return false; + } + } catch (e) { + return false; + } + } + isJson(obj) { + var isjson = typeof (obj) == "object" && Object.prototype.toString.call(obj).toLowerCase() == "[object object]" && !obj.length; + return isjson; + } + async sendMsg(message) { + if (!message) return; + if ($.isNode()) { + await notify.sendNotify($.name, message) + } else { + $.msg($.name, '', message) + } + } + async httpRequest(options) { + let t = { + ...options + }; + if (!t.headers) { + t.headers = {} + } + if (t.params) { + t.url += '?' + this.queryStr(t.params); + } + t.method = t.method.toLowerCase(); + if (t.method === 'get') { + delete t.headers['Content-Type']; + delete t.headers['Content-Length']; + delete t.headers['content-type']; + delete t.headers['content-length']; + delete t["body"] + } + if (t.method === 'post') { + let ContentType; + if (!t.body) { + t.body = "" + } else { + if (typeof t.body == "string") { + if (this.isJSONString(t.body)) { + ContentType = 'application/json' + } else { + ContentType = 'application/x-www-form-urlencoded' + } + } else if (this.isJson(t.body)) { + t.body = JSON.stringify(t.body); + ContentType = 'application/json'; + } + } + if (!t.headers['Content-Type'] || !t.headers['content-type']) { + t.headers['Content-Type'] = ContentType; + } + delete t.headers['Content-Length']; + } + if (this.isNode()) { + this.initGotEnv(t); + let httpResult = await this.got(t); + if (this.isJSONString(httpResult.body)) { + httpResult.body = JSON.parse(httpResult.body) + } + return httpResult; + } + if (this.isQuanX()) { + t.method = t.method.toUpperCase() + return new Promise((resolve, reject) => { + $task.fetch(t).then(response => { + if (this.isJSONString(response.body)) { + response.body = JSON.parse(response.body) + } + resolve(response) + }) + }) + } + } + randomNumber(length) { + const characters = '0123456789'; + return Array.from({ length }, () => characters[Math.floor(Math.random() * characters.length)]).join(''); + } + randomString(length) { + const characters = 'abcdefghijklmnopqrstuvwxyz0123456789'; + return Array.from({ length }, () => characters[Math.floor(Math.random() * characters.length)]).join(''); + } + timeStamp() { + return new Date().getTime() + } + uuid() { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + var r = Math.random() * 16 | 0, + v = c == 'x' ? r : (r & 0x3 | 0x8); + return v.toString(16); + }); + } + time(t) { + let s = { + "M+": new Date().getMonth() + 1, + "d+": new Date().getDate(), + "H+": new Date().getHours(), + "m+": new Date().getMinutes(), + "s+": new Date().getSeconds(), + "q+": Math.floor((new Date().getMonth() + 3) / 3), + S: new Date().getMilliseconds(), + }; + /(y+)/.test(t) && + (t = t.replace( + RegExp.$1, + (new Date().getFullYear() + "").substr(4 - RegExp.$1.length) + )); + for (let e in s) + new RegExp("(" + e + ")").test(t) && + (t = t.replace( + RegExp.$1, + 1 == RegExp.$1.length + ? s[e] + : ("00" + s[e]).substr(("" + s[e]).length) + )); + return t; + } + msg(s = t, e = "", i = "", o) { + const h = (t) => + !t || (!this.isLoon() && this.isSurge()) + ? t + : "string" == typeof t + ? this.isLoon() + ? t + : this.isQuanX() + ? { "open-url": t } + : void 0 + : "object" == typeof t && (t["open-url"] || t["media-url"]) + ? this.isLoon() + ? t["open-url"] + : this.isQuanX() + ? t + : void 0 + : void 0; + this.isMute || + (this.isSurge() || this.isLoon() + ? $notification.post(s, e, i, h(o)) + : this.isQuanX() && $notify(s, e, i, h(o))); + let logs = ['', '==============📣系统通知📣==============']; + logs.push(t); + e ? logs.push(e) : ''; + i ? logs.push(i) : ''; + console.log(logs.join('\n')); + this.logs = this.logs.concat(logs); + } + log(...t) { + t.length > 0 && (this.logs = [...this.logs, ...t]), + console.log(t.join(this.logSeparator)); + } + logErr(t, s) { + const e = !this.isSurge() && !this.isQuanX() && !this.isLoon(); + e + ? this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) + : this.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t); + } + wait(t) { + return new Promise((s) => setTimeout(s, t)); + } + done(t = {}) { + const s = new Date().getTime(), + e = (s - this.startTime) / 1e3; + this.log( + "", + `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${e} \u79d2` + ) + this.log() + if (this.isNode()) { + process.exit(1) + } + if (this.isQuanX()) { + $done(t) + } + } + })(t, s); +} \ No newline at end of file diff --git a/波司登.js b/波司登.js index 64391f7..e43234b 100644 --- a/波司登.js +++ b/波司登.js @@ -1,6 +1,6 @@ /* ------------------------------------------ -@Author: smallfawn 860562056 +@Author: smallfawn @Date: 2024.06.09 10.04 @Description: 波司登小程序 每日签到 ------------------------------------------ diff --git a/爱玛会员俱乐部.js b/爱玛会员俱乐部.js index 9325cd7..ad9f43a 100644 --- a/爱玛会员俱乐部.js +++ b/爱玛会员俱乐部.js @@ -1,6 +1,6 @@ /* ------------------------------------------ -@Author: smallfawn 860562056 +@Author: smallfawn @Date: 2024.06.08 10.25 @Description: 爱玛会员俱乐部 小程序 ------------------------------------------ diff --git a/瑷尔博士.js b/瑷尔博士.js index 2d25127..471441e 100644 --- a/瑷尔博士.js +++ b/瑷尔博士.js @@ -1,6 +1,6 @@ /* ------------------------------------------ -@Author: smallfawn 860562056 +@Author: smallfawn @Date: 2024.06.11 12:44 @Description: 瑷尔博士官方云商城小程序 ------------------------------------------