From c0944fc0be5d44d4860a36d2dbcef3c17fa3d34f Mon Sep 17 00:00:00 2001 From: smallfawn <860562056@QQ.COM> Date: Mon, 6 Apr 2026 18:28:39 +0800 Subject: [PATCH] feat(del some script): del some script --- daily/musi.js | 2 +- wxapp/7dian5.py | 113 --- wxapp/bnmdhg_wx.js | 384 ---------- wxapp/qfxsh.js | 1468 ------------------------------------- wxapp/yeyebupaocha.js | 261 ------- wxapp/zippo.js | 516 ------------- wxapp/杰士邦安心福利社.js | 321 -------- wxapp/草莓台.js | 516 ------------- 8 files changed, 1 insertion(+), 3580 deletions(-) delete mode 100644 wxapp/7dian5.py delete mode 100644 wxapp/bnmdhg_wx.js delete mode 100644 wxapp/qfxsh.js delete mode 100644 wxapp/yeyebupaocha.js delete mode 100644 wxapp/zippo.js delete mode 100644 wxapp/杰士邦安心福利社.js delete mode 100644 wxapp/草莓台.js diff --git a/daily/musi.js b/daily/musi.js index 69ed317..df6c74c 100644 --- a/daily/musi.js +++ b/daily/musi.js @@ -20,7 +20,7 @@ cron: 30 10 * * * 7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 */ -const { Env } = require("./tools/env") +const { Env } = require("../tools/env") const $ = new Env("慕思小程序"); let ckName = `musi`; const strSplitor = "#"; diff --git a/wxapp/7dian5.py b/wxapp/7dian5.py deleted file mode 100644 index c8a9ab4..0000000 --- a/wxapp/7dian5.py +++ /dev/null @@ -1,113 +0,0 @@ - -#微信小程序:七点五饮用天然矿泉水 - - -import requests -from os import path -import json -import time -import os - -def load_send(): - cur_path = path.abspath(path.dirname(__file__)) - notify_file = cur_path + "/notify.py" - - if path.exists(notify_file): - try: - from notify import send # 导入模块的send为notify_send - print("加载通知服务成功!") - return send # 返回导入的函数 - except ImportError: - print("加载通知服务失败~") - else: - print("加载通知服务失败~") - - return False # 返回False表示未成功加载通知服务 - - - -def sign(): - url = "https://h5.youzan.com/wscump/checkin/checkinV2.json?checkinId=3997371" - headers = { - '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(0x63090b11) XWEB/9129", - 'xweb_xhr': "1", - 'extra-data': sid, - 'sec-fetch-site': "cross-site", - 'sec-fetch-mode': "cors", - 'sec-fetch-dest': "empty", - 'referer': "https://servicewechat.com/wx5508c9ab0d2118ff/63/page-frame.html", - 'accept-language': "zh-CN,zh;q=0.9", - 'Cookie': "KDTWEAPPSESSIONID="+sid - } - - response = requests.get(url, headers=headers) - time.sleep(2) - print(response.text) - time.sleep(2) - return response.text - -def jifen(): - url = "https://h5.youzan.com/wscump/pointstore/getCustomerPoints.json" - - headers = { - '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(0x63090b11) XWEB/9129", - 'Cookie': "KDTWEAPPSESSIONID="+sid - } - - response = requests.get(url, headers=headers) - time.sleep(2) - # print(response.text) - try: - xiaoku=json.loads(response.text) - jifen1=str(xiaoku["data"]["currentAmount"]) - print('目前积分为'+jifen1) - time.sleep(2) - - url = "https://h5.youzan.com/wscump/checkin/get_activity_by_yzuid_v2.json?checkinId=3997371" - - headers = { - '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(0x63090b11) XWEB/9129", - 'extra-data': "sid="+sid, - 'Cookie': "KDTWEAPPSESSIONID="+sid - } - - response = requests.get(url, headers=headers) - xiaoku=json.loads(response.text) - print('目前签到天数为'+str(xiaoku["data"]["continuesDay"])) - # print(response.text) - tongzhi='\n目前积分为'+jifen1+'\n签到天数为'+str(xiaoku["data"]["continuesDay"]) - return tongzhi - except: - print('积分查询失败,检查变量是否正确') - - - -if __name__ == "__main__": - var_name='qdwxcxcookie' - values = os.getenv(var_name) - values=values.split('\n') - content='' - for value in values: - beizhu=value.split('#')[0]; - sid=value.split('#')[1]; - print('-------开始' + str(beizhu) + '签到------') - content=content+'\n===='+str(beizhu)+'账号签到情况====\n' - content=content+str(sign()) - print('-------开始' + str(beizhu) + '查询积分------') - content=content+str(jifen()) - content=content+'\n----------------------\n' - # 在load_send中获取导入的send函数 - send = load_send() - print() - - - print('------运行结束-------') - content=content+'\n签到10天送100积分,连续20天送20元券,连续30天送25元券,连续45天送七点五饮用天然泉水高端弱碱饮用天然泉水 表白礼物 整箱520ml*15\n' - content=content+'\n所有账号运行完毕\n' - print('签到10天送100积分,连续20天送20元券,连续30天送25元券,连续45天送七点五饮用天然泉水高端弱碱饮用天然泉水 表白礼物 整箱520ml*15') - # 判断send是否可用再进行调用 - print() - if send: - send('七点五饮用天然矿泉水签到推送', content) - else: - print('通知服务不可用') diff --git a/wxapp/bnmdhg_wx.js b/wxapp/bnmdhg_wx.js deleted file mode 100644 index 383c029..0000000 --- a/wxapp/bnmdhg_wx.js +++ /dev/null @@ -1,384 +0,0 @@ -/* ------------------------------------------- -@Author: sm -@Date: 2024.06.07 19:15 -@Description: 测试 ------------------------------------------- -#Notice: 只适用于购买了luflytoken的 购买联系QQ860562056 -变量wxid_bnmd 填写wxid_bnmd 多账号&分割或者换行 -wxcenter 填写wxcenter -⚠️【免责声明】 ------------------------------------------- -1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 -2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 -3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 -4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 -5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 -6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 -7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 -*/ - -const $ = new Env("巴奴毛肚小程序"); -let ckName = `wxid_bnmd`; -const strSplitor = "#"; -const envSplitor = ["&", "\n"]; -const crypto = require("crypto-js"); -const notify = $.isNode() ? require("../sendNotify") : ""; -const axios = require("axios"); -const defaultUserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 16_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.31(0x18001e31) NetType/WIFI Language/zh_CN miniProgram" -const key = "bfc5e947cd84c7ced1ee48d28fb3e90f"; -let wxcenter = process.env.wxcenter || "" -let appid = 'wx71373698c47f9a9f' -class Public { - async request(options) { - return await axios.request(options); - } -} -class Task extends Public { - constructor(env) { - - super(); - this.index = $.userIdx++ - let user = env.split(strSplitor); - this.wxid = user[0]; - } - getUUID(_0x4b4b65 = 16, _0x14813d = 36) { - const _0x181bd6 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""); - const _0x295ca7 = []; - let _0x4713fe = 0; - if (_0x4b4b65) { - for (_0x4713fe = 0; _0x4713fe < _0x4b4b65; _0x4713fe++) { - _0x295ca7[_0x4713fe] = _0x181bd6[0 | Math.random() * _0x14813d]; - } - } else { - let _0x540406; - for (_0x295ca7[8] = _0x295ca7[13] = _0x295ca7[18] = _0x295ca7[23] = "-", _0x295ca7[14] = "4", _0x4713fe = 0; _0x4713fe < 36; _0x4713fe++) { - if (!_0x295ca7[_0x4713fe]) { - _0x540406 = 0 | 16 * Math.random(); - _0x295ca7[_0x4713fe] = _0x181bd6[19 === _0x4713fe ? 3 & _0x540406 | 8 : _0x540406]; - } - } - } - return _0x295ca7.join(""); - } - getHeaders(options, _0x32d686, authorization) { - const keyOptions = { - app_key: "KlZ4LqOF", - app_secret: "HoBJTYXdwn" - }; - const _0x3aaf0a = { - t: Math.floor(new Date().getTime() / 1000), - n: this.getUUID(), - ...keyOptions - }; - const _0x419328 = Object.values(_0x3aaf0a).join(""); - - const sign = this.stringToLowerCase(this.stringToLowerCase(_0x419328)).split("").reverse().join(""); - const header = { - 'Connection': 'keep-alive', - 'content-type': 'application/json', - 'uuid': options.uuid, - 'platform_version_code': 'iOS 16.6', - 'authorization': authorization, // - 'tenancy_id': 'banu', - 'app_key': 'KlZ4LqOF', - 'code': 'f22b68d1c74c3a66aa7a1b199bcd4e20', // - 'platform_version_name': 'iPhone 11', - 'platform_version_weapp': '8.0.50', - 't': _0x3aaf0a.t, - 'n': _0x3aaf0a.n, - 'platform_version_sdk': '3.5.8', - 'sign': sign, - '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.50(0x1800323d) NetType/4G Language/zh_CN', - 'Referer': 'https://servicewechat.com/wx71373698c47f9a9f/474/page-frame.html' - } - - if (_0x32d686) { - const _0xa2075e = new URLSearchParams({ - ...options, - enc_data: _0x32d686 - }).toString(); - const code = this.stringToLowerCase(this.stringToLowerCase(_0xa2075e)).split("").reverse().join(""); - header.code = code; - } - return header; - } - stringToLowerCase(str) { - return crypto.MD5(str).toString().toLowerCase(); - } - decrypt(_0x3c73c4) { - const _0x3218f0 = crypto.lib.WordArray.random(16).toString(); - const _0x30b65e = JSON.stringify(_0x3c73c4); - const _0x429ee1 = crypto.AES.encrypt(_0x30b65e, crypto.enc.Utf8.parse(key), { - iv: crypto.enc.Utf8.parse(_0x3218f0), - mode: crypto.mode.CBC - }).toString(); - return crypto.enc.Base64.stringify(crypto.enc.Utf8.parse(JSON.stringify({ - iv: _0x3218f0, - encrypted_data: _0x429ee1 - }))); - } - async getcode() { - - let options = { - url: `${wxcenter}/api/Wxapp/JSLogin`, - headers: { - 'Content-Type': 'application/json' - }, - method: 'POST', - data: { "Wxid": "" + this.wxid, "Appid": "" + appid } - } - let { data: result } = await this.request(options); - - - - - if (result.Success) { - let code = result.Data.code - $.log(`账号[${this.wxid}] 获取code成功[${code}]`); - let { member_id: memberId, openid: authorization } = await this.login(code) - const headerObj = {}; - const data = { - member_id: memberId - }; - try { - headerObj.uuid = this.getUUID(); - const res = await axios.get("https://cloud.banu.cn/api/sign-in/days", { - params: data, - headers: this.getHeaders(headerObj, false, authorization) - }); - if (res.data.data.is_sign_in) { - $.log(`账号[${this.wxid}] 重复签到`); - } else { - const decryptData = this.decrypt(data); - const res = await axios.post("https://cloud.banu.cn/api/sign-in", { - enc_data: decryptData - }, { - headers: this.getHeaders(headerObj, decryptData, authorization) - }); - $.log("签到:" + res.data.message); - } - const info = await axios.get("https://cloud.banu.cn/api/member/statistic", { - params: data, - headers: this.getHeaders(headerObj, false, authorization) - }); - const result = "\nMember_id:" + memberId + "\n用户名:" + info.data.data.name + "\n总积分:" + info.data.data.points; - $.log(result); - - } catch (err) { - - $.log("签到失败:" + err + " | 签到时间:" + Date.now()); - } - } else { - console.log(result); - } - - - - - } - async login(code) { - let url = 'https://cloud.banu.cn/api/wx/weapp/auth'; - let data = { - 'app_id': 'wx71373698c47f9a9f', - 'code': code - } - const headerObj = {}; - headerObj.uuid = this.getUUID(); - let headers = this.getHeaders(headerObj, false, ""); - - let { data: res } = await this.request({ - url, - method: "POST", - headers, - data - }) - return res.data; - } - async run() { - if (!wxcenter) return $.log(`请填写wxcenter`) - - await this.getcode() - - - - } -} - - -!(async () => { - await getNotice() - $.checkEnv(ckName); - - for (let user of $.userList) { - // - - await new Task(user).run(); - - } - - -})() - .catch((e) => console.log(e)) - .finally(() => $.done()); - -async function getNotice() { - let options = { - url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`, - headers: { - "User-Agent": defaultUserAgent, - } - } - let { data: res } = await new Public().request(options); - $.log(res) - return res -} - - -// prettier-ignore -function Env(t, s) { - return new (class { - constructor(t, s) { - this.userIdx = 1; - this.userList = []; - this.userCount = 0; - this.name = t; - this.notifyStr = []; - this.logSeparator = "\n"; - this.startTime = new Date().getTime(); - Object.assign(this, s); - this.log(`\ud83d\udd14${this.name},\u5f00\u59cb!`); - } - checkEnv(ckName) { - let userCookie = (this.isNode() ? process.env[ckName] : "") || ""; - this.userList = userCookie.split(envSplitor.find((o) => userCookie.includes(o)) || "&").filter((n) => n); - this.userCount = this.userList.length; - this.log(`共找到${this.userCount}个账号`); - } - async sendMsg() { - this.log("==============📣Center 通知📣==============") - for (let i = 0; i < this.notifyStr.length; i++) { - if (Object.prototype.toString.call(this.notifyStr[i]) === '[object Object]' || - Object.prototype.toString.call(this.notifyStr[i]) === '[object Array]') { - this.notifyStr[i] = JSON.stringify(this.notifyStr[i]); - } - } - - let message = this.notifyStr.join(this.logSeparator); - if (this.isNode()) { - await notify.sendNotify(this.name, message); - } else { - } - } - isNode() { - return "undefined" != typeof module && !!module.exports; - } - - 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; - } - - 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; - } - - log(content) { - this.notifyStr.push(content) - console.log(content) - } - wait(t) { - return new Promise((s) => setTimeout(s, t)); - } - async done(t = {}) { - await this.sendMsg(); - const s = new Date().getTime(), - e = (s - this.startTime) / 1e3; - this.log( - `\ud83d\udd14${this.name},\u7ed3\u675f!\ud83d\udd5b ${e}\u79d2` - ); - if (this.isNode()) { - process.exit(1); - } - } - })(t, s); -} \ No newline at end of file diff --git a/wxapp/qfxsh.js b/wxapp/qfxsh.js deleted file mode 100644 index 4e1cc79..0000000 --- a/wxapp/qfxsh.js +++ /dev/null @@ -1,1468 +0,0 @@ -/* -地址: - -#小程序://起飞线/x8h0xqNEoODRlyg - -复制以上 微信打开 - -点击我的并抓包, -抓取https://cluster.qifeixian.com/api/user/v1/center/info,此链接请求头的x-ds-key和返回报文体中的id -变量export qfxhd='x-ds-key&id' -多账号@隔开 -export qfxhd='x-ds-key&id@x-ds-key&id' -*/ -// corn 0 */3 * * * - -const $ = new Env('起飞线生活'); -const axios = require('axios'); -let request = require("request"); -request = request.defaults({ - jar: true -}); -const { - log -} = console; -const Notify = 1; //0为关闭通知,1为打开通知,默认为1 -const debug = 0; //0为关闭调试,1为打开调试,默认为0 -let qfxhd = ($.isNode() ? process.env.qfxhd : $.getdata("qfxhd")) || "" -let qfxhdArr = []; -let data = ''; -let msg = ''; -var hours = new Date().getMonth(); -var timestamp = Math.round(new Date().getTime()).toString(); -//---------------------- 自定义变量区域 ----------------------------------- -let host = 'cluster.qifeixian.com' -let userAgent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.42(0x18002a29) NetType/WIFI Language/zh_CN' -let xdPort = '1380' -let baseVersion = '3.1.2' -let version = '5.0.13' -let connection = 'keep-alive' -let contentType = 'application/json' -let acceptEncoding = 'gzip,compress,br,deflate' -let referer = 'https://servicewechat.com/wx3c0d10f34c013209/258/page-frame.html' -//----------------------------------------------------------------------- -!(async () => { - if (typeof $request !== "undefined") { - await GetRewrite(); - } else { - if (!(await Envs())) - return; - else { - - addNotifyStr(`\n\n============================================= \n脚本执行 - 北京时间(UTC+8):${new Date( - new Date().getTime() + new Date().getTimezoneOffset() * 60 * 1000 + - 8 * 60 * 60 * 1000).toLocaleString()} \n=============================================\n`); - - - - addNotifyStr(`\n=================== 共找到 ${qfxhdArr.length} 个账号 ===================`) - if (debug) { - log(`【debug】 这是你的全部账号数组:\n ${qfxhdArr}`); - } - for (let index = 0; index < qfxhdArr.length; index++) { - - let num = index + 1 - addNotifyStr(`\n==== 开始【第 ${num} 个账号】====\n`, true) - - qfx = qfxhdArr[index]; - qfxhd = qfx.split('&')[0]; - // log("00:" + qfxhd); - userId = qfx.split('&')[1]; - // log("11:" + userId); - restoken = qfxhd.match(/\.(.*?)\./)[1] - restoken = JSON.parse(Buffer.from(restoken, 'base64').toString('utf8')) - restoken = restoken.data.refreshToken - await refreshTokens() - await info() - // await list() - await share_bk() - await share_mall() - await invite_friends() - await lottery() - await first() - await water() - } - await SendMsg(msg); - } - } -})() - .catch((e) => log(e)) - .finally(() => $.done()) -async function refreshTokens() { - return new Promise((resolve) => { - - var options = { - method: 'POST', - url: 'https://cluster.qifeixian.com/api/user/v1/public/token', - headers: { - Host: host, - Connection: connection, - 'user-agent': userAgent, - 'Content-Type': contentType, - Accept: '*/*', - Referer: referer, - 'Accept-Encoding': acceptEncoding - }, - data: { - refresh_token: restoken - } - }; - if (debug) { - log(`\n【debug】=============== 这是 请求 url ===============`); - log(JSON.stringify(options)); - } - axios.request(options).then(async function (response) { - try { - var data = response.data; - if (debug) { - log(`\n\n【debug】===============这是 返回data==============`); - log(data) - } - if (data.data.code = 10000) { - newtoken = data.data.access_token - addNotifyStr('刷新token:' + newtoken) - } else - addNotifyStr(data.msg) - } catch (e) { - addNotifyStr(`异常:${data},原因:${data.msg}`) - } - }).catch(function (error) { - console.error(error); - }).then(res => { - //这里处理正确返回 - resolve(); - }); - }) - -} -//每日抽奖 -async function lottery() { - return new Promise((resolve) => { - - var options = { - method: 'POST', - url: 'https://cluster.qifeixian.com/api/activity-center/v1/lottery', - headers: { - Host: host, - Connection: connection, - 'x-ds-key': newtoken, - Authorization: 'Basic ' + newtoken, - 'Content-Type': contentType, - 'user-agent': userAgent, - 'x-ds-port': xdPort, - 'base-version': baseVersion, - version: version, - Accept: '*/*', - Referer: referer, - 'Accept-Encoding': acceptEncoding - }, - data: {} - }; - if (debug) { - log(`\n【debug】=============== 这是 请求 url ===============`); - log(JSON.stringify(options)); - } - axios.request(options).then(async function (response) { - try { - var data = response.data; - if (debug) { - log(`\n\n【debug】===============这是 返回data==============`); - log(data) - } - if (data.data.code = 10000) { - addNotifyStr(data.data.data.prize.prizeLevel.desc) - addNotifyStr(data.data.data.prize.prizeLevel.name) - addNotifyStr(data.data.data.prize.desc) - winid = data.data.data['winner_id'] - addNotifyStr(data.data.msg) - await winning() - } else - addNotifyStr(data.msg) - - } catch (e) { - addNotifyStr(`${data.data.msg}`) - } - }).catch(function (error) { - console.error(error); - }).then(res => { - //这里处理正确返回 - resolve(); - }); - }) - -} -//抽奖结果 -async function winning() { - return new Promise((resolve) => { - - var options = { - method: 'GET', - url: 'https://cluster.qifeixian.com/api/activity-center/v1/winning-records/' + winid, - headers: { - Host: host, - Connection: connection, - 'x-ds-key': newtoken, - Authorization: 'Basic ' + newtoken, - 'Content-Type': contentType, - 'user-agent': userAgent, - 'x-ds-port': xdPort, - 'base-version': baseVersion, - version: version, - Accept: '*/*', - Referer: referer, - 'Accept-Encoding': acceptEncoding - }, - data: {} - }; - if (debug) { - log(`\n【debug】=============== 这是 请求 url ===============`); - log(JSON.stringify(options)); - } - axios.request(options).then(function (response) { - try { - var data = response.data; - if (debug) { - log(`\n\n【debug】===============这是 返回data==============`); - log(data) - } - if (data.data.prizeExt) { - addNotifyStr(data.data.prizeExt.name + ' ' + data.data.sendType.name + ' ' + data.data.status.name) - - } else - addNotifyStr(data.data.msg) - - } catch (e) { - addNotifyStr(`异常:${data},原因:${data.msg}`) - } - }).catch(function (error) { - console.error(error); - }).then(res => { - //这里处理正确返回 - resolve(); - }); - }) - -} -//个人信息 -async function info() { - return new Promise((resolve) => { - - var options = { - method: 'GET', - url: 'https://cluster.qifeixian.com/api/wallet/v1/member/account/info', - headers: { - Host: host, - Connection: connection, - 'x-ds-key': newtoken, - Authorization: 'Basic ' + newtoken, - 'Content-Type': contentType, - 'user-agent': userAgent, - 'x-ds-port': xdPort, - 'base-version': baseVersion, - version: version, - Accept: '*/*', - Referer: referer, - 'Accept-Encoding': acceptEncoding - }, - data: {} - }; - if (debug) { - log(`\n【debug】=============== 这是 请求 url ===============`); - log(JSON.stringify(options)); - } - axios.request(options).then(function (response) { - try { - var data = response.data; - if (debug) { - log(`\n\n【debug】===============这是 返回data==============`); - log(data) - } - if (data.data) { - addNotifyStr('money:' + data.data.money + ' score:' + data.data.score) - - } else - addNotifyStr(data.data.msg) - - } catch (e) { - addNotifyStr(`异常:${data},原因:${data.msg}`) - } - }).catch(function (error) { - console.error(error); - }).then(res => { - //这里处理正确返回 - resolve(); - }); - }) - -} -//邀请好友 -async function invite_friends() { - return new Promise((resolve) => { - - var options = { - method: 'POST', - url: 'https://cluster.qifeixian.com/api/activity-center/v1/resouces/record', - headers: { - Host: host, - Connection: connection, - 'x-ds-key': newtoken, - Authorization: 'Basic ' + newtoken, - 'Content-Type': contentType, - 'user-agent': userAgent, - 'x-ds-port': xdPort, - 'base-version': baseVersion, - version: version, - Accept: '*/*', - Referer: referer, - 'Accept-Encoding': acceptEncoding - }, - data: { "type": "invite_friends", "userId": userId } - }; - if (debug) { - log(`\n【debug】=============== 这是 请求 url ===============`); - log(JSON.stringify(options)); - } - axios.request(options).then(async function (response) { - try { - var data = response.data; - if (debug) { - log(`\n\n【debug】===============这是 返回data==============`); - log(data) - } - if (data.data.data.status == false) { - addNotifyStr('未种树 先给你种个葡萄吧') - - } else - addNotifyStr(data.msg) - - } catch (e) { - addNotifyStr(`异常:${data},原因:${data.msg}`) - } - }).catch(function (error) { - console.error(error); - }).then(res => { - //这里处理正确返回 - resolve(); - }); - }) - -} -async function list() { - return new Promise((resolve) => { - - var options = { - method: 'GET', - url: 'https://cluster.qifeixian.com/api/goods/v1/goods/list?gcId=&page=1&page_size=10&name=', - headers: { - Host: 'cluster.qifeixian.com', - Connection: 'keep-alive', - 'x-ds-key': newtoken, - Authorization: 'Basic ' + newtoken, - 'Content-Type': 'application/json', - 'user-agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.42(0x18002a29) NetType/WIFI Language/zh_CN', - 'x-ds-port': '1380', - 'base-version': '3.1.2', - version: '5.0.13', - Accept: '*/*', - Referer: 'https://servicewechat.com/wx3c0d10f34c013209/258/page-frame.html', - 'Accept-Encoding': 'gzip,compress,br,deflate' - }, - data: {} - }; - if (debug) { - log(`\n【debug】=============== 这是 请求 url ===============`); - log(JSON.stringify(options)); - } - axios.request(options).then(function (response) { - try { - var data = response.data; - log(data); - if (debug) { - log(`\n\n【debug】===============这是 返回data==============`); - log(data) - } - if (data.data) { - log('商品编号goods_id:' + data.data.list[0].goods_id) - } else - log(data.data.msg) - - } catch (e) { - log(`异常:${data},原因:${data.msg}`) - } - }).catch(function (error) { - console.error(error); - }).then(res => { - //这里处理正确返回 - resolve(); - }); - }) - -} -//分享爆款商品 -async function share_bk() { - return new Promise((resolve) => { - - var options = { - method: 'POST', - url: 'https://cluster.qifeixian.com/api/activity-center/v1/resouces/record', - headers: { - Host: host, - Connection: connection, - 'x-ds-key': newtoken, - Authorization: 'Basic ' + newtoken, - 'Content-Type': contentType, - 'user-agent': userAgent, - 'x-ds-port': xdPort, - 'base-version': baseVersion, - version: version, - Accept: '*/*', - Referer: referer, - 'Accept-Encoding': acceptEncoding - }, - data: { "type": "share_bk", "userId": userId } - }; - if (debug) { - log(`\n【debug】=============== 这是 请求 url ===============`); - log(JSON.stringify(options)); - } - axios.request(options).then(async function (response) { - try { - var data = response.data; - if (debug) { - log(`\n\n【debug】===============这是 返回data==============`); - log(data) - } - if (data.data.data.status == false) { - addNotifyStr('未种树 先给你种个葡萄吧') - - } else - addNotifyStr(data.msg) - - } catch (e) { - addNotifyStr(`异常:${data},原因:${data.msg}`) - } - }).catch(function (error) { - console.error(error); - }).then(res => { - //这里处理正确返回 - resolve(); - }); - }) - -} -//分享商城商品 -async function share_mall() { - return new Promise((resolve) => { - - var options = { - method: 'POST', - url: 'https://cluster.qifeixian.com/api/activity-center/v1/resouces/record', - headers: { - Host: host, - Connection: connection, - 'x-ds-key': newtoken, - Authorization: 'Basic ' + newtoken, - 'Content-Type': contentType, - 'user-agent': userAgent, - 'x-ds-port': xdPort, - 'base-version': baseVersion, - version: version, - Accept: '*/*', - Referer: referer, - 'Accept-Encoding': acceptEncoding - }, - data: { "type": "share_mall", "userId": userId } - }; - if (debug) { - log(`\n【debug】=============== 这是 请求 url ===============`); - log(JSON.stringify(options)); - } - axios.request(options).then(async function (response) { - try { - var data = response.data; - if (debug) { - log(`\n\n【debug】===============这是 返回data==============`); - log(data) - } - if (data.data.data.status == false) { - addNotifyStr('未种树 先给你种个葡萄吧') - - } else - addNotifyStr("00000" + data.msg) - - } catch (e) { - addNotifyStr(`异常:${data},原因:${data.msg}`) - } - }).catch(function (error) { - console.error(error); - }).then(res => { - //这里处理正确返回 - resolve(); - }); - }) - -} -//每日登录 -async function first() { - return new Promise((resolve) => { - - var options = { - method: 'POST', - url: 'https://cluster.qifeixian.com/api/activity-center/v1/orchard/first', - headers: { - Host: host, - Connection: connection, - 'x-ds-key': newtoken, - Authorization: 'Basic ' + newtoken, - 'Content-Type': contentType, - 'user-agent': userAgent, - 'x-ds-port': xdPort, - 'base-version': baseVersion, - version: version, - Accept: '*/*', - Referer: referer, - 'Accept-Encoding': acceptEncoding - }, - data: {} - }; - if (debug) { - log(`\n【debug】=============== 这是 请求 url ===============`); - log(JSON.stringify(options)); - } - axios.request(options).then(async function (response) { - try { - var data = response.data; - if (debug) { - log(`\n\n【debug】===============这是 返回data==============`); - log(data) - } - if (data.data.data.status == false) { - addNotifyStr('未种树 先给你种个葡萄吧') - await orchard() - await details() - } else - await details() - - } catch (e) { - log(`异常:${data},原因:${data.msg}`) - } - }).catch(function (error) { - console.error(error); - }).then(res => { - //这里处理正确返回 - resolve(); - }); - }) - -} -//种植果树 -async function orchard() { - return new Promise((resolve) => { - - var options = { - method: 'POST', - url: 'https://cluster.qifeixian.com/api/activity-center/v1/orchard/task', - headers: { - Host: host, - Connection: connection, - 'x-ds-key': newtoken, - Authorization: 'Basic ' + newtoken, - 'Content-Type': contentType, - 'user-agent': userAgent, - 'x-ds-port': xdPort, - 'base-version': baseVersion, - version: version, - Accept: '*/*', - Referer: referer, - 'Accept-Encoding': acceptEncoding - }, - data: { "tree_id": 9 } - }; - if (debug) { - log(`\n【debug】=============== 这是 请求 url ===============`); - log(JSON.stringify(options)); - } - axios.request(options).then(async function (response) { - try { - var data = response.data; - if (debug) { - log(`\n\n【debug】===============这是 返回data==============`); - log(data) - } - if (data.data.code = 10000) { - - addNotifyStr('种树成功') - } else - addNotifyStr(data.data.msg) - - } catch (e) { - addNotifyStr(`异常:${data},原因:${data.msg}`) - } - }).catch(function (error) { - console.error(error); - }).then(res => { - //这里处理正确返回 - resolve(); - }); - }) - -} -//详情 -async function details() { - return new Promise((resolve) => { - - var options = { - method: 'GET', - url: 'https://cluster.qifeixian.com/api/activity-center/v1/orchard/details', - headers: { - Host: host, - Connection: connection, - 'x-ds-key': newtoken, - Authorization: 'Basic ' + newtoken, - 'Content-Type': contentType, - 'user-agent': userAgent, - 'x-ds-port': xdPort, - 'base-version': baseVersion, - version: version, - Accept: '*/*', - Referer: referer, - 'Accept-Encoding': acceptEncoding - }, - data: {} - }; - if (debug) { - log(`\n【debug】=============== 这是 请求 url ===============`); - log(JSON.stringify(options)); - } - axios.request(options).then(async function (response) { - try { - var data = response.data; - if (debug) { - log(`\n\n【debug】===============这是 返回data==============`); - log(data) - } - // log(data) - if (data.data.code = 10000) { - tsid = data.data.data.basisinfo['ts_id'] - - tasks = data.data.data.task.daily - - - addNotifyStr(tasks['is_lucky_draw']['task_name'] + ':') - await task_water(tasks['is_lucky_draw']['task_id']) - - addNotifyStr(tasks['is_landing']['task_name'] + ':') - await task_water(tasks['is_landing']['task_id']) - - addNotifyStr(tasks['is_invitation']['task_name'] + ':') - await task_water(tasks['is_invitation']['task_id']) - - addNotifyStr(tasks['is_share']['task_name'] + ':') - await task_water(tasks['is_share']['task_id']) - - addNotifyStr(tasks['is_bk']['task_name'] + ':') - await task_water(tasks['is_bk']['task_id']) - - addNotifyStr(tasks['is_cancel_after_verification_bk']['task_name'] + ':') - await task_water(tasks['is_cancel_after_verification_bk']['task_id']) - - addNotifyStr(tasks['is_consumption']['task_name'] + ':') - await task_water(tasks['is_consumption']['task_id']) - - addNotifyStr(tasks['is_registered']['task_name'] + ':') - await task_water(tasks['is_registered']['task_id']) - - addNotifyStr(tasks['is_registered']['task_name'] + ':') - await task_water(tasks['is_registered']['task_id']) - taskss = data.data.data.task.will - - addNotifyStr(taskss['is_personal_data']['task_name'] + ':') - await task_water(taskss['is_personal_data']['task_id']) - } else - addNotifyStr(data.data.msg) - - } catch (e) { - log(`异常:${data},原因:${data.msg}`) - } - }).catch(function (error) { - console.error(error); - }).then(res => { - //这里处理正确返回 - resolve(); - }); - }) - -} -//领取奖励 -async function task_water(task_id) { - return new Promise((resolve) => { - - var options = { - method: 'GET', - url: 'https://cluster.qifeixian.com/api/activity-center/v1/orchard/task_water', - params: { ts_id: tsid, task_id: task_id }, - headers: { - Host: host, - Connection: connection, - 'x-ds-key': newtoken, - Authorization: 'Basic ' + newtoken, - 'Content-Type': contentType, - 'user-agent': userAgent, - 'x-ds-port': xdPort, - 'base-version': baseVersion, - version: version, - Accept: '*/*', - Referer: referer, - 'Accept-Encoding': acceptEncoding - }, - data: {} - }; - if (debug) { - log(`\n【debug】=============== 这是 请求 url ===============`); - log(JSON.stringify(options)); - } - axios.request(options).then(function (response) { - try { - var data = response.data; - if (debug) { - log(`\n\n【debug】===============这是 返回data==============`); - log(data) - } - if (data.data.code = 10000) { - - addNotifyStr(data.data.msg) - } else - addNotifyStr(data.data.msg) - - } catch (e) { - addNotifyStr(`异常:${data},原因:${data.msg}`) - } - }).catch(function (error) { - console.error(error); - }).then(res => { - //这里处理正确返回 - resolve(); - }); - }) - -} -//浇水 -async function water() { - return new Promise((resolve) => { - - var options = { - method: 'GET', - url: 'https://cluster.qifeixian.com/api/activity-center/v1/orchard/water/' + tsid, - - headers: { - Host: host, - Connection: connection, - 'x-ds-key': newtoken, - Authorization: 'Basic ' + newtoken, - 'Content-Type': contentType, - 'user-agent': userAgent, - 'x-ds-port': xdPort, - 'base-version': baseVersion, - version: version, - Accept: '*/*', - Referer: referer, - 'Accept-Encoding': acceptEncoding - }, - data: {} - }; - if (debug) { - log(`\n【debug】=============== 这是 请求 url ===============`); - log(JSON.stringify(options)); - } - axios.request(options).then(function (response) { - try { - var data = response.data; - if (debug) { - log(`\n\n【debug】===============这是 返回data==============`); - log(data) - } - if (data.data.code = 10000) { - - addNotifyStr(data.data.msg) - } else - addNotifyStr(data.data.msg) - - } catch (e) { - addNotifyStr(`异常:${data},原因:${data.msg}`) - } - }).catch(function (error) { - console.error(error); - }).then(res => { - //这里处理正确返回 - resolve(); - }); - }) - -} - - - - - - - - -async function Envs() { - if (qfxhd) { - if (qfxhd.indexOf("@") != -1) { - qfxhd.split("@").forEach((item) => { - - qfxhdArr.push(item); - }); - } else if (qfxhd.indexOf("\n") != -1) { - qfxhd.split("\n").forEach((item) => { - qfxhdArr.push(item); - }); - } else { - qfxhdArr.push(qfxhd); - } - } else { - addNotifyStr(`\n 【${$.name}】:未填写变量 qfxhd`) - return; - } - - return true; -} - -function md5(inputString) { - var hc = "0123456789abcdef"; - - function rh(n) { - var j, s = ""; - for (j = 0; j <= 3; j++) s += hc.charAt((n >> (j * 8 + 4)) & 0x0F) + hc.charAt((n >> (j * 8)) & 0x0F); - return s; - } - - function ad(x, y) { - var l = (x & 0xFFFF) + (y & 0xFFFF); - var m = (x >> 16) + (y >> 16) + (l >> 16); - return (m << 16) | (l & 0xFFFF); - } - - function rl(n, c) { - return (n << c) | (n >>> (32 - c)); - } - - function cm(q, a, b, x, s, t) { - return ad(rl(ad(ad(a, q), ad(x, t)), s), b); - } - - function ff(a, b, c, d, x, s, t) { - return cm((b & c) | ((~b) & d), a, b, x, s, t); - } - - function gg(a, b, c, d, x, s, t) { - return cm((b & d) | (c & (~d)), a, b, x, s, t); - } - - function hh(a, b, c, d, x, s, t) { - return cm(b ^ c ^ d, a, b, x, s, t); - } - - function ii(a, b, c, d, x, s, t) { - return cm(c ^ (b | (~d)), a, b, x, s, t); - } - - function sb(x) { - var i; - var nblk = ((x.length + 8) >> 6) + 1; - var blks = new Array(nblk * 16); - for (i = 0; i < nblk * 16; i++) blks[i] = 0; - for (i = 0; i < x.length; i++) blks[i >> 2] |= x.charCodeAt(i) << ((i % 4) * 8); - blks[i >> 2] |= 0x80 << ((i % 4) * 8); - blks[nblk * 16 - 2] = x.length * 8; - return blks; - } - - var i, x = sb(inputString), - a = 1732584193, - b = -271733879, - c = -1732584194, - d = 271733878, - olda, oldb, oldc, oldd; - for (i = 0; i < x.length; i += 16) { - olda = a; - oldb = b; - oldc = c; - oldd = d; - a = ff(a, b, c, d, x[i + 0], 7, -680876936); - d = ff(d, a, b, c, x[i + 1], 12, -389564586); - c = ff(c, d, a, b, x[i + 2], 17, 606105819); - b = ff(b, c, d, a, x[i + 3], 22, -1044525330); - a = ff(a, b, c, d, x[i + 4], 7, -176418897); - d = ff(d, a, b, c, x[i + 5], 12, 1200080426); - c = ff(c, d, a, b, x[i + 6], 17, -1473231341); - b = ff(b, c, d, a, x[i + 7], 22, -45705983); - a = ff(a, b, c, d, x[i + 8], 7, 1770035416); - d = ff(d, a, b, c, x[i + 9], 12, -1958414417); - c = ff(c, d, a, b, x[i + 10], 17, -42063); - b = ff(b, c, d, a, x[i + 11], 22, -1990404162); - a = ff(a, b, c, d, x[i + 12], 7, 1804603682); - d = ff(d, a, b, c, x[i + 13], 12, -40341101); - c = ff(c, d, a, b, x[i + 14], 17, -1502002290); - b = ff(b, c, d, a, x[i + 15], 22, 1236535329); - a = gg(a, b, c, d, x[i + 1], 5, -165796510); - d = gg(d, a, b, c, x[i + 6], 9, -1069501632); - c = gg(c, d, a, b, x[i + 11], 14, 643717713); - b = gg(b, c, d, a, x[i + 0], 20, -373897302); - a = gg(a, b, c, d, x[i + 5], 5, -701558691); - d = gg(d, a, b, c, x[i + 10], 9, 38016083); - c = gg(c, d, a, b, x[i + 15], 14, -660478335); - b = gg(b, c, d, a, x[i + 4], 20, -405537848); - a = gg(a, b, c, d, x[i + 9], 5, 568446438); - d = gg(d, a, b, c, x[i + 14], 9, -1019803690); - c = gg(c, d, a, b, x[i + 3], 14, -187363961); - b = gg(b, c, d, a, x[i + 8], 20, 1163531501); - a = gg(a, b, c, d, x[i + 13], 5, -1444681467); - d = gg(d, a, b, c, x[i + 2], 9, -51403784); - c = gg(c, d, a, b, x[i + 7], 14, 1735328473); - b = gg(b, c, d, a, x[i + 12], 20, -1926607734); - a = hh(a, b, c, d, x[i + 5], 4, -378558); - d = hh(d, a, b, c, x[i + 8], 11, -2022574463); - c = hh(c, d, a, b, x[i + 11], 16, 1839030562); - b = hh(b, c, d, a, x[i + 14], 23, -35309556); - a = hh(a, b, c, d, x[i + 1], 4, -1530992060); - d = hh(d, a, b, c, x[i + 4], 11, 1272893353); - c = hh(c, d, a, b, x[i + 7], 16, -155497632); - b = hh(b, c, d, a, x[i + 10], 23, -1094730640); - a = hh(a, b, c, d, x[i + 13], 4, 681279174); - d = hh(d, a, b, c, x[i + 0], 11, -358537222); - c = hh(c, d, a, b, x[i + 3], 16, -722521979); - b = hh(b, c, d, a, x[i + 6], 23, 76029189); - a = hh(a, b, c, d, x[i + 9], 4, -640364487); - d = hh(d, a, b, c, x[i + 12], 11, -421815835); - c = hh(c, d, a, b, x[i + 15], 16, 530742520); - b = hh(b, c, d, a, x[i + 2], 23, -995338651); - a = ii(a, b, c, d, x[i + 0], 6, -198630844); - d = ii(d, a, b, c, x[i + 7], 10, 1126891415); - c = ii(c, d, a, b, x[i + 14], 15, -1416354905); - b = ii(b, c, d, a, x[i + 5], 21, -57434055); - a = ii(a, b, c, d, x[i + 12], 6, 1700485571); - d = ii(d, a, b, c, x[i + 3], 10, -1894986606); - c = ii(c, d, a, b, x[i + 10], 15, -1051523); - b = ii(b, c, d, a, x[i + 1], 21, -2054922799); - a = ii(a, b, c, d, x[i + 8], 6, 1873313359); - d = ii(d, a, b, c, x[i + 15], 10, -30611744); - c = ii(c, d, a, b, x[i + 6], 15, -1560198380); - b = ii(b, c, d, a, x[i + 13], 21, 1309151649); - a = ii(a, b, c, d, x[i + 4], 6, -145523070); - d = ii(d, a, b, c, x[i + 11], 10, -1120210379); - c = ii(c, d, a, b, x[i + 2], 15, 718787259); - b = ii(b, c, d, a, x[i + 9], 21, -343485551); - a = ad(a, olda); - b = ad(b, oldb); - c = ad(c, oldc); - d = ad(d, oldd); - } - return rh(a) + rh(b) + rh(c) + rh(d); -} - -/** - * 添加消息 - * @param str - * @param is_log - */ -function addNotifyStr(str, is_log = true) { - if (is_log) { - log(`${str}\n`) - } - msg += `${str}\n` -} - -// ============================================发送消息============================================ \\ -async function SendMsg(message) { - if (!message) - return; - - if (Notify > 0) { - if ($.isNode()) { - var notify = require('../sendNotify'); - await notify.sendNotify($.name, message); - } else { - $.msg(message); - } - } else { - log(message); - } -} - -/** - * 随机延时1-30s,避免大家运行时间一样 - * @returns {*|number} - */ -function delay() { - let time = parseInt(Math.random() * 100000); - if (time > 30000) { // 大于30s重新生成 - return delay(); - } else { - console.log('随机延时:', `${time}ms, 避免大家运行时间一样`) - return time; // 小于30s,返回 - } -} - -/** - * 随机数生成 - */ -function randomString(e) { - e = e || 32; - var t = "QWERTYUIOPASDFGHJKLZXCVBNM1234567890", - a = t.length, - n = ""; - for (i = 0; i < e; i++) - n += t.charAt(Math.floor(Math.random() * a)); - return n -} - -/** - * 随机整数生成 - */ -function randomInt(min, max) { - return Math.round(Math.random() * (max - min) + min) -} - -/** - * 获取毫秒时间戳 - */ -function timestampMs() { - return new Date().getTime(); -} - -/** - * 获取秒时间戳 - */ -function timestampS() { - return Date.parse(new Date()) / 1000; -} - -function randomStrings(e) { - e = e || 32; - let t = "abcdefhijkmnprstwxyz2345678", - a = t.length, - n = ""; - for (i = 0; i < e; i++) - n += t.charAt(Math.floor(Math.random() * a)); - return n -} -/** - * - * 示例:$.time('yyyy-MM-dd qq HH:mm:ss.S') - * :$.time('yyyyMMddHHmmssS') - * y:年 M:月 d:日 q:季 H:时 m:分 s:秒 S:毫秒 - * 其中y可选0-4位占位符、S可选0-1位占位符,其余可选0-2位占位符 - * @param {string} fmt 格式化参数 - * @param {number} 可选: 根据指定时间戳返回格式化日期 - * - */ -function time(fmt, ts = null) { - const date = ts ? new Date(ts) : new Date(); - let o = { - 'M+': date.getMonth() + 1, - 'd+': date.getDate(), - 'H+': date.getHours(), - 'm+': date.getMinutes(), - 's+': date.getSeconds(), - 'q+': Math.floor((date.getMonth() + 3) / 3), - S: date.getMilliseconds(), - }; - if (/(y+)/.test(fmt)) - fmt = fmt.replace( - RegExp.$1, - (date.getFullYear() + '').substr(4 - RegExp.$1.length) - ); - for (let k in o) - if (new RegExp('(' + k + ')').test(fmt)) - fmt = fmt.replace( - RegExp.$1, - RegExp.$1.length == 1 ? - o[k] : - ('00' + o[k]).substr(('' + o[k]).length) - ); - return fmt; -} - -/** - * 修改配置文件 - */ - - - - -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/wxapp/yeyebupaocha.js b/wxapp/yeyebupaocha.js deleted file mode 100644 index 57cbf69..0000000 --- a/wxapp/yeyebupaocha.js +++ /dev/null @@ -1,261 +0,0 @@ - -/** - * 爷爷不泡茶 - * yybpc - * cron "10 8 * * *" yybpc.js - * export yybpc= qm-user-token 多账号换行或者#分隔 - */ -// ============================================================================================================ -const $ = new Env('vx爷爷不泡茶') -const axios = require('axios') -const env_name = 'yybpc' //环境变量名字 -const env = process.env[env_name] || '' -const Notify = 1 -const debug = 0 -let scriptVersionNow = "1.0.0"; -let msg = ""; -// ==================================异步顺序============================================================================== -!(async () => { - //await getNotice(); //远程通知 - //await getVersion("yang7758258/ohhh154@main/yybpc.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 Authorization = ck_info[0] - //let uid = ck_info[0] - //let deviceCode = ck_info[2] - let user = { - index: index, - Authorization, - //uid, - //deviceCode, - } - index = index + 1 //每次用完序号+1 - //开始账号任务 - let Run = new run(); - await Run.userTask(user) - //每个账号之间等1~5秒随机时间 - let rnd_time = Math.floor(Math.random() * 4000) + 1000 - console.log(`随机等待${rnd_time / 1000}秒...`) - await $.wait(rnd_time) - } -} -// ======================================开始任务========================================= -class run { - constructor(user) { - - } -async userTask(user) { - console.log(`\n========= 账号[${user.index}] 开始任务 =========`) - await this.SignTask(user) - await wait(2) - await this.account(user) -} -// ============================================================================================================================= -//签到 - async SignTask(user) { - try { - DoubleLog(`🕊账号[${user.index}] 开始签到...`); - let urlObject = { - method: 'post', - url: `https://webapi.qmai.cn/web/cmk-center/sign/takePartInSign`, - headers: { - "qm-from": "wechat", - "qm-user-token": user.Authorization, - '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:{ - "activityId": "983701274523176960", - "appid": "wx3423ef0c7b7f19af" - } - } - // - let { data: result} = await axios.request(urlObject) - //console.log(result); - if (result?.status == true) { - //打印签到结果 - DoubleLog(`🕊账号[${user.index}] 签到成功🎉`); - }if(result?.data.sign == "false") { - DoubleLog(`🕊账号[${user.index}] 签到失败:原因未知🚫`) - }if (result?.status == false) { - DoubleLog(`🕊账号[${user.index}] 签到失败:${result.message}🚫`) - } - - - } catch (e) { - console.log(e); - } - } -//积分 -async account(user) { - try { - DoubleLog(`🕊账号[${user.index}] 开始查询积分...`); - let urlObject = { - method: 'post', - url: `https://webapi.qmai.cn/web/mall-apiserver/integral/user/points-info`, - headers: { - "qm-from": "wechat", - "qm-user-token": user.Authorization, - '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: { - "appid": "wx3423ef0c7b7f19af" - } - } - // - let { data: result} = await axios.request(urlObject) - //console.log(result); - if (result?.status == true) { - //打印签到结果 - DoubleLog(`🕊账号[${user.index}] 当前积分[${result.data.totalPoints}]🎉`); - }else { - DoubleLog(`🕊账号[${user.index}] 积分查询失败:${result.message}🚫`) - } - - - } 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://tfapi.cn/tl.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] : ""; - DoubleLog(`\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) } diff --git a/wxapp/zippo.js b/wxapp/zippo.js deleted file mode 100644 index 52f68f3..0000000 --- a/wxapp/zippo.js +++ /dev/null @@ -1,516 +0,0 @@ - -/** - * - * zippo - * - * cron 0 0,7 * * * zippo.js - * 多账号并行执行任务模板 - * 抓域名wx-center.zippo.com.cn/下 请求authorization - * export zippo= 多账号换行或者& - */ -//=====================================================// -const $ = new Env("zippo"); -const Notify = 1 -const debug = 0 -const axios = require("axios"); -let ckStr = ($.isNode() ? process.env.zippo : $.getdata('zippo')) || ''; //检测CK 外部 -let msg, ck; -let host = 'wx-center.zippo.com.cn'; -let hostname = 'https://' + host; -let scriptVersionNow = "1.0.1"; -//---------------------------------------------------// -async function tips(ckArr) { - //DoubleLog(`当前脚本版本${Version}\n📌,如果脚本版本不一致请及时更新`); - console.log("完成积分签到与收藏任务"); - DoubleLog(`\n========== 共找到 ${ckArr.length} 个账号 ==========`); - debugLog(`【debug】 这是你的账号数组:\n ${ckArr}`); -} -!(async () => { - let ckArr = await checkEnv(ckStr, "zippo"); //检查CK - //await getNotice(); //远程通知 - //await getVersion("yang7758258/ohhh154@main/zippo会员签到.js"); - await tips(ckArr); //脚本提示 - await start(); //开始任务 - await SendMsg(msg); //发送通知 - -})() - .catch((e) => $.logErr(e)) - .finally(() => $.done()); - - -//---------------------------------------------------------------------------------封装循环测试 -async function newstart(name, taskname, time) { //任务名 函数名 等待时间 - let ckArr = await checkEnv(ckStr, "zippo"); //检查CK - console.log("\n📌📌📌📌📌📌📌📌" + name + "📌📌📌📌📌📌📌📌"); - for (i = 0; i < ckArr.length; i++) { - ck = ckArr[i].split("&"); //单账号多变量分割符,如果一个账号需要user和token两个变量,那么则输入user1&token1@user2&token2... - //let CK = ckArr[i] - await taskname(); - await $.wait(time * 1000); - } -} -//-------------------------------------------------------------------------------封装循环测试 - -async function start() { - await newstart("登录/CK检测", userinfo, 1); - await newstart("开始签到", dailySign, 1); - await newstart("开始收藏任务", shoucang, 1); - await newstart("开始领取", lingjiang, 1); - await newstart("当前积分查询", jifen, 1); -} - - - - -//------------------------------------------------------------------------------------------ -//用户信息查询 -async function userinfo() { - try { - let url = { - url: `${hostname}/api/users/profile`, - headers: { - 'x-app-id': 'zippo', - 'x-platform-id': 'wxaa75ffd8c2d75da7', - 'x-platform-env': 'release', - 'x-platform': 'wxmp', - 'authorization': ck[0], - 'xweb_xhr': 1, - 'sec-fetch-site': 'cross-site', - 'sec-fetch-mode': 'cors', - 'sec-fetch-dest': 'empty', - 'referer': 'https://servicewechat.com/wxaa75ffd8c2d75da7/76/page-frame.html', - 'accept-language': 'zh-CN,zh;q=0.9', - }, - - }; - let result = await httpGet(url, `用户信息查询`); - - //console.log(result); - if (result?.code != 401) { - DoubleLog(`账号[` + Number(i + 1) + `]` + `当前用户为🌸[${result.phone}]🎉`); - //let phone = result.data.phone - //let jifen = result?.data.memberInfo.totalScore - } if (result?.code == 401) { - DoubleLog(`账号[` + Number(i + 1) + `]` + `查询失败,可能是CK失效!`); - //console.log(result); - } - - } catch (error) { - //console.log(error); - console.log("服务器卡爆啦"); - } - -} - -//积分查询 -async function jifen() { - try { - let url = { - url: `${hostname}/api/users/points?withoutList=1`, - headers: { - 'x-app-id': 'zippo', - 'x-platform-id': 'wxaa75ffd8c2d75da7', - 'x-platform-env': 'release', - 'x-platform': 'wxmp', - 'authorization': ck[0], - 'xweb_xhr': 1, - 'sec-fetch-site': 'cross-site', - 'sec-fetch-mode': 'cors', - 'sec-fetch-dest': 'empty', - 'referer': 'https://servicewechat.com/wxaa75ffd8c2d75da7/76/page-frame.html', - 'accept-language': 'zh-CN,zh;q=0.9', - }, - - }; - let result = await httpGet(url, `当前积分查询`); - if (result?.balance != 0) { - DoubleLog(`账号[` + Number(i + 1) + `]` + `当前积分为💰[${result.balance}]🎉`); - }if (result?.code == 401) { - DoubleLog(`账号[` + Number(i + 1) + `]` + `查询失败,可能是CK失效!`); - } - - - - - - } catch (error) { - console.log("请检查环境变量是否正确"); - - } - -} - - - - - - -//用户签到 POST -async function dailySign() { - try { - let url = { - url: `${hostname}/api/daily-signin`, - headers: { - 'x-app-id': 'zippo', - 'x-platform-id': 'wxaa75ffd8c2d75da7', - 'x-platform-env': 'release', - 'x-platform': 'wxmp', - 'authorization': ck[0], - 'xweb_xhr': 1, - 'sec-fetch-site': 'cross-site', - 'sec-fetch-mode': 'cors', - 'sec-fetch-dest': 'empty', - 'referer': 'https://servicewechat.com/wxaa75ffd8c2d75da7/76/page-frame.html', - 'accept-language': 'zh-CN,zh;q=0.9', - }, - }; - let result = await httpPost(url, `签到`); - - //console.log(result); - if (result?.code != 'already_signed') { - DoubleLog(`账号[` + Number(i + 1) + `]` + `签到成功,获得积分:${result.count}🎉`); - await wait(2); - } if (result?.code == 'already_signed') { - DoubleLog(`账号[` + Number(i + 1) + `]` + `签到失败:${result.message}`); - } - - - - } catch (error) { - //console.log(error); - console.log("好像出了点小问题"); - } - -} -//用户收藏任务 POST -async function shoucang() { - try { - let host = 'wx-center.zippo.com.cn'; - let hostname = 'https://' + host; - let url = `${hostname}/api/favorites` - let body = { - "targetType": "sku", - "targetId": "265", - "favorited": true - } - - const result = await axios.post(url, body, { - headers: { - 'x-app-id': 'zippo', - 'x-platform-id': 'wxaa75ffd8c2d75da7', - 'x-platform-env': 'release', - 'x-platform': 'wxmp', - 'authorization': ck[0], - 'xweb_xhr': '1', - 'sec-fetch-site': 'cross-site', - 'sec-fetch-mode': 'cors', - 'sec-fetch-dest': 'empty', - 'referer': 'https://servicewechat.com/wxaa75ffd8c2d75da7/76/page-frame.html', - 'accept-language': 'zh-CN,zh;q=0.9', - } - }) - const r = result.data; - //console.log(result); - if (r?.favorited == true) { - DoubleLog(`账号[` + Number(i + 1) + `]` + `任务成功,id编号:${result.data.targetId}🎉`); - await wait(2); - }if (r?.code == 400) { - DoubleLog(`账号[` + Number(i + 1) + `]` + `任务失败:${result.data.message}`); - } - }catch (error) { - //console.log(error); - console.log("好像出了点小问题"); - } -} - -//用户领奖 POST -async function lingjiang() { - try { - let url = { - url: `${hostname}/api/missions/5/rewards`, - headers: { - 'x-app-id': 'zippo', - 'x-platform-id': 'wxaa75ffd8c2d75da7', - 'x-platform-env': 'release', - 'x-platform': 'wxmp', - 'authorization': ck[0], - 'xweb_xhr': 1, - 'sec-fetch-site': 'cross-site', - 'sec-fetch-mode': 'cors', - 'sec-fetch-dest': 'empty', - 'referer': 'https://servicewechat.com/wxaa75ffd8c2d75da7/76/page-frame.html', - 'accept-language': 'zh-CN,zh;q=0.9', - }, - body: JSON.stringify({"id":5}), - }; - let result = await httpPost(url, `领取奖励`); - - //console.log(result); - if (result?.rewardValue == 5) { - DoubleLog(`账号[` + Number(i + 1) + `]` + `领取成功,获得积分💰:${result.rewardValue}🎉`); - await wait(2); - } if (result?.code == 400) { - DoubleLog(`账号[` + Number(i + 1) + `]` + `领取失败:${result.message}`); - } - - - - } catch (error) { - //console.log(error); - console.log("好像出了点小问题"); - } - -} - - - -// #region ******************************************************** 固定代码 ******************************************************** -/** - * 变量检查 - */ -async function checkEnv(ck, Variables) { - return new Promise((resolve) => { - let ckArr = [] - if (ck) { - if (ck.indexOf("@") !== -1) { - - ck.split("@").forEach((item) => { - ckArr.push(item); - }); - } else if (ck.indexOf("\n") !== -1) { - - ck.split("\n").forEach((item) => { - ckArr.push(item); - }); - } else { - ckArr.push(ck); - } - resolve(ckArr) - } else { - console.log(` ${$.neme}:未填写变量 ${Variables} ,请仔细阅读脚本说明!`) - } - } - ) -} -/** - * 发送消息 - */ -async function SendMsg(message) { - if (!message) return; - if (Notify > 0) { - if ($.isNode()) { - var notify = require("../sendNotify"); - //let text = '仅完成积分签到\n@auth:Mist\n@date:2024-05-29\n注: 本脚本仅用于个人学习和交流请勿用于非法用途。用户应当遵守所有适用的法律和规定。在任何情况下,脚本的开发者或贡献者均不对任何直接或间接使用本脚本而产生的结果负责。' - await notify.sendNotify($.name, message); - } else { - // $.msg(message); - $.msg($.name, '', message) - } - } else { - console.log(message); - } -} - -/** - * 双平台log输出 - */ -function DoubleLog(data) { - if ($.isNode()) { - if (data) { - console.log(`${data}`); - msg += `\n${data}`; - } - } else { - console.log(`${data}`); - msg += `\n${data}`; - } - -} -/** -* 等待 X 秒 -*/ -function wait(n) { - return new Promise(function (resolve) { - setTimeout(resolve, n * 1000); - }); -} - -/** - * get请求 - */ -async function httpGet(getUrlObject, tip, timeout = 3) { - return new Promise((resolve) => { - let url = getUrlObject; - if (!tip) { - let tmp = arguments.callee.toString(); - let re = /function\s*(\w*)/i; - let matches = re.exec(tmp); - tip = matches[1]; - } - if (debug) { - console.log(`\n 【debug】=============== 这是 ${tip} 请求 url ===============`); - console.log(url); - } - - $.get( - url, - async (err, resp, data) => { - try { - if (debug) { - console.log(`\n\n 【debug】===============这是 ${tip} 返回data==============`); - console.log(data); - console.log(`\n 【debug】=============这是 ${tip} json解析后数据============`); - console.log(JSON.parse(data)); - } - let result = JSON.parse(data); - if (result == undefined) { - return; - } else { - resolve(result); - } - - } catch (e) { - //console.log(err, resp); - console.log(`\n ${tip} 失败了!请稍后尝试!!`); - msg = `\n ${tip} 失败了!请稍后尝试!!` - console.log("服务器卡爆啦"); - } finally { - resolve(); - } - }, - timeout - ); - }); -} - -/** - * post请求 - */ -async function httpPost(postUrlObject, tip, timeout = 3) { - return new Promise((resolve) => { - let url = postUrlObject; - if (!tip) { - let tmp = arguments.callee.toString(); - let re = /function\s*(\w*)/i; - let matches = re.exec(tmp); - tip = matches[1]; - } - if (debug) { - console.log(`\n 【debug】=============== 这是 ${tip} 请求 url ===============`); - console.log(url); - } - - $.post( - url, - async (err, resp, data) => { - try { - if (debug) { - console.log(`\n\n 【debug】===============这是 ${tip} 返回data==============`); - console.log(data); - console.log(`\n 【debug】=============这是 ${tip} json解析后数据============`); - console.log(JSON.parse(data)); - } - let result = JSON.parse(data); - if (result == undefined) { - return; - } else { - resolve(result); - } - - } catch (e) { - //console.log(err, resp); - console.log(`\n ${tip} 失败了!请稍后尝试!!`); - msg = `\n ${tip} 失败了!请稍后尝试!!` - console.log("服务器卡爆啦"); - } finally { - resolve(); - } - }, - timeout - ); - }); -} - -/** - * 网络请求 (get, post等) - */ -function httpRequest(options, timeout = 1 * 1000) { - method = options.method ? options.method.toLowerCase() : options.body ? "post" : "get"; - return new Promise(resolve => { - setTimeout(() => { - $[method](options, (err, resp, data) => { - try { - if (err) { - console.log(JSON.stringify(err)); - $.logErr(err); - } else { - try { data = JSON.parse(data); } catch (error) { } - } - } catch (e) { - console.log(e); - $.logErr(e, resp); - } finally { - resolve(data); - } - }) - }, timeout) - }) -} - - -/** - * debug调试 - */ -function debugLog(...args) { - if (debug) { - console.log(...args); - } -} -//获取远程通知 -async function getNotice() { - try { - const urls = [ - "https://gitee.com/ohhhooh/jd_haoyangmao/raw/master/Notice.json", - - ]; - let notice = null; - for (const url of urls) { - const options = { url, headers: { "User-Agent": "" }, }; - const result = await httpRequest(options); - if (result && "notice" in result) { - notice = result.notice.replace(/\\n/g, "\n"); - break; - } - } - if (notice) { $.DoubleLog(notice); } - } catch (e) { - console.log(e); - } -} - -/** - * 获取远程版本 - */ -function getVersion(scriptUrl, timeout = 3 * 1000) { - return new Promise((resolve) => { - const options = { url: `https://fastly.jsdelivr.net/gh/${scriptUrl}` }; - $.get(options, (err, resp, data) => { - try { - const regex = /scriptVersionNow\s*=\s*(["'`])([\d.]+)\1/; - const match = data.match(regex); - const scriptVersionLatest = match ? match[2] : ""; - console.log(`\n====== 当前版本:${scriptVersionNow} 📌 最新版本:${scriptVersionLatest} ======`); - } catch (e) { - $.logErr(e, resp); - } - resolve(); - }, timeout); - }); -} - - - - -// 完整 API -function Env(t, e) { class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return ("POST" === e && (s = this.post), new Promise((e, a) => { s.call(this, t, (t, s, r) => { t ? a(t) : e(s) }) })) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new (class { constructor(t, e) { this.userList = []; this.userIdx = 0; (this.name = t), (this.http = new s(this)), (this.data = null), (this.dataFile = "box.dat"), (this.logs = []), (this.isMute = !1), (this.isNeedRewrite = !1), (this.logSeparator = "\n"), (this.encoding = "utf-8"), (this.startTime = new Date().getTime()), Object.assign(this, e), this.log("", `🔔${this.name},开始!`) } getEnv() { return "undefined" != typeof $environment && $environment["surge-version"] ? "Surge" : "undefined" != typeof $environment && $environment["stash-version"] ? "Stash" : "undefined" != typeof module && module.exports ? "Node.js" : "undefined" != typeof $task ? "Quantumult X" : "undefined" != typeof $loon ? "Loon" : "undefined" != typeof $rocket ? "Shadowrocket" : void 0 } isNode() { return "Node.js" === this.getEnv() } isQuanX() { return "Quantumult X" === this.getEnv() } isSurge() { return "Surge" === this.getEnv() } isLoon() { return "Loon" === this.getEnv() } isShadowrocket() { return "Shadowrocket" === this.getEnv() } isStash() { return "Stash" === this.getEnv() } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const a = this.getdata(t); if (a) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise((e) => { this.get({ url: t }, (t, s, a) => e(a)) }) } runScript(t, e) { return new Promise((s) => { let a = this.getdata("@chavy_boxjs_userCfgs.httpapi"); a = a ? a.replace(/\n/g, "").trim() : a; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); (r = r ? 1 * r : 20), (r = e && e.timeout ? e.timeout : r); const [i, o] = a.split("@"), n = { url: `http://${o}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": i, Accept: "*/*" }, timeout: r, }; this.post(n, (t, e, a) => s(a)) }).catch((t) => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { (this.fs = this.fs ? this.fs : require("fs")), (this.path = this.path ? this.path : require("path")); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), a = !s && this.fs.existsSync(e); if (!s && !a) return {}; { const a = s ? t : e; try { return JSON.parse(this.fs.readFileSync(a)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { (this.fs = this.fs ? this.fs : require("fs")), (this.path = this.path ? this.path : require("path")); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), a = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : a ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const a = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of a) if (((r = Object(r)[t]), void 0 === r)) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), (e.slice(0, -1).reduce((t, s, a) => Object(t[s]) === t[s] ? t[s] : (t[s] = Math.abs(e[a + 1]) >> 0 == +e[a + 1] ? [] : {}), t)[e[e.length - 1]] = s), t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, a] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, a, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, a, r] = /^@(.*?)\.(.*?)$/.exec(e), i = this.getval(a), o = a ? ("null" === i ? null : i || "{}") : "{}"; try { const e = JSON.parse(o); this.lodash_set(e, r, t), (s = this.setval(JSON.stringify(e), a)) } catch (e) { const i = {}; this.lodash_set(i, r, t), (s = this.setval(JSON.stringify(i), a)) } } else s = this.setval(t, e); return s } getval(t) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.read(t); case "Quantumult X": return $prefs.valueForKey(t); case "Node.js": return (this.data = this.loaddata()), this.data[t]; default: return (this.data && this.data[t]) || null } } setval(t, e) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": return $persistentStore.write(t, e); case "Quantumult X": return $prefs.setValueForKey(t, e); case "Node.js": return ((this.data = this.loaddata()), (this.data[e] = t), this.writedata(), !0); default: return (this.data && this.data[e]) || null } } initGotEnv(t) { (this.got = this.got ? this.got : require("got")), (this.cktough = this.cktough ? this.cktough : require("tough-cookie")), (this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar()), t && ((t.headers = t.headers ? t.headers : {}), void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = () => { }) { switch ((t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"], delete t.headers["content-type"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let s = require("iconv-lite"); this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), (e.cookieJar = this.ckjar) } } catch (t) { this.logErr(t) } }).then((t) => { const { statusCode: a, statusCode: r, headers: i, rawBody: o, } = t, n = s.decode(o, this.encoding); e(null, { status: a, statusCode: r, headers: i, rawBody: o, body: n, }, n) }, (t) => { const { message: a, response: r } = t; e(a, r, r && s.decode(r.rawBody, this.encoding)) }) } } post(t, e = () => { }) { const s = t.method ? t.method.toLocaleLowerCase() : "post"; switch ((t.body && t.headers && !t.headers["Content-Type"] && !t.headers["content-type"] && (t.headers["content-type"] = "application/x-www-form-urlencoded"), t.headers && (delete t.headers["Content-Length"], delete t.headers["content-length"]), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: this.isSurge() && this.isNeedRewrite && ((t.headers = t.headers || {}), Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient[s](t, (t, s, a) => { !t && s && ((s.body = a), (s.statusCode = s.status ? s.status : s.statusCode), (s.status = s.statusCode)), e(t, s, a) }); break; case "Quantumult X": (t.method = s), this.isNeedRewrite && ((t.opts = t.opts || {}), Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then((t) => { const { statusCode: s, statusCode: a, headers: r, body: i, bodyBytes: o, } = t; e(null, { status: s, statusCode: a, headers: r, body: i, bodyBytes: o, }, i, o) }, (t) => e((t && t.error) || "UndefinedError")); break; case "Node.js": let a = require("iconv-lite"); this.initGotEnv(t); const { url: r, ...i } = t; this.got[s](r, i).then((t) => { const { statusCode: s, statusCode: r, headers: i, rawBody: o, } = t, n = a.decode(o, this.encoding); e(null, { status: s, statusCode: r, headers: i, rawBody: o, body: n }, n) }, (t) => { const { message: s, response: r } = t; e(s, r, r && a.decode(r.rawBody, this.encoding)) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date(); let a = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds(), }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in a) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? a[e] : ("00" + a[e]).substr(("" + a[e]).length))); return t } queryStr(t) { let e = ""; for (const s in t) { let a = t[s]; null != a && "" !== a && ("object" == typeof a && (a = JSON.stringify(a)), (e += `${s}=${a}&`)) } return (e = e.substring(0, e.length - 1)), e } msg(e = t, s = "", a = "", r) { const i = (t) => { switch (typeof t) { case void 0: return t; case "string": switch (this.getEnv()) { case "Surge": case "Stash": default: return { url: t }; case "Loon": case "Shadowrocket": return t; case "Quantumult X": return { "open-url": t }; case "Node.js": return }case "object": switch (this.getEnv()) { case "Surge": case "Stash": case "Shadowrocket": default: { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } case "Loon": { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } case "Quantumult X": { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl, a = t["update-pasteboard"] || t.updatePasteboard; return { "open-url": e, "media-url": s, "update-pasteboard": a, } } case "Node.js": return }default: return } }; if (!this.isMute) switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": default: $notification.post(e, s, a, i(r)); break; case "Quantumult X": $notify(e, s, a, i(r)); break; case "Node.js": }if (!this.isMuteLog) { let t = ["", "==============📣系统通知📣==============",]; t.push(e), s && t.push(s), a && t.push(a), console.log(t.join("\n")), (this.logs = this.logs.concat(t)) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { switch (this.getEnv()) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: this.log("", `❗️${this.name},错误!`, t); break; case "Node.js": this.log("", `❗️${this.name},错误!`, t.stack) } } wait(t) { return new Promise((e) => setTimeout(e, t)) } DoubleLog(d) { if (this.isNode()) { if (d) { console.log(`${d}`); msg += `\n ${d}` } } else { console.log(`${d}`); msg += `\n ${d}` } } async SendMsg(m) { if (!m) return; if (Notify > 0) { if (this.isNode()) { var notify = require("../sendNotify"); await notify.sendNotify(this.name, m) } else { this.msg(this.name, "", m) } } else { console.log(m) } } done(t = {}) { const e = new Date().getTime(), s = (e - this.startTime) / 1e3; switch ((this.log("", `🔔${this.name},结束!🕛${s}秒`), this.log(), this.getEnv())) { case "Surge": case "Loon": case "Stash": case "Shadowrocket": case "Quantumult X": default: $done(t); break; case "Node.js": process.exit(1) } } })(t, e) } -//Env rewrite:smallfawn Update-time:23-6-30 newAdd:DoubleLog & SendMsg diff --git a/wxapp/杰士邦安心福利社.js b/wxapp/杰士邦安心福利社.js deleted file mode 100644 index 56e9998..0000000 --- a/wxapp/杰士邦安心福利社.js +++ /dev/null @@ -1,321 +0,0 @@ -/* ------------------------------------------- -@Author: sm -@Date: 2024.06.07 19:15 -@Description: 测试 ------------------------------------------- -#Notice: - 变量名jieshibang 抓小程序杰士邦会员中心https://api.vshop.hchiv.cn/jfmb/api Headers中 authorization 去掉Bearer 多账号&连接 -⚠️【免责声明】 ------------------------------------------- -1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。 -2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。 -3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。 -4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。 -5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。 -6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。 -7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。 -*/ - -const $ = new Env("杰士邦会员中心"); -let ckName = `jieshibang`; -const strSplitor = "#"; -const envSplitor = ["&", "\n"]; -const notify = $.isNode() ? require("../sendNotify") : ""; -const axios = require("axios"); -const defaultUserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 16_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.31(0x18001e31) NetType/WIFI Language/zh_CN miniProgram" - -class Public { - async request(options) { - return await axios.request(options); - } -} -class Task extends Public { - constructor(env) { - - super(); - this.index = $.userIdx++ - let user = env.split("#"); - this.token = user[0]; - this.isSign = false; - } - async addSign() { - let options = { - method: "POST", - url: "https://api.vshop.hchiv.cn/jfmb/api/play-default/sign/add-sign-new.do?sideType=3&mob=&appId=wx5966681b4a895dee&shopNick=wx5966681b4a895dee×tamp=1739704494584&guideNo=&encryPlatId=d89385f4d1a7783414258f80d3fbedf6bb2d0e10f94fc010eb524fdd2a14f9a3", - headers: { - "accept": "*/*", - "accept-language": "zh-CN,zh;q=0.9", - "appenv": "test", - "authorization": "Bearer " + this.token, - "content-type": "application/json", - "sec-fetch-dest": "empty", - "sec-fetch-mode": "cors", - "sec-fetch-site": "cross-site", - "xweb_xhr": "1", - "cookie": "JSESSIONID=acb5cc02-db4e-4caf-9ebf-c5b67524ec06", - "Referer": "https://servicewechat.com/wx5966681b4a895dee/30/page-frame.html", - "Referrer-Policy": "unsafe-url" - }, - data: JSON.stringify({ - "appId": "wx5966681b4a895dee", - "openId": true, - "shopNick": "", - "timestamp": Date.now(), - "interfaceSource": 0, - "activityId": "156947" - }), - } - try { - let { data: res } = await this.request(options); - if (res.success == true) { - $.log(`签到成功 获得【${res.data.integral}】积分`) - } else { - $.log(`签到失败`) - console.log(res); - } - } catch (e) { - console.log(e); - - } - } - async activityInfo() { - let options = { - method: "POST", - url: "https://api.vshop.hchiv.cn/jfmb/api/activity/activity-info.do?sideType=3&mob=&appId=wx5966681b4a895dee&shopNick=wx5966681b4a895dee×tamp=1739705505052&guideNo=&encryPlatId=d89385f4d1a7783414258f80d3fbedf6bb2d0e10f94fc010eb524fdd2a14f9a3", - headers: { - "accept": "*/*", - "accept-language": "zh-CN,zh;q=0.9", - "appenv": "test", - "authorization": "Bearer " + this.token, - "content-type": "application/json", - "sec-fetch-dest": "empty", - "sec-fetch-mode": "cors", - "sec-fetch-site": "cross-site", - "xweb_xhr": "1", - "cookie": "JSESSIONID=acb5cc02-db4e-4caf-9ebf-c5b67524ec06", - "Referer": "https://servicewechat.com/wx5966681b4a895dee/30/page-frame.html", - "Referrer-Policy": "unsafe-url" - }, - data: JSON.stringify({ - "appId": "wx5966681b4a895dee", - "openId": true, - "shopNick": "", - "timestamp": Date.now(), - "interfaceSource": 0, - "id": "156947" - }), - } - try { - let { data: res } = await this.request(options); - if (res.code == '1') { - - if (res.data.isSign == false) { - $.log(`今日未签到`) - this.isSign = false - } else { - $.log(`今日已签到`) - this.isSign = true - } - } else { - - } - } catch (e) { - console.log(e); - - } - } - async run() { - - await this.activityInfo(); - if (this.isSign == false) { - await this.addSign(); - } - - - } - - -} - - - - - - - -!(async () => { - await getNotice() - $.checkEnv(ckName); - - for (let user of $.userList) { - // - - await new Task(user).run(); - - } - - -})() - .catch((e) => console.log(e)) - .finally( () => $.done()); - -async function getNotice() { - let options = { - url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`, - headers: { - "User-Agent": defaultUserAgent, - } - } - let { data: res } = await new Public().request(options); - return res -} - - -// prettier-ignore -function Env(t, s) { - return new (class { - constructor(t, s) { - this.userIdx = 1; - this.userList = []; - this.userCount = 0; - this.name = t; - this.notifyStr = []; - this.logSeparator = "\n"; - this.startTime = new Date().getTime(); - Object.assign(this, s); - this.log(`\ud83d\udd14${this.name},\u5f00\u59cb!`); - } - checkEnv(ckName) { - let userCookie = (this.isNode() ? process.env[ckName] : "") || ""; - this.userList = userCookie.split(envSplitor.find((o) => userCookie.includes(o)) || "&").filter((n) => n); - this.userCount = this.userList.length; - this.log(`共找到${this.userCount}个账号`); - } - async sendMsg() { - this.log("==============📣Center 通知📣==============") - for (let i = 0; i < this.notifyStr.length; i++) { - if (Object.prototype.toString.call(this.notifyStr[i]) === '[object Object]' || - Object.prototype.toString.call(this.notifyStr[i]) === '[object Array]') { - this.notifyStr[i] = JSON.stringify(this.notifyStr[i]); - } - } - - let message = this.notifyStr.join(this.logSeparator); - if (this.isNode()) { - await notify.sendNotify(this.name, message); - } else { - } - } - isNode() { - return "undefined" != typeof module && !!module.exports; - } - - 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; - } - - 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; - } - - log(content) { - this.notifyStr.push(content) - console.log(content) - } - wait(t) { - return new Promise((s) => setTimeout(s, t)); - } - async done(t = {}) { - await this.sendMsg(); - const s = new Date().getTime(), - e = (s - this.startTime) / 1e3; - this.log( - `\ud83d\udd14${this.name},\u7ed3\u675f!\ud83d\udd5b ${e}\u79d2` - ); - if (this.isNode()) { - process.exit(1); - } - } - })(t, s); -} \ No newline at end of file diff --git a/wxapp/草莓台.js b/wxapp/草莓台.js deleted file mode 100644 index 4e4a514..0000000 --- a/wxapp/草莓台.js +++ /dev/null @@ -1,516 +0,0 @@ -/** - * 草莓台小程序签到v0.03 - * cron 10 12 * * * 草莓台.js - * - * ========= 青龙--配置文件 =========== - * # 项目名称 - * export caomeitai_token='你抓包的openid#你的userId' - - * 自己抓包协议头上的Cookie - - * 多账号换行或&隔开 - - * 奖励:签到草莓币 - * const $ = new Env("草莓台") - * ==================================== - * - */ -//Sat Jan 25 2025 08:33:12 GMT+0000 (Coordinated Universal Time) -//Base:https://github.com/echo094/decode-js -//Modify:https://github.com/smallfawn/decode_action -const $ = new Env("草莓台小程序签到"); -let envParams = "caomeitai_token", - envSplitor = ["\n", "&"], - authorizationToken = ($.isNode() ? process.env[envParams] : $.getdata(envParams)) || "", - initedJobForTokens = [], - currentUserIndex = 0; -class JobTask { - constructor(_0x2a8b2b) { - this.index = ++currentUserIndex; - this.points = 0; - this.valid = false; - this.userId = ""; - [this.openid, this.userId] = _0x2a8b2b?.["split"]("#"); - this.activedAuthToken = ""; - } - async ["taskApi"](_0x47ec4f, _0x4e5aeb, _0x574064, _0x2d47eb) { - let _0x4541cc = null; - try { - { - let _0x12da9e = { - "url": _0x574064, - "headers": { - "Accept": "*/*", - "Accept-Language": "zh-CN,zh", - "Connection": "keep-alive", - "Content-Type": "application/json", - "Host": "cmtv.xmay.cc", - "Sec-Fetch-Dest": "empty", - "Sec-Fetch-Mode": "cors", - "Sec-Fetch-Site": "cross-site", - "referer": "https://servicewechat.com/wxc2a56f3a7492b8c4/145/page-frame.html", - "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF XWEB/6945", - "xweb_xhr": "1" - }, - "timeout": 60000 - }; - this.activedAuthToken && (_0x12da9e.headers.Authorization = "Bearer " + this.activedAuthToken); - if (_0x2d47eb) { - _0x12da9e.body = _0x2d47eb; - _0x12da9e.headers["Content-Length"] = _0x2d47eb?.["length"]; - } - await httpRequest(_0x4e5aeb, _0x12da9e).then(async _0x5cd31a => { - { - if (_0x5cd31a.resp?.["statusCode"] == 200) { - if (_0x5cd31a.resp?.["body"]) _0x4541cc = JSON.parse(_0x5cd31a.resp.body);else {} - } else console.log("账号[" + this.index + "]调用" + _0x4e5aeb + "[" + _0x47ec4f + "]出错,返回状态码[" + (_0x5cd31a.resp?.["statusCode"] || "") + "]", "返回结果:", _0x5cd31a.resp?.["body"]); - } - }); - } - } catch (_0x24afeb) { - console.log(_0x24afeb); - } finally { - return Promise.resolve(_0x4541cc); - } - } - async ["LoginIn"]() { - try { - let _0x329bf1 = "LoginIn", - _0x168fa7 = "post", - _0x13d94a = "https://cmtv.xmay.cc/api/WX/login2", - _0x444be0 = "{\"id\":\"" + this.userId + "\",\"openid\":\"" + this.openid + "\"}"; - await this.taskApi(_0x329bf1, _0x168fa7, _0x13d94a, _0x444be0).then(async _0x257d58 => { - { - if (_0x257d58?.["token"]) { - this.activedAuthToken = _0x257d58?.["token"]; - this.valid = true; - this.points = _0x257d58?.["user"]["chbeanNum"] / 100; - this.userId = _0x257d58?.["user"]["id"]; - console.log("账号[" + this.index + "] 登录成功,昵称:" + _0x257d58?.["user"]["nickname"] + ",草莓币:" + _0x257d58?.["user"]["chbeanNum"] / 100); - } else console.log("账号[" + this.index + "] 登录失败", _0x257d58), this.valid = false; - } - }); - } catch (_0x28cd9b) { - console.log(_0x28cd9b); - } finally { - return Promise.resolve(1); - } - } - async ["GetUserTask"]() { - try { - { - let _0x45d636 = "GetUserTask", - _0x413c1c = "get", - _0x1e2fea = "https://cmtv.xmay.cc/api/registerInfo/checkRegister?userId=" + this.userId, - _0x29a6c7 = ""; - return await this.taskApi(_0x45d636, _0x413c1c, _0x1e2fea, _0x29a6c7).then(async _0x335edf => { - if (_0x335edf) { - if (!_0x335edf.isAfter) return console.log("账号[" + this.index + "] " + this.userId + " - 已经签到了,无需签到"), false; - console.log("账号[" + this.index + "] " + this.userId + " - 检测到还未签到"); - return true; - } else $.logAndNotify("账号[" + this.index + "] " + this.userId + " - 查询草莓币失败,可能帐号无效:" + JSON.stringify(_0x335edf)); - }); - } - } catch (_0x519874) { - console.log(_0x519874); - } - } - async ["SignInDaily"]() { - try { - let _0x3c8847 = "SignInDaily", - _0x43fe4c = "post", - _0x27aa7e = "https://cmtv.xmay.cc/api/registerInfo", - _0x20f926 = "{\"userId\":\"" + this.userId + "\"}"; - await this.taskApi(_0x3c8847, _0x43fe4c, _0x27aa7e, _0x20f926).then(async _0x3bb44f => { - { - if (_0x3bb44f?.["id"]) console.log("账号[" + this.index + "] 签到成功,获得" + _0x3bb44f.cmb + "草莓币,当前草莓币:" + (this.points + _0x3bb44f.cmb));else { - console.log("账号[" + this.index + "] 签到失败"); - } - } - }); - } catch (_0xe65438) { - console.log(_0xe65438); - } finally { - return Promise.resolve(1); - } - } - async ["doTask"]() { - try { - console.log("\n============= 账号[" + this.index + "] 开始签到============="); - (await this.GetUserTask()) && (await this.SignInDaily()); - } catch (_0x208f28) { - console.log(_0x208f28); - } - } -} -!(async () => { - if (typeof $request !== "undefined") await GetRewrite();else { - if (!(await checkEnv())) return; - console.log("\n================ 开始执行 ================"); - for (let _0x13b5ec of initedJobForTokens) { - console.log("----------- 执行 第 [" + _0x13b5ec.index + "] 个账号 -----------"); - await _0x13b5ec.LoginIn(); - } - let _0x183d17 = initedJobForTokens.filter(_0x57aa60 => _0x57aa60.valid); - if (_0x183d17.length > 0) { - { - console.log("\n================ 任务队列构建完毕 ================"); - for (let _0x50ca01 of _0x183d17) { - console.log("----------- 账号[" + _0x50ca01.index + "] -----------"); - await _0x50ca01.doTask(); - } - } - } else { - console.log("\n====幻生提示:无可用账号,请检查配置============ 任务结束 ================"); - } - await $.showmsg(); - } -})().catch(_0x337032 => console.log(_0x337032)).finally(() => $.done()); -async function GetRewrite() {} -async function checkEnv() { - if (authorizationToken) { - let _0x1a5c2c = envSplitor[0]; - for (let _0x3bab5c of envSplitor) { - if (authorizationToken.indexOf(_0x3bab5c) > -1) { - _0x1a5c2c = _0x3bab5c; - break; - } - } - for (let _0x2df51d of authorizationToken.split(_0x1a5c2c)) { - { - if (_0x2df51d) initedJobForTokens.push(new JobTask(_0x2df51d)); - } - } - userCount = initedJobForTokens.length; - } else { - console.log("未找到 配置信息,请检查是否配置 变量:", envParams); - return; - } - console.log("共找到" + userCount + "个账号"); - return true; -} -async function httpRequest(_0xc08f76, _0x506aa0) { - httpErr = null; - httpReq = null; - httpResp = null; - return new Promise(_0x31994f => { - $.send(_0xc08f76, _0x506aa0, async (_0x22f513, _0x1d7338, _0x2845eb) => { - httpErr = _0x22f513; - httpReq = _0x1d7338; - httpResp = _0x2845eb; - _0x31994f({ - "err": _0x22f513, - "req": _0x1d7338, - "resp": _0x2845eb - }); - }); - }); -} -function Env(_0x513ce9, _0x3f5b80) { - "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); - return new class { - constructor(_0xe1e102, _0x737bae) { - this.name = _0xe1e102; - this.notifyStr = ""; - this.startTime = new Date().getTime(); - Object.assign(this, _0x737bae); - 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"](_0x4af141) { - let _0xf083dc = this.getval(_0x4af141); - if (/^@/.test(_0x4af141)) { - const [, _0x40f7e0, _0x1886d5] = /^@(.*?)\.(.*?)$/.exec(_0x4af141), - _0x13b49e = _0x40f7e0 ? this.getval(_0x40f7e0) : ""; - if (_0x13b49e) try { - const _0x3fbd1c = JSON.parse(_0x13b49e); - _0xf083dc = _0x3fbd1c ? this.lodash_get(_0x3fbd1c, _0x1886d5, "") : _0xf083dc; - } catch (_0x35b1b7) { - _0xf083dc = ""; - } - } - return _0xf083dc; - } - ["setdata"](_0x28bfb3, _0x322236) { - let _0x1d16d8 = false; - if (/^@/.test(_0x322236)) { - { - const [, _0x1d300b, _0x4d0d99] = /^@(.*?)\.(.*?)$/.exec(_0x322236), - _0x201be5 = this.getval(_0x1d300b), - _0x549465 = _0x1d300b ? "null" === _0x201be5 ? null : _0x201be5 || "{}" : "{}"; - try { - const _0x76924e = JSON.parse(_0x549465); - this.lodash_set(_0x76924e, _0x4d0d99, _0x28bfb3); - _0x1d16d8 = this.setval(JSON.stringify(_0x76924e), _0x1d300b); - } catch (_0x463f8b) { - const _0x4c1fab = {}; - this.lodash_set(_0x4c1fab, _0x4d0d99, _0x28bfb3); - _0x1d16d8 = this.setval(JSON.stringify(_0x4c1fab), _0x1d300b); - } - } - } else { - _0x1d16d8 = this.setval(_0x28bfb3, _0x322236); - } - return _0x1d16d8; - } - ["getval"](_0x57c252) { - return this.isSurge() || this.isLoon() ? $persistentStore.read(_0x57c252) : this.isQuanX() ? $prefs.valueForKey(_0x57c252) : this.isNode() ? (this.data = this.loaddata(), this.data[_0x57c252]) : this.data && this.data[_0x57c252] || null; - } - ["setval"](_0x134051, _0x4faa57) { - return this.isSurge() || this.isLoon() ? $persistentStore.write(_0x134051, _0x4faa57) : this.isQuanX() ? $prefs.setValueForKey(_0x134051, _0x4faa57) : this.isNode() ? (this.data = this.loaddata(), this.data[_0x4faa57] = _0x134051, this.writedata(), true) : this.data && this.data[_0x4faa57] || null; - } - ["send"](_0x1c870b, _0x5a3c06, _0x42ea8e = () => {}) { - { - if (_0x1c870b != "get" && _0x1c870b != "post" && _0x1c870b != "put" && _0x1c870b != "delete") { - console.log("无效的http方法:" + _0x1c870b); - return; - } - if (_0x1c870b == "get" && _0x5a3c06.headers) delete _0x5a3c06.headers["Content-Type"], delete _0x5a3c06.headers["Content-Length"];else { - if (_0x5a3c06.body && _0x5a3c06.headers) { - { - if (!_0x5a3c06.headers["Content-Type"]) _0x5a3c06.headers["Content-Type"] = "application/x-www-form-urlencoded"; - } - } - } - if (this.isSurge() || this.isLoon()) { - this.isSurge() && this.isNeedRewrite && (_0x5a3c06.headers = _0x5a3c06.headers || {}, Object.assign(_0x5a3c06.headers, { - "X-Surge-Skip-Scripting": false - })); - let _0x4a58cf = { - "method": _0x1c870b, - "url": _0x5a3c06.url, - "headers": _0x5a3c06.headers, - "timeout": _0x5a3c06.timeout, - "data": _0x5a3c06.body - }; - if (_0x1c870b == "get") delete _0x4a58cf.data; - $axios(_0x4a58cf).then(_0x376e23 => { - { - const { - status: _0x2633d7, - request: _0x1ee9f, - headers: _0x5588d1, - data: _0x56dfa3 - } = _0x376e23; - _0x42ea8e(null, _0x1ee9f, { - "statusCode": _0x2633d7, - "headers": _0x5588d1, - "body": _0x56dfa3 - }); - } - }).catch(_0x48f466 => console.log(_0x48f466)); - } else { - if (this.isQuanX()) _0x5a3c06.method = _0x1c870b.toUpperCase(), this.isNeedRewrite && (_0x5a3c06.opts = _0x5a3c06.opts || {}, Object.assign(_0x5a3c06.opts, { - "hints": false - })), $task.fetch(_0x5a3c06).then(_0x24a32b => { - { - const { - statusCode: _0x2ce309, - request: _0x553dee, - headers: _0x47ad1d, - body: _0x1d51d4 - } = _0x24a32b; - _0x42ea8e(null, _0x553dee, { - "statusCode": _0x2ce309, - "headers": _0x47ad1d, - "body": _0x1d51d4 - }); - } - }, _0x2b68b9 => _0x42ea8e(_0x2b68b9));else { - if (this.isNode()) { - { - this.got = this.got ? this.got : require("got"); - const { - url: _0x535b9e, - ..._0x16a812 - } = _0x5a3c06; - this.instance = this.got.extend({ - "followRedirect": false - }); - this.instance[_0x1c870b](_0x535b9e, _0x16a812).then(_0x1b5a14 => { - { - const { - statusCode: _0x2b7984, - request: _0x24596f, - headers: _0x17cbfd, - body: _0x18ca69 - } = _0x1b5a14; - _0x42ea8e(null, _0x24596f, { - "statusCode": _0x2b7984, - "headers": _0x17cbfd, - "body": _0x18ca69 - }); - } - }, _0x56154e => { - { - const { - message: _0x88f437, - request: _0x261d64, - response: _0x2cc23c - } = _0x56154e; - _0x42ea8e(_0x88f437, _0x261d64, _0x2cc23c); - } - }); - } - } - } - } - } - } - ["time"](_0x1b4234, _0x2e33d8 = null) { - let _0x13f44e = _0x2e33d8 ? new Date(_0x2e33d8) : new Date(), - _0xd1abb3 = { - "M+": _0x13f44e.getMonth() + 1, - "d+": _0x13f44e.getDate(), - "h+": _0x13f44e.getHours(), - "m+": _0x13f44e.getMinutes(), - "s+": _0x13f44e.getSeconds(), - "q+": Math.floor((_0x13f44e.getMonth() + 3) / 3), - "S": _0x13f44e.getMilliseconds() - }; - /(y+)/.test(_0x1b4234) && (_0x1b4234 = _0x1b4234.replace(RegExp.$1, (_0x13f44e.getFullYear() + "").substr(4 - RegExp.$1.length))); - for (let _0x12593f in _0xd1abb3) new RegExp("(" + _0x12593f + ")").test(_0x1b4234) && (_0x1b4234 = _0x1b4234.replace(RegExp.$1, 1 == RegExp.$1.length ? _0xd1abb3[_0x12593f] : ("00" + _0xd1abb3[_0x12593f]).substr(("" + _0xd1abb3[_0x12593f]).length))); - return _0x1b4234; - } - async ["showmsg"]() { - if (!this.notifyStr) return; - let _0x44fa77 = this.name + " 运行通知\n\n" + this.notifyStr; - if ($.isNode()) { - var _0x2a2ac8 = require("../sendNotify"); - console.log("\n============== 推送 =============="); - await _0x2a2ac8.sendNotify(this.name, _0x44fa77); - } else this.msg(_0x44fa77); - } - ["logAndNotify"](_0x147484) { - console.log(_0x147484); - this.notifyStr += _0x147484; - this.notifyStr += "\n"; - } - ["logAndNotifyWithTime"](_0x445549) { - { - let _0xb8cb7b = "[" + this.time("hh:mm:ss.S") + "]" + _0x445549; - console.log(_0xb8cb7b); - this.notifyStr += _0xb8cb7b; - this.notifyStr += "\n"; - } - } - ["logWithTime"](_0x3ee709) { - console.log("[" + this.time("hh:mm:ss.S") + "]" + _0x3ee709); - } - ["msg"](_0x2fbece = t, _0x54b688 = "", _0x3bcc34 = "", _0x224c9d) { - const _0x1a3f75 = _0x250b42 => { - { - if (!_0x250b42) return _0x250b42; - if ("string" == typeof _0x250b42) return this.isLoon() ? _0x250b42 : this.isQuanX() ? { - "open-url": _0x250b42 - } : this.isSurge() ? { - "url": _0x250b42 - } : undefined; - if ("object" == typeof _0x250b42) { - if (this.isLoon()) { - let _0x207cc8 = _0x250b42.openUrl || _0x250b42.url || _0x250b42["open-url"], - _0x5139ba = _0x250b42.mediaUrl || _0x250b42["media-url"]; - return { - "openUrl": _0x207cc8, - "mediaUrl": _0x5139ba - }; - } - if (this.isQuanX()) { - let _0x49efdc = _0x250b42["open-url"] || _0x250b42.url || _0x250b42.openUrl, - _0x3e3764 = _0x250b42["media-url"] || _0x250b42.mediaUrl; - return { - "open-url": _0x49efdc, - "media-url": _0x3e3764 - }; - } - if (this.isSurge()) { - let _0x260a6d = _0x250b42.url || _0x250b42.openUrl || _0x250b42["open-url"]; - return { - "url": _0x260a6d - }; - } - } - } - }; - this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(_0x2fbece, _0x54b688, _0x3bcc34, _0x1a3f75(_0x224c9d)) : this.isQuanX() && $notify(_0x2fbece, _0x54b688, _0x3bcc34, _0x1a3f75(_0x224c9d))); - let _0x1ab4e9 = ["", "============== 系统通知 =============="]; - _0x1ab4e9.push(_0x2fbece); - _0x54b688 && _0x1ab4e9.push(_0x54b688); - _0x3bcc34 && _0x1ab4e9.push(_0x3bcc34); - console.log(_0x1ab4e9.join("\n")); - } - ["getMin"](_0x111e23, _0x5d49a3) { - return _0x111e23 < _0x5d49a3 ? _0x111e23 : _0x5d49a3; - } - ["getMax"](_0x57a5cf, _0x4b6479) { - return _0x57a5cf < _0x4b6479 ? _0x4b6479 : _0x57a5cf; - } - ["padStr"](_0x1330d0, _0x447e5a, _0x1ce3d8 = "0") { - let _0x74cf55 = String(_0x1330d0), - _0x475acb = _0x447e5a > _0x74cf55.length ? _0x447e5a - _0x74cf55.length : 0, - _0x5dc5de = ""; - for (let _0x3735bb = 0; _0x3735bb < _0x475acb; _0x3735bb++) { - _0x5dc5de += _0x1ce3d8; - } - _0x5dc5de += _0x74cf55; - return _0x5dc5de; - } - ["json2str"](_0x2e906e, _0x548b9d, _0x156871 = false) { - let _0x485825 = []; - for (let _0xafaf11 of Object.keys(_0x2e906e).sort()) { - let _0x593dc4 = _0x2e906e[_0xafaf11]; - if (_0x593dc4 && _0x156871) _0x593dc4 = encodeURIComponent(_0x593dc4); - _0x485825.push(_0xafaf11 + "=" + _0x593dc4); - } - return _0x485825.join(_0x548b9d); - } - ["str2json"](_0x55e93e, _0x170529 = false) { - { - let _0x806c53 = {}; - for (let _0x5bc7b3 of _0x55e93e.split("&")) { - if (!_0x5bc7b3) continue; - let _0x2887cc = _0x5bc7b3.indexOf("="); - if (_0x2887cc == -1) continue; - let _0x4fc7f5 = _0x5bc7b3.substr(0, _0x2887cc), - _0x33ebe3 = _0x5bc7b3.substr(_0x2887cc + 1); - if (_0x170529) _0x33ebe3 = decodeURIComponent(_0x33ebe3); - _0x806c53[_0x4fc7f5] = _0x33ebe3; - } - return _0x806c53; - } - } - ["randomString"](_0xc6b621, _0x555c1b = "abcdef0123456789") { - let _0x447945 = ""; - for (let _0x5b26e3 = 0; _0x5b26e3 < _0xc6b621; _0x5b26e3++) { - _0x447945 += _0x555c1b.charAt(Math.floor(Math.random() * _0x555c1b.length)); - } - return _0x447945; - } - ["randomList"](_0x39e14e) { - { - let _0x30db5e = Math.floor(Math.random() * _0x39e14e.length); - return _0x39e14e[_0x30db5e]; - } - } - ["wait"](_0x39530a) { - return new Promise(_0x40404a => setTimeout(_0x40404a, _0x39530a)); - } - ["done"](_0x38e142 = {}) { - const _0x3168b5 = new Date().getTime(), - _0xd54e2e = (_0x3168b5 - this.startTime) / 1000; - console.log("\n" + this.name + " 运行结束,共运行了 " + _0xd54e2e + " 秒!"); - if (this.isSurge() || this.isQuanX() || this.isLoon()) $done(_0x38e142); - } - }(_0x513ce9, _0x3f5b80); -} \ No newline at end of file