From 3050d7a80d13721b2b33146ccb9b0af7e3fcac70 Mon Sep 17 00:00:00 2001 From: 3288588344 <127068117+3288588344@users.noreply.github.com> Date: Sat, 15 Jun 2024 16:36:22 +0800 Subject: [PATCH] Add files via upload --- this官方商城.js | 149 +++ 一汽大众.js | 174 ++++ 今日一句.js | 213 +++++ 体彩通杀.js | 255 ++++++ 免流校园网签到.py | 38 + 华硕商城每日抽奖.js | 251 ++++++ 卡士会员.js | 152 ++++ 卡池.js | 156 ++++ 古井贡酒.js | 165 ++++ 媓钻小程序.js | 174 ++++ 小猴工具小程序.js | 110 +++ 巨量ip_Sign.py | 139 +++ 得无开源.js | 1740 ++++++++++++++++++++++++++++++++++++ 微信小程序虔金E站.js | 118 +++ 慕思.js | 571 ++++++++++++ 所有女生小程序.js | 217 +++++ 星火学院新.py | 13 + 波司登.js | 187 ++++ 海天美味馆.js | 504 +++++++++++ 潇洒桐庐.js | 448 ++++++++++ 爱奇艺会员.js | 555 ++++++++++++ 爱玛会员俱乐部.js | 167 ++++ 瑷尔博士.js | 180 ++++ 统一.js | 318 +++++++ 臭宝乐园.js | 159 ++++ 逑美And薇诺娜专柜小程序.js | 253 ++++++ 26 files changed, 7406 insertions(+) create mode 100644 this官方商城.js create mode 100644 一汽大众.js create mode 100644 今日一句.js create mode 100644 体彩通杀.js create mode 100644 免流校园网签到.py create mode 100644 华硕商城每日抽奖.js create mode 100644 卡士会员.js create mode 100644 卡池.js create mode 100644 古井贡酒.js create mode 100644 媓钻小程序.js create mode 100644 小猴工具小程序.js create mode 100644 巨量ip_Sign.py create mode 100644 得无开源.js create mode 100644 微信小程序虔金E站.js create mode 100644 慕思.js create mode 100644 所有女生小程序.js create mode 100644 星火学院新.py create mode 100644 波司登.js create mode 100644 海天美味馆.js create mode 100644 潇洒桐庐.js create mode 100644 爱奇艺会员.js create mode 100644 爱玛会员俱乐部.js create mode 100644 瑷尔博士.js create mode 100644 统一.js create mode 100644 臭宝乐园.js create mode 100644 逑美And薇诺娜专柜小程序.js diff --git a/this官方商城.js b/this官方商城.js new file mode 100644 index 0000000..07eacc8 --- /dev/null +++ b/this官方商城.js @@ -0,0 +1,149 @@ +/* +------------------------------------------ +@Author: smallfawn 860562056 +@Date: 2024.06.09 13.27 +@Description: this官方商城小程序 签到 +------------------------------------------ +变量名this +变量值https://xcx.this.cn/api/ 域名下请求头Headers中authori-zation的值 去掉Bearer 多账号&或换行或新建同名变量 +[Script] +http-response + +[MITM] +hostname = + +⚠️【免责声明】 +------------------------------------------ +1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 +2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 +3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 +4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 +5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 +6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 +7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 +*/ + +const $ = new Env("this官方商城"); +let ckName = `this`; +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; + await info() + } + + await $.sendMsg($.logs.join("\n")); +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); +async function info() { + let data = JSON.stringify({ + "sign": 1 + }); + + let config = { + method: 'POST', + url: 'https://xcx.this.cn/api/sign/user', + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220089 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android', + 'Accept-Encoding': 'gzip,compress,br,deflate', + 'Content-Type': 'application/json', + 'charset': 'utf-8', + 'form-type': 'routine', + 'authori-zation': 'Bearer ' + $.token, + 'Referer': 'https://servicewechat.com/wx1c228827dfa0de9e/13/page-frame.html' + }, + data: data + }; + let { data: result } = await Request(config) + if (result?.status == 200) { + $.log(`${result.data.nickname} 累计签到[${result.data.sign_num}]天 当前积分[${result.data.integral}]分`) + if (result.data.is_day_sgin !== true) { + $.log(`未签到 ===> 签到ing`) + await signIn() + } else { + $.log(`已签到 ===> 跳过签到`) + } + } else { + $.log(result.msg) + } +} +async function signIn() { + let data = JSON.stringify({}); + + let config = { + method: 'POST', + url: 'https://xcx.this.cn/api/sign/integral', + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220089 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android', + 'Accept-Encoding': 'gzip,compress,br,deflate', + 'Content-Type': 'application/json', + 'charset': 'utf-8', + 'form-type': 'routine', + 'authori-zation': 'Bearer ' + $.token, + 'Referer': 'https://servicewechat.com/wx1c228827dfa0de9e/13/page-frame.html' + }, + data: data + }; + let { data: result } = await Request(config) + if (result?.status == 200) { + $.log(`签到成功:[${result.msg}]`) + } else { + $.log(result.msg) + } +} + + +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) { + return error && error.error ? error.error : "请求失败"; + } + }; + } + 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 new file mode 100644 index 0000000..91614c1 --- /dev/null +++ b/一汽大众.js @@ -0,0 +1,174 @@ +/** + * 一汽大众,签到 + * cron 0 9 * * * 一汽大众.js + * ========= 青龙--配置文件 =========== + * # 项目名称 + * export yqdz_data='token @ token' + * + * 多账号用 换行 或 @ 分割 + * ==================================== + * + */ +const $ = new Env("一汽大众"); +const ckName = "yqdz_data"; +//-------------------- 一般不动变量区域 ------------------------------------- +const Notify = 1; //0为关闭通知,1为打开通知,默认为1 +let debug = 1; //Debug调试 0关闭 1开启 +let envSplitor = ["@", "\n"]; //多账号分隔符 +let ck = msg = ''; //let ck,msg +let host, hostname; +let userCookie = ($.isNode() ? process.env[ckName] : $.getdata(ckName)) || ''; +let userList = []; +let userIdx = 0; +let userCount = 0; +//---------------------- 自定义变量区域 ----------------------------------- + +function r(r, n, t, u, e, o) { + return c((f = c(c(n, r), c(u, o))) << (a = e) | f >>> 32 - a, t); + var f, a; +} + +function n(n, t, u, e, c, o, f) { + return r(t & u | ~t & e, n, t, c, o, f); +} + +function t(n, t, u, e, c, o, f) { + return r(t & e | u & ~e, n, t, c, o, f); +} + +function u(n, t, u, e, c, o, f) { + return r(t ^ u ^ e, n, t, c, o, f); +} + +function e(n, t, u, e, c, o, f) { + return r(u ^ (t | ~e), n, t, c, o, f); +} + +function c(r, n) { + var t = (65535 & r) + (65535 & n); + return (r >> 16) + (n >> 16) + (t >> 16) << 16 | 65535 & t; +} + +const hex_md5 = function(r) { + return function(r) { + for (var n = "0123456789abcdef", t = "", u = 0; u < 4 * r.length; u++) t += n.charAt(r[u >> 2] >> u % 4 * 8 + 4 & 15) + n.charAt(r[u >> 2] >> u % 4 * 8 & 15); + return t; + }(function(r, o) { + r[o >> 5] |= 128 << o % 32, r[14 + (o + 64 >>> 9 << 4)] = o; + for (var f = 1732584193, a = -271733879, i = -1732584194, h = 271733878, v = 0; v < r.length; v += 16) { + var A = f, g = a, l = i, d = h; + f = n(f, a, i, h, r[v + 0], 7, -680876936), h = n(h, f, a, i, r[v + 1], 12, -389564586), + i = n(i, h, f, a, r[v + 2], 17, 606105819), a = n(a, i, h, f, r[v + 3], 22, -1044525330), + f = n(f, a, i, h, r[v + 4], 7, -176418897), h = n(h, f, a, i, r[v + 5], 12, 1200080426), + i = n(i, h, f, a, r[v + 6], 17, -1473231341), a = n(a, i, h, f, r[v + 7], 22, -45705983), + f = n(f, a, i, h, r[v + 8], 7, 1770035416), h = n(h, f, a, i, r[v + 9], 12, -1958414417), + i = n(i, h, f, a, r[v + 10], 17, -42063), a = n(a, i, h, f, r[v + 11], 22, -1990404162), + f = n(f, a, i, h, r[v + 12], 7, 1804603682), h = n(h, f, a, i, r[v + 13], 12, -40341101), + i = n(i, h, f, a, r[v + 14], 17, -1502002290), f = t(f, a = n(a, i, h, f, r[v + 15], 22, 1236535329), i, h, r[v + 1], 5, -165796510), + h = t(h, f, a, i, r[v + 6], 9, -1069501632), i = t(i, h, f, a, r[v + 11], 14, 643717713), + a = t(a, i, h, f, r[v + 0], 20, -373897302), f = t(f, a, i, h, r[v + 5], 5, -701558691), + h = t(h, f, a, i, r[v + 10], 9, 38016083), i = t(i, h, f, a, r[v + 15], 14, -660478335), + a = t(a, i, h, f, r[v + 4], 20, -405537848), f = t(f, a, i, h, r[v + 9], 5, 568446438), + h = t(h, f, a, i, r[v + 14], 9, -1019803690), i = t(i, h, f, a, r[v + 3], 14, -187363961), + a = t(a, i, h, f, r[v + 8], 20, 1163531501), f = t(f, a, i, h, r[v + 13], 5, -1444681467), + h = t(h, f, a, i, r[v + 2], 9, -51403784), i = t(i, h, f, a, r[v + 7], 14, 1735328473), + f = u(f, a = t(a, i, h, f, r[v + 12], 20, -1926607734), i, h, r[v + 5], 4, -378558), + h = u(h, f, a, i, r[v + 8], 11, -2022574463), i = u(i, h, f, a, r[v + 11], 16, 1839030562), + a = u(a, i, h, f, r[v + 14], 23, -35309556), f = u(f, a, i, h, r[v + 1], 4, -1530992060), + h = u(h, f, a, i, r[v + 4], 11, 1272893353), i = u(i, h, f, a, r[v + 7], 16, -155497632), + a = u(a, i, h, f, r[v + 10], 23, -1094730640), f = u(f, a, i, h, r[v + 13], 4, 681279174), + h = u(h, f, a, i, r[v + 0], 11, -358537222), i = u(i, h, f, a, r[v + 3], 16, -722521979), + a = u(a, i, h, f, r[v + 6], 23, 76029189), f = u(f, a, i, h, r[v + 9], 4, -640364487), + h = u(h, f, a, i, r[v + 12], 11, -421815835), i = u(i, h, f, a, r[v + 15], 16, 530742520), + f = e(f, a = u(a, i, h, f, r[v + 2], 23, -995338651), i, h, r[v + 0], 6, -198630844), + h = e(h, f, a, i, r[v + 7], 10, 1126891415), i = e(i, h, f, a, r[v + 14], 15, -1416354905), + a = e(a, i, h, f, r[v + 5], 21, -57434055), f = e(f, a, i, h, r[v + 12], 6, 1700485571), + h = e(h, f, a, i, r[v + 3], 10, -1894986606), i = e(i, h, f, a, r[v + 10], 15, -1051523), + a = e(a, i, h, f, r[v + 1], 21, -2054922799), f = e(f, a, i, h, r[v + 8], 6, 1873313359), + h = e(h, f, a, i, r[v + 15], 10, -30611744), i = e(i, h, f, a, r[v + 6], 15, -1560198380), + a = e(a, i, h, f, r[v + 13], 21, 1309151649), f = e(f, a, i, h, r[v + 4], 6, -145523070), + h = e(h, f, a, i, r[v + 11], 10, -1120210379), i = e(i, h, f, a, r[v + 2], 15, 718787259), + a = e(a, i, h, f, r[v + 9], 21, -343485551), f = c(f, A), a = c(a, g), i = c(i, l), + h = c(h, d); + } + return Array(f, a, i, h); + }(function(r) { + for (var n = Array(), t = 0; t < 8 * r.length; t += 8) n[t >> 5] |= (255 & r.charCodeAt(t / 8)) << t % 32; + return n; + }(r), 8 * r.length)); +}; + + +const queryToArray = function (data) { + let array = []; + for (let e in data) null != data[e] && array.push("".concat(e, "=").concat(data[e])); + return array; +}; +const path = '/general/public/v1/mall/integral/get_days_sign' + +let users = userCookie.split(envSplitor[0]) +console.log('找到'+(users.length)+'个账号') + +for (let user of users){ + start(user) +} + +function start(token){ + const queryData = { + appkey:'6667793400',// 小程序的key + signTimestamp:Date.now(), + timestamp:Date.now(), + nonce:'', + } + queryData.nonce = Array.from({length: 8}).map(function () { + return (65536 * (1 + Math.random()) | 0).toString(16).substring(1); + }).join(""); + + let queryArray = queryToArray(queryData); + + let digitalSign, newPath = path.replace("one-app/", "").replace("test/", "").replace(/^\//, ""); + if (Array.isArray(queryArray)) { + queryArray.sort(); + let pathStr = "".concat(newPath, "_").concat(queryArray.join("_"), "_").concat('a9a7371b38547e7ddbdd368927f9da9c'), + c = encodeURIComponent(pathStr); + digitalSign = hex_md5(c); + } else console.error("signAlgorithm - queryArray 必须为数组!"); + queryData.digitalSign = digitalSign + + const query = queryToArray(queryData).join('&') + let options = { + url: 'https://one-app-h5.faw-vw.com/prod-api/mobile/one-app'+path+'?'+query, + headers: { + "Host":"one-app-h5.faw-vw.com", + "Connection":"keep-alive", + "Content-Length":"147", + "Did":"VW_WECHAT_iPhone 14 Pro_12345678912345678900_iOS 16.6_v1.23.0", + "content-type":"application/json", + "x-mp-name":"SERVER", + "x-microservice-name":"api-gateway", + "Authorization":token, + "bodySign":"111b4e07bc91b24267b4dc698955e37bc4b683f9995db56262567b9913976606", + "x-namespace-code":"production", + "anonymous-id":"MINIAPPSERVER_", + "Accept-Encoding":"gzip,compress,br,deflate", + "User-Agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.42(0x18002a2b) NetType/WIFI Language/zh_CN", + "Referer":"https://servicewechat.com/wx684fc81ee38e543e/56/page-frame.html", + } + } + + + $.get(options, (err, resp, str) => { + const data = JSON.parse(str) + if(data.returnStatus === 'SUCCEED'){ + const res = data.data + console.log(`账号1登录成功,总积分${res.availablescore},累计签到:${res.totaldays}天`) + }else{ + console.log('异常信息') + console.log(data) + } + }) + +} + +// 完整 Env +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/今日一句.js b/今日一句.js new file mode 100644 index 0000000..83aebc4 --- /dev/null +++ b/今日一句.js @@ -0,0 +1,213 @@ +/* +------------------------------------------ +@Author: smallfawn 860562056 +@Date: 2024.06.10 21:00 +@Description: 每日一句 小程序 一天大概2毛 满3提 +------------------------------------------ +变量名:juzi +变量值 https://api.juzi.co/ 接口域名的请求头Headers中token的值 多账号&或换行或新建同名变量 +[Script] +http-response + +[MITM] +hostname = + +⚠️【免责声明】 +------------------------------------------ +1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 +2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 +3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 +4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 +5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 +6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 +7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 +*/ + +const $ = new Env("每日一句小程序"); +let ckName = `juzi`; +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; + $.juzi = null + $.sid = null + await getJuzi(); + if ($.juzi) { + $.log(`🎉 获取成功:${$.juzi}`); + await postJuzi(); + } else { + } + await getNewJuzi() + if ($.sid) { + await likeJuzi() + } else { + } + } + + await $.sendMsg($.logs.join("\n")); +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); + +async function getJuzi() { + let config = { + url: `https://v1.hitokoto.cn`, + method: "GET" + } + let { data: result } = await Request(config); + if (result) { + $.juzi = result.hitokoto + "~~~" + result.from_who; + } +} +async function postJuzi() { + + let config = { + url: `https://api.juzi.co/sentence/execWrite`, + method: "POST", + headers: { + "accept": "*/*", + "accept-language": "zh-CN,zh;q=0.9", + "content-type": "application/x-www-form-urlencoded; charset=UTF-8", + "sec-fetch-dest": "empty", + "sec-fetch-mode": "cors", + "sec-fetch-site": "cross-site", + "token": $.token, + "xweb_xhr": "1", + "Referer": "https://servicewechat.com/wx3e3540cb2012ea1f/26/page-frame.html", + "Referrer-Policy": "unsafe-url" + }, + data: qs({ + "juzi": encodeURIComponent($.juzi), + "original": "false", + "writer": "", + "source": "", + "tagsValue": "", + "tagslength": "0", + "tags": "" + }) + + } + + + let { data: result } = await Request(config); + if (result.code = 200) { + $.log(`发布句子成功`) + console.log(result) + } else { + $.log(`发布句子失败 [${result.msg}]`) + } +} + +async function likeJuzi() { + let config = { + url: `https://api.juzi.co/sentence/slike`, + method: "POST", + headers: { + "accept": "*/*", + "accept-language": "zh-CN,zh;q=0.9", + "content-type": "application/x-www-form-urlencoded; charset=UTF-8", + "sec-fetch-dest": "empty", + "sec-fetch-mode": "cors", + "sec-fetch-site": "cross-site", + "token": $.token, + "xweb_xhr": "1", + "Referer": "https://servicewechat.com/wx3e3540cb2012ea1f/26/page-frame.html", + "Referrer-Policy": "unsafe-url" + }, + data: qs({ sid: $.sid }) + } + let { data: result } = await Request(config); + if (result.code = 200) { + $.log(`点赞句子成功`) + } else { + $.log(`点赞句子失败 [${result.msg}]`) + } +} +async function getNewJuzi() { + let config = { + url: `https://api.juzi.co/index/tab`, + method: "GET", + headers: { + "accept": "*/*", + "accept-language": "zh-CN,zh;q=0.9", + "content-type": "application/x-www-form-urlencoded; charset=UTF-8", + "sec-fetch-dest": "empty", + "sec-fetch-mode": "cors", + "sec-fetch-site": "cross-site", + "token": $.token, + "xweb_xhr": "1", + "Referer": "https://servicewechat.com/wx3e3540cb2012ea1f/26/page-frame.html", + "Referrer-Policy": "unsafe-url" + }, + } + let { data: result } = await Request(config); + if (result.code = 200) { + let num = Math.floor(Math.random() * 9) + $.sid = result.data.recommend[num].id + } else { + $.log(`获取待点赞句子失败 [${result.msg}]`) + } +} +function qs(obj) { + let str = ""; + for (let key in obj) { + str += `${key}=${obj[key]}&` + } + return str.substring(0, str.length - 1) +} + +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) { + return error && error.error ? error.error : "请求失败"; + } + }; + } + if ($.isQuanX()) { + Request = async (options) => { + try { + return await $task.fetch(options); + } catch (error) { + return error && error.error ? error.error : "请求失败"; + } + }; + } + return await Request(options); +} + + diff --git a/体彩通杀.js b/体彩通杀.js new file mode 100644 index 0000000..941f759 --- /dev/null +++ b/体彩通杀.js @@ -0,0 +1,255 @@ +/** + * + *gdtc + *Author: Mist + *Date: 2024-06-09 + * 抓 vx公众号广东,福建体彩服务号 + * cron "10 11 * * *" fjtc.js + * export fjtc= uuid&accessToken 多账号换行或者#分隔 + */ +// ============================================================================================================ +const $ = new Env('vx体彩服务号') +const axios = require('axios') +const env_name = 'gdtc' //环境变量名字 +const env = process.env[env_name] || '' //获取环境变量 +const Notify = 1//是否通知, 1通知, 0不通知. 默认通知 +const debug = 0//是否调试, 1调试, 0不调试. 默认不调试 +let scriptVersionNow = "1.0.0";//脚本版本号 +let msg = ""; +// ==================================异步顺序============================================================================== +!(async () => { + await getNotice(); //远程通知 + await getVersion("yang7758258/ohhh154@main/gdtc.js"); + await main();//主函数 + await SendMsg(msg); //发送通知 + +})() + .catch((e) => $.logErr(e)) + .finally(() => $.done()); +//==================================脚本入口函数main()============================================================== +async function main() { + if (env == '') { + //没有设置变量,直接退出 + console.log(`没有填写变量,请查看脚本说明: ${env_name}`) + return + } + let user_ck = env.split('\n') + DoubleLog(`\n========= 共找到 ${user_ck.length} 个账号 =========`); + let index = 1 //用来给账号标记序号, 从1开始 + for (let ck of user_ck) { + if (!ck) continue //跳过空行 + let ck_info = ck.split('&') + let uuid = ck_info[0] + let accessToken = ck_info[1] + //let deviceCode = ck_info[2] + let user = { + index: index, + uuid, + accessToken, + //deviceCode, + } + index = index + 1 //每次用完序号+1 + //开始账号任务 + await userTask(user) + //每个账号之间等1~5秒随机时间 + let rnd_time = Math.floor(Math.random() * 4000) + 1000 + console.log(`账号[${user.index}]随机等待${rnd_time / 1000}秒...`) + await $.wait(rnd_time) + } +} +// ======================================开始任务========================================= +async function userTask(user) { + console.log(`\n============= 账号[${user.index}]开始任务 =============`) + await SignTask(user) + await wait (2) + await account(user) +} +// ============================================================================================================================= +//签到 +async function SignTask(user) { + try { + let urlObject = { + method: 'post', + url: 'https://pnup-hd.tcssyw.com/api/act/do_sign_in', + headers: { + 'Host': 'pnup-hd.tcssyw.com', + 'Content-Type': 'application/x-www-form-urlencoded', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a13) XWEB/9129', + }, + data: { + "uuid": user.uuid, + "accessToken": user.accessToken, + } + } + // + let { data: result} = await axios.request(urlObject) + //console.log(result); + if (result?.ret == "0") { + //打印签到结果 + DoubleLog(`🌸账号[${user.index}]` + `🕊签到成功,获得[${result.data.getwealth}]积分,总积分:${result.data.allwealth}🎉`); + }if(result?.ret == "10005") { + DoubleLog(`🌸账号[${user.index}]签到失败:[${result.msg}]❌`) + }if (result?.code == "500") { + DoubleLog(`🌸账号[${user.index}]可能已签到:${result.msg}❌`) + } + + + } catch (e) { + //打印错误信息 + console.log(e) + } +} +//账户积分 +async function account(user) { + try { + let urlObject = { + method: 'post', + url: 'https://pnup-fj.lottery-sports.com/sapi/point/pointsBill', + headers: { + 'Host': 'pnup-fj.lottery-sports.com', + 'Content-Type': 'application/x-www-form-urlencoded', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a13) XWEB/9129', + }, + data: { + 'pageNum': '1', + 'channelId': '35', + 'accessToken': user.accessToken, + } + }; + let { data: result } = await axios.request(urlObject) + //console.log(result); + if (result?.code == "0") { + DoubleLog(`🌸账号[${user.index}]🕊账户当前积分${result.data.records[0].postMemberPoints}💰`) + }if (result?.code == "100005"){ + DoubleLog(`🌸账号[${user.index}]🕊查询当前积分失败:${result.msg}❌`) + } + } catch (e) { + //打印错误信息 + console.log(e) + } +} +/** + * =========================================================发送消息============================================= + */ +async function SendMsg(message) { + if (!message) return; + if (Notify > 0) { + if ($.isNode()) { + var notify = require("./sendNotify"); + 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); + }); +} +/** +* ======================================================随机等待 1-5 秒============================================ +*/ +function sjwait() { + return new Promise(function (resolve) { + let waitTime = Math.floor(Math.random() * 4000 + 1000); + setTimeout(resolve, waitTime); + }); +} +// ==========================================================13位时间戳===================================================== +function getTimestamp() { + return new Date().getTime(); +} +//===============================================网络请求httpRequest========================================= +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..26a8807 --- /dev/null +++ b/免流校园网签到.py @@ -0,0 +1,38 @@ +import requests +import time + +url = "http://8.137.111.254:1024/user/index.php" +params = {'act': "do_login"} +payload = "name=xxxxxx&pass=xxxxxxxxxxx"#name是账号,pass是密码 +headers = { + 'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36", + 'Accept': "application/json, text/javascript, */*; q=0.01", + 'Accept-Encoding': "gzip, deflate", + 'X-Requested-With': "XMLHttpRequest", + 'Content-Type': "application/x-www-form-urlencoded; charset=UTF-8", + 'Origin': "http://8.137.111.254:1024", + 'Referer': "http://8.137.111.254:1024/user/index.php", + 'Accept-Language': "zh-CN,zh;q=0.9", +} +response = requests.post(url, params=params, data=payload, headers=headers) + +cookie_value = response.cookies.get('PHPSESSID') +print("Cookie value:", cookie_value) + +time.sleep(2) + +url = "http://8.137.111.254:1024/user/getline.php" +params = {'act': "sign"} +headers = { + 'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36", + 'Accept': "application/json, text/javascript, */*; q=0.01", + 'Accept-Encoding': "gzip, deflate", + 'X-Requested-With': "XMLHttpRequest", + 'Origin': "http://8.137.111.254:1024", + 'Referer': "http://8.137.111.254:1024/user/admin.php", + 'Accept-Language': "zh-CN,zh;q=0.9", + 'Cookie': f"PHPSESSID={cookie_value}" +} +response = requests.post(url, params=params, headers=headers) + +print(response.json()) diff --git a/华硕商城每日抽奖.js b/华硕商城每日抽奖.js new file mode 100644 index 0000000..f4d9470 --- /dev/null +++ b/华硕商城每日抽奖.js @@ -0,0 +1,251 @@ +/* +------------------------------------------ +@Author: smallfawn 860562056 +@Date: 2024.06.11 16:43 +@Description: 华硕商城APP 基础任务 浏览[好像有BUG]5分 + 签到5分 = 抽奖9分 +------------------------------------------ +经测试小程序CK失效短 故抓取APP的数据API +变量名asusStore +变量值 https://store.asus.com.cn/storeapi 域名请求头Headers中Authorization的值#token的值 + 多账号&或换行或新增同名变量 +[Script] +http-response + +[MITM] +hostname = + +⚠️【免责声明】 +------------------------------------------ +1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 +2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 +3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 +4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 +5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 +6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 +7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 +*/ +const $ = new Env("华硕商城APP"); +let ckName = `asusStore`; + +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++ + $.auth = user.split(strSplitor)[0]; + $.token = user.split(strSplitor)[1]; + $.ckStatus = true; + await signIn() + for (let i of [1, 2]) { + await roll() + await $.wait(5000) + + } + await $.wait(5000) + + await get_more() + } + + await $.sendMsg($.logs.join("\n")); +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); + +//签到 +async function signIn() { + let time = Date.parse(new Date) / 1e3 + let nonce = d(1e4, 99999) + let text = `${nonce}${time}Asus!@#$%^&*()Store` + let config = { + url: `https://store.asus.com.cn/storeapi/user/my/sign`, + method: "POST", + headers: { + 'User-Agent': 'okhttp/3.9.1', + 'Connection': 'Keep-Alive', + 'Accept-Encoding': 'gzip', + 'Content-Type': 'application/x-www-form-urlencoded', + 'Authorization': $.auth, + 'plat': 'android', + 'source': '2', + 'version': '2.7.16', + 'device': 'MI 8 Lite', + 'token': $.token, + 'visitorid': 'a232e99938994576', + 'Cache-Control': 'no-cache' + }, + data: `timestamp=${time}&nonce=${nonce}&signature=${MD5(text)}` + } + let { data: result } = await Request(config) + if (result?.code == 200) { + $.log(`签到成功`) + } else { + $.log(`签到失败 [${result.msg}]`) + } +} + +//获取兑奖码 +async function get_more() { + let time = Date.parse(new Date) / 1e3 + let nonce = d(1e4, 99999) + let text = `${nonce}${time}Asus!@#$%^&*()Store` + let config = { + url: `https://store.asus.com.cn/storeapi/user/activity/get-more`, + method: "POST", + headers: { + 'User-Agent': 'okhttp/3.9.1', + 'Connection': 'Keep-Alive', + 'Accept-Encoding': 'gzip', + 'Content-Type': 'application/x-www-form-urlencoded', + 'Authorization': $.auth, + 'plat': 'android', + 'source': '2', + 'version': '2.7.16', + 'device': 'MI 8 Lite', + 'token': $.token, + 'visitorid': 'a232e99938994576', + 'Cache-Control': 'no-cache' + }, + data: `page=1&limit=10×tamp=${time}&nonce=${nonce}&signature=${MD5(text)}` + } + let { data: result } = await Request(config) + if (result?.code == 200) { + for (let i of result.data.list) { + $.log(`历史奖品:${i.id} ===> [${i.prize_name}]`) + if (i.is_exchange !== 1) { + if (i.level == 4) { + $.log(`${i.id} 未兑换 --- 脚本执行兑换`) + await exchange(i.id) + } else { + $.log(`${i.id} 未兑换实物奖励 --- 请看规则找客服或页面兑换`) + } + + } + } + + } +} +//兑奖 + +async function exchange(id) { + let time = Date.parse(new Date) / 1e3 + let nonce = d(1e4, 99999) + let text = `${nonce}${time}Asus!@#$%^&*()Store` + let config = { + url: `https://store.asus.com.cn/storeapi/user/activity/exchange`, + method: "POST", + headers: { + 'User-Agent': 'okhttp/3.9.1', + 'Connection': 'Keep-Alive', + 'Accept-Encoding': 'gzip', + 'Content-Type': 'application/x-www-form-urlencoded', + 'Authorization': $.auth, + 'plat': 'android', + 'source': '2', + 'version': '2.7.16', + 'device': 'MI 8 Lite', + 'token': $.token, + 'visitorid': 'a232e99938994576', + 'Cache-Control': 'no-cache' + }, + data: `id=${id}×tamp=${time}&nonce=${nonce}&signature=${MD5(text)}` + } + let { data: result } = await Request(config) + if (result?.code == 200) { + $.log(`兑换成功 [${id}]`) + } else { + $.log(`兑换失败 [${result.msg}]`) + } +} +//抽奖 +async function roll() { + let time = Date.parse(new Date) / 1e3 + let nonce = d(1e4, 99999) + let text = `${nonce}${time}Asus!@#$%^&*()Store` + let config = { + url: `https://store.asus.com.cn/storeapi/user/activity/roll`, + method: "POST", + headers: { + 'User-Agent': 'okhttp/3.9.1', + 'Connection': 'Keep-Alive', + 'Accept-Encoding': 'gzip', + 'Content-Type': 'application/x-www-form-urlencoded', + 'Authorization': $.auth, + 'plat': 'android', + 'source': '2', + 'version': '2.7.16', + 'device': 'MI 8 Lite', + 'token': $.token, + 'visitorid': 'a232e99938994576', + 'Cache-Control': 'no-cache' + }, + data: `ticket=RixzlRQgH&activity_type=1&active_code=×tamp=${time}&nonce=${nonce}&signature=${MD5(text)}` + } + let { data: result } = await Request(config) + if (result?.code == 200) { + $.log(`抽奖成功`) + } else { + $.log(`抽奖失败 [${result.msg}]`) + } + +} +function d(t, e) { + var r = e - t + , n = Math.random(); + return String(t + Math.round(n * r)) +} + +function MD5(data) { + const crypto = require('crypto'); + return crypto.createHash('md5').update(data).digest('hex'); +} + +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) { + return error && error.error ? error.error : "请求失败"; + } + }; + } + 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 new file mode 100644 index 0000000..fe305a6 --- /dev/null +++ b/卡士会员.js @@ -0,0 +1,152 @@ +/* +------------------------------------------ +@Author: smallfawn +@Date: 2024.06.09 11.56 +@Description: 卡士会员小程序 +------------------------------------------ +变量名kashivip +值 第一次进签到页面会有https://gateway.fengxuan.cn/Identity/API_Authen/Get_Token 获取TOKEN的请求 找到Url中pid和key和secret和unionid和绑定的手机号和进入签到页面的https://gateway.fengxuan.cn/QianDao/API_Sign/Save_User_Sign_Detail +里面的Post请求体的参数uid 这个UID在用户界面点我的庄园 找到https://internal.fengxuan.cn/API_Member/GetUserContent接口的返回uid的值 +一共六个值 pid#key#secret#unionid#手机号#uid 在点进去签到页面之前就开启抓包 第一次很容易抓到 或者等7200s之后再去抓token的请求 +[Script] +http-response + +[MITM] +hostname = + +⚠️【免责声明】 +------------------------------------------ +1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 +2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 +3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 +4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 +5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 +6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 +7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 +*/ + +const $ = new Env("卡士会员"); +let ckName = `kashivip`; +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++ + $.access_token = null + $.pid = user.split(strSplitor)[0]; + $.key = user.split(strSplitor)[1]; + $.secret = user.split(strSplitor)[2]; + $.unionid = user.split(strSplitor)[3]; + + $.bid = null + $.phone = user.split(strSplitor)[4]; + $.uid = user.split(strSplitor)[5]; + $.ckStatus = true; + await getToken() + if ($.access_token) { + await signIn() + } + } + + await $.sendMsg($.logs.join("\n")); +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); +async function getToken() { + let config = { + method: 'GET', + url: `https://gateway.fengxuan.cn/Identity/API_Authen/Get_Token?pid=&key=${$.key}&secret=${$.secret}&openid=&unionid=&appid=`, + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220089 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android', + 'Accept-Encoding': 'gzip,compress,br,deflate', + 'authorization': '', + 'charset': 'utf-8', + 'content-type': 'application/x-www-form-urlencoded', + 'Referer': 'https://servicewechat.com/wxf1b4741159cb8b06/43/page-frame.html' + } + }; + let { data: result } = await Request(config); + if (result?.code == 0) { + $.access_token = result.access_token + $.bid = result.bid; + } +} +async function signIn() { + + let config = { + method: 'POST', + url: `https://gateway.fengxuan.cn/QianDao/API_Sign/Save_User_Sign_Detail?bid=${$.bid}&pid=${$.pid}`, + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220089 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android', + 'Accept-Encoding': 'gzip,compress,br,deflate', + 'Content-Type': 'application/x-www-form-urlencoded', + 'authorization': 'Bearer ' + $.access_token, + 'charset': 'utf-8', + 'Referer': 'https://servicewechat.com/wxf1b4741159cb8b06/43/page-frame.html' + }, + data: { + 'phone': $.phone, + 'unionid': $.unionid, + 'uid': $.uid, + 'type': '1', + }, + } + let { data: result } = await Request(config); + if (result?.code == 0) { + $.log(`签到状态[${result.msg}]`) + } else { + $.log(`签到状态[${result.msg}]`) + } +} + + +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) { + return error && error.error ? error.error : "请求失败"; + } + }; + } + 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 new file mode 100644 index 0000000..3f9743b --- /dev/null +++ b/卡池.js @@ -0,0 +1,156 @@ +/* +------------------------------------------ +@Author: smallfawn 860562056 +@Date: 2024.06.11 18:52 +@Description: 卡池权益会员店 小程序 一周签到大概50积分 500换5花费 +------------------------------------------ +变量名 kachi +变量值 点击我的 ID 填入 多账号&或换行或新建同名变量 +[Script] +http-response + +[MITM] +hostname = + +⚠️【免责声明】 +------------------------------------------ +1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 +2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 +3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 +4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 +5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 +6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 +7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 +*/ + +const $ = new Env("卡池权益会员店"); +let ckName = `kachi`; +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++ + $.userId = user + $.ckStatus = true; + await initJifen() + } + + await $.sendMsg($.logs.join("\n")); +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); +async function initJifen() { + let config = { + url: `https://wx.wpool.cn/kqcentersp.do`, + method: 'POST', + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-CN,zh;q=0.9", + "Connection": "keep-alive", + "Content-Type": "application/x-www-form-urlencoded", + "Cookie": "", + "Host": "wx.wpool.cn", + "Referer": "https://servicewechat.com/wxdae71fc43b208fff/63/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: `kqapp=1&plantform=0&userid=${$.userId}` + } + let { data: result } = await Request(config); + if (result?.result == "ok") { + $.log(`当前积分[${result.data.userAccount.coupons}]`) + if (result.data.signData.nowsign.sign !== 1) { + $.log(`开始签到`); + await signIn(result.data.signData.nowsign.jifen) + + } else { + $.log(`今天已经签到过了`); + } + } else { + $.log(`获取签到信息失败 [${JSON.stringify(result)}]`); + } +} +async function signIn(jifen) { + let config = { + url: `https://wx.wpool.cn/senvendaydosignsp.do`, + method: 'POST', + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-CN,zh;q=0.9", + "Connection": "keep-alive", + "Content-Type": "application/x-www-form-urlencoded", + "Cookie": "", + "Host": "wx.wpool.cn", + "Referer": "https://servicewechat.com/wxdae71fc43b208fff/63/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: `userid=${$.userId}&jifen=${jifen}&indexday=0&plantform=3` + } + let { data: result } = await Request(config); + if (result?.result == "ok") { + $.log(`签到成功`); + } else { + $.log(`签到失败 [${JSON.stringify(result)}]`); + } + +} + +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) { + return error && error.error ? error.error : "请求失败"; + } + }; + } + 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 new file mode 100644 index 0000000..82d6a57 --- /dev/null +++ b/古井贡酒.js @@ -0,0 +1,165 @@ +/* +------------------------------------------ +@Author: smallfawn 860562056 +@Date: 2024.06.09 12.40 +@Description: 古井贡酒会员中心小程序 +------------------------------------------ +变量名 gujing +值 https://scrm.gujing.com/gujing_scrm/ 请求头Headers中的Access-Token的值 多账号&或换行或新建同名变量 + +[Script] +http-response + +[MITM] +hostname = + +⚠️【免责声明】 +------------------------------------------ +1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 +2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 +3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 +4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 +5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 +6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 +7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 +*/ + +const $ = new Env("古井贡酒会员中心小程序"); +let ckName = `gujing`; +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; + await search() + } + + await $.sendMsg($.logs.join("\n")); +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); +async function search() { + let data = JSON.stringify({ + "activityId": "110001000", + "preview": false + }); + + let config = { + method: 'POST', + url: 'https://scrm.gujing.com/gujing_scrm/wxclient/mkt/activities/sign:search', + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220089 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 miniProgram/wxba9855bdb1a45c8e', + 'Accept': 'application/json, text/plain, */*', + 'sec-ch-ua': '"Chromium";v="122", "Not(A:Brand";v="24", "Android WebView";v="122"', + 'Content-Type': 'application/json;charset=UTF-8', + 'sec-ch-ua-mobile': '?1', + 'Access-Token': $.token, + 'sec-ch-ua-platform': '"Android"', + 'Origin': 'https://scrm.gujing.com', + 'X-Requested-With': 'com.tencent.mm', + 'Sec-Fetch-Site': 'same-origin', + 'Sec-Fetch-Mode': 'cors', + 'Sec-Fetch-Dest': 'empty', + 'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7', + + }, + data: data + }; + let { data: result } = await Request(config) + if (result?.code == 200) { + if (result.content.signed !== 1) { + $.log(`未签到 ===> 签到ing`) + await signIn() + } else { + $.log(`已签到 ===> 什么都不做`) + } + } else { + $.log(`签到查询失败 [${JSON.stringify(result)}]`) + } +} +async function signIn() { + let data = JSON.stringify({ + "activityId": "110001000", + "preview": false + }); + + let config = { + method: 'POST', + url: 'https://scrm.gujing.com/gujing_scrm/wxclient/mkt/activities/sign:search', + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220089 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 miniProgram/wxba9855bdb1a45c8e', + 'Accept': 'application/json, text/plain, */*', + 'sec-ch-ua': '"Chromium";v="122", "Not(A:Brand";v="24", "Android WebView";v="122"', + 'Content-Type': 'application/json;charset=UTF-8', + 'sec-ch-ua-mobile': '?1', + 'Access-Token': $.token, + 'sec-ch-ua-platform': '"Android"', + 'Origin': 'https://scrm.gujing.com', + 'X-Requested-With': 'com.tencent.mm', + 'Sec-Fetch-Site': 'same-origin', + 'Sec-Fetch-Mode': 'cors', + 'Sec-Fetch-Dest': 'empty', + 'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7', + }, + data: data + }; + let { data: result } = await Request(config) + if (result?.code == 200) { + $.log(`签到成功 获得积分[${result.content.point}]`) + } else { + $.log(`签到失败 [${result.chnDesc}]`) + } +} + +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) { + return error && error.error ? error.error : "请求失败"; + } + }; + } + 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 new file mode 100644 index 0000000..6e9cab7 --- /dev/null +++ b/媓钻小程序.js @@ -0,0 +1,174 @@ +/* +------------------------------------------ +@Author: sm +@Date: 2024.06.08 13.38 +@Description: 媓钻 小程序 赛龙舟活动 每天抽奖2-3次 +------------------------------------------ +变量名huangzuan_WX +变量值https://api.hzyxhfp.com/api/ 请求头Headers中authorization的值 去掉Bearer 多账号&或换行或新建同名变量 +[Script] +http-response + +[MITM] +hostname = + +⚠️【免责声明】 +------------------------------------------ +1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 +2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 +3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 +4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 +5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 +6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 +7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 +*/ + +const $ = new Env("媓钻小程序"); +let ckName = `huangzuan_WX`; +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 = 0; + //let strSplitor = "#"; + + for (let user of userCookie) { + $.log(`\n🚀 user:【${index || ++index}】 start work\n`); + $.token = user + $.ckStatus = false; + await signIn() + for (let i = 0; i < 2; i++) { + await play() + await $.wait(5000) + + if ($.ckStatus) { + await lottery() + + } + } + + } + + await $.sendMsg($.logs.join("\n")); +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); +//取150-200随机数 +function getRandomInt(min, max) { + min = Math.ceil(min); + max = Math.floor(max); + return Math.floor(Math.random() * (max - min)) + min; //不含最大值,含最小值 +} +async function signIn() { + + let data = JSON.stringify({}); + + let config = { + method: 'POST', + url: 'https://api.hzyxhfp.com/api/signInLog/addSignIn', + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220067 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android', + 'Accept-Encoding': 'gzip,compress,br,deflate', + 'app': 'wx3df7476c42cace5d', + 'authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2FwaS5oenl4aGZwLmNvbS9hcGkveWZtR2V0QXV0aFVzZXIiLCJpYXQiOjE3MTc4MjQ4NzMsImV4cCI6MjMxNzgyNDgxMywibmJmIjoxNzE3ODI0ODczLCJqdGkiOiJxdWRGcUlLaHRxWUd3Y0dIIiwic3ViIjozMDIwMTk5LCJwcnYiOiJjNzdlYWJjNmQyOWRiY2UwYjU1ZTk4YmRlYzM5MWI1NDlhNWVmMWYwIn0.0akWVLgE0Bd8_a-EOIQiC8dB_xiiOc2Y40xIVQnBRkU', + 'charset': 'utf-8', + 'content-type': 'application/json;charset=UTF-8', + 'Referer': 'https://servicewechat.com/wx3df7476c42cace5d/370/page-frame.html' + }, + data: data + }; + let { data: result } = await Request(config) + result?.code == 0 ? ($.log(`签到成功 已签到[${result.data.cont_days}]天`)) : ($.log(`签到失败`), console.log(JSON.stringify(result))) + +} +async function play() { + let data = JSON.stringify({ + "id": "1", + "score": getRandomInt(150, 200) + }); + + let config = { + method: 'POST', + url: 'https://api.hzyxhfp.com/api/dragonActivity/addDragonScore', + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220067 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android', + 'Accept-Encoding': 'gzip,compress,br,deflate', + 'app': 'wx3df7476c42cace5d', + 'authorization': 'Bearer ' + $.token, + 'charset': 'utf-8', + 'content-type': 'application/json;charset=UTF-8', + 'Referer': 'https://servicewechat.com/wx3df7476c42cace5d/370/page-frame.html' + }, + data: data + }; + let { data: result } = await Request(config) + result?.code == 0 ? ($.log(`游戏成功`), $.ckStatus = true) : ($.log(`游戏失败`), console.log(JSON.stringify(result))) +} +async function lottery() { + let data = JSON.stringify({ + "id": "1" + }); + + let config = { + method: 'POST', + url: 'https://api.hzyxhfp.com/api/dragonActivity/getDragonPrizeResult', + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220067 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android', + 'Accept-Encoding': 'gzip,compress,br,deflate', + 'app': 'wx3df7476c42cace5d', + 'authorization': 'Bearer ' + $.token, + 'charset': 'utf-8', + 'content-type': 'application/json;charset=UTF-8', + 'Referer': 'https://servicewechat.com/wx3df7476c42cace5d/370/page-frame.html' + }, + data: data + }; + let { data: result } = await Request(config) + result?.code == 0 ? $.log(`抽奖[${result.data.title}]`) : ($.log(`抽奖失败`), console.log(JSON.stringify(result))) +} + +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) { + throw error && error.error ? error.error : "请求失败"; + } + }; + } + if ($.isQuanX()) { + Request = async (options) => { + try { + return await $task.fetch(options); + } catch (error) { + throw error && error.error ? error.error : "请求失败"; + } + }; + } + return await Request(options); +} \ No newline at end of file diff --git a/小猴工具小程序.js b/小猴工具小程序.js new file mode 100644 index 0000000..cdd8673 --- /dev/null +++ b/小猴工具小程序.js @@ -0,0 +1,110 @@ +/* +------------------------------------------ +@Author: smallfawn 860562056 +@Date: 2024.06.08 13.21 +@Description: 小猴工具小程序 +------------------------------------------ +自己先签到一次 抓请求包https://h5.youzan.com/wscump/checkin/checkinV2.json 后面Url的checkinId和请求头Headers中extra-data里面sid的值 +#拼接 多账号&或换行或新建同名变量 +[Script] +http-response + +[MITM] +hostname = + +⚠️【免责声明】 +------------------------------------------ +1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 +2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 +3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 +4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 +5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 +6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 +7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 +*/ + +const $ = new Env("小猴工具小程序"); +let ckName = `Monkey_WX`; +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 = 0; + let strSplitor = "#"; + + for (let user of userCookie) { + $.log(`\n🚀 user:【${index || ++index}】 start work\n`); + $.checkInId = user.split(strSplitor)[0]; + $.sid = user.split(strSplitor)[1]; + await signIn(); + } + + await $.sendMsg($.logs.join("\n")); +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); +async function signIn() { + + let config = { + method: 'GET', + url: 'https://h5.youzan.com/wscump/checkin/checkinV2.json?checkinId=' + $.checkInId + '&app_id=&kdt_id=&access_token=', + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220067 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android', + 'Accept-Encoding': 'gzip,compress,br,deflate', + 'charset': 'utf-8', + 'content-type': 'application/json', + 'extra-data': '{"is_weapp":1,"sid":"' + $.sid + '","version":"2.154.3.101","client":"weapp","bizEnv":"wsc","uuid":"","ftime":""}', + 'referer': 'https://servicewechat.com/wx0451bbda59c220a8/95/page-frame.html' + } + }; + let { data: result } = await Request(config) + result?.code == 0 ? $.log(`签到成功`) : $.log(`签到失败`); console.log(JSON.stringify(result)); + +} + + +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) { + throw error && error.error ? error.error : "请求失败"; + } + }; + } + if ($.isQuanX()) { + Request = async (options) => { + try { + return await $task.fetch(options); + } catch (error) { + throw error && error.error ? error.error : "请求失败"; + } + }; + } + return await Request(options); +} \ No newline at end of file diff --git a/巨量ip_Sign.py b/巨量ip_Sign.py new file mode 100644 index 0000000..96973b0 --- /dev/null +++ b/巨量ip_Sign.py @@ -0,0 +1,139 @@ +# -*- coding: utf-8 -*- +#!/usr/bin/env python3 +""" +* 仅供学习交流,请在下载后的24小时内完全删除 请勿将任何内容用于商业或非法目的,否则后果自负。 +* 巨量ip签到。每日签到领取1000免费IP +* 巨量ip注册地址 https://www.juliangip.com/user/reg?inviteCode=1017082 +#!/usr/bin/env python3 +""" +# # # # # # # # # # # + +import json +import re + +import requests +import urllib3 +from urllib3.exceptions import InsecureRequestWarning + +urllib3.disable_warnings(InsecureRequestWarning) +token = "填写token" +username = "填入你的巨量账号" +password = "填入你的巨量密码" + +def jl_login(username, password): + url = "https://www.juliangip.com/login/go" + payload = f'type=password&username={username}&password={password}&sms_code=' + headers = { + 'Accept': 'application/json, text/javascript, */*; q=0.01', + 'Accept-Encoding': 'gzip, deflate, br', + 'Accept-Language': 'zh-CN,zh;q=0.9', + 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', + 'Origin': 'https://www.juliangip.com', + 'Referer': 'https://www.juliangip.com/user/login', + 'Sec-Ch-Ua': '"Microsoft Edge";v="117", "Not;A=Brand";v="8", "Chromium";v="117"', + 'Sec-Ch-Ua-Mobile': '?0', + 'Sec-Ch-Ua-Platform': '"Windows"', + 'Sec-Fetch-Dest': 'empty', + 'Sec-Fetch-Mode': 'cors', + 'Sec-Fetch-Site': 'same-origin', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.2045.43', + 'X-Requested-With': 'XMLHttpRequest' + } + + response = requests.request("POST", url, headers=headers, data=payload, verify=False) + if response.status_code == 200: + return "_JSID=" + response.cookies.get("_JSID") + return None + + +def jl_users(tk): + url = "https://www.juliangip.com/users/" + headers = { + 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7', + 'Accept-Language': 'zh-CN,zh;q=0.9', + 'Sec-Ch-Ua': '"Microsoft Edge";v="117", "Not;A=Brand";v="8", "Chromium";v="117"', + 'Sec-Ch-Ua-Mobile': '?0', + 'Sec-Ch-Ua-Platform': '"Windows"', + 'Sec-Fetch-Dest': 'empty', + 'Sec-Fetch-Mode': 'cors', + "Cookie": tk, + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.2045.43', + } + response = requests.get(url, headers=headers, verify=False) + if response.status_code == 200: + return re.findall("const tx =new TencentCaptcha\('(\d+)'", response.text) + return [] + + +def getcode(aid): + url = "http://119.96.239.11:8888/api/getcode" + headers = { + "Content-Type": "application/json" + } + data = { + "timeout": "90", # 超时时间 请确保http请求超时>该参数,否则识别成功但连接已断开失败 + "type": "tencent-turing", # 类型 + "appid": aid, # 抓包所得aid/appid/id参数 tencent[aid/appid] netease[id] + "token": token, # 用户token 用于识别区分用户 + "developeraccount": "" # 软件开发者用户名 //可空 + } + response = requests.post(url, headers=headers, verify=False, timeout=90, data=json.dumps(data)) + if response.status_code == 200: + if response.json()['status'] == 200: + return response.json() + else: + print(response.json()) + return {} + return {} + + +def getFree(tk, js): + headers = { + "Host": "www.juliangip.com", + "Cookie": tk, + "sec-ch-ua": "\"Microsoft Edge\";v=\"117\", \"Not;A=Brand\";v=\"8\", \"Chromium\";v=\"117\"", + "accept": "*/*", + "content-type": "application/x-www-form-urlencoded; charset=UTF-8", + "x-requested-with": "XMLHttpRequest", + "sec-ch-ua-mobile": "?0", + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.2045.43", + "sec-ch-ua-platform": "\"Windows\"", + "origin": "https://www.juliangip.com", + "sec-fetch-site": "same-origin", + "sec-fetch-mode": "cors", + "sec-fetch-dest": "empty", + "referer": "https://www.juliangip.com/users/", + "accept-language": "zh-CN,zh;q=0.9" + } + data_js = json.loads(js['data']['code']) + data = { + "randStr": data_js['randstr'], + "ticket": data_js["ticket"] + } + url = "https://www.juliangip.com/users/getFree" + response = requests.post(url, headers=headers, data=data, + verify=False) # 注意:verify=False 用于禁用SSL验证,如果需要SSL验证,请删除这个参数 + if response.status_code == 200: + print(response.json()) + else: + print(response.text) + + +def main(): + tk = jl_login(username, password) + if not tk: + print("登录失败") + return + aid = jl_users(tk) + if not aid: + print("获取aid失败") + return + js = getcode(aid[0]) + if not js: + print("获取打码平台失败") + return + getFree(tk, js) + + +if __name__ == '__main__': + main() diff --git a/得无开源.js b/得无开源.js new file mode 100644 index 0000000..98c1955 --- /dev/null +++ b/得无开源.js @@ -0,0 +1,1740 @@ +/** + * cron 10 11 * * * + * 依赖 crypto-js & jsencrypt + * 得物APP 探索中的玩一玩 所有游戏的入口都在那里 请跑任务之前手动玩一次 + * -------------------------------------------------- + * 变量名:dewuCK + * 变量值:抓app.dewu.com 请求头Headers中的x-auth-token 去掉Bearer # 连接cookie中dutoken得值 可以直接搜dutoken # 连接SK + * 三个值 x-auth-token的值去掉Bearer#dutoken的值#SK的值 + * UA的变量名UAdefult_dewu + * export UAdefult_dewu="Mozilla/5.0 (.....UA" + * 例如ejxxxxx...#d41d8cd9|16...2233|17...|4sasasasa...#9xxxxxxxx + * 多账号& 或换行 或新建同名变量 + * ------------------------------------------------- + * -------------------------------------------------- + * new Env("得物") + */ + +let ckName = "dewuCK";//CK变量名字 + + +const version = "testV1" +const isPromiseAll = process.env["isPromiseAll"] ? process.env["isPromiseAll"] : "true";//是否开启并发 +let UAdefult = "Mozilla/5.0 (Linux; Android 10; MI 8 Lite Build/QKQ1.190910.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.99 Mobile Safari/537.36/duapp/5.39.1(android;10)" +let UA = process.env["UAdefult_dewu"] ? process.env["UAdefult_dewu"] : UAdefult +let SK = process.env["SKdefult_dewu"] ? process.env["SKdefult_dewu"] : "" + +const $ = new Env("得物农场"); +const notify = $.isNode() ? require('./sendNotify') : ''; +let envSplitor = ["&", "\n"]; //多账号分隔符 +let strSplitor = "#"; //多变量分隔符 +let userIdx = 0; +let userList = []; +let authShareCodeList = [] +let stationShareCodesList = [] +let zeroLotteryShareCodesModeGetList = [] +let helpCode = "" +const CryptoJS = require("crypto-js"); +async function main() { + $.log(`并发状态:${isPromiseAll == "true" ? "[true]" : "[false]"}`) + let { body: shareCode } = await $.httpRequest({ timeout: 10000, method: "get", url: "https://gitee.com/smallfawn/Note/raw/main/updateTeam/dwnc.json", headers: { "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_1_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148/duapp/5.38.6" } }) + $.log(`当前版本:${version} 最新版本${shareCode.v}`) + if (version != shareCode.v) { + $.log(`当前版本和最新版本不一致`) + return + } + $.log(`[${shareCode.notice}]`); + authShareCodeList = shareCode.treeShareCodesList + stationShareCodesList = shareCode.stationShareCodesList + zeroLotteryShareCodesModeGetList = shareCode.zeroLotteryShareCodesModeGetList + let taskall = []; + $.log(`======= 🌳初始化邀请码 =======`) + for (let user in userList) { + if (userList[user].ckStatus) { + //如果user处于数组第一 那么则await 否则则promiseAll + if (user == 0) { + await userList[0].UserInit(); + } else { + if (isPromiseAll == "true") { + taskall.push(userList[user].UserInit()); + } else { + taskall.push(await userList[user].UserInit()); + } + } + } + } + await Promise.all(taskall); + $.log(`======= 🌳果园 =======`) + for (let user of userList) { + if (user.ckStatus) { + if (isPromiseAll == "true") { + taskall.push(user.tree()); + } else { taskall.push(await user.tree()); } + } + } + await Promise.all(taskall); + taskall = []; + $.log(`======= 🐟鱼厂 =======`) + + for (let user of userList) { + if (user.ckStatus) { + if (isPromiseAll == "true") { + taskall.push(user.fish()); + } else { + taskall.push(await user.fish()); + } + } + } + await Promise.all(taskall); + taskall = []; + $.log(`======= 上上签💴 =======`) + for (let user of userList) { + if (user.ckStatus) { + if (isPromiseAll == "true") { + taskall.push(user.station()); + } else { + taskall.push(await user.station()); + } + + } + } + await Promise.all(taskall); + taskall = []; + $.log(`======= 0元抽💴 =======`) + for (let user of userList) { + if (user.ckStatus) { + if (isPromiseAll == "true") { + taskall.push(user.zeroLottery()); + } else { + taskall.push(await user.zeroLottery()); + } + } + } + await Promise.all(taskall); + taskall = []; + $.log(`======= 抽盲盒 =======`) + for (let user of userList) { + if (user.ckStatus) { + if (isPromiseAll == "true") { + taskall.push(user.buZhou()); + } else { + taskall.push(await user.buZhou()); + } + } + } + await Promise.all(taskall); + $.log(`======= 潮金币 =======`) + taskall = []; + for (let user of userList) { + if (user.ckStatus) { + if (isPromiseAll == "true") { + taskall.push(user.point()); + } else { + taskall.push(await user.point()); + + } + } + } + await Promise.all(taskall); + +} +class Task { + constructor(str) { + this.index = ++userIdx; + this.ck = str.split(strSplitor)[0]; //单账号多变量分隔符 + this.ckStatus = true; + this.taskListTree = [] + this.doWaterStatus = true + this.taskListFish = [] + this.fishFeedStatus = true + this.fishId = "" + this.fishType = "" + this.stationList = []; + this.duToken = str.split(strSplitor)[1]; + this.sk = str.split(strSplitor)[2]; + this.prizeLocations = [] + this.BuZhouRefreshStatus = false + this.chanceCount = 0 + this.waitPrizeLocations = [] + this.ua = UA + //this.sk = SK + } + async tree() { + await this.Dowater() + await $.wait(2500) + await this.TreeInviteReward() + await $.wait(1500) + await this.Get_Tree_Info() + await $.wait(1500) + await this.TreeInfo() + await $.wait(1500) + await this.SignListTree() + await $.wait(1500) + await this.TaskListTree(); + await $.wait(1500) + await this.Droplet_Get_Generate_Droplet() + await $.wait(1500) + await this.Droplet_ExtraInfo() + } + async fish() { + await this.SignListFish() + await $.wait(2500) + await this.TaskListFish() + await $.wait(2500) + await this.UserFinshInfo() + + + + + } + async station() { + for (let i of stationShareCodesList) { + await $.wait(1500) + let shareKey = await this.ShareCodesGet(i) + if (shareKey != '') { + let id = shareKey.split("id=")[1].split("&")[0] + let userId = shareKey.split("shareUserId=")[1].split("&")[0] + let status = await this.StationAssist(id, userId) + if (status) { + break; + } + } else { + } + + } + await this.StationList() + for (let j of this.stationList) { + await $.wait(2000) + await this.StationEgnageIn(j.id) + } + + } + async zeroLottery() { + await this.zeroLotteryWinList() + await this.zeroLotteryList() + for (let j of zeroLotteryShareCodesModeGetList) { + await $.wait(1500) + let shareKey = await this.ShareCodesGet(j) + if (shareKey != '') { + shareKey = decodeURIComponent(shareKey.split("shareKey=")[1].split("&")[0]) + let status = await this.zeroLotteryShare(shareKey) + if (status) { + break; + } + } else { + } + } + + } + async buZhou() { + await this.BuZhouTaskList() + await $.wait(2000) + await this.BuZhouInfo() + await $.wait(2000) + await this.BuZhouInfo() + } + async point() { + await this.PonitSignIn() + await this.PointTaskList() + } + async DoTask(body) { + try { + let taskStatusResult = {}; + let commitBody = {}; + let preStatus = false + if (body.taskType == 50) { + taskStatusResult = await this.taskRequest_task("get", `https://app.dewu.com/hacking-task/v1/task/status?taskId=${body.taskId}&taskType=50&sign=94fd23c93d62ae0f75108f94c093b198`) + if (taskStatusResult.code == 200) { + if (taskStatusResult.data.status == 1) { + //$.log(`账号[${this.index}] 开始任务成功🎉`) + commitBody = { "taskId": body.taskId, "taskType": String(body.taskType), "btd": 0, spuId: 0 } + preStatus = true + } + } + } + if (body.taskType == 1) { + if ("classify" in body) { + if (body.classify == 2) { + taskStatusResult = await this.taskRequest_task("post", `https://app.dewu.com/hacking-task/v1/task/pre_commit?sign=b7382f4d908e04356f9646688afe096c`, { taskId: body.taskId, taskType: body.taskType, btn: 0 }) + //console.log(taskStatusResult); + if (taskStatusResult.code == 200) { + if (taskStatusResult.data.isOk == true) { + //$.log(`账号[${this.index}] 开始任务成功🎉`) + $.log(`延迟${body.countdownTime + 1}秒浏览${body.taskName}`) + await $.wait((body.countdownTime + 1) * 1000) + commitBody = { "taskId": body.taskId, "taskType": String(body.taskType), "activityType": null, "activityId": null, "taskSetId": null, "venueCode": null, "venueUnitStyle": null, "taskScene": null, "btd": 0 } + preStatus = true + } + } else { + $.log(`❌账号[${this.index}] 开始任务失败[${taskStatusResult.msg}]`); + } + } + } else { + /*taskStatusResult = await this.taskRequest_task("post", `https://app.dewu.com/hacking-task/v1/task/pre_commit?sign=b7382f4d908e04356f9646688afe096c`, { taskId: body.taskId, taskType: body.taskType, btn: 0 }) + if (taskStatusResult.code == 200) { + if (taskStatusResult.data.isOk == true) { + //$.log(`账号[${this.index}] 开始任务成功🎉`) + await $.wait(16000) + commitBody = { "taskId": body.taskId, "taskType": body.taskType, "activityType": null, "activityId": null, "taskSetId": null, "venueCode": null, "venueUnitStyle": null, "taskScene": null, "btd": 0 } + preStatus = true + } + } else { + $.log(`❌账号[${this.index}] 开始任务失败[${taskStatusResult.msg}]`); + }*/ + } + + + } + if (body.taskType == 123 || body.taskType == 124) { + commitBody = { "taskType": String(body.taskType) } + preStatus = true + } + //console.log(taskStatusResult) + if (preStatus == true) { + let commitResult = await this.taskRequest_task("post", `https://app.dewu.com/hacking-task/v1/task/commit?sign=826988b593cd8cd75162b6d3b7dade15`, commitBody) + //console.log(commitResult) + if (commitResult.code == 200) { + if (commitResult.data.status == 2) { + $.log(`账号[${this.index}] [${body.taskName}]任务成功🎉`) + return true + } else { + $.log(`账号[${this.index}] [${body.taskName}]任务失败🎉`) + } + } else { + $.log(`账号[${this.index}] [${body.taskName}]任务失败🎉`) + } + } else { + return false + } + } catch (e) { + console.log(e); + } + + } + async StationAssist(id, shareUserId) { + let body = { "id": id, "shareUserId": shareUserId } + try { + let result = await this.taskRequest("post", `https://app.dewu.com/api/v1/h5/delicate-sell-interfaces/dsell/station/assist?sign=${this.calculateSign(body)}`, body) + if (result.code == 200) { + //$.log(`账号[${this.index}] 助力参与作者组队上上签成功🎉`) + return true + } else { + //$.log(`❌账号[${this.index}] 助力参与作者组队上上签失败[${result.msg}]`); + return false + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async zeroLotteryEgnageIn(id) { + let body = { "id": id, "source": "wotab" } + try { + let result = await this.taskRequest_task("post", `https://app.dewu.com/hacking-zero-lottery/v1/activity/engage-in?sign=${this.calculateSign(body)}`, body) + if (result.code == 200) { + $.log(`账号[${this.index}] 0元抽签参与成功[${result.data.title}]🎉`) + } else { + $.log(`❌账号[${this.index}] 0元抽签0参与失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async ShareCodesGet(key) { + try { + let result = await this.taskRequest_task("get", `https://app.dewu.com/hacking-keyword/v1/common/keyword/share-info?keyword=${key}`) + if (result.code == 200) { + if (result.data !== null) { + + return result.data.activityInfo.enterUrl + + + + } else { + return '' + } + } else { + + $.log(`❌账号[${this.index}] 助力参与0元购失败[${result.msg}]🎉`) + return '' + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async zeroLotteryShare(key) { + + let body = { "shareKey": key } + try { + let result = await this.taskRequest_task("post", `https://app.dewu.com/hacking-zero-lottery/v1/activity/report-keyword?sign=${this.calculateSign(body)}`, body) + if (result.code == 200) { + //$.log(`账号[${this.index}] 助力参与0元购成功🎉`) + return true + } else { + //$.log(`❌账号[${this.index}] 助力参与0元购失败[${result.msg}]🎉`) + return false + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async zeroLotteryWinList() { + let body = { "limit": 10, "lastId": 0 } + try { + let result = await this.taskRequest_task("post", `https://app.dewu.com/hacking-zero-lottery/v1/activity/engage-in-list`, body) + if (result.code == 200) { + if (result.data?.list) { + for (let i of result.data.list) { + // ... + if (i.win == true) { + $.log(`账号[${this.index}] 恭喜中签[${i.name}]🎉🎉🎉🎉🎉🎉🎉🎉`) + } + } + } + + + } else { + $.log(`❌账号[${this.index}] 获取0元购列表失败[${result.msg}]🎉`) + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async zeroLotteryList() { + let body = { "source": "wotab" } + try { + let result = await this.taskRequest_task("post", `https://app.dewu.com/api/v1/h5/zero-lottery-interfaces/zl/activity/query-today?sign=${this.calculateSign(body)}`, body) + if (result.code == 200) { + for (let i of result.data.activityList) { + let taskStatus = false + if (i.status == 0) { + if ("taskVo" in i) { + await this.DoTask(i.taskVo) + + } else { + await this.zeroLotteryEgnageIn(i.id) + } + } + } + } else { + $.log(`❌账号[${this.index}] 获取0元购列表失败[${result.msg}]🎉`) + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async StationEgnageIn(id) { + let body = { "id": id } + try { + let result = await this.taskRequest_task("post", `https://app.dewu.com/api/v1/h5/delicate-sell-interfaces/dsell/station/egnage-in?sign=${this.calculateSign(body)}`, body) + if (result.code == 200) { + $.log(`账号[${this.index}] 参与上上签成功🎉`) + } else { + $.log(`❌账号[${this.index}] 参与上上签失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async StationList() { + let body = { "student": false, "source": "" } + try { + let result = await this.taskRequest_task("post", `https://app.dewu.com/api/v1/h5/delicate-sell-interfaces/dsell/query/ongoing-list?sign=${this.calculateSign(body)}`, body) + if (result.code == 200) { + for (let i of result.data.records) { + if (i.userPartakeStatus == 10) { + this.stationList.push(i) + } + } + } else { + $.log(`❌账号[${this.index}] 获取上上签列表失败[${result.msg}]🎉`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async BuZhouInfo() { + let body = { "benefitId": 1, "additionPresent": 0, "source": "gamecentertask" } + try { + let result = await this.taskRequest_task("post", `https://app.dewu.com/api/v1/h5/mount-buzhou-interfaces/gk/index?sign=${this.calculateSign(body)}`, body) + if (result.code == 200) { + //console.log(result.data); + $.log(`账号[${this.index}] 盲盒赛季[${result.data.seasonName}] 当前抽奖机会[${result.data.chanceCount}] 🎉`) + if ("prizeLocations" in result.data) { + $.log(`已开盲盒位置[${result.data.prizeLocations}]`) + this.prizeLocations = result.data.prizeLocations + } else { + this.prizeLocations = [] + } + this.chanceCount = result.data.chanceCount + //console.log(result.data.hasDraw); + if (this.chanceCount != 0) { + this.waitPrizeLocations = this.findMissingNumbers(this.prizeLocations) + //加一个条件 如果waitPriz...... 小于 chence 则 刷新 + if (this.waitPrizeLocations.length == 0 && this.chanceCount > 0) { + await $.wait(2500) + await this.BuZhouRefresh(result.data.seasonId) + } + this.waitPrizeLocations = this.findMissingNumbers(this.prizeLocations) + //如果长度大于等于chence 则不刷新 + + let max = this.waitPrizeLocations.length >= this.chanceCount ? this.chanceCount : this.waitPrizeLocations.length + for (let i = 0; i < max; i++) { + let prizeLocation = this.waitPrizeLocations[i] + $.log("开始第" + (i + 1) + "次抽奖") + await $.wait(2500) + await this.BuZhouLottery(result.data.seasonId, prizeLocation) + } + await $.wait(2500) + await this.BuZhouRefresh(result.data.seasonId) + } + + + + + } else { + $.log(`❌账号[${this.index}] 盲盒获取失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async BuZhouLottery(seasonId, prizeLocation) { + let body = { "benefitId": 1, "seasonId": seasonId, "prizeLocation": prizeLocation, "source": "gamecentertask" } + try { + let result = await this.taskRequest_task("post", `https://app.dewu.com/api/v1/h5/mount-buzhou-interfaces/gk/lottery?sign=${this.calculateSign(body)}`, body) + if (result.code == 200) { + $.log(`账号[${this.index}] 盲盒抽取[${result.data.gkLotteryVo.gkName}]碎片`); + } else { + $.log(`❌账号[${this.index}] 盲盒抽取失败[${result.msg}]`); + //console.log(seasonId, prizeLocation); + } + } catch (e) { + console.log(e); + } + } + async BuZhouRefresh(seasonId) { + let body = { "seasonId": seasonId } + try { + let result = await this.taskRequest_task("post", `https://app.dewu.com/api/v1/h5/mount-buzhou-interfaces/gk/refresh?sign=${this.calculateSign(body)}`, body) + if (result.code == 200) { + $.log(`账号[${this.index}] 刷新盲盒成功`); + this.BuZhouRefreshStatus = true; + this.prizeLocations = [] + } else { + $.log(`❌账号[${this.index}] 刷新盲盒失败[${result.msg}]`); + //console.log(result); + this.BuZhouRefreshStatus = false; + } + } catch (e) { + console.log(e); + } + } + async BuZhouTaskList() { + let body = { "source": "gamecentertask" } + try { + let result = await this.taskRequest_task("get", `https://app.dewu.com/api/v1/h5/mount-buzhou-interfaces/gk/task-list?source=gamecentertask&sign=${this.calculateSign(body)}`) + if (result.code == 200) { + for (let i of result.data.taskVoList) { + let taskStatus = false + if (i.isComplete == false) { + if (i.taskType == 1) { + if (i.classify == 2) { + //浏览 + + taskStatus = await this.DoTask(i) + } + } + if (i.taskType == 50) { + await $.wait(2500) + + taskStatus = await this.DoTask(i) + //收藏 + } + } else if (i.isComplete == true && i.isReceiveReward == false) { + await $.wait(2500) + await this.TaskReceiveBuZhou(i) + } + if (taskStatus == true) { + await $.wait(2500) + await this.TaskReceiveBuZhou(i) + } + } + } else { + $.log(`❌账号[${this.index}] 盲盒任务获取失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async TaskReceivePoint(body) { + try { + let RequestBody = { taskId: body.taskId, taskType: body.taskType } + + let result = await this.taskRequest("post", `https://app.dewu.com/hacking-game-center/v1/sign/task_receive?sign=${this.calculateSign(RequestBody)}`, RequestBody) + //console.log(JSON.stringify(result)); + if (result.code == 200) { + $.log(`账号[${this.index}] 领取任务奖励[${result.msg}] --- [${result.data.amount}]金币🎉`) + } else { + //console.log(body.taskId); + $.log(`❌账号[${this.index}] 领取任务奖励失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async TaskReceiveBuZhou(body) { + try { + let RequestBody = { taskId: body.taskId, classify: body.classify } + let result = await this.taskRequest("post", `https://app.dewu.com/api/v1/h5/mount-buzhou-interfaces/gk/task-receive?sign=${this.calculateSign(RequestBody)}`, RequestBody) + //console.log(JSON.stringify(result)); + if (result.code == 200) { + $.log(`账号[${this.index}] 领取任务奖励[${result.msg}] --- [${result.data.count}]次数🎉`) + } else { + //console.log(body.taskId); + $.log(`❌账号[${this.index}] 领取任务奖励失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async FishFeed() { + let body = { "feedTimes": 1, "fishId": this.fishId, "fishType": this.fishType } + try { + let result = await this.taskRequest("post", `https://app.dewu.com/hacking-fish/v1/fish/feed?sign=63a26f09f6d985b73299f92506f6e986`, body) + if (result.code == 200) { + $.log(`账号[${this.index}] 喂食🐟成功🎉`) + this.fishFeedStatus = true + } else { + this.fishFeedStatus = false + $.log(`❌账号[${this.index}] 喂食🐟失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async Dowater() { + if (this.droplet > 0) { + $.log(`账号[${this.index}] 可浇水${parseInt(this.droplet / 100)}次,开始浇水`); + if (this.treeMode == 0) { + for (let i = 0; i < parseInt(this.droplet / 100); i++) { + if (this.doWaterStatus) { + await this.DoWaterApi() + //随机延迟random + await $.wait(this.randomNumber(1000, 2000)) + } + } + } else if (this.treeMode == 1) { + $.log(`账号[${this.index}] 组队浇水 =>`) + for (let i = 0; i < parseInt(this.droplet / 100); i++) { + if (this.doWaterStatus) { + await this.DoWaterTeamApi(this.treeId) + //随机延迟random + await $.wait(this.randomNumber(1000, 2000)) + } + } + await this.TeamInfo() + } + + } + } + async DoWaterApi() { + let body = {} + try { + let result = await this.taskRequest("post", `https://app.dewu.com/hacking-tree/v1/tree/watering?sign=fe26befc49444d362c8f17463630bdba`, body) + if (result.code == 200) { + $.log(`账号[${this.index}] 浇水成功🎉`) + this.doWaterStatus = true + } else { + this.doWaterStatus = false + $.log(`❌账号[${this.index}] 浇水失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async DoWaterTeamApi(teamTreeId) { + let body = { "teamTreeId": teamTreeId } + try { + let result = await this.taskRequest("post", `https://app.dewu.com/hacking-tree/v1/team/tree/watering?sign=b5ee2c7e8d1aaf214886c438c4f25cd9`, body) + if (result.code == 200) { + $.log(`账号[${this.index}] 浇水成功🎉`) + if (result.data.coupons !== null) { + $.log(`账号[${this.index}] 浇水成功获得${result.data.coupons[0].limitDesc}🎉`) + + } + this.doWaterStatus = true + } else { + this.doWaterStatus = false + $.log(`❌账号[${this.index}] 浇水失败[${result.msg}]`); + + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async TreeInfo() { + try { + let result = await this.taskRequest("get", `https://app.dewu.com/hacking-tree/v1/user/target/info`) + //console.log(result); + if (result.code == 200) { + $.log(`账号[${this.index}] [${result.data.name}] Lv[${result.data.level}]🎉`) + + } else { + $.log(`❌账号[${this.index}] 获取🌳信息失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async TaskListTree() { + try { + let result = await this.taskRequest("get", `https://app.dewu.com/hacking-tree/v1/task/list`) + //console.log(result); + if (result.code == 200) { + $.log(`账号[${this.index}] 获取任务列表成功 采集/领取 集到[${result.data.taskList.length}]条任务🎉`) + for (let i of result.data.taskList) { + this.taskListTree.push(i) + } + for (let i of this.taskListTree) { + let taskStatus = false + if (i.isComplete == false) { + await $.wait(2500) + if (i.taskType == 1) { + if (i.classify == 2) { + //浏览 + + taskStatus = await this.DoTask(i) + } + if (i.classify == 1) { + //完成固定次数浇灌 默认5次 + } + } + if (i.taskType == 10) { + //固定时间段领取 40g + } + if (i.taskType == 123) { + taskStatus = await this.DoTask(i) + //从桌面组件访问 + } + if (i.taskType == 50) { + taskStatus = await this.DoTask(i) + //收藏 + } + if (i.taskType == 201) { + //逛95分 + } + if (i.taskType == 4) { + //收集一次水滴生产 + } + } else if (i.isComplete == true && i.isReceiveReward == false) { + await $.wait(2500) + await this.TaskReceiveTree(i) + } + if (taskStatus) { + await $.wait(2500) + await this.TaskReceiveTree(i) + } + } + } else { + $.log(`❌账号[${this.index}] 获取任务列表成功🎉失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async SignListTree() { + try { + let result = await this.taskRequest("get", `https://app.dewu.com/hacking-tree/v1/sign/list`) + //console.log(JSON.stringify(result)); + if (result.code == 200) { + $.log(`账号[${this.index}] 今日${result.data.status == 1 ? "未签到" : "已签到"}🎉`) + if (result.data.status == 1) { + let SignInResult = await this.taskRequest("post", `https://app.dewu.com/hacking-tree/v1/sign/sign_in`, {}) + if (SignInResult.code == 200) { + $.log(`账号[${this.index}] 签到领取水滴[${SignInResult.msg}] --- [${SignInResult.data.Num}]🎉`) + } else { + $.log(`账号[${this.index}] 签到领取水滴[${SignInResult.msg}]`) + } + } + } else { + $.log(`❌账号[${this.index}] 获取签到列表失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async SignListFish() { + try { + let result = await this.taskRequest_task("get", `https://app.dewu.com/hacking-fish/v1/daily_sign/list`) + //console.log(JSON.stringify(result)); + if (result.code == 200) { + $.log(`账号[${this.index}] 今日${result.data.status == 1 ? "未签到" : "已签到"}🎉`) + if (result.data.status == 1) { + let SignInResult = await this.taskRequest("post", `https://app.dewu.com/hacking-fish/v1/daily_sign/receive`, {}) + if (SignInResult.code == 200) { + $.log(`账号[${this.index}] 签到领取鱼食[${SignInResult.msg}] --- [${SignInResult.data.Num}]🎉`) + } else { + $.log(`账号[${this.index}] 签到领取鱼食[${SignInResult.msg}]`) + } + } + } else { + $.log(`❌账号[${this.index}] 获取签到列表失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async PointInfo() { + try { + let result = await this.taskRequest_task("get", `https://app.dewu.com/hacking-game-center/v1/gold/balance`) + //console.log(JSON.stringify(result)); + if (result.code == 200) { + $.log(`账号[${this.index}] 潮金币[${result.data.coinDetailList[0].value}]`); + } else { + $.log(`❌账号[${this.index}] 获取潮金币信息失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async PointTaskList() { + try { + let result = await this.taskRequest_task("get", `https://app.dewu.com/hacking-game-center/v1/sign/task_list`) + //console.log(JSON.stringify(result)); + if (result.code == 200) { + for (let i of result.data.list) { + let taskStatus = false + if (i.isComplete == false) { + if (i.taskType == 1) { + i.classify = 2 + taskStatus = await this.DoTask(i) + } + if (i.taskType == 50) { + await $.wait(2500) + taskStatus = await this.DoTask(i) + //收藏 + } + } else if (i.isComplete == true && i.isReceiveReward == false) { + await $.wait(2500) + await this.TaskReceivePoint(i) + } + if (taskStatus == true) { + await $.wait(2500) + await this.TaskReceivePoint(i) + } + } + } else { + $.log(`❌账号[${this.index}] 获取潮金币任务列表失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async PonitSignIn() { + try { + let result = await this.taskRequest("post", `https://app.dewu.com/hacking-game-center/v1/sign/sign`, {}) + //console.log(JSON.stringify(result)); + if (result.code == 200) { + $.log(`账号[${this.index}] 外部活动潮币签到成功 获得[${result.data.coins}g💧]🎉`) + } else { + $.log(`❌账号[${this.index}] 外部活动潮币签到失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async Droplet_ExtraInfo() { + try { + let result = await this.taskRequest("get", `https://app.dewu.com/hacking-tree/v1/droplet-extra/info`) + //console.log(JSON.stringify(result)); + if (result.code == 200) { + $.log(`账号[${this.index}] 气泡水滴 可领取 --- 💧🎉`) + let receiveResult = await this.taskRequest("post", `https://app.dewu.com/hacking-tree/v1/droplet-extra/receive`, {}) + //console.log(JSON.stringify(result)); + if (receiveResult.code == 200) { + $.log(`账号[${this.index}] 领取气泡水滴[${receiveResult.msg}] --- [${receiveResult.data.totalDroplet}g]💧🎉`) + } else { + $.log(`❌账号[${this.index}] 领取气泡失败[${receiveResult.msg}]`); + //console.log(result); + } + } else { + $.log(`❌账号[${this.index}] 气泡水滴获取失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async Droplet_Get_Generate_Droplet() { + try { + let result = await this.taskRequest("post", `https://app.dewu.com/hacking-tree/v1/droplet/get_generate_droplet`, {}) + //console.log(JSON.stringify(result)); + if (result.code == 200) { + $.log(`账号[${this.index}] 领取小木桶积攒水滴[${result.msg}] --- [${result.data.droplet}g]💧🎉`) + } else { + $.log(`❌账号[${this.index}] 领取小木桶积攒水滴失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async TaskReceiveFish(body) { + try { + let result = await this.taskRequest("post", `https://app.dewu.com/hacking-fish/v1/task/receive?sign=ee632e4b8e24d2526737bca0b7c0c678`, { taskId: body.taskId, classify: body.classify }) + //console.log(JSON.stringify(result)); + if (result.code == 200) { + $.log(`账号[${this.index}] 领取任务奖励[${result.msg}] --- [${result.data.num}g]💧🎉`) + + } else { + $.log(`❌账号[${this.index}] 领取任务奖励失败[${result.msg}]`); + //console.log(body.taskId); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async TaskReceiveTree(body) { + try { + let result = await this.taskRequest("post", `https://app.dewu.com/hacking-tree/v1/task/receive?sign=15c051cc7af50c30318c05b539e434e7`, { taskId: body.taskId, classify: body.classify }) + //console.log(JSON.stringify(result)); + if (result.code == 200) { + $.log(`账号[${this.index}] 领取任务奖励[${result.msg}] --- [${result.data.num}g]💧🎉`) + } else { + //console.log(body.taskId); + $.log(`❌账号[${this.index}] 领取任务奖励失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async Get_Tree_Info() { + try { + let result = await this.taskRequest("get", `https://app.dewu.com/hacking-tree/v1/tree/get_tree_info`) + //console.log(JSON.stringify(result)); + if (result.code == 200) { + $.log(`账号[${this.index}] [${result.data.treeId}] 成熟进度 --- [${result.data.userWateringDroplet}/${result.data.currentLevelNeedWateringDroplet}g]💧🎉`) + + } else { + $.log(`❌账号[${this.index}] 获取🌳成长信息失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async TaskListFish() { + try { + let result = await this.taskRequest("get", `https://app.dewu.com/hacking-fish/v1/task/list`) + //console.log(JSON.stringify(result)); + if (result.code == 200) { + $.log(`账号[${this.index}] 获取任务列表成功 采集/领取 [${result.data.taskList.length}]条任务🎉`) + for (let i of result.data.taskList) { + this.taskListFish.push(i) + } + for (let i of this.taskListFish) { + let taskStatus = false + if (i.isComplete == false) { + await $.wait(2500) + if (i.taskType == 1) { + if (i.classify == 2) { + //浏览 + + taskStatus = await this.DoTask(i) + } + if (i.classify == 1) { + //完成固定次数浇灌 默认5次 + } + } + if (i.taskType == 100001) { + //喂养5次 + } + if (i.taskType == 124) { + taskStatus = await this.DoTask(i) + //从桌面组件访问 + } + if (i.taskType == 50) { + taskStatus = await this.DoTask(i) + //收藏 + } + if (i.taskType == 201) { + //逛95分 + } + if (i.taskType == 100002) { + //30g鱼食 每日9点/13点/17点/21点各领一次 + } + } else if (i.isComplete == true && i.isReceiveReward == false) { + await $.wait(3000) + await this.TaskReceiveFish(i) + } + if (taskStatus) { + await $.wait(3000) + await this.TaskReceiveFish(i) + } + } + } else { + $.log(`❌账号[${this.index}] 获取任务🐟失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + async UserInit() { + let result = { + code: 0, + msg: "获取🌳信息失败", + } + try { + let authHelpCode = ""; + if (this.index == 1) { + for (let j of authShareCodeList) { + authHelpCode = j + result = await this.taskRequest("post", `https://app.dewu.com/hacking-tree/v1/user/init?sign=d25c30ebdf1adeb29ca10ccb825bbf66`, { "keyword": "", "source": "wotab04", "koc": 0, "ffOfflineFlag": "", "keywordType": 0 }) + if (result.code == 200) { + if ("inviteRes" in result.data) { + if (result.data.inviteRes.indexOf("成功") != -1) { + $.log(`首账号助力作者成功`) + break + } + } + } + } + let helpCodeResult = await this.taskRequest("post", "https://app.dewu.com/hacking-tree/v1/keyword/gen?sign=fe26befc49444d362c8f17463630bdba", {}) + if (helpCodeResult.code == 200) { + let kw = helpCodeResult.data.keyword + helpCode = kw.split("œ")[1] + $.log(`首账号助力码[${helpCode}]`) + } + } else { + result = await this.taskRequest("post", `https://app.dewu.com/hacking-tree/v1/user/init?sign=d25c30ebdf1adeb29ca10ccb825bbf66`, { "keyword": "", "source": "wotab04", "koc": 0, "ffOfflineFlag": "", "keywordType": 0 }) + } + if (result.code == 200) { + $.log(`账号[${this.index}] [${result.msg}] 剩余水滴[${result.data.droplet}g] 助力[${this.index == 1 ? "作者:" + authHelpCode : helpCode}][${"inviteRes" in result.data ? result.data.inviteRes : "未成功"}]🎉`) + this.treeId = result.data.treeId + this.droplet = result.data.droplet + this.treeMode = result.data.mode + + + } else { + $.log(`❌账号[${this.index}] 获取🌳信息失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + + async TreeInviteReward() { + try { + let result = await this.taskRequest("get", `https://app.dewu.com/hacking-tree/v1/invite/list`, `sign=fe26befc49444d362c8f17463630bdba`) + + if (result.code == 200) { + if (result.data?.list) { + for (let i of result.data.list) { + if (i.status == 0) { + let body = { "inviteeUserId": i.inviteeUserId } + let rewardResult = await this.taskRequest("post", `https://app.dewu.com/hacking-tree/v1/invite/reward`, body) + if (rewardResult.code == 200) { + $.log(`账号[${this.index}] 领取邀请奖励成功 获取[${rewardResult.data.droplet}]g`); + } + + } + } + } + + + } + } catch (e) { + console.log(e); + } + } + async TeamInfo() { + try { + let result = await this.taskRequest("get", `https://app.dewu.com/hacking-tree/v1/team/info`) + //console.log(result); + if (result.code == 200) { + for (let i of result.data.member) { + if (i.isCaptain == true) { + $.log(`账号[${this.index}] 组队队长[${i.name}] 今日是否上线[${i.status == 1 ? '是' : '否'}]`) + } else { + $.log(`账号[${this.index}] 组员[${i.name}] 今日是否上线[${i.status == 1 ? '是' : '否'}]`) + } + } + } else { + $.log(`❌账号[${this.index}] 获取队伍🌳🎉失败[${result.msg}]`); + //console.log(result); + } + + + + } catch (e) { + console.log(e); + } + } + async UserFinshInfo() { + try { + let result = await this.taskRequest_task("get", `https://app.dewu.com/hacking-fish/v1/user/home?userSelectFishId=0&sign=5d75086e825f0fcea4b2cbdf5e6d940f`) + //console.log(result); + let fishName = "" + let lv = "" + let progress = "" + if (result.code == 200) { + this.fishId = result.data.selectFishId + for (let j of result.data.fishList) { + if (this.fishId == j.fishId) { + this.fishType = j.type + fishName = j.typeData.name + lv = j.level + progress = j.progress + break; + } + } + $.log(`账号[${this.index}] [${fishName}]等级[${lv}] [${progress}/1000000] 剩余※鱼食🐟[${result.data.balance}g]🎉`) + if (result.data.balance > 0) { + $.log(`账号[${this.index}] 喂食🐟${parseInt(result.data.balance / 10)}次,开始喂食`); + for (let i = 0; i < parseInt(result.data.balance / 10); i++) { + if (this.fishFeedStatus) { + await this.FishFeed() + //随机延迟random + await $.wait(this.randomNumber(1000, 2000)) + } + } + } + + } else { + $.log(`❌账号[${this.index}] 获取用户信息成功🎉失败[${result.msg}]`); + //console.log(result); + } + } catch (e) { + console.log(e); + } + } + findMissingNumbers(arr) { + const nums = [0, 1, 2, 3, 4, 5, 6, 7, 8]; + const missing = []; + + for (const num of nums) { + if (!arr.includes(num)) { + missing.push(num); + } + } + + return missing; + } + //randominit + randomNumber(min, max) { + return Math.floor(Math.random() * (max - min)) + min; + } + async taskRequest(method, url, body = {}) { + // + + let headers = { + "Host": "app.dewu.com", + + "SK": this.sk, + + "x-auth-token": "Bearer " + this.ck, + + "duToken": "" + this.duToken, + + "cookieToken": "" + this.duToken, + "traceparent": this.generateIds(), + "User-Agent": this.ua, + + "sks": "1,hdw3", + + + "Cookie": "duToken=" + this.duToken + } + const reqeuestOptions = { + url: url, + method: method, + headers: headers + + } + //console.log(body); + let { enData, n } = this.createEncryptedBody(JSON.stringify(body)) + reqeuestOptions.headers["a"] = n + //console.log(enData); + method == "get" ? (reqeuestOptions.url.split("?")[1] != undefined ? reqeuestOptions.url += "&data=" + encodeURIComponent(enData.data) : reqeuestOptions.url += "?data=" + encodeURIComponent(enData.data)) : Object.assign(reqeuestOptions, { body: JSON.stringify({ data: enData.data }) }) + //console.log(reqeuestOptions) + try { + let { body: result } = await $.httpRequest(reqeuestOptions) + if (!$.isJson(result)) { + result = JSON.parse(this.decryptResponseBody(result, n)) + } + //console.log(result); + return result + + } catch (error) { + //console.log(error); + // $.log(`接口请求失败 `) + return { code: 0, msg: "接口请求失败" } + } + + } + generateIds() { + var Uo = Array(32); + var oe = "0000000000000000"; + + function Ho(e) { + for (var t = 0; t < 2 * e; t++) + Uo[t] = Math.floor(16 * Math.random()) + 48, + Uo[t] >= 58 && (Uo[t] += 39); + return String.fromCharCode.apply(null, Uo.slice(0, 2 * e)); + } + + var Mo = "00000000000000000000000000000000"; // Assuming Mo is defined somewhere else in your code + + var generateSpanId = function () { + return function (e) { + var t = e(8); + if (t === oe) + return Mo; + return t; + }(Ho); + }; + + var generateTraceId = function () { + return function (e) { + var t = Math.floor(Date.now() / 1e3).toString(16), + n = e(8), + r = e(3); + return "f5" + r + t + n; + }(Ho); + }; + + return "00-" + generateTraceId() + "-" + generateSpanId() + "-01" + }; + + async taskRequest_task(method, url, body = "") { + + + let headers = { + "Host": "app.dewu.com", + "Connection": "keep-alive", + //"Content-Length": "62", + //"ua": "duapp/5.37.0(android;10)", + //"Origin": "https://cdn-m.dewu.com", + //"appid": "h5", + "SK": this.sk, + /*"shumeiId": "20240229101108a9d7deaedd9e5e305209da327c58c8fc21a0fe159c45b78d",*/ + /*"deviceTrait": "MI+8+Lite",*/ + "x-auth-token": "Bearer " + this.ck, + /*"Sec-Fetch-Dest": "empty", + "channel": "xiaomi", + "duToken": "d41d8cd9|1630362958|1711360875|4bf085e789d085b0", + "appVersion": "5.37.0", + "emu": "0",*/ + //"cookieToken": "d41d8cd9|1630362958|1711360875|4bf085e789d085b0", + "traceparent": this.generateIds(), + /*"dudeliveryid": "79F073E7555D2BD9490AF2270549ADBABDFE24914A4EEF24D4D5C25559243BDD",*/ + "User-Agent": this.ua, + //"duproductid": "0BC86B71CB9BA08726EDD70256925177BDFE24914A4EEF24D4D5C25559243BDD", + "Content-Type": "application/json", + /*"isRoot": "0", + "imei": "", + "duid": "0BC86B71CB9BA08726EDD70256925177BDFE24914A4EEF24D4D5C25559243BDD", + "platform": "h5", + "isProxy": "0", + */ + /*"X-Requested-With": "com.shizhuang.duapp", + "Sec-Fetch-Site": "same-site", + "Sec-Fetch-Mode": "cors", + "Referer": "https://cdn-m.dewu.com/h5-growth/game-task?gameTaskFlag=true&taskId=Nr52k&taskType=50&countdownIcon=%7B%22countdownIcon%22%3A%22https%3A%2F%2Fcdn.poizon.com%2Fnode-common%2F28c7b3d4060e086551dcc84eca7bfbeb.png%22%2C%22hideCountdownIcon%22%3A%22https%3A%2F%2Fcdn.poizon.com%2Fnode-common%2Fa8b472c7622a53454d82745345cefa71.png%22%2C%22coordinate%22%3A%2212%2C600%22%7D&scrollbarColor=%2301C1C2&fontColor=%23FFFFFF&btd=83500&goodsCollect=goodsDetail&popId=0", + "Accept-Encoding": "gzip, deflate", + "Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",*/ + "Cookie": `duToken=${this.duToken};` + } + const reqeuestOptions = { + url: url, + method: method, + headers: headers + + } + body == "" ? "" : Object.assign(reqeuestOptions, { body: JSON.stringify(body) }) + //console.log(reqeuestOptions) + try { + let { body: result } = await $.httpRequest(reqeuestOptions) + return result + } catch (error) { + // $.log(`接口请求失败 `) + return { code: 0, msg: "接口请求失败" } + } + // + + } + createEncryptedBody(data) { + const key2 = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANMGZPlLobHYWoZyMvHD0a6emIjEmtf5Z6Q++VIBRulxsUfYvcczjB0fMVvAnd1douKmOX4G690q9NZ6Q7z/TV8CAwEAAQ=="; + const publicKeyPem = '-----BEGIN PUBLIC KEY-----\n' + + key2 + + '-----END PUBLIC KEY-----'; + + global["window"] = {} + const jsencrypt = require("jsencrypt") + const crypt = new jsencrypt() + crypt.setKey(publicKeyPem) + const n = this.randomStr(48, 16); + const encrypted = crypt.encrypt(n) + const enBody = CryptoJS.enc.Utf8.parse(data); + const enResult = CryptoJS.AES.encrypt(enBody, CryptoJS.enc.Utf8.parse(n.substr(10, 16)), { + iv: CryptoJS.enc.Utf8.parse(n.substr(20, 16)), + mode: CryptoJS.mode.CBC, + padding: CryptoJS.pad.Pkcs7, + }); + //console.log(encrypted); + //console.log(hexToBase64(encrypted)); + const newBody = { + data: encrypted + "​" + enResult.ciphertext.toString().toUpperCase(), + }; + newBody.sign = this.calculateSign(newBody); + return { enData: newBody, n }; + function hexToBase64(hexString) { + const buffer = Buffer.from(hexString, 'hex'); + const base64String = buffer.toString('base64'); + return base64String; + } + } + randomStr(length, charset) { var tmp1, tmp2, data = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), result = []; if (((charset = charset || data["length"]), length)) for (tmp1 = 0; tmp1 < length; tmp1++)result[tmp1] = data[0 | (Math.random() * charset)]; else for (result[8] = result[13] = result[18] = result[23] = "-", result[14] = "4", tmp1 = 0; tmp1 < 36; tmp1++)result[tmp1] || ((tmp2 = 0 | (16 * Math["random"]())), (result[tmp1] = data[19 === tmp1 ? (3 & tmp2) | 8 : tmp2])); return result["join"]("") } + decryptResponseBody(result, n) { + try { + const de1 = CryptoJS.enc.Hex.parse(result), + de2 = CryptoJS.enc.Base64.stringify(de1); + const decrypted = CryptoJS.AES.decrypt(de2, CryptoJS.enc.Utf8.parse(n.substr(10, 16)), { + iv: CryptoJS.enc.Utf8.parse(n.substr(20, 16)), + mode: CryptoJS.mode.CBC, + padding: CryptoJS.pad.Pkcs7, + }).toString(CryptoJS.enc.Utf8); + return decrypted; + } catch (error) { + n = "987654321012345678901234567890123456789012345678" + const de1 = CryptoJS.enc.Hex.parse(result), + de2 = CryptoJS.enc.Base64.stringify(de1); + const decrypted = CryptoJS.AES.decrypt(de2, CryptoJS.enc.Utf8.parse(n.substr(10, 16)), { + iv: CryptoJS.enc.Utf8.parse(n.substr(20, 16)), + mode: CryptoJS.mode.CBC, + padding: CryptoJS.pad.Pkcs7, + }).toString(CryptoJS.enc.Utf8); + return decrypted; + } + + } + //修复自 修改处理后 空值删除得情况 改为不删除 + calculateSign(requestBody) { const sortedKeys = Object.keys(requestBody).sort(); let signContent = sortedKeys.reduce((acc, key) => { const value = requestBody[key]; if (value === null) { return acc } if (typeof value === 'object' && !Array.isArray(value)) { return acc.concat(key).concat(JSON.stringify(value)) } if (Array.isArray(value)) { if (value.length > 0) { let typeOfFirstItem = typeof value[0]; if (typeOfFirstItem === 'object') { let arrayStr = ''; value.forEach((item, index) => { arrayStr += JSON.stringify(item) + (index !== value.length - 1 ? ',' : '') }); return acc.concat(key).concat(arrayStr) } } return acc.concat(key).concat(value.toString()) } return acc.concat(key).concat(value.toString()) }, ''); const secretKey = "048a9c4943398714b356a696503d2d36"; const hashedContent = CryptoJS.MD5(signContent.concat(secretKey)).toString(); return hashedContent } + + getRandomUA() { + // 生成 iOS 版本号 + const iOSVersion = (Math.floor(Math.random() * (161 - 120) + 120) / 10).toFixed(1); + + // 生成 AppleWebKit 版本号 + const AppleWebKitVersion = `${Math.floor(Math.random() * (605 - 500) + 500)}.${Math.floor(Math.random() * 10)}.${Math.floor(Math.random() * 20)}`; + + // 生成 Mobile 版本号 + const mobileVersion = `${Math.floor(Math.random() * 10)}${String.fromCharCode(65 + Math.floor(Math.random() * 26))}${Math.floor(Math.random() * 10)}`; + + // 生成 User-Agent 字符串 + const userAgent = `Mozilla/5.0 (iPhone; CPU iPhone OS ${iOSVersion} like Mac OS X) AppleWebKit/${AppleWebKitVersion} (KHTML, like Gecko) Mobile/${mobileVersion}/duapp/5.38.6`; + + return userAgent; + } + +} + + + + +!(async () => { + if (!(await checkEnv())) return; + if (userList.length > 0) { + await main() + + } + 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 +} +//Env Api ============================= +/* +* @modifyAuthor @smallfawn +* @modifyTime 2024-03-25 +* @modifyInfo 重写请求函数 在got环境或axios环境都可以请求 删除不必要的函数 +*/ +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; + } + async 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) this.writeFile(this.dataFile, JSON.stringify([])); + const pt = e ? t : s; + let r = await this.readFile(pt); + return r + } + async writedata() { + 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); + const o = JSON.stringify(this.data, null, 2); + const pt = e ? t : i ? s : t; + await writeFile(pt, o) + } + readFile(pt) { + this.fs = this.fs ? this.fs : require("fs"); + return new Promise((resolve, reject) => { + this.fs.readFile(pt, "utf8", (r, o) => { + if (r) reject({}); + else o = this.isJSONString(o) ? JSON.parse(o) : o; + resolve(o); + }); + }); + } + writeFile(pt, o) { + this.fs = this.fs ? this.fs : require("fs"); + return new Promise((resolve, reject) => { + this.fs.writeFile(pt, o, (r) => { + if (r) reject(r); + else resolve(); + }); + }); + } + async 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 = await this.loaddata(); + return await this.data[t]; + } else { + return (this.data && this.data[t]) || null; + } + } + async 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 = await this.loaddata(); + this.data[s] = t; + await this.writedata(); + return true; + } else { + return (this.data && this.data[s]) || null; + } + } + initRequestEnv(t) { + try { + require.resolve("got") && + ((this.requset = require("got")), (this.requestModule = "got")); + } catch (e) { } + try { + require.resolve("axios") && + ((this.requset = require("axios")), (this.requestModule = "axios")); + } catch (e) { } + 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; + } + } + } + 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 ($.isNode()) { + await notify.sendNotify($.name, message); + } else { + $.msg($.name, "", message); + } + } + async httpRequest(options) { + let t = { ...options }; + 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; + } else if (t.method === "post") { + let ContentType; + if (!t.body) { + t.body = ""; + } else if (typeof t.body === "string") { + ContentType = this.isJSONString(t.body) + ? "application/json" + : "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; + } + } + if (this.isNode()) { + this.initRequestEnv(t); + if (this.requestModule === "axios" && t.method === "post") { + t.data = t.body; + delete t.body; + } + let httpResult; + if (this.requestModule === "got") { + httpResult = await this.requset(t); + if (this.isJSONString(httpResult.body)) { + httpResult.body = JSON.parse(httpResult.body); + } + } else if (this.requestModule === "axios") { + httpResult = await this.requset(t); + httpResult.body = httpResult.data; + } + 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); +} diff --git a/微信小程序虔金E站.js b/微信小程序虔金E站.js new file mode 100644 index 0000000..0adea0c --- /dev/null +++ b/微信小程序虔金E站.js @@ -0,0 +1,118 @@ +/* +------------------------------------------ +@Author: sm +@Date: 2024.06.07 19:15 +@Description: 微信小程序虔金E站 每日签到 +------------------------------------------ +变量名qianjin +变量值https://www.xrservice.cn/请求头Headers中Homing-Auth的值 去掉Bearer 多账号&或换行 +[Script] +http-response + +[MITM] +hostname = + +⚠️【免责声明】 +------------------------------------------ +1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 +2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 +3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 +4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 +5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 +6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 +7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 +*/ + +const $ = new Env("微信小程序虔金E站"); +let ckName = `qianjin`; +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 = 0; + //let strSplitor = "#"; + + for (let user of userCookie) { + $.log(`\n🚀 user:【${index || ++index}】 start work\n`); + $.ck = user + //$.ckStatus = false; + await signIn() + } + + await $.sendMsg($.logs.join("\n")); +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); +async function signIn() { + let config = { + method: 'POST', + url: 'https://www.xrservice.cn/rayo-gz-fes-back/blade-signin/signin-user/submit', + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220067 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 miniProgram/wx7bda09dcc9affced', + 'Accept': 'application/json, text/plain, */*', + 'Content-Type': 'application/json', + 'sec-ch-ua': '"Chromium";v="122", "Not(A:Brand";v="24", "Android WebView";v="122"', + 'Homing-Auth': 'Bearer '+$.ck, + 'sec-ch-ua-mobile': '?1', + //'Authorization': 'Basic aG9taW5nLXd4bHA6UEhPU2J6SEVoRWhkRW4xYWlDSmhnYmJadVQ=', + 'sec-ch-ua-platform': '"Android"', + 'Origin': 'https://www.xrservice.cn', + 'X-Requested-With': 'com.tencent.mm', + 'Sec-Fetch-Site': 'same-origin', + 'Sec-Fetch-Mode': 'cors', + 'Sec-Fetch-Dest': 'empty', + 'Referer': 'https://www.xrservice.cn/rayo-gz-fes-h5/', + 'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7' + }, + data: JSON.stringify({}) + }; + let { data: result } = await Request(config); + result?.code == 200 ? $.log(`签到成功`) : $.log(`签到失败`); console.log(JSON.stringify(result)); +} + + +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) { + throw error && error.error ? error.error : "请求失败"; + } + }; + } + if ($.isQuanX()) { + Request = async (options) => { + try { + return await $task.fetch(options); + } catch (error) { + throw error && error.error ? error.error : "请求失败"; + } + }; + } + return await Request(options); +} \ No newline at end of file diff --git a/慕思.js b/慕思.js new file mode 100644 index 0000000..85e49d3 --- /dev/null +++ b/慕思.js @@ -0,0 +1,571 @@ +/** + * 慕思 + * const $ = new Env("慕思"); + * cron 10 6,15 * * * 慕思.js + * 活动入口:https://pic.imgdb.cn/item/64eaffc4661c6c8e54806be6.jpg + * Author by Huansheng1 + * ========= 青龙--配置文件 =========== + * # 项目名称 + * export mshy='api_token#openId' + * 自己抓包 请求头里的 api_token,请求包里的 openId + * 抓包后不要打开小程序避免刷新了token,有效期待测试,如出现 “Token有误” 则是 token过期了请重新抓取 + * 多账号可用 换行、&、@ 符号隔开,支持新建多个同名环境变量来设置多账号 + * 奖励:签到每天得积分,积分兑换实物 + * ==================================== + */ +const $ = new Env("慕思"); +const utils = require("./utils") +let envParams = 'mshy'; + +let envSplitor = ['\n', '@', '&'] + +let processEnvParams = ($.isNode() ? process.env[envParams] : $.getdata(envParams)) || ''; + +let initedJobForTokens = [] +let currentUserIndex = 0 + +class JobTask { + constructor(str) { + this.requestUA = generateRandomUA(); + this.index = ++currentUserIndex + this.valid = false; + try { + [this.activedAuthToken, this.openId] = str; + } catch (error) { + console.log('参数不完整:自己抓包 请求头里的 api_token,请求包里的 openId') + } + } + + async taskApi (fn, method, url, body, moreHeaders = {}) { + let result = null + try { + let urlObject = { + url: url, + headers: { + 'Accept': '*/*', + 'Accept-Language': 'zh-CN,zh', + 'Connection': 'keep-alive', + 'Host': 'atom.musiyoujia.com', + 'Referer': 'https://servicewechat.com/wx03527497c5369a2c/94/page-frame.html', + 'Sec-Fetch-Dest': 'empty', + 'Sec-Fetch-Mode': 'cors', + 'Sec-Fetch-Site': 'cross-site', + 'User-Agent': this.requestUA || '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 XWEB/8379', + 'api_client_code': '65', + 'api_token': this.activedAuthToken, + 'api_version': '1.0.0', + 'xweb_xhr': '1', + 'Content-Type': 'application/json', + ...moreHeaders + }, + timeout: 60000, + } + if (this.requestUA) { + urlObject.headers['User-Agent'] = this.requestUA + } + if (body) { + urlObject.body = body + // urlObject.headers['Content-Length'] = body?.length + } + // console.log('urlObject:', urlObject); + await httpRequest(method, urlObject).then(async (ret) => { + if (ret.resp?.statusCode == 200) { + if (ret.resp?.body) { + result = JSON.parse(ret.resp.body) + } else { + console.log(`账号[${this.index}]调用${method}[${fn}]出错,返回为空`) + } + } else { + console.log(`账号[${this.index}]调用${method}[${fn}]出错,返回状态码[${ret.resp?.statusCode || ''}]`, '返回结果:', ret.resp?.body || ret?.err) + } + }) + } catch (e) { + console.log(e) + } finally { + return Promise.resolve(result); + } + } + + async GetUserInfo () { + try { + let fn = 'GetUserInfo' + let method = 'post' + let url = `https://atom.musiyoujia.com/member/wechatlogin/selectuserinfo`; + const timestamp = new Date().getTime(); + let moreHeaders = { + 'api_timestamp': timestamp, + 'api_sign': utils?.MD5_Encrypt(`api_client_code=65&api_version=1.0.0&api_timestamp=${timestamp}`)?.toUpperCase() + } + let body = `{"appId":"wx03527497c5369a2c","appType":"WECHAT_MINI_PROGRAM","openId":"${this.openId}"}`; + await this.taskApi(fn, method, url, body, moreHeaders).then(async (result) => { + if (result?.msg === "success") { + this.valid = true; + this.customId = result?.data.resMemberInfo.memberId; + console.log(`账号[${this.index}] 查询个人信息成功,积分:${result?.data?.memberInfo?.pointInfo?.point}`) + } else { + console.log(`账号[${this.index}] 查询个人信息失败:${result?.msg || JSON.stringify(result)}`) + this.valid = false + } + }) + } catch (e) { + console.log(e) + } + } + + async GetJob () { + try { + let fn = 'GetJob' + let method = 'post' + let url = `https://atom.musiyoujia.com/member/memberbehavior/getBehaviorInfos`; + let body = `{"appId":"wx03527497c5369a2c","appType":"WECHAT_MINI_PROGRAM","behaviorIds":[1,2,10203,10204,10205,5],"sourceChannel":"会员小程序","source":"${this.customId}","openId":"${this.openId}"}`; + const timestamp = new Date().getTime(); + let moreHeaders = { + 'api_timestamp': timestamp, + 'api_sign': utils?.MD5_Encrypt(`api_token=${this.activedAuthToken}&api_client_code=65&api_version=1.0.0&api_timestamp=${timestamp}`)?.toUpperCase() + } + await this.taskApi(fn, method, url, body, moreHeaders).then(async (result) => { + if (result?.msg === "success") { + this.isSigned = result?.data[0].acts['每天已获得积分次数'] === 1; + console.log(`账号[${this.index}] 获取任务列表成功,${this.isSigned ? '已签到' : '未签到'}`) + } else { + console.log(`账号[${this.index}] 获取任务列表失败:${result?.msg || JSON.stringify(result)}`) + } + }) + } catch (e) { + console.log(e) + } + } + + async Sign () { + try { + let fn = 'Sign' + let method = 'post' + let url = `https://atom.musiyoujia.com/member/memberbehavior/add`; + const currentDate = new Date(); + const year = currentDate.getFullYear(); + const month = currentDate.getMonth() + 1; + const day = currentDate.getDate(); + let body = `{"appId":"wx03527497c5369a2c","appType":"WECHAT_MINI_PROGRAM","osType":"windows","model":"microsoft","browser":"微信小程序","platform":"1","sourceType":"5","sourceChannel":"会员小程序","siteId":"","visitorId":"","deviceId":"","spotId":"","campaignId":"","deviceType":"","eventLabel":"","eventValue":"","eventAttr2":"${`${year}.${month}.${day}`}","eventAttr3":"","eventAttr4":"","eventAttr5":"","eventAttr6":"","googleCampaignName":"","googleCampaignSource":"","googleCampaignMedium":"","googleCampaignContent":"","memberType":"DeRUCCI","customId":"${this.customId}","locationUrl":"/pages/user/signIn","url":"/pages/user/signIn","pageTitle":"每日签到","logType":"event","behaviorIds":[1,3],"eventCategory":"用户签到","eventAction":"签到","eventAttr1":2,"openId":"${this.openId}"}`; + const timestamp = new Date().getTime(); + let moreHeaders = { + 'api_timestamp': timestamp, + 'api_sign': utils?.MD5_Encrypt(`api_token=${this.activedAuthToken}&api_client_code=65&api_version=1.0.0&api_timestamp=${timestamp}`)?.toUpperCase() + } + await this.taskApi(fn, method, url, body, moreHeaders).then(async (result) => { + if (result?.msg === "success") { + console.log(`账号[${this.index}] 签到成功,获得积分:${result?.data?.point}`) + } else { + console.log(`账号[${this.index}] 签到失败:${result?.msg || JSON.stringify(result)}`) + } + }) + } catch (e) { + console.log(e) + } + } + + async doTask () { + try { + console.log(`\n============= 账号[${this.index}] 开始获取任务=============`); + await this.GetJob(); + if (!this.isSigned) { + console.log(`\n============= 账号[${this.index}] 开始执行 签到任务=============`); + await this.Sign(); + } + } catch (e) { + console.log(e) + } + } +} + +!(async () => { + if (typeof $request !== "undefined") { + await GetRewrite() + } else { + if (!(await checkEnv())) return; + + console.log('\n================ 开始执行 ================') + for (let user of initedJobForTokens) { + console.log(`----------- 执行 第 [${user.index}] 个账号 -----------`) + await user.GetUserInfo(); + } + + let validUserList = initedJobForTokens.filter(x => x.valid) + + if (initedJobForTokens.length > 0) { + console.log('\n================ 任务队列构建完毕 ================') + for (let user of initedJobForTokens) { + console.log(`----------- 账号[${user.index}] -----------`) + await user.doTask(); + } + } else { + console.log('\n====幻生提示:无可用账号,请检查配置============ 任务结束 ================') + } + + await $.showmsg(); + } +})() + .catch((e) => console.log(e)) + .finally(() => $.done()) + +async function GetRewrite () { +} + +async function checkEnv () { + if (processEnvParams) { + let splitor = envSplitor[0]; + for (let sp of envSplitor) { + if (processEnvParams.indexOf(sp) > -1) { + splitor = sp; + break; + } + } + for (let token of processEnvParams.split(splitor)) { + if (token) initedJobForTokens.push(new JobTask(token?.split('#'))) + } + userCount = initedJobForTokens.length + } else { + console.log('未找到 配置信息,请检查是否配置 变量:', envParams) + return; + } + + console.log(`共找到${userCount}个账号`) + return true +} + +function generateRandomUA () { + var androidVersion = Math.floor(Math.random() * 6) + 8; // 生成 Android 版本号 8-13 之间的随机数 + var androidModels = [ + "PBBM00", "SM-G975F", "Pixel 4", "OnePlus 7T", "Redmi Note 8 Pro", + "iPhone X", "Galaxy S10", "Huawei P30 Pro", "LG G8 ThinQ", "Sony Xperia 1", + "Moto G7", "Nokia 9 PureView", "Xiaomi Mi 9", "Google Pixel 3a", "OnePlus 6T", + "Redmi Note 7", "Samsung Galaxy A50", "Huawei Mate 20 Pro", "LG V40 ThinQ", "Sony Xperia XZ3", + "Moto Z4", "Nokia 7.1", "Xiaomi Mi Mix 3", "Google Pixel 2", "OnePlus 5T", + "Redmi Note 6 Pro", "Samsung Galaxy A70", "Huawei P20 Pro", "LG G7 ThinQ", "Sony Xperia XZ2", + "Moto G6", "Nokia 6.1", "Xiaomi Mi 8", "Google Pixel", "OnePlus 5", + "Redmi Note 5 Pro", "Samsung Galaxy A30", "Huawei Mate 10 Pro", "LG V30", "Sony Xperia XZ1", + "Moto X4", "Nokia 5.1", "Xiaomi Mi 6", "Google Pixel XL", "OnePlus 3T", + "Redmi Note 4", "Samsung Galaxy A20", "Huawei P10 Plus", "LG G6", "Sony Xperia XZ", + "Moto G5 Plus", "Nokia 3.1", "Xiaomi Mi 5", "Google Pixel 3", "OnePlus 3", + "Redmi Note 3", "Samsung Galaxy A10", "Huawei Mate 9", "LG V20", "Sony Xperia X Compact", + "Moto G4", "Nokia 2.2", "Xiaomi Mi 4", "Google Pixel 2 XL", "OnePlus 2", + "Redmi Note 2", "Samsung Galaxy A5", "Huawei P9", "LG G5", "Sony Xperia X", + "Moto E6", "Nokia 1", "Xiaomi Mi 3", "Google Pixel 4", "OnePlus One", + "Redmi Note", "Samsung Galaxy A3", "Huawei P8", "LG G4", "Sony Xperia Z5", + "Moto E5", "Nokia 3310", "Xiaomi Mi 2", "Google Pixel 4 XL", "OnePlus Nord" + ]; // 常见的手机型号 + + var chromeVersion = "Chrome/" + (Math.floor(Math.random() * 30) + 50) + ".0." + (Math.floor(Math.random() * 1000) + 100); // 生成 Chrome 版本号 50.0.100-79.0.999 之间的随机数 + + var ua = "Mozilla/5.0 (Linux; Android " + androidVersion + "; " + androidModels[Math.floor(Math.random() * androidModels.length)] + " Build/PPR1.180610.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 " + chromeVersion + " Mobile Safari/537.36;xsb_wangchao;xsb_wangchao;5.3.1;native_app"; + + return ua; +} + +// 无参数加密:请求地址+时间戳+A749380BBD5A4D93B55B4BE245A42988+Token +// 示例数据:https://api.ikbang.cn/v2/iclick-new/signIn/sign1692923683034A749380BBD5A4D93B55B4BE245A4298839D21A3B3EFF817154C47470BF13E62CF05F956446D53C359688A094E91A9B1F2A67065862923551F147C32E3AFAF778 +// 如果请求URL有参数则是 在时间戳 和 盐 之间增加 stringify后的参数(POST) + +async function httpRequest (method, url) { + httpErr = null, httpReq = null, httpResp = null; + return new Promise((resolve) => { + $.send(method, url, async (err, req, resp) => { + httpErr = err, httpReq = req, httpResp = resp; + resolve({ err, req, resp }) + }) + }); +} + +function Env (name, env) { + "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); + return new class { + constructor(name, env) { + this.name = name + this.notifyStr = '' + this.startTime = (new Date).getTime() + Object.assign(this, env) + console.log(`${this.name} 开始运行:\n`) + } + 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 + } + 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 + } + send (m, t, e = (() => { })) { + if (m != 'get' && m != 'post' && m != 'put' && m != 'delete') { + console.log(`无效的http方法:${m}`); + return; + } + if (m == 'get' && t.headers) { + delete t.headers["Content-Type"]; + delete t.headers["Content-Length"]; + } else if (t.body && t.headers) { + if (!t.headers["Content-Type"]) t.headers["Content-Type"] = "application/x-www-form-urlencoded"; + } + if (this.isSurge() || this.isLoon()) { + if (this.isSurge() && this.isNeedRewrite) { + t.headers = t.headers || {}; + Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 }); + } + let conf = { + method: m, + url: t.url, + headers: t.headers, + timeout: t.timeout, + data: t.body + }; + if (m == 'get') delete conf.data + $axios(conf).then(t => { + const { + status: i, + request: q, + headers: r, + data: o + } = t; + e(null, q, { + statusCode: i, + headers: r, + body: o + }); + }).catch(err => console.log(err)) + } else if (this.isQuanX()) { + t.method = m.toUpperCase(), this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { + hints: !1 + })), + $task.fetch(t).then(t => { + const { + statusCode: i, + request: q, + headers: r, + body: o + } = t; + e(null, q, { + statusCode: i, + headers: r, + body: o + }) + }, t => e(t)) + } else if (this.isNode()) { + this.got = this.got ? this.got : require("got"); + const { + url: s, + ...i + } = t; + this.instance = this.got.extend({ + followRedirect: false + }); + this.instance[m](s, i).then(t => { + const { + statusCode: i, + request: q, + headers: r, + body: o + } = t; + e(null, q, { + statusCode: i, + headers: r, + body: o + }) + }, t => { + const { + message: s, + request: q, + response: i + } = t; + e(s, q, i) + }) + } + } + time (t, x = null) { + let xt = x ? new Date(x) : new Date + let e = { + "M+": xt.getMonth() + 1, + "d+": xt.getDate(), + "h+": xt.getHours(), + "m+": xt.getMinutes(), + "s+": xt.getSeconds(), + "q+": Math.floor((xt.getMonth() + 3) / 3), + S: xt.getMilliseconds() + }; + /(y+)/.test(t) && (t = t.replace(RegExp.$1, (xt.getFullYear() + "").substr(4 - RegExp.$1.length))); + for (let s in e) + new RegExp("(" + s + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? e[s] : ("00" + e[s]).substr(("" + e[s]).length))); + return t + } + async showmsg () { + if (!this.notifyStr) return; + let notifyBody = this.name + " 运行通知\n\n" + this.notifyStr + if ($.isNode()) { + var notify = require('./sendNotify'); + console.log('\n============== 推送 ==============') + await notify.sendNotify(this.name, notifyBody); + } else { + this.msg(notifyBody); + } + } + logAndNotify (str) { + console.log(str) + this.notifyStr += str + this.notifyStr += '\n' + } + logAndNotifyWithTime (str) { + let t = '[' + this.time('hh:mm:ss.S') + ']' + str + console.log(t) + this.notifyStr += t + this.notifyStr += '\n' + } + logWithTime (str) { + console.log('[' + this.time('hh:mm:ss.S') + ']' + str) + } + 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 + } + } + } + }; + this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))); + let h = ["", "============== 系统通知 =============="]; + h.push(e), + s && h.push(s), + i && h.push(i), + console.log(h.join("\n")) + } + getMin (a, b) { + return ((a < b) ? a : b) + } + getMax (a, b) { + return ((a < b) ? b : a) + } + padStr (num, length, padding = '0') { + let numStr = String(num) + let numPad = (length > numStr.length) ? (length - numStr.length) : 0 + let retStr = '' + for (let i = 0; i < numPad; i++) { + retStr += padding + } + retStr += numStr + return retStr; + } + json2str (obj, c, encodeUrl = false) { + let ret = [] + for (let keys of Object.keys(obj).sort()) { + let v = obj[keys] + if (v && encodeUrl) v = encodeURIComponent(v) + ret.push(keys + '=' + v) + } + return ret.join(c); + } + str2json (str, decodeUrl = false) { + let ret = {} + for (let item of str.split('&')) { + if (!item) continue; + let idx = item.indexOf('=') + if (idx == -1) continue; + let k = item.substr(0, idx) + let v = item.substr(idx + 1) + if (decodeUrl) v = decodeURIComponent(v) + ret[k] = v + } + return ret; + } + randomString (len, charset = 'abcdef0123456789') { + let str = ''; + for (let i = 0; i < len; i++) { + str += charset.charAt(Math.floor(Math.random() * charset.length)); + } + return str; + } + randomList (a) { + let idx = Math.floor(Math.random() * a.length) + return a[idx] + } + wait (t) { + return new Promise(e => setTimeout(e, t)) + } + done (t = {}) { + const e = (new Date).getTime(), + s = (e - this.startTime) / 1e3; + console.log(`\n${this.name} 运行结束,共运行了 ${s} 秒!`) + if (this.isSurge() || this.isQuanX() || this.isLoon()) $done(t) + } + }(name, env) +} \ No newline at end of file diff --git a/所有女生小程序.js b/所有女生小程序.js new file mode 100644 index 0000000..125c8e7 --- /dev/null +++ b/所有女生小程序.js @@ -0,0 +1,217 @@ +/* +------------------------------------------ +@Author: smallfawn 860562056 +@Date: 2024.06.10 14.14 +@Description: 所有女生小程序 +------------------------------------------ +变量名wawo +变量值 https://7.wawo.cc/api/ 域名Headers请求头里面的authorization 去掉bearer 多账号&或换行或新建同名变量 +[Script] +http-response + +[MITM] +hostname = + +⚠️【免责声明】 +------------------------------------------ +1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 +2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 +3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 +4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 +5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 +6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 +7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 +*/ + +const $ = new Env("所有女生会员中心"); +let ckName = `wawo`; +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; + await getPoints() + await signInInfo() + } + + await $.sendMsg($.logs.join("\n")); +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); +async function getPoints() { + const config = + { + url: 'https://7.wawo.cc/api/score/wx/score/queryAmount', + headers: { + "content-type": "application/json", + 'accept': '*/*', + 'accept-language': 'zh-CN,zh;q=0.9', + 'authorization': 'bearer ' + $.token, + 'content-type': 'application/json', + 'sec-fetch-dest': 'empty', + 'sec-fetch-mode': 'cors', + 'sec-fetch-site': 'cross-site', + 'xweb_xhr': '1', + "referer": `https://servicewechat.com/wx7d1403fe84339669/1038/page-frame.html`, + "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` + + } + } + let { data: result } = await Request(config) + + if (result?.code == "000") { + $.log(`账号当前积分[${result.data}]`) + } else { + $.log(`账号积分查询失败[${result.message}]`) + } +} +async function signInInfo() { + const config = + { + url: 'https://7.wawo.cc/api/activity/wx/task/sign/signMsg', + method: "POST", + headers: { + "content-type": "application/json", + 'accept': '*/*', + 'accept-language': 'zh-CN,zh;q=0.9', + 'authorization': 'bearer ' + $.token, + 'content-type': 'application/json', + 'sec-fetch-dest': 'empty', + 'sec-fetch-mode': 'cors', + 'sec-fetch-site': 'cross-site', + 'xweb_xhr': '1', + "referer": `https://servicewechat.com/wx7d1403fe84339669/1038/page-frame.html`, + "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` + + }, + data: JSON.stringify({ + "cardNo": "411886986591633408" + }) + } + let { data: result } = await Request(config) + + if (result?.code == "000") { + if (result.data.signed !== 1) { + $.log(`未签到 ===> 签到ing`) + await signIn() + } else { + $.log(`已签到 ===> 跳过签到`) + } + } else { + $.log(`获取签到信息失败[${result.message}]`) + } +} +async function signIn() { + const config = + { + url: 'https://7.wawo.cc/api/activity/wx/task/sign/signIn', + method: "POST", + headers: { + "content-type": "application/json", + 'accept': '*/*', + 'accept-language': 'zh-CN,zh;q=0.9', + 'authorization': 'bearer ' + $.token, + 'content-type': 'application/json', + 'sec-fetch-dest': 'empty', + 'sec-fetch-mode': 'cors', + 'sec-fetch-site': 'cross-site', + 'xweb_xhr': '1', + "referer": `https://servicewechat.com/wx7d1403fe84339669/1038/page-frame.html`, + "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` + + }, + data: JSON.stringify({}) + } + let { data: result } = await Request(config) + + if (result?.code == "000") { + $.log(`签到成功`) + } else { + $.log(`签到失败[${result.message}]`) + } +} + +async function done(taskId) { + const config = + { + url: 'https://7.wawo.cc/api/operate/wx/rewards/task/done?taskId=' + taskId, + method: "POST", + + headers: { + "content-type": "application/json", + 'accept': '*/*', + 'accept-language': 'zh-CN,zh;q=0.9', + 'authorization': 'bearer ' + $.token, + 'content-type': 'application/json', + 'sec-fetch-dest': 'empty', + 'sec-fetch-mode': 'cors', + 'sec-fetch-site': 'cross-site', + 'xweb_xhr': '1', + "referer": `https://servicewechat.com/wx7d1403fe84339669/1038/page-frame.html`, + "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` + + }, + data: JSON.stringify({ "taskId": taskId }) + } + let { data: result } = await Request(config) + + if (result?.code == "000") { + $.log(`任务成功`) + } 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) { + return error && error.error ? error.error : "请求失败"; + } + }; + } + 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/星火学院新.py b/星火学院新.py new file mode 100644 index 0000000..0cbbd39 --- /dev/null +++ b/星火学院新.py @@ -0,0 +1,13 @@ +''' +复制微信打开:https://mx.qrurl.net/s/24211Mky3iJ +一天一次 +每日任务/签到/学习时长增加 +积分兑换实物卡券 +变量名:xhxy +填入token,多账号换行或& +自行抓包token +自动抓包软群文件有 +''' +project = 'fireAcademy' +import lzma, base64 +exec(lzma.decompress(base64.b64decode('/Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4APbASldADSbSme4Ujxz98E0ClwvVjo94gxrJSFdUXCaQNLKTdOsYdLothMkppmNAscozSJk4tdIc96jCFo3keWoy3EcDTbT1ZSwlKaqPKcVyS4no4oaysCKPQ79xk32HCrwl40UCbK6RnfKil4L4YOYIEUuIcpQoUlOvw1+PX1qdn4C/HrQiwXK31ZFmFqXZAFi3R/ZzruxVdnXMRAHX+2zWVgBxbUL5haj4QC0K/kptlSQDkhXGaUH3e/N6KO+QpKWAhOVw9gDR0jAR0c338RXd2AO4D9scmiI5JV9eQi5/NMhtfW5GlluRWqpsJ71rlMDBjggQVFGtkaJvy9jjfa214dkFEkfU4qdKs8ONZKMTdreCOmVHwIV+XydAmlEfhA0yH5kx/50x5hc2wtXUAAAAABCT7Iye8/dnwABxQLcBwAAHhh9kbHEZ/sCAAAAAARZWg=='))) diff --git a/波司登.js b/波司登.js new file mode 100644 index 0000000..64391f7 --- /dev/null +++ b/波司登.js @@ -0,0 +1,187 @@ +/* +------------------------------------------ +@Author: smallfawn 860562056 +@Date: 2024.06.09 10.04 +@Description: 波司登小程序 每日签到 +------------------------------------------ +变量名bosideng +变量值 抓https://gwuop.bsdits.cn/points-mall/ 请求头Headers中x-access-token的值和 +https://gbpapihost.bsdits.cn/v3/projects/bfe7825ce8dd5cec/collect POST请求中请求体的gioId或deviceId或userId + +两个值拼接# 例如89f...........#o15uuuuu_mf-SSS +多账号&或换行或新建同名变量 +如果找不到第二个值 那么请进入签到页面找到https://gwuop.bsdits.cn/points-mall/front/member/ 开头的 /activities/1/records结尾的 中间的就是第二个值 +[Script] +http-response + +[MITM] +hostname = + +⚠️【免责声明】 +------------------------------------------ +1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 +2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 +3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 +4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 +5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 +6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 +7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 +*/ + +const $ = new Env("波司登小程序"); +let ckName = `bosideng`; +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.split(strSplitor)[0] + $.union_id = user.split(strSplitor)[1] + $.ckStatus = true; + await records() + } + + await $.sendMsg($.logs.join("\n")); +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); +function getTime() { + // 创建Date对象 + const now = new Date(); + // 获取年、月、日、时、分、秒,并格式化为两位数 + const year = now.getFullYear(); + const month = String(now.getMonth() + 1).padStart(2, '0'); // getMonth返回的是0-11,所以需要+1 + const day = String(now.getDate()).padStart(2, '0'); + const hours = String(now.getHours()).padStart(2, '0'); + const minutes = String(now.getMinutes()).padStart(2, '0'); + const seconds = String(now.getSeconds()).padStart(2, '0'); + const timestampStr = `${year}${month}${day}${hours}${minutes}${seconds}`; + return timestampStr + // 调用函数并打印结果 +} +function MD5(data) { + let crypto = require('crypto') + return crypto.createHash('md5').update(data).digest('hex') +} +async function records() { + let time = getTime() + let nonce = $.uuid() + let text = `${$.union_id}${$.token}${time}${nonce}` + let config = { + method: 'GET', + url: `https://gwuop.bsdits.cn/points-mall/front/member/${$.union_id}/activities/1/records`, + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220089 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android', + 'Accept-Encoding': 'gzip,compress,br,deflate', + 'charset': 'utf-8', + 'x-nonce': nonce, + 'x-datadog-sampling-priority': '1', + 'x-timestamp': time, + 'x-datadog-origin': 'rum', + 'bgno': 'BOSIDENG', + 'x-signature': MD5(text).toUpperCase(), + 'content-type': 'application/json', + 'x-login-type': 'MiniProgram', + 'x-access-token': $.token, + 'Referer': 'https://servicewechat.com/wx3f8f90e766e5c545/355/page-frame.html' + } + }; + + let { data: result } = await Request(config) + if (result.code == 200) { + if (result.result.isSigned !== 1) { + $.log(`未签到 ===> 签到ing`) + await signIn() + } else { + $.log(`已签到 ===> 什么都不做`) + } + $.log(`🎉 签到信息查询成功,当前签到${result.result.signedDay}天 本次签到获得积分[${result.result.records[0].rewardPoints}]`) + } else { + $.log(`❌ 签到信息查询失败,原因:${result.message}`) + } +} +async function signIn() { + let data = JSON.stringify({}); + let time = getTime() + let nonce = $.uuid() + let text = `${$.union_id}${$.token}${time}${nonce}` + let config = { + method: 'POST', + url: 'https://gwuop.bsdits.cn/points-mall/front/points/', + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220089 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android', + 'Accept-Encoding': 'gzip,compress,br,deflate', + 'charset': 'utf-8', + 'x-nonce': nonce, + 'x-datadog-sampling-priority': '1', + 'x-timestamp': time, + 'x-datadog-origin': 'rum', + 'bgno': 'BOSIDENG', + 'x-signature': MD5(text).toUpperCase(), + 'content-type': 'application/json', + 'x-login-type': 'MiniProgram', + 'x-access-token': $.token, + 'Referer': 'https://servicewechat.com/wx3f8f90e766e5c545/355/page-frame.html' + }, + data: data + }; + let { data: result } = await Request(config) + if (result.code == 200) { + $.log(result) + $.log(`🎉 签到成功`) + } 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) { + return error && error.error ? error.error : "请求失败"; + } + }; + } + 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 new file mode 100644 index 0000000..2a769f5 --- /dev/null +++ b/海天美味馆.js @@ -0,0 +1,504 @@ +/* +------------------------------------------ +@Author: smallfawn +@Date: 2024.06.11 17:33 +@Description: 海天美味馆小程序 每日签到+ 抽奖(端午)6.27结束 +------------------------------------------ +自己先去抽一次奖 签个到 把新手任务过了 别上来就跑 黑号不管 没写评论 不然一封封一堆 +变量名:haday +变量值 https://cmallapi.haday.cn/buyer-api/ 请求头Headers中的Authorization和uuid #连接 +多账号&或换行或新建同名变量 +[Script] +http-response + +[MITM] +hostname = + +⚠️【免责声明】 +------------------------------------------ +1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 +2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 +3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 +4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 +5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 +6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 +7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 +*/ + +const $ = new Env("海天美味馆小程序"); +let ckName = `haday`; +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.split(strSplitor)[0]; + $.uuid = user.split(strSplitor)[1]; + $.ckStatus = true; + $.activity_code = null + $.canUse = 0 + await getActivityInfo() + await $.wait(3000) + + if ($.activity_code) { + await userInfo() + } + await task_1() + await $.wait(3000) + + await task_2() + await $.wait(3000) + + await lotteryInfo() + await $.wait(3000) + + await getLotteryNum() + for (let i = 0; i < $.canUse; i++) { + await $.wait(3000) + + await lottery() + + } + } + + await $.sendMsg($.logs.join("\n")); +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); +async function getActivityInfo() { + let config = { + url: `https://cmallapi.haday.cn/buyer-api/sign/activity/code?activityCode=`, + method: "GET", + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-CN,zh;q=0.9", + "Authorization": $.token, + "Connection": "keep-alive", + "Content-Type": "application/x-www-form-urlencoded", + "envVersion": "release", + "Host": "cmallapi.haday.cn", + "Referer": "https://servicewechat.com/wx7a890ea13f50d7b6/597/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", + "uuid": $.uuid, + "xweb_xhr": "1" + } + } + let { data: result } = await Request(config) + if (result?.code == 403) { + $.log(`获取活动信息失败,原因:CK可能过期`) + } + if ("activity_code" in result) { + $.log(`获取活动信息成功,活动ID:${result.activity_code}`) + $.activity_code = result.activity_code + } +} +async function signIn() { + let data = { "activity_code": $.activity_code, "fill_date": "" } + let config = { + url: `https://cmallapi.haday.cn/buyer-api/sign/activity/sign`, + method: "POST", + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-CN,zh;q=0.9", + "Authorization": $.token, + "Connection": "keep-alive", + "Content-Type": "application/json", + "envVersion": "release", + "Host": "cmallapi.haday.cn", + "Referer": "https://servicewechat.com/wx7a890ea13f50d7b6/597/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", + "uuid": $.uuid, + "xweb_xhr": "1" + }, + data: JSON.stringify(data) + } + let { data: result } = await Request(config) + if (result.is_sign == true) { + $.log(`签到成功`) + } else { + $.log(`签到失败 [${result.message}]`) + } + +} + +async function userInfo() { + + let config = { + url: `https://cmallapi.haday.cn/buyer-api/sign/activity/member/info?activityCode=${$.activity_code}`, + method: "GET", + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-CN,zh;q=0.9", + "Authorization": $.token, + "Connection": "keep-alive", + "Content-Type": "application/x-www-form-urlencoded", + "envVersion": "release", + "Host": "cmallapi.haday.cn", + "Referer": "https://servicewechat.com/wx7a890ea13f50d7b6/597/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", + "uuid": $.uuid, + "xweb_xhr": "1" + } + } + let { data: result } = await Request(config) + if (result?.is_sign !== true) { + $.log(`${result.member_id}未签到,开始签到`) + await signIn() + } else { + + } + $.log(`当前累计签到[${result.sign_day_num}]`) +} +//浏览页面 +async function task_1() { + let data = {} + let config = { + url: `https://cmallapi.haday.cn/buyer-api/members/browsePage`, + method: "POST", + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-CN,zh;q=0.9", + "Authorization": $.token, + "Connection": "keep-alive", + "Content-Type": "application/json", + "envVersion": "release", + "Host": "cmallapi.haday.cn", + "Referer": "https://servicewechat.com/wx7a890ea13f50d7b6/597/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", + "uuid": $.uuid, + "xweb_xhr": "1" + }, + data: JSON.stringify(data) + } + let { data: result } = await Request(config) + if (result?.code == 200) { + $.log(`浏览界面 操作成功`) + } else { + $.log(`浏览界面 操作失败[${JSON.stringify(result)}]`) + } + +} +//浏览社区 +async function task_2() { + let data = {} + let config = { + url: `https://cmallapi.haday.cn/buyer-api/members/commnity/brosing/duration/add?seconds=100`, + method: "POST", + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-CN,zh;q=0.9", + "Authorization": $.token, + "Connection": "keep-alive", + "Content-Type": "application/json", + "envVersion": "release", + "Host": "cmallapi.haday.cn", + "Referer": "https://servicewechat.com/wx7a890ea13f50d7b6/597/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", + "uuid": $.uuid, + "xweb_xhr": "1" + }, + data: JSON.stringify(data) + } + let { data: result } = await Request(config) + if (result?.statusCode == 200) { + $.log(`浏览社区 操作成功`) + } else { + $.log(`浏览社区 操作失败 貌似是正常的 [${result}]`) + } + +} +async function getLotteryNum() { + let config = { + url: `https://cmallapi.haday.cn/buyer-api/lucky/activity/opporturnity?activityCode=jfcj0527`, + method: "GET", + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-CN,zh;q=0.9", + "Authorization": $.token, + "Connection": "keep-alive", + "Content-Type": "application/json", + "envVersion": "release", + "Host": "cmallapi.haday.cn", + "Referer": "https://servicewechat.com/wx7a890ea13f50d7b6/597/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", + "uuid": $.uuid, + "xweb_xhr": "1" + }, + } + let { data: result } = await Request(config) + if (result.can_use > 0) { + $.canUse = result.can_use + $.log(`当前剩余抽奖次数:${result.can_use}`) + } else { + $.log(`当前剩余抽奖次数0`) + } +} +async function lottery() { + let config = { + url: `https://cmallapi.haday.cn/buyer-api/lucky/activity/extract?activityCode=jfcj0527`, + method: "GET", + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-CN,zh;q=0.9", + "Authorization": $.token, + "Connection": "keep-alive", + "Content-Type": "application/json", + "envVersion": "release", + "Host": "cmallapi.haday.cn", + "Referer": "https://servicewechat.com/wx7a890ea13f50d7b6/597/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", + "uuid": $.uuid, + "xweb_xhr": "1" + }, + } + let { data: result } = await Request(config) + if (result.lucky_record_vo) { + $.log(`抽奖获得:${result.lucky_record_vo.prize_name}`) + } else { + $.log(result.message) + } + +} +async function lotteryInfo() { + let config = { + url: `https://cmallapi.haday.cn/buyer-api/lucky/task/package/jfcj0527`, + method: "GET", + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-CN,zh;q=0.9", + "Authorization": $.token, + "Connection": "keep-alive", + "Content-Type": "application/x-www-form-urlencoded", + "envVersion": "release", + "Host": "cmallapi.haday.cn", + "Referer": "https://servicewechat.com/wx7a890ea13f50d7b6/597/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", + "uuid": $.uuid, + "xweb_xhr": "1" + }, + } + let { data: result } = await Request(config) + if (result?.member_id) { + + for (let i of result.task_list) { + if (i.today_obtained_task_number < i.today_available_task_number) { + if (i.task_key == 'LOGIN') { + await $.wait(3000) + + await lottery_task_login() + } + if (i.task_key == 'POINT_EXCHANGE') { + for (let j = 0; j < i.today_available_task_number; j++) { + await $.wait(3000) + await lottery_task_exchange() + + } + } + if (i.task_key == 'BROWSE_PAGE_TASK') { + await $.wait(3000) + + await lottery_task_see(i.link) + + } + } + + + } + } else { + $.log(`获取抽奖信息 操作失败[${JSON.stringify(result)}]`) + } + +} +//抽奖登录 领取次数 +async function lottery_task_login() { + let data = {} + let config = { + url: `https://cmallapi.haday.cn/buyer-api/lucky/task/getLoginOpporturnity/jfcj0527`, + method: "PUT", + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-CN,zh;q=0.9", + "Authorization": $.token, + "Connection": "keep-alive", + "Content-Type": "application/json", + "envVersion": "release", + "Host": "cmallapi.haday.cn", + "Referer": "https://servicewechat.com/wx7a890ea13f50d7b6/597/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", + "uuid": $.uuid, + "xweb_xhr": "1" + }, + data: JSON.stringify(data) + } + let { data: result } = await Request(config) + $.log(result) + +} +async function lottery_task_exchange() { + let config = { + url: `https://cmallapi.haday.cn/buyer-api/lucky/activity/redeem?activityCode=jfcj0527`, + method: "GET", + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-CN,zh;q=0.9", + "Authorization": $.token, + "Connection": "keep-alive", + "Content-Type": "application/json", + "envVersion": "release", + "Host": "cmallapi.haday.cn", + "Referer": "https://servicewechat.com/wx7a890ea13f50d7b6/597/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", + "uuid": $.uuid, + "xweb_xhr": "1" + }, + } + let { data: result } = await Request(config) + if (result?.member_id) { + $.log(`兑换次数成功`) + + } else { + $.log(`兑换次数失败`) + $.log(result) + } + +} +//浏览页面 +async function lottery_task_see(link) { + let config_start = { + url: `https://cmallapi.haday.cn/buyer-api/lucky/task/browse/page/start/jfcj0527?pageUrl=${link}`, + method: "GET", + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-CN,zh;q=0.9", + "Authorization": $.token, + "Connection": "keep-alive", + "Content-Type": "application/json", + "envVersion": "release", + "Host": "cmallapi.haday.cn", + "Referer": "https://servicewechat.com/wx7a890ea13f50d7b6/597/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", + "uuid": $.uuid, + "xweb_xhr": "1" + }, + } + let { data: result_start } = await Request(config_start) + let config_end = { + url: `https://cmallapi.haday.cn/buyer-api/lucky/task/browse/page/start/jfcj0527?pageUrl=${link}`, + method: "GET", + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-CN,zh;q=0.9", + "Authorization": $.token, + "Connection": "keep-alive", + "Content-Type": "application/json", + "envVersion": "release", + "Host": "cmallapi.haday.cn", + "Referer": "https://servicewechat.com/wx7a890ea13f50d7b6/597/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", + "uuid": $.uuid, + "xweb_xhr": "1" + }, + } + let { data: result_end } = await Request(config_end) + $.log(`浏览页面完成`) +} + + +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) { + return error && error.error ? error.error : "请求失败"; + } + }; + } + 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 new file mode 100644 index 0000000..3407c99 --- /dev/null +++ b/潇洒桐庐.js @@ -0,0 +1,448 @@ +/** + * cron 5 15 * * * V3.js + * Show: 每天0.6 + * 变量名:账号密码 + * 变量值: + * scriptVersionNow = "0.0.1"; + */ + +const $ = new Env("潇洒桐庐"); +const notify = $.isNode() ? require("./sendNotify") : ""; +let ckName = "xiaosa"; +let envSplitor = ["@", "\n"]; //多账号分隔符 +let strSplitor = "&"; //多变量分隔符 +let userIdx = 0; +let userList = []; +class UserInfo { + constructor(str) { + this.index = ++userIdx; + //this.ck = str.split(strSplitor)[0]; //单账号多变量分隔符 + this.ckStatus = true; + this.artList = [] + this.accountId = null; + this.sessionId = null; + this.channelId = [`6530daf779f6be358bba1522`, `6530dae171a9ed74577e4689`, `6530db1e71a9ed74577e468e`]; + this.round = 1; + this.num = null; + this.mobile = str.split(strSplitor)[0]; + this.password = str.split(strSplitor)[1]; + this.code = null; + this.username = null; + this.wxopenId = null; + //定义在这里的headers会被get请求删掉content-type 而不会重置 + } + + async main() { + $.log(`------开始${this.mobile}------`) + await this.getCode() + if (this.code !== null) { + await this.login() + if (this.accountId !== null && this.sessionId !== null) { + await this.user_info() + if (this.wxopenId !== "" && this.wxopenId !== null) { + await this.art_list(this.channelId[0]); + this.round = 1; + if (this.artList.length == 0) { + await this.art_list(this.channelId[1]); + this.round = 2; + } + if (this.artList.length == 0) { + await this.art_list(this.channelId[2]); + this.round = 3; + } + + if (this.artList.length !== 0) { + this.num = this.artList.length + for (let artId of this.artList) { + await this.read_status(artId) + if (this.artReadStatus == true) { + console.log(`已阅读${artId}`) + await this.read_task(artId) + } else if (this.artReadStatus == false) { + console.log(`未阅读${artId}`) + await this.do_read(artId) + await $.wait(5000) + await this.read_task(artId) + } + } + await this.lottery_num() + } + + } else { + $.log(`未绑定微信`) + } + //await this.lottery_task() + + } + } + + + } + async getCode() { + try { + let options = { + fn: "获取登录code", + method: "post", + url: `https://passport.tmuyun.com/web/oauth/credential_auth`, + headers: { + 'Host': 'passport.tmuyun.com', + 'Content-Type': 'application/x-www-form-urlencoded', + 'Accept-Encoding': 'gzip, deflate, br' + }, + body: `client_id=10017&password=${encodeURIComponent(this.rsa_encrypt(this.password))}&phone_number=${this.mobile}` + }; + let { body: result } = await httpRequest(options); + //console.log(options); + result = JSON.parse(result); + //console.log(result); + if (result.code == 0) { + //console.log(result.data.authorization_code.code) + this.code = result.data.authorization_code.code + } else { + + } + } catch (e) { + console.log(e); + } + } + async login() { + try { + let host_data = `/api/zbtxz/login` + let REQUEST_ID = this.getUUID(); + let TIMESTAMP = Date.now(); + let s = `${host_data}&&6565886da95d5a47f651317f&&${REQUEST_ID}&&${TIMESTAMP}&&FR*r!isE5W&&59` + //console.log(s) + let SIGNATURE = this.SHA256_Encrypt(s) + let options = { + fn: "登录", + method: 'post', + url: `https://vapp.tmuyun.com/api/zbtxz/login`, + headers: { + 'X-SESSION-ID': `6565886da95d5a47f651317f`, + 'X-REQUEST-ID': REQUEST_ID, + 'X-TIMESTAMP': TIMESTAMP, + 'X-SIGNATURE': SIGNATURE, + 'X-TENANT-ID': `59`, + 'User-Agent': '1.1.9;00000000-67f7-45bf-ffff-ffffa7397b83;Xiaomi MI 8 Lite;Android;10;Release', + 'Cache-Control': 'no-cache', + Host: 'vapp.tmuyun.com', + Connection: 'Keep-Alive', + }, + body: `check_token=&code=${this.code}&token=&type=-1&union_id=` + }; + let { body: result } = await httpRequest(options); + //console.log(options); + result = JSON.parse(result); + //console.log(result) + if (result.code == 0) { + this.sessionId = result.data.session.id + this.accountId = result.data.session.account_id + this.username = result.data.account.nick_name + } else { + + } + } catch (e) { + console.log(e); + } + } + async user_info() { + try { + let options = { + fn: "信息查询", + method: "get", + url: `https://wxapi.hoolo.tv/event/dtqp/index.php?s=/home/TmApi/getUserInformation&accountId=${this.accountId}&username=${encodeURIComponent(this.username)}&type=jsonp`, + headers: this.get_headers(), + }; + let { body: result } = await httpRequest(options); + //console.log(options); + result = JSON.parse(result); + //console.log(result); + if (result.code == 0) { + this.wxopenId = result.data.userid + } else { + console.log(`❌[${options.fn}]失败`); + console.log(JSON.stringify(result)); + } + } catch (e) { + console.log(e); + } + } + async read_status(articleId) { + try { + let options = { + fn: "阅读状态", + method: "get", + url: `https://wxapi.hoolo.tv/event/dtqp/index.php?s=/home/TmApi/getUserRead&accountId=${this.accountId}&articleId=${articleId}&type=jsonp`, + headers: this.get_headers(), + }; + let { body: result } = await httpRequest(options); + //console.log(options); + result = JSON.parse(result); + //console.log(result); + if (result.read_effective == 1) { + this.artReadStatus = true; + await this.read_task(articleId) + } else if (result.read_effective == 0) { + this.artReadStatus = false; + } else { + console.log(`❌[${options.fn}]失败`); + console.log(JSON.stringify(result)); + } + } catch (e) { + //console.log(e); + } + } + async read_task(articleId) { + try { + let options = { + fn: "阅读执行", + method: "get", + url: `https://wxapi.hoolo.tv/event/dtqp/index.php?s=home/baoming/postBaoming/&activityId=428&name=${this.accountId}&city=${articleId}&gender=${this.round}&cellphone=${this.mobile}&type=jsonp`, + headers: this.get_headers(), + }; + let { body: result } = await httpRequest(options); + //console.log(options); + result = JSON.parse(result); + //console.log(result); + if (result.code == 0) { + //console.log(`✅阅读回调成功🎉`); + } else { + console.log(`❌[${options.fn}]失败`); + console.log(JSON.stringify(result)); + } + } catch (e) { + console.log(e); + } + } + + async lottery_num() { + try { + let options = { + fn: "抽奖查询", + method: "get", + url: `https://wxapi.hoolo.tv/event/dtqp/index.php?s=/home/TmApi/addPrizenum&accountId=${this.accountId}&round=${this.round}&num=${this.num}&type=jsonp`, + headers: this.get_headers(), + }; + let { body: result } = await httpRequest(options); + //console.log(options); + result = JSON.parse(result); + console.log(result); + if (result.code == "0") { + //console.log(`✅账号[${this.index}] 欢迎用户: ${result.errcode}🎉`); + $.log(`✅可以抽奖咯!🎉`); + await this.lottery_task() + } else { + console.log(`❌[${options.fn}]失败`); + console.log(JSON.stringify(result)); + } + } catch (e) { + console.log(e); + } + } + + async lottery_task() { + let expando = "jQuery" + ("1.7.1" + Math.random()).replace(/\D/g, ""); + let time1 = new Date().getTime(); + let time2 = new Date().getTime(); + try { + let options = { + fn: "执行抽奖", + method: "get", + url: `https://wxapi.hoolo.tv/event/dtqp/index.php?s=/Home/ChoujiangNew/apiChoujiang&callback=${expando}_${time1}&openId=${this.accountId}&action=cj&typeId=122&address=&userid=${this.wxopenId}&_=${time2}`, + headers: this.get_headers(), + }; + let { body: result } = await httpRequest(options); + //console.log(options); + //result = JSON.parse(result); + result = result.replace(`${expando}_${time1}`, "") + result = result.replace(`(`, "") + result = result.replace(`)`, "") + result = JSON.parse(result) + $.log(JSON.stringify(result)) + } catch (e) { + console.log(e); + } + } + // + + async art_list(channelId) { + try { + let options = { + fn: "文章列表", + method: "get", + url: `https://wxapi.hoolo.tv/event/dtqp/index.php?s=/home/TmApi/channelList&channelId=${channelId}&userId=${this.accountId}&sessionId=${this.sessionId}`, + headers: this.get_headers(), + }; + //console.log(options); + let { body: result } = await httpRequest(options); + //console.log(options); + //console.log(result); + result = JSON.parse(result); + //console.log(result); + for (let art of result) { + //console.log(art.id) + this.artList.push(art.id) + } + + } catch (e) { + console.log(e); + } + } + getUUID() { + 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); + }); + } + SHA256_Encrypt(str) { + const crypto = require('crypto'); + return crypto.createHash("sha256").update(str).digest('hex'); + } + async do_read(articleId) { + let host_data = `/api/article/detail` + let REQUEST_ID = this.getUUID(); + let TIMESTAMP = Date.now(); + let s = `${host_data}&&${this.sessionId}&&${REQUEST_ID}&&${TIMESTAMP}&&FR*r!isE5W&&59` + let SIGNATURE = this.SHA256_Encrypt(s) + let options = { + fn: "阅读文章", + method: 'get', + url: `https://vapp.tmuyun.com/api/article/detail?id=${articleId}`, + headers: { + 'X-SESSION-ID': `${this.sessionId}`, + 'X-REQUEST-ID': REQUEST_ID, + 'X-TIMESTAMP': TIMESTAMP, + 'X-SIGNATURE': SIGNATURE, + 'X-TENANT-ID': `59`, + 'User-Agent': '1.1.9;00000000-67f7-45bf-ffff-ffffa7397b83;Xiaomi MI 8 Lite;Android;10;Release', + 'Cache-Control': 'no-cache', + Host: 'vapp.tmuyun.com', + Connection: 'Keep-Alive', + } + }; + try { + + let { body: result } = await httpRequest(options); + //console.log(options); + result = JSON.parse(result); + //console.log(result); + if (result.code == "0") { + console.log(`阅读成功`) + } + + } catch (e) { + console.log(e); + } + } + rsa_encrypt(data) { + //创建RSA加密对象 + global["window"] = {} + const JSEncrypt = require("jsencrypt") + var encrypt = new JSEncrypt(); + //设置公钥 + var publicKey = "-----BEGIN PUBLIC KEY-----\n" + + "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD6XO7e9YeAOs+cFqwa7ETJ+WXizPqQeXv68i5vqw9pFREsrqiBTRcg7wB0RIp3rJkDpaeVJLsZqYm5TW7FWx/iOiXFc+zCPvaKZric2dXCw27EvlH5rq+zwIPDAJHGAfnn1nmQH7wR3PCatEIb8pz5GFlTHMlluw4ZYmnOwg+thwIDAQAB\n" + + "-----END PUBLIC KEY-----"; + encrypt.setPublicKey(publicKey); + + //使用公钥进行加密 + return encrypt.encrypt(data); + } + get_headers() { + return { + 'Host': 'wxapi.hoolo.tv', + 'Accept': 'application/json, text/javascript, /; q=0.01', + '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/81.0.4044.138 Mobile Safari/537.36;xsb_xiaosatonglu;xsb_xiaosatonglu;1.0.60;native_app;6.5.1', + 'Origin': 'https://tp.hoolo.tv', + 'X-Requested-With': 'com.chinamcloud.wangjie.b87d8fb20e29a0328c6e21045e8b500e', + 'Sec-Fetch-Site': 'same-site', + 'Sec-Fetch-Mode': 'cors', + 'Sec-Fetch-Dest': 'empty', + 'Referer': 'https://tp.hoolo.tv/h5/tlread/index.html', + 'Accept-Encoding': 'gzip, deflate', + 'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7' + } + + } +} + +async function start() { + let taskall = []; + for (let user of userList) { + if (user.ckStatus) { + taskall.push(await user.main()); + } + } + await Promise.all(taskall); +} + +!(async () => { + if (!(await checkEnv())) return; + if (userList.length > 0) { + await start(); + } + await SendMsg($.logs.join("\n")); +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); + +//******************************************************** +/** + * 变量检查与处理 + * @returns + */ +async function checkEnv() { + //let userCookie = ($.isNode() ? process.env[ckName] : $.getdata(ckName)) || ""; + 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 UserInfo(n)); + } else { + console.log("未找到CK"); + return; + } + return console.log(`共找到${userList.length}个账号`), true; //true == !0 +} + +///////////////////////////////////////////////////////////////////////////////////// +function httpRequest(options) { + if (!options["method"]) { + return console.log(`请求方法不存在`); + } + if (!options["fn"]) { + console.log(`函数名不存在`); + } + return new Promise((resolve) => { + $[options.method](options, (err, resp, data) => { + try { + if (err) { + $.logErr(err); + } else { + try { + resp = JSON.parse(resp); + } catch (error) { } + } + } catch (e) { + $.logErr(e, resp); + } finally { + resolve(resp); + } + }); + }); +} +async function SendMsg(message) { + if (!message) return; + if ($.isNode()) { + await notify.sendNotify($.name, message); + } else { + $.msg($.name, "", message); + } +} +// prettier-ignore +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 } getScript(t) { return new Promise((s) => { this.get({ url: t }, (t, e, i) => s(i)) }) } runScript(t, s) { return new Promise((e) => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let o = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); (o = o ? 1 * o : 20), (o = s && s.timeout ? s.timeout : o); const [h, a] = i.split("@"), r = { url: `http://${a}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: o }, headers: { "X-Key": h, Accept: "*/*" }, }; this.post(r, (t, s, i) => e(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), 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.fs.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) { 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, s) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, s) : this.isQuanX() ? $prefs.setValueForKey(t, s) : this.isNode() ? ((this.data = this.loaddata()), (this.data[s] = t), this.writedata(), !0) : (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()), t && ((t.headers = t.headers ? t.headers : {}), void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, s = () => { }) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? $httpClient.get(t, (t, e, i) => { !t && e && ((e.body = i), (e.statusCode = e.status)), s(t, e, i) }) : this.isQuanX() ? $task.fetch(t).then((t) => { const { statusCode: e, statusCode: i, headers: o, body: h } = t; s(null, { status: e, statusCode: i, headers: o, body: h }, h) }, (t) => s(t)) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, s) => { try { const e = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); this.ckjar.setCookieSync(e, null), (s.cookieJar = this.ckjar) } catch (t) { this.logErr(t) } }).then((t) => { const { statusCode: e, statusCode: i, headers: o, body: h, } = t; s(null, { status: e, statusCode: i, headers: o, body: h }, h) }, (t) => s(t))) } post(t, s = () => { }) { if ((t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), delete t.headers["Content-Length"], this.isSurge() || this.isLoon())) $httpClient.post(t, (t, e, i) => { !t && e && ((e.body = i), (e.statusCode = e.status)), s(t, e, i) }); else if (this.isQuanX()) (t.method = "POST"), $task.fetch(t).then((t) => { const { statusCode: e, statusCode: i, headers: o, body: h } = t; s(null, { status: e, statusCode: i, headers: o, body: h }, h) }, (t) => s(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: e, ...i } = t; this.got.post(e, i).then((t) => { const { statusCode: e, statusCode: i, headers: o, body: h } = t; s(null, { status: e, statusCode: i, headers: o, body: h }, h) }, (t) => s(t)) } } 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(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } })(t, s) } diff --git a/爱奇艺会员.js b/爱奇艺会员.js new file mode 100644 index 0000000..8efdd25 --- /dev/null +++ b/爱奇艺会员.js @@ -0,0 +1,555 @@ +/* +爱奇艺会员签到脚本 + +更新时间: 2024/05/15 +脚本兼容: QuantumultX, Surge4, Loon, JsBox, Node.js +电报频道: @NobyDa +问题反馈: @NobyDa_bot + +获取Cookie说明: +Safari浏览器打开 https://m.iqiyi.com/user.html 使用密码登录, 如通知成功获取cookie则可使用该脚本. +获取Cookie后, 请将Cookie脚本禁用并移除主机名,以免产生不必要的MITM. +脚本将在每天上午9:00执行, 您可以修改执行时间。 + +如果使用Node.js, 需自行安装'request'模块. 例: npm install request -g + +Node.js环境变量相关: +Cookie:IQIYI_COOKIE +Debug调试:IQIYI_DEBUG +Bark通知推送Key:BARK_PUSH +Bark服务端(默认官方):BARK_SERVER + +JsBox, Node.js用户获取Cookie说明: +方法一手机:开启抓包, 网页登录 https://m.iqiyi.com/user.html 返回抓包APP搜索URL关键字 apis/user/info.action 复制请求头中的Cookie字段填入以下脚本变量或环境变量中即可 + +方法二PC:网页登录 https://www.iqiyi.com 按F12控制台执行 console.log(document.cookie) 复制打印的Cookie填入以下脚本变量或环境变量中即可 +*/ + +var cookie = ''; //单引号内填入手动获取的Cookie + +var barkKey = ''; //Bark APP 通知推送Key + +var barkServer = ''; //Bark APP 通知服务端地址(默认官方) + +/********************* +QuantumultX 远程脚本配置: +********************** +[task_local] +# 爱奇艺会员签到 +0 9 * * * https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js + +[rewrite_local] +# 获取Cookie +^https:\/\/passport\.iqiyi\.com\/apis\/user\/ url script-request-header https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js + +[mitm] +hostname= passport.iqiyi.com + +********************** +Surge 4.2.0+ 脚本配置: +********************** +[Script] +爱奇艺签到 = type=cron,cronexp=0 9 * * *,timeout=120,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js + +爱奇艺获取Cookie = type=http-request,pattern=^https:\/\/passport\.iqiyi\.com\/apis\/user\/,script-path=https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js + +[MITM] +hostname= passport.iqiyi.com + +************************ +Loon 2.1.0+ 脚本配置: +************************ + +[Script] +# 爱奇艺签到 +cron "0 9 * * *" script-path=https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js + +# 获取Cookie +http-request ^https:\/\/passport\.iqiyi\.com\/apis\/user\/ script-path=https://raw.githubusercontent.com/NobyDa/Script/master/iQIYI-DailyBonus/iQIYI.js + +[Mitm] +hostname= passport.iqiyi.com + +*/ + +var LogDetails = false; // 响应日志 + +var pushMsg = []; + +let P00001, P00003, DFP + +var $nobyda = nobyda(); + +(async () => { + cookie = cookie || $nobyda.read("CookieQY") + LogDetails = $nobyda.read("iQIYI_LogDetails") === "true" ? true : LogDetails + if (typeof process !== 'undefined' && typeof process.env !== 'undefined') { + cookie = cookie || process.env.IQIYI_COOKIE; + LogDetails = LogDetails || process.env.IQIYI_DEBUG; + barkKey = barkKey || process.env.BARK_PUSH; + barkServer = barkServer || process.env.BARK_SERVER; + } + if ($nobyda.isRequest) { + GetCookie() + } else if (cookie) { + if (cookie.includes("P00001") && cookie.includes("P00003") && cookie.includes("__dfp=")) { + P00001 = cookie.match(/P00001=(.*?);/)[1]; + P00003 = cookie.match(/P00003=(.*?);/)[1]; + DFP = cookie.match(/__dfp=(\w+)/)[1]; + await login(); + await Checkin(); + for (let i = 0; i < 3; i++) { + const run = await Lottery(i); + if (run) { + await new Promise(r => setTimeout(r, 1000)); + } else { + break + } + } + const tasks = await getTaskList(); + for (let i = 0; i < tasks.length; i++) { + if (![1, 4].includes(tasks[i].status)) { //0:待领取 1:已完成 2:未开始 4:进行中 + await joinTask(tasks[i]); + await notifyTask(tasks[i]); + await new Promise(r => setTimeout(r, 1000)); + await getTaskRewards(tasks[i]); + console.log(`--------------------`) + } + } + const expires = $nobyda.expire ? $nobyda.expire.replace(/\u5230\u671f/, "") : "获取失败 ⚠️" + if (!$nobyda.isNode) $nobyda.notify("爱奇艺", "到期时间: " + expires, pushMsg.join('\n')); + if (barkKey) await BarkNotify($nobyda, barkKey, '爱奇艺', `到期时间: ${expires}\n${pushMsg.join('\n')}`, barkServer); + await $nobyda.time(); + } else { + console.log(`Cookie缺少关键值,需重新获取`) + } + } else { + $nobyda.notify("爱奇艺会员", "", "签到终止, 未获取Cookie"); + } +})().finally(() => { + $nobyda.done(); +}) + +function login() { + return new Promise(resolve => { + var URL = { + url: 'https://cards.iqiyi.com/views_category/3.0/vip_home?secure_p=iPhone&scrn_scale=0&dev_os=0&ouid=0&layout_v=6&psp_cki=' + P00001 + '&page_st=suggest&app_k=8e48946f144759d86a50075555fd5862&dev_ua=iPhone8%2C2&net_sts=1&cupid_uid=0&xas=1&init_type=6&app_v=11.4.5&idfa=0&app_t=0&platform_id=0&layout_name=0&req_sn=0&api_v=0&psp_status=0&psp_uid=451953037415627&qyid=0&secure_v=0&req_times=0', + headers: { + sign: '7fd8aadd90f4cfc99a858a4b087bcc3a', + t: '479112291' + } + } + $nobyda.get(URL, function (error, response, data) { + const Details = LogDetails ? data ? `response:\n${data}` : '' : '' + if (!error && data.match(/\"text\":\"\d.+?\u5230\u671f\"/)) { + $nobyda.expire = data.match(/\"text\":\"(\d.+?\u5230\u671f)\"/)[1] + console.log(`爱奇艺-查询成功: ${$nobyda.expire} ${Details}`) + } else { + console.log(`爱奇艺-查询失败${error || ': 无到期数据 ⚠️'} ${Details}`) + } + resolve() + }) + }) +} + +function Checkin() { + const timestamp = new Date().getTime(); + const stringRandom = (length) => { + var rdm62, ret = ''; + while (length--) { + rdm62 = 0 | Math.random() * 62; + ret += String.fromCharCode(rdm62 + (rdm62 < 10 ? 48 : rdm62 < 36 ? 55 : 61)) + } + return ret; + }; + return new Promise(resolve => { + const sign_date = { + task_code: 'natural_month_sign', + timestamp: timestamp, + appKey: 'lequ_rn', + userId: P00003, + authCookie: P00001, + agenttype: 20, + agentversion: '15.4.6', + srcplatform: 20, + appver: '15.4.6', + qyid: md5(stringRandom(16)) + }; + + const post_date = { + "natural_month_sign": { + "verticalCode": "iQIYI", + "agentVersion": "15.4.6", + "authCookie": P00001, + "taskCode": "iQIYI_mofhr", + "dfp": DFP, + "qyid": md5(stringRandom(16)), + "agentType": 20, + "signFrom": 1 + } + }; + const sign = k("cRcFakm9KSPSjFEufg3W", sign_date, { + split: "|", + sort: !0, + splitSecretKey: !0 + }); + var URL = { + url: 'https://community.iqiyi.com/openApi/task/execute?' + w(sign_date) + "&sign=" + sign, + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(post_date) + } + $nobyda.post(URL, function (error, response, data) { + let CheckinMsg, rewards = []; + const Details = LogDetails ? `msg:\n${data || error}` : ''; + try { + if (error) throw new Error(`接口请求出错 ‼️`); + const obj = JSON.parse(data) + if (obj.code === "A00000") { + if (obj.data.code === "A0000") { + for (let i = 0; i < obj.data.data.rewards.length; i++) { + if (obj.data.data.rewards[i].rewardType == 1) { + rewards.push(`成长值+${obj.data.data.rewards[i].rewardCount}`) + } else if (obj.data.data.rewards[i].rewardType == 2) { + rewards.push(`VIP天+${obj.data.data.rewards[i].rewardCount}`) + } else if (obj.data.data.rewards[i].rewardType == 3) { + rewards.push(`积分+${obj.data.data.rewards[i].rewardCount}`) + } + } + var continued = obj.data.data.signDays; + CheckinMsg = `应用签到: ${rewards.length ? `${rewards.join(", ")}${rewards.length < 3 ? `, 累计签到${continued}天` : ``}` : '无奖励'} 🎉`; + } else { + CheckinMsg = `应用签到: ${obj.data.msg} ⚠️`; + } + } else { + CheckinMsg = `应用签到: Cookie无效 ⚠️`; + } + } catch (e) { + CheckinMsg = `应用签到: ${e.message || e}`; + } + pushMsg.push(CheckinMsg); + console.log(`爱奇艺-${CheckinMsg} ${Details}`); + resolve() + }) + }) +} + +function Lottery(s) { + return new Promise(resolve => { + const URL = { + url: 'https://iface2.iqiyi.com/aggregate/3.0/lottery_activity?app_k=0&app_v=0&platform_id=0&dev_os=0&dev_ua=0&net_sts=0&qyid=0&psp_uid=0&psp_cki=' + P00001 + '&psp_status=0&secure_p=0&secure_v=0&req_sn=0' + } + $nobyda.get(URL, async function (error, response, data) { + const Details = LogDetails ? `msg:\n${data || error}` : '' + let LotteryMsg; + try { + if (error) throw new Error("接口请求出错 ‼️"); + const obj = JSON.parse(data); + if (obj.title) { + LotteryMsg = `应用抽奖: ${obj.title != '影片推荐' && obj.awardName || '未中奖'} 🎉`; + LotteryMsg = obj.kv.code == 'Q00702' && `应用抽奖: 您的抽奖次数已经用完 ⚠️` || LotteryMsg; + $nobyda.stop = obj.kv.code == 'Q00702'; + } else if (obj.kv.code == 'Q00304') { + LotteryMsg = `应用抽奖: Cookie无效 ⚠️`; + $nobyda.stop = 1; + } else { + LotteryMsg = `应用抽奖: 未知错误 ⚠️` + } + } catch (e) { + LotteryMsg = `应用抽奖: ${e.message || e}`; + } + console.log(`爱奇艺-${LotteryMsg} (${s + 1}) ${Details}`) + pushMsg.push(LotteryMsg) + resolve(!$nobyda.stop) + }) + }) +} + +function getTaskList(task) { + return new Promise(resolve => { + $nobyda.get(`https://tc.vip.iqiyi.com/taskCenter/task/queryUserTask?P00001=${P00001}`, function (error, response, data) { + let taskListMsg, taskList = []; + const Details = LogDetails ? `msg:\n${data || error}` : ''; + try { + if (error) throw new Error(`请求失败`); + const obj = JSON.parse(data); + if (obj.code == 'A00000' && obj.data && obj.data.tasks) { + Object.keys(obj.data.tasks).map((group) => { + (obj.data.tasks[group] || []).map((item) => { + taskList.push({ + name: item.taskTitle, + taskCode: item.taskCode, + status: item.status + }) + }) + }) + taskListMsg = `获取成功!`; + } else { + taskListMsg = `获取失败!`; + } + } catch (e) { + taskListMsg = `${e.message || e} ‼️`; + } + console.log(`爱奇艺-任务列表: ${taskListMsg} ${Details}`) + resolve(taskList) + }) + }) +} + +function joinTask(task) { + return new Promise(resolve => { + $nobyda.get('https://tc.vip.iqiyi.com/taskCenter/task/joinTask?taskCode=' + task.taskCode + '&lang=zh_CN&platform=0000000000000000&P00001=' + P00001, function (error, response, data) { + let joinTaskMsg, Details = LogDetails ? `msg:\n${data || error}` : ''; + try { + if (error) throw new Error(`请求失败`); + const obj = JSON.parse(data); + joinTaskMsg = obj.code || '领取失败'; + } catch (e) { + joinTaskMsg = `错误 ${e.message || e}`; + } + console.log(`爱奇艺-领取任务: ${task.name} => ${joinTaskMsg} ${Details}`) + resolve() + }) + }) +} + +function notifyTask(task) { + return new Promise(resolve => { + $nobyda.get('https://tc.vip.iqiyi.com/taskCenter/task/notify?taskCode=' + task.taskCode + '&lang=zh_CN&platform=0000000000000000&P00001=' + P00001, function (error, response, data) { + let notifyTaskMsg, Details = LogDetails ? `msg:\n${data || error}` : ''; + try { + if (error) throw new Error(`请求失败`); + const obj = JSON.parse(data); + notifyTaskMsg = obj.code || '失败'; + } catch (e) { + notifyTaskMsg = e.message || e; + } + console.log(`爱奇艺-开始任务: ${task.name} => ${notifyTaskMsg} ${Details}`) + resolve() + }) + }) +} + +function getTaskRewards(task) { + return new Promise(resolve => { + $nobyda.get('https://tc.vip.iqiyi.com/taskCenter/task/getTaskRewards?taskCode=' + task.taskCode + '&lang=zh_CN&platform=0000000000000000&P00001=' + P00001, function (error, response, data) { + let RewardsMsg; + const Details = LogDetails ? `msg:\n${data || error}` : '' + try { + if (error) throw new Error(`接口请求出错 ‼️`); + const obj = JSON.parse(data) + if (obj.msg === "成功" && obj.code === "A00000" && obj.dataNew[0] !== undefined) { + RewardsMsg = `任务奖励: ${task.name} => ${obj.dataNew[0].name + obj.dataNew[0].value} 🎉` + } else { + RewardsMsg = `任务奖励: ${task.name} => ${obj.msg !== `成功` && obj.msg || `未完成`} ⚠️` + } + } catch (e) { + RewardsMsg = `任务奖励: ${e.message || e}`; + } + pushMsg.push(RewardsMsg) + console.log(`爱奇艺-${RewardsMsg} ${Details}`) + resolve() + }) + }) +} + +function GetCookie() { + if (!$request.url.includes("iqiyi.com")) { + $nobyda.notify(`写入爱奇艺Cookie失败`, "", "请更新脚本配置(URL正则/MITM)"); + return + } + var CKA = $request.headers['Cookie'] || $request.headers['cookie'];; + var iQIYI = CKA && CKA.includes("P00001=") && CKA.includes("P00003=") && CKA.includes("__dfp=") && CKA; + var RA = $nobyda.read("CookieQY") + if (CKA && iQIYI) { + if (RA != iQIYI) { + var OldTime = $nobyda.read("CookieQYTime") + if (!$nobyda.write(iQIYI, "CookieQY")) { + $nobyda.notify(`${RA ? `更新` : `首次写入`}爱奇艺签到Cookie失败‼️`, "", "") + } else { + if (!OldTime || OldTime && (Date.now() - OldTime) / 1000 >= 21600) { + $nobyda.write(JSON.stringify(Date.now()), "CookieQYTime") + $nobyda.notify(`${RA ? `更新` : `首次写入`}爱奇艺签到Cookie成功 🎉`, "", "") + } else { + console.log(`\n更新爱奇艺Cookie成功! 🎉\n检测到频繁通知, 已转为输出日志`) + } + } + } else { + console.log("\n爱奇艺-与本机储存Cookie相同, 跳过写入 ⚠️") + } + } else { + $nobyda.notify(`爱奇艺`, "", "写入Cookie失败,关键值缺失 ⚠️") + } +} + +async function BarkNotify(c, k, t, b, p) { for (let i = 0; i < 3; i++) { console.log(`🔷Bark notify >> Start push (${i + 1})`); const s = await new Promise((n) => { c.post({ url: p || 'https://api.day.app/push', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ title: t, body: b, device_key: k, ext_params: { group: t } }) }, (e, r, d) => r && r.status == 200 ? n(1) : n(d || e)) }); if (s === 1) { console.log('✅Push success!'); break } else { console.log(`❌Push failed! >> ${s.message || s}`) } } } + +function nobyda() { + const times = 0 + const start = Date.now() + const isRequest = typeof $request != "undefined" + const isSurge = typeof $httpClient != "undefined" + const isQuanX = typeof $task != "undefined" + const isLoon = typeof $loon != "undefined" + const isJSBox = typeof $app != "undefined" && typeof $http != "undefined" + const isNode = typeof require == "function" && !isJSBox; + const node = (() => { + if (isNode) { + const request = require('request'); + return ({ + request + }) + } else { + return (null) + } + })() + const notify = (title, subtitle, message) => { + if (isQuanX) $notify(title, subtitle, message) + if (isSurge) $notification.post(title, subtitle, message) + if (isNode) log('\n' + title + '\n' + subtitle + '\n' + message) + if (isJSBox) $push.schedule({ + title: title, + body: subtitle ? subtitle + "\n" + message : message + }) + } + const write = (value, key) => { + if (isQuanX) return $prefs.setValueForKey(value, key) + if (isSurge) return $persistentStore.write(value, key) + } + const read = (key) => { + if (isQuanX) return $prefs.valueForKey(key) + if (isSurge) return $persistentStore.read(key) + } + const adapterStatus = (response) => { + if (response) { + if (response.status) { + response["statusCode"] = response.status + } else if (response.statusCode) { + response["status"] = response.statusCode + } + } + return response + } + const get = (options, callback) => { + if (isQuanX) { + if (typeof options == "string") options = { + url: options + } + options["method"] = "GET" + $task.fetch(options).then(response => { + callback(null, adapterStatus(response), response.body) + }, reason => callback(reason.error, null, null)) + } + if (isSurge) $httpClient.get(options, (error, response, body) => { + callback(error, adapterStatus(response), body) + }) + if (isNode) { + node.request(options, (error, response, body) => { + callback(error, adapterStatus(response), body) + }) + } + if (isJSBox) { + if (typeof options == "string") options = { + url: options + } + options["header"] = options["headers"] + options["handler"] = function (resp) { + let error = resp.error; + if (error) error = JSON.stringify(resp.error) + let body = resp.data; + if (typeof body == "object") body = JSON.stringify(resp.data); + callback(error, adapterStatus(resp.response), body) + }; + $http.get(options); + } + } + const post = (options, callback) => { + if (isQuanX) { + if (typeof options == "string") options = { + url: options + } + options["method"] = "POST" + $task.fetch(options).then(response => { + callback(null, adapterStatus(response), response.body) + }, reason => callback(reason.error, null, null)) + } + if (isSurge) { + options.headers['X-Surge-Skip-Scripting'] = false + $httpClient.post(options, (error, response, body) => { + callback(error, adapterStatus(response), body) + }) + } + if (isNode) { + node.request.post(options, (error, response, body) => { + callback(error, adapterStatus(response), body) + }) + } + if (isJSBox) { + if (typeof options == "string") options = { + url: options + } + options["header"] = options["headers"] + options["handler"] = function (resp) { + let error = resp.error; + if (error) error = JSON.stringify(resp.error) + let body = resp.data; + if (typeof body == "object") body = JSON.stringify(resp.data) + callback(error, adapterStatus(resp.response), body) + } + $http.post(options); + } + } + + const log = (message) => console.log(message) + const time = () => { + const end = ((Date.now() - start) / 1000).toFixed(2) + return console.log('\n签到用时: ' + end + ' 秒') + } + const done = (value = {}) => { + if (isQuanX) return $done(value) + if (isSurge) isRequest ? $done(value) : $done() + } + return { + isRequest, + isNode, + notify, + write, + read, + get, + post, + log, + time, + times, + done + } +}; + +function k(e, t) { + var a = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {} + , n = a.split + , c = void 0 === n ? "|" : n + , r = a.sort + , s = void 0 === r || r + , o = a.splitSecretKey + , i = void 0 !== o && o + , l = s ? Object.keys(t).sort() : Object.keys(t) + , u = l.map((function (e) { + return "".concat(e, "=").concat(t[e]) + } + )).join(c) + (i ? c : "") + e; + return md5(u) +} + +// Modified from https://github.com/blueimp/JavaScript-MD5 +function md5(string) { function RotateLeft(lValue, iShiftBits) { return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits)) } function AddUnsigned(lX, lY) { var lX4, lY4, lX8, lY8, lResult; lX8 = (lX & 0x80000000); lY8 = (lY & 0x80000000); lX4 = (lX & 0x40000000); lY4 = (lY & 0x40000000); lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF); if (lX4 & lY4) { return (lResult ^ 0x80000000 ^ lX8 ^ lY8) } if (lX4 | lY4) { if (lResult & 0x40000000) { return (lResult ^ 0xC0000000 ^ lX8 ^ lY8) } else { return (lResult ^ 0x40000000 ^ lX8 ^ lY8) } } else { return (lResult ^ lX8 ^ lY8) } } function F(x, y, z) { return (x & y) | ((~x) & z) } function G(x, y, z) { return (x & z) | (y & (~z)) } function H(x, y, z) { return (x ^ y ^ z) } function I(x, y, z) { return (y ^ (x | (~z))) } function FF(a, b, c, d, x, s, ac) { a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac)); return AddUnsigned(RotateLeft(a, s), b) }; function GG(a, b, c, d, x, s, ac) { a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac)); return AddUnsigned(RotateLeft(a, s), b) }; function HH(a, b, c, d, x, s, ac) { a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac)); return AddUnsigned(RotateLeft(a, s), b) }; function II(a, b, c, d, x, s, ac) { a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac)); return AddUnsigned(RotateLeft(a, s), b) }; function ConvertToWordArray(string) { var lWordCount; var lMessageLength = string.length; var lNumberOfWords_temp1 = lMessageLength + 8; var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64; var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16; var lWordArray = Array(lNumberOfWords - 1); var lBytePosition = 0; var lByteCount = 0; while (lByteCount < lMessageLength) { lWordCount = (lByteCount - (lByteCount % 4)) / 4; lBytePosition = (lByteCount % 4) * 8; lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition)); lByteCount++ } lWordCount = (lByteCount - (lByteCount % 4)) / 4; lBytePosition = (lByteCount % 4) * 8; lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition); lWordArray[lNumberOfWords - 2] = lMessageLength << 3; lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29; return lWordArray }; function WordToHex(lValue) { var WordToHexValue = "", WordToHexValue_temp = "", lByte, lCount; for (lCount = 0; lCount <= 3; lCount++) { lByte = (lValue >>> (lCount * 8)) & 255; WordToHexValue_temp = "0" + lByte.toString(16); WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2) } return WordToHexValue }; function Utf8Encode(string) { string = string.replace(/\r\n/g, "\n"); var utftext = ""; for (var n = 0; n < string.length; n++) { var c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c) } else if ((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128) } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128) } } return utftext }; var x = Array(); var k, AA, BB, CC, DD, a, b, c, d; var S11 = 7, S12 = 12, S13 = 17, S14 = 22; var S21 = 5, S22 = 9, S23 = 14, S24 = 20; var S31 = 4, S32 = 11, S33 = 16, S34 = 23; var S41 = 6, S42 = 10, S43 = 15, S44 = 21; string = Utf8Encode(string); x = ConvertToWordArray(string); a = 0x67452301; b = 0xEFCDAB89; c = 0x98BADCFE; d = 0x10325476; for (k = 0; k < x.length; k += 16) { AA = a; BB = b; CC = c; DD = d; a = FF(a, b, c, d, x[k + 0], S11, 0xD76AA478); d = FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756); c = FF(c, d, a, b, x[k + 2], S13, 0x242070DB); b = FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE); a = FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF); d = FF(d, a, b, c, x[k + 5], S12, 0x4787C62A); c = FF(c, d, a, b, x[k + 6], S13, 0xA8304613); b = FF(b, c, d, a, x[k + 7], S14, 0xFD469501); a = FF(a, b, c, d, x[k + 8], S11, 0x698098D8); d = FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF); c = FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1); b = FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE); a = FF(a, b, c, d, x[k + 12], S11, 0x6B901122); d = FF(d, a, b, c, x[k + 13], S12, 0xFD987193); c = FF(c, d, a, b, x[k + 14], S13, 0xA679438E); b = FF(b, c, d, a, x[k + 15], S14, 0x49B40821); a = GG(a, b, c, d, x[k + 1], S21, 0xF61E2562); d = GG(d, a, b, c, x[k + 6], S22, 0xC040B340); c = GG(c, d, a, b, x[k + 11], S23, 0x265E5A51); b = GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA); a = GG(a, b, c, d, x[k + 5], S21, 0xD62F105D); d = GG(d, a, b, c, x[k + 10], S22, 0x2441453); c = GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681); b = GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8); a = GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6); d = GG(d, a, b, c, x[k + 14], S22, 0xC33707D6); c = GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87); b = GG(b, c, d, a, x[k + 8], S24, 0x455A14ED); a = GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905); d = GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8); c = GG(c, d, a, b, x[k + 7], S23, 0x676F02D9); b = GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A); a = HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942); d = HH(d, a, b, c, x[k + 8], S32, 0x8771F681); c = HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122); b = HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C); a = HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44); d = HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9); c = HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60); b = HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70); a = HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6); d = HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA); c = HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085); b = HH(b, c, d, a, x[k + 6], S34, 0x4881D05); a = HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039); d = HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5); c = HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8); b = HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665); a = II(a, b, c, d, x[k + 0], S41, 0xF4292244); d = II(d, a, b, c, x[k + 7], S42, 0x432AFF97); c = II(c, d, a, b, x[k + 14], S43, 0xAB9423A7); b = II(b, c, d, a, x[k + 5], S44, 0xFC93A039); a = II(a, b, c, d, x[k + 12], S41, 0x655B59C3); d = II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92); c = II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D); b = II(b, c, d, a, x[k + 1], S44, 0x85845DD1); a = II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F); d = II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0); c = II(c, d, a, b, x[k + 6], S43, 0xA3014314); b = II(b, c, d, a, x[k + 13], S44, 0x4E0811A1); a = II(a, b, c, d, x[k + 4], S41, 0xF7537E82); d = II(d, a, b, c, x[k + 11], S42, 0xBD3AF235); c = II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB); b = II(b, c, d, a, x[k + 9], S44, 0xEB86D391); a = AddUnsigned(a, AA); b = AddUnsigned(b, BB); c = AddUnsigned(c, CC); d = AddUnsigned(d, DD) } var temp = WordToHex(a) + WordToHex(b) + WordToHex(c) + WordToHex(d); return temp.toLowerCase() } + +function w() { + var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {} + , t = []; + return Object.keys(e).forEach((function (a) { + t.push("".concat(a, "=").concat(e[a])) + } + )), + t.join("&") +} diff --git a/爱玛会员俱乐部.js b/爱玛会员俱乐部.js new file mode 100644 index 0000000..9325cd7 --- /dev/null +++ b/爱玛会员俱乐部.js @@ -0,0 +1,167 @@ +/* +------------------------------------------ +@Author: smallfawn 860562056 +@Date: 2024.06.08 10.25 +@Description: 爱玛会员俱乐部 小程序 +------------------------------------------ +变量名 aima +变量值 https://scrm.aimatech.com/aima 请求头Headers中access-token的值 多账号&或换行或新建同名变量 +[Script] +http-response + +[MITM] +hostname = + +⚠️【免责声明】 +------------------------------------------ +1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 +2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 +3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 +4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 +5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 +6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 +7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 +*/ + +const $ = new Env("爱玛会员俱乐部"); +let ckName = `aima`; +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; + await signInSearch() + } + + await $.sendMsg($.logs.join("\n")); +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); +function MD5(data) { + const crypto = require('crypto'); + return crypto.createHash('md5').update(data).digest('hex'); +} +async function signInSearch() { + let accessToken = $.token.substring(50, 80) + let nonce = $.uuid() + let time = (new Date).getTime() + let text = `App-IdscrmTime-Stamp${time}TraceLog-Id${nonce}Access-Token${accessToken}AimaScrm321_^` + let data = JSON.stringify({ + "activityId": "100000893" + }); + let config = { + method: 'POST', + url: 'https://scrm.aimatech.com/aima/wxclient/mkt/activities/sign:search', + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220089 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android', + 'Accept-Encoding': 'gzip,compress,br,deflate', + 'Content-Type': 'application/json', + 'time-stamp': time, + 'charset': 'utf-8', + 'app-id': 'scrm', + 'sign': MD5(text), + 'access-token': $.token, + 'tracelog-id': nonce, + 'Referer': 'https://servicewechat.com/wx2dcfb409fd5ddfb4/162/page-frame.html' + }, + data: data + }; + let { data: result } = await Request(config) + if (result.code == 200) { + if (result.content.signed !== 1) { + $.log(`未签到 ===> 签到ing`) + await signInJoin() + } else { + $.log(`已签到 ===> 什么都不做`) + } + } else { + $.log(`签到查询失败`) + } +} +async function signInJoin() { + let accessToken = $.token.substring(50, 80) + let nonce = $.uuid() + let time = (new Date).getTime() + let text = `App-IdscrmTime-Stamp${time}TraceLog-Id${nonce}Access-Token${accessToken}AimaScrm321_^` + let data = JSON.stringify({ + "activityId": "100000893", + "activitySceneId": null + }); + + let config = { + method: 'POST', + url: 'https://scrm.aimatech.com/aima/wxclient/mkt/activities/sign:join', + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220089 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android', + 'Accept-Encoding': 'gzip,compress,br,deflate', + 'Content-Type': 'application/json', + 'time-stamp': time, + 'charset': 'utf-8', + 'app-id': 'scrm', + 'sign': MD5(text), + 'access-token': $.token, + 'tracelog-id': nonce, + 'Referer': 'https://servicewechat.com/wx2dcfb409fd5ddfb4/162/page-frame.html' + }, + data: data + }; + let { data: result } = await Request(config) + if (result.code == 200) { + $.log(`签到成功`) + } else { + $.log(`签到失败 [${result.chnDesc}]`) + } +} + +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) { + return error && error.error ? error.error : "请求失败"; + } + }; + } + 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 new file mode 100644 index 0000000..2d25127 --- /dev/null +++ b/瑷尔博士.js @@ -0,0 +1,180 @@ +/* +------------------------------------------ +@Author: smallfawn 860562056 +@Date: 2024.06.11 12:44 +@Description: 瑷尔博士官方云商城小程序 +------------------------------------------ +变量名airboshi +变量值 https://xapi.weimob.com/api3/ 域名下的Headers请求头的X-WX-Token 多账号&或换行或新增同名变量 +[Script] +http-response + +[MITM] +hostname = + +⚠️【免责声明】 +------------------------------------------ +1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 +2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 +3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 +4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 +5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 +6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 +7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 +*/ + +const $ = new Env("瑷尔博士官方云商城"); +let ckName = `airboshi`; +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; + await signIn() + } + + await $.sendMsg($.logs.join("\n")); +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); +async function signIn() { + const config = { + method: 'post', + url: 'https://xapi.weimob.com/api3/onecrm/mactivity/sign/misc/sign/activity/c/signMainInfo', + headers: { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate, br", + "Accept-Language": "zh-CN,zh;q=0.9", + "Connection": "keep-alive", + "Content-Type": "application/json", + "Host": "xapi.weimob.com", + "Referer": "https://servicewechat.com/wx0399cf391f15b422/46/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", + "X-WX-Token": $.token, + "xweb_xhr": "1" + }, + data: JSON.stringify({ + "appid": "wx0399cf391f15b422", + "basicInfo": { + "vid": 6015569623153, + "vidType": 2, + "bosId": 4021407433153, + "productId": 146, + "productInstanceId": 6351100153, + "productVersionId": "14026", + "merchantId": 2000150059153, + "tcode": "weimob", + "cid": 376411153 + }, + "extendInfo": { + "wxTemplateId": 7579, + "analysis": [], + "bosTemplateId": 1000001485, + "childTemplateIds": [ + { + "customId": 90004, + "version": "crm@0.1.17" + }, + { + "customId": 90002, + "version": "ec@43.9" + }, + { + "customId": 90006, + "version": "hudong@0.0.205" + }, + { + "customId": 90008, + "version": "cms@0.0.429" + } + ], + "quickdeliver": { + "enable": false + }, + "youshu": { + "enable": false + }, + "source": 1, + "channelsource": 5, + "refer": "onecrm-signgift", + //"mpScene": 1256 + }, + "queryParameter": null, + "i18n": { + "language": "zh", + "timezone": "8" + }, + "pid": "", + "storeId": "", + "customInfo": { + "source": 0, + //"wid": 11167663828 + } + }) + }; + let { data: result } = await Request(config) + if (result?.errcode == "0") { + $.log(`签到成功`); + } else { + $.log(`签到失败`) + $.log(JSON.stringify(result)) + } + +} + + +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) { + return error && error.error ? error.error : "请求失败"; + } + }; + } + 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 new file mode 100644 index 0000000..52d4302 --- /dev/null +++ b/统一.js @@ -0,0 +1,318 @@ +/* +------------------------------------------ +@Author: smallfawn 86056 +@Date: 2024.06.08 09.46 +@Description: 统一抽奖大集结 +------------------------------------------ +变量名 tongyi +变量值抓https://xapi.weimob.com/api3/ Headers中的x-wx-token的值 多账号&或换行 或新建同名变量 +[Script] +http-response + +[MITM] +hostname = + +⚠️【免责声明】 +------------------------------------------ +1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 +2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 +3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 +4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 +5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 +6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 +7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 +*/ + +const $ = new Env("统一抽奖大集结"); +let ckName = `tongyi`; +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++ + $.ckStatus = true; + $.token = user + let activityIds = [{ name: `小明同学`, id: 20001389211 }, { name: `雅马哈`, id: 20001390387 }, { name: `周末`, id: 20001403008 }] + for (let activity of activityIds) { + $.log(`当前玩的是[${activity.name}]`) + for (let i = 0; i < 5; i++) { + await lightCard(activity.id) + $.log(`本次抽奖结束延迟5s`) + await $.wait(5000) + } + $.log(`游戏结束延迟5s`) + await $.wait(5000) + } + await draw() + } + + await $.sendMsg($.logs.join("\n")); +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); +async function lightCard(activityId) { + + let data = JSON.stringify({ + "appid": "wx532ecb3bdaaf92f9", + "basicInfo": { + "vid": 6013753979957, + "vidType": 2, + "bosId": 4020112618957, + "productId": 165646, + "productInstanceId": 3169913957, + "productVersionId": "16233", + "merchantId": 2000020692957, + "tcode": "weimob", + "cid": 176205957 + }, + "extendInfo": { + "wxTemplateId": 7593, + "analysis": [], + "bosTemplateId": 1000001511, + "childTemplateIds": [ + { + "customId": 90004, + "version": "crm@0.1.21" + }, + { + "customId": 90002, + "version": " ec@46.4" + }, + { + "customId": 90006, + "version": "hudong@0.0.208" + }, + { + "customId": 90008, + "version": "cms@0.0.439" + }, + { + "customId": 90060, + "version": "elearning@0.1.1" + } + ], + "quickdeliver": { + "enable": false + }, + "youshu": { + "enable": false + }, + "source": 1, + "channelsource": 5, + "refer": "hd-card-home", + "mpScene": 1005 + }, + "queryParameter": null, + "i18n": { + "language": "zh", + "timezone": "8" + }, + "pid": "4020112618957", + "storeId": "0", + "activityId": activityId, ////////////////////////////////////////// + "source": 1, + "_version": "2.9.2", + "appletVersion": 280, + "_transformBasicInfo": true, + "v": "76e04a82cc9efce6e19336bfddab891410029744", + "operationSource": 4, + "vid": 6013753979957, + "vidType": 2, + "bosId": 4020112618957, + "productId": 165646, + "productInstanceId": 3169913957, + "productVersionId": "16233", + "merchantId": 2000020692957, + "tcode": "weimob", + "cid": 176205957, + "vidTypes": [ + 2 + ], + "openid": "oBk224mM4QEh5M3dNtocB9ZU6foQ" + }); + + let config = { + method: 'POST', + url: 'https://xapi.weimob.com/api3/interactive/qianxi/amasscard/api/lightCard', + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220067 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android', + 'Accept-Encoding': 'gzip,compress,br,deflate', + 'Content-Type': 'application/json', + 'charset': 'utf-8', + 'x-wx-token': $.token, + 'Referer': 'https://servicewechat.com/wx532ecb3bdaaf92f9/195/page-frame.html', + }, + data: data + }; + let { data: result } = await Request(config); + if (result.errcode == '0') { + $.log(`抽卡成功[${result.data.cardId}]`) + } else { + $.log(`抽卡失败`) + $.log(JSON.stringify(result)) + } +} +async function draw() { + let data = JSON.stringify({ + "appid": "wx532ecb3bdaaf92f9", + "basicInfo": { + "vid": 6013753979957, + "vidType": 2, + "bosId": 4020112618957, + "productId": 222, + "productInstanceId": 3169919957, + "productVersionId": "12004", + "merchantId": 2000020692957, + "tcode": "weimob", + "cid": 176205957 + }, + "extendInfo": { + "wxTemplateId": 7593, + "analysis": [], + "bosTemplateId": 1000001511, + "childTemplateIds": [ + { + "customId": 90004, + "version": "crm@0.1.21" + }, + { + "customId": 90002, + "version": " ec@46.4" + }, + { + "customId": 90006, + "version": "hudong@0.0.208" + }, + { + "customId": 90008, + "version": "cms@0.0.439" + }, + { + "customId": 90060, + "version": "elearning@0.1.1" + } + ], + "quickdeliver": { + "enable": false + }, + "youshu": { + "enable": false + }, + "source": 1, + "channelsource": 5, + "refer": "hd-lego-index", + "mpScene": 1005 + }, + "queryParameter": null, + "i18n": { + "language": "zh", + "timezone": "8" + }, + "pid": "4020112618957", + "storeId": "0", + "_transformBasicInfo": true, + "_requrl": "/orchestration/mobile/activity/draw/play", + "templateId": 767, + "templateKey": "bigwheel", + "activityId": "30000041622", + "bussinessType": 1, + "channel": 1, + "channelType": 1, + "source": 1, + "_version": "2.5.4", + "activityIdentity": "20", + "openId": "oBk224mM4QEh5M3dNtocB9ZU6foQ", + "wid": 11165796601, + "appId": "wx532ecb3bdaaf92f9", + "playSourceCode": "lcode", + "vid": 6013753979957, + "vidType": 2, + "bosId": 4020112618957, + "productId": 222, + "productInstanceId": 3169919957, + "productVersionId": "12004", + "merchantId": 2000020692957, + "tcode": "weimob", + "cid": 176205957, + "vidTypes": [ + 2 + ], + "openid": "oBk224mM4QEh5M3dNtocB9ZU6foQ" + }); + + let config = { + method: 'POST', + url: 'https://xapi.weimob.com/api3/orchestration/mobile/activity/draw/play', + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220067 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android', + 'Accept-Encoding': 'gzip,compress,br,deflate', + 'Content-Type': 'application/json', + 'charset': 'utf-8', + 'x-wx-token': $.token, + 'Referer': 'https://servicewechat.com/wx532ecb3bdaaf92f9/195/page-frame.html', + 'Cookie': 'rprm_cuid=7849974103hl3bid9hbo' + }, + data: data + }; + let { data: result } = await Request(config); + if (result.errcode == '0') { + $.log(`抽奖成功[${result.data.cardId}]`) + } else if (result.errcode == "100200003") { + $.log(`抽奖失败 次数不够`) + } else { + $.log(`抽奖失败`) + $.log(JSON.stringify(result)) + } +} + + +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) { + return error && error.error ? error.error : "请求失败"; + } + }; + } + 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 new file mode 100644 index 0000000..24a659f --- /dev/null +++ b/臭宝乐园.js @@ -0,0 +1,159 @@ +/* +------------------------------------------ +@Author: smallfawn +@Date: 2024.06.09 12.51 +@Description: 臭宝乐园小程序 签到换螺蛳粉 +------------------------------------------ +变量名choubao +变量值 https://cbxcx.weinian.com.cn/wnuser 请求头Headers中authorization的值 多账号&或换行或新建同名变量 +[Script] +http-response + +[MITM] +hostname = + +⚠️【免责声明】 +------------------------------------------ +1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 +2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 +3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 +4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 +5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 +6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 +7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 +*/ + +const $ = new Env("臭宝乐园"); +let ckName = `choubao`; +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 + $.ckFlag = true; + await getUserInfo() + if ($.ckFlag) { + await signInCheck() + await $.wait(3000) + } + + } + + await $.sendMsg($.logs.join("\n")); +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); + +async function signInCheck() { + let config = { + method: 'POST', + url: 'https://cbxcx.weinian.com.cn/wnuser/v1/memberUser/checkSignNum', + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220089 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android', + 'Accept-Encoding': 'gzip,compress,br,deflate', + 'authorization': $.token, + 'charset': 'utf-8', + 'content-type': 'application/json', + 'Referer': 'https://servicewechat.com/wx2206cca563f6f937/82/page-frame.html' + } + }; + let { data: result } = await Request(config) + if (result?.status == 200) { + await signIn() + }else{ + $.log(`获取签到状态[${result.msg}]`) + } +} +async function signIn() { + let config = { + method: 'POST', + url: 'https://cbxcx.weinian.com.cn/wnuser/v1/memberUser/daySign', + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220089 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android', + 'Accept-Encoding': 'gzip,compress,br,deflate', + 'authorization': $.token, + 'charset': 'utf-8', + 'content-type': 'application/json', + 'Referer': 'https://servicewechat.com/wx2206cca563f6f937/82/page-frame.html' + } + }; + let { data: result } = await Request(config) + if (result?.status == 200) { + $.log(`签到成功`) + } else { + $.log(`签到失败【${result.msg}】`) + } +} +async function getUserInfo() { + let config = { + method: 'POST', + url: 'https://cbxcx.weinian.com.cn/wnuser/v1/memberUser/getMemberUser', + headers: { + '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/122.0.6261.120 Mobile Safari/537.36 XWEB/1220089 MMWEBSDK/20240404 MMWEBID/8150 MicroMessenger/8.0.49.2600(0x28003156) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android', + 'Accept-Encoding': 'gzip,compress,br,deflate', + 'authorization': $.token, + 'charset': 'utf-8', + 'content-type': 'application/json', + 'Referer': 'https://servicewechat.com/wx2206cca563f6f937/82/page-frame.html' + } + }; + let { data: result } = await Request(config) + if (result?.status == 200) { + $.log(`[${result.data.nickName}] 嗦粉币[${result.data.points}]`) + } else { + $.log(`获取用户信息失败【${result.msg}】`) + $.ckFlag = false + } +} + +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) { + return error && error.error ? error.error : "请求失败"; + } + }; + } + 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/逑美And薇诺娜专柜小程序.js b/逑美And薇诺娜专柜小程序.js new file mode 100644 index 0000000..fc7ea84 --- /dev/null +++ b/逑美And薇诺娜专柜小程序.js @@ -0,0 +1,253 @@ +/* +------------------------------------------ +@Author: SMALLFAWN +@Date: 2024.06.10 13:34 +@Description: 逑美小程序&薇诺娜专柜商城(薇诺娜旗下小程序) +------------------------------------------ +变量名qiumei_weinuona +变量值 逑美小程序https://api.qiumeiapp.com/common-activity 域名下POST请求体 Body中appUserToken的值 + 薇诺娜专柜商城小程序https://api.qiumeiapp.com/zg-activity/ 域名下POST请求体 Body中appUserToken的值 + 两个值用#连接 多账号&或换行或新建同名变量 + +[Script] +http-response + +[MITM] +hostname = + +⚠️【免责声明】 +------------------------------------------ +1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 +2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 +3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 +4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 +5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 +6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 +7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 +*/ + +const $ = new Env("逑美/薇诺娜专柜小程序"); +let ckName = `qiumei_weinuona`; +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.split(strSplitor)[0] + $.token1 = user.split(strSplitor)[1] + $.ckStatus = false; + $.batchCode = null + await getWmcMemberInfo() + + if ($.ckStatus) { + await getSigninBatch() + if ($.batchCode) { + await getUserSigninInfo() + + } + } + if($.token1){ + await userSignin1() + } + + } + + await $.sendMsg($.logs.join("\n")); +})() + .catch((e) => console.log(e)) + .finally(() => $.done()); + +async function userSignin() { + + let config = { + url: "https://api.qiumeiapp.com/common-activity/signin/userSignin", + method: "POST", + headers: { + 'accept': '*/*', + 'accept-language': 'zh-CN,zh;q=0.9', + 'content-type': 'application/json', + 'sec-fetch-dest': 'empty', + 'sec-fetch-mode': 'cors', + 'sec-fetch-site': 'cross-site', + 'xweb_xhr': '1', + 'Referer': 'https://servicewechat.com/wx30cc0fb02a84eb74/215/page-frame.html', + 'Referrer-Policy': 'unsafe-url' + }, + data: JSON.stringify({ + appUserToken: $.token, + batchCode: $.batchCode + }) + } + let { data: result } = await Request(config) + if (result?.code == 200) { + $.log(`签到成功[${result.data.prizeName}]`) + } else { + $.log(`签到失败[${result.msg}]`) + } +} +async function userSignin1() { + + let config = { + url: "https://api.qiumeiapp.com/zg-activity/zg-daily/zgSigninNew", + method: "POST", + headers: { + 'accept': '*/*', + 'accept-language': 'zh-CN,zh;q=0.9', + 'content-type': 'application/json', + 'sec-fetch-dest': 'empty', + 'sec-fetch-mode': 'cors', + 'sec-fetch-site': 'cross-site', + 'xweb_xhr': '1', + 'Referer': 'https://servicewechat.com/wx250394ab3f680bfa/554/page-frame.html', + 'Referrer-Policy': 'unsafe-url' + }, + data: JSON.stringify({ + appUserToken: $.token1, + }) + } + let { data: result } = await Request(config) + if (result?.code == 200) { + $.log(`薇诺娜专柜/ 签到成功`) + } else { + $.log(`薇诺娜专柜/ 签到失败[${result.msg}]`) + } +} +async function getUserSigninInfo() { + + let config = { + url: "https://api.qiumeiapp.com/common-activity/signin/getUserSigninInfo", + method: "POST", + headers: { + 'accept': '*/*', + 'accept-language': 'zh-CN,zh;q=0.9', + 'content-type': 'application/json', + 'sec-fetch-dest': 'empty', + 'sec-fetch-mode': 'cors', + 'sec-fetch-site': 'cross-site', + 'xweb_xhr': '1', + 'Referer': 'https://servicewechat.com/wx30cc0fb02a84eb74/215/page-frame.html', + 'Referrer-Policy': 'unsafe-url' + }, + data: JSON.stringify({ + appUserToken: $.token, + batchCode: $.batchCode + }) + } + let { data: result } = await Request(config) + if (result?.code == 200) { + if (result.data.runningDays !== 1) { + $.log(`未签到 ===> 签到ing`) + await userSignin() + } else { + $.log(`已签到 ===> 跳过签到`) + } + } else { + $.log(`获取签到信息失败[${result.msg}]`) + } +} +async function getWmcMemberInfo() { + let config = { + url: "https://api.qiumeiapp.com/qmxcx/10001/getWmcMemberInfo", + method: "POST", + headers: { + 'accept': '*/*', + 'accept-language': 'zh-CN,zh;q=0.9', + 'content-type': 'application/json', + 'sec-fetch-dest': 'empty', + 'sec-fetch-mode': 'cors', + 'sec-fetch-site': 'cross-site', + 'xweb_xhr': '1', + 'Referer': 'https://servicewechat.com/wx30cc0fb02a84eb74/215/page-frame.html', + 'Referrer-Policy': 'unsafe-url' + }, + data: JSON.stringify({ + appUserToken: $.token, + }) + } + let { data: result } = await Request(config) + if (result?.code == 200) { + $.log(`[${result.data.mobile}] 积分[${result.data.winonaPoint}}]`) + $.ckStatus = true + } else { + $.log(`获取用户信息失败[${result.msg}]`) + } +} +async function getSigninBatch() { + + let config = { + url: "https://api.qiumeiapp.com/common-activity/signin/getSigninBatch", + method: "POST", + headers: { + 'accept': '*/*', + 'accept-language': 'zh-CN,zh;q=0.9', + 'content-type': 'application/json', + 'sec-fetch-dest': 'empty', + 'sec-fetch-mode': 'cors', + 'sec-fetch-site': 'cross-site', + 'xweb_xhr': '1', + 'Referer': 'https://servicewechat.com/wx30cc0fb02a84eb74/215/page-frame.html', + 'Referrer-Policy': 'unsafe-url' + }, + data: JSON.stringify({ + appId: "wmcenter-1b60-11e8-98b9-7cd30ae08066" + }) + } + let { data: result } = await Request(config) + if (result?.code == 200) { + $.log(`本次签到batchCode为[${result.data.signinBatchCode}]`) + $.batchCode = result.data.signinBatchCode + } else { + $.log(`获取签到batchCode失败[${result.msg}]`) + } +} + +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) { + return error && error.error ? error.error : "请求失败"; + } + }; + } + 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