feat(del some script): del some script

This commit is contained in:
smallfawn 2026-04-06 18:28:39 +08:00
parent bd2055532b
commit c0944fc0be
8 changed files with 1 additions and 3580 deletions

View File

@ -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 = "#";

View File

@ -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('通知服务不可用')

View File

@ -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<iPhone12,1>',
'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);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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&timestamp=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&timestamp=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);
}

View File

@ -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);
}