fix(fix bug): fix bug notice

This commit is contained in:
smallfawn committed 2026-04-07 20:21:56 +08:00
1 parent 9beadc566c
commit 295b81a176
36 files changed
+893 -3340

No files matched your search

+40 -31
View File
@@ -36,45 +36,43 @@ jobs:
import datetime
import subprocess
# 1. 获取更改的文件列表
# 1. 获取本次 Push 更改的文件列表
try:
diff_cmd = ['git', 'diff', '--name-only', 'HEAD~1', 'HEAD']
result = subprocess.run(diff_cmd, capture_output=True, text=True, check=True)
changed_files = result.stdout.splitlines()
except subprocess.CalledProcessError:
diff_cmd = ['git', 'diff', '--name-only', '--cached']
result = subprocess.run(diff_cmd, capture_output=True, text=True, check=True)
changed_files = result.stdout.splitlines()
except Exception:
changed_files = []
try:
diff_cmd = ['git', 'diff', '--name-only', '--cached']
result = subprocess.run(diff_cmd, capture_output=True, text=True, check=True)
changed_files = result.stdout.splitlines()
except Exception:
changed_files = []
# 2. 筛选逻辑:必须在 daily 目录下,且不是 notify.py 和 .md 文件
target_files = []
now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
# 2. 提取变更文件中的 Env 名称及更新时间
updates = {}
for f in changed_files:
# 检查文件是否在 daily 目录下且文件存在
if f.startswith('daily/') and os.path.exists(f):
filename = os.path.basename(f)
# 排除 notify.py 和所有 .md 后缀文件
if filename != 'notify.py' and not f.endswith('.md'):
target_files.append(f)
with open(f, 'r', encoding='utf-8') as file:
match = re.search(r'Env\s*\(\s*["\']([^"\']+)["\']\s*\)', file.read())
if match:
updates[match.group(1)] = now
if not target_files:
print("没有检测到符合条件的脚本文件变更(排除 notify.py 和 md),退出。")
exit(0)
# 3. 提取 Env 名称
now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
updates = {}
for f in target_files:
with open(f, 'r', encoding='utf-8') as file:
content = file.read()
match = re.search(r'Env\s*\(\s*["\']([^"\']+)["\']\s*\)', content)
if match:
updates[match.group(1)] = now
if not updates:
print("变更的脚本中未找到 Env 标签,退出。")
exit(0)
# 3. 遍历 daily 目录获取所有的 Env(用于找出表格中缺失的)
all_envs = set()
if os.path.exists('daily'):
for root, _, files in os.walk('daily'):
for file in files:
if file != 'notify.py' and not file.endswith('.md'):
fpath = os.path.join(root, file).replace('\\', '/')
with open(fpath, 'r', encoding='utf-8') as f:
match = re.search(r'Env\s*\(\s*["\']([^"\']+)["\']\s*\)', f.read())
if match:
all_envs.add(match.group(1))
# 4. 修改 README.md
readme_path = 'README.md'
@@ -85,8 +83,8 @@ jobs:
with open(readme_path, 'r', encoding='utf-8') as f:
full_text = f.read()
start_tag = "<!-- README_TABLE_START -->"
end_tag = "<!-- README_TABLE_END -->"
start_tag = ""
end_tag = ""
if start_tag not in full_text or end_tag not in full_text:
print("错误:未找到锚点标记!")
@@ -113,25 +111,36 @@ jobs:
existing_names = set()
new_body_lines = []
# A. 处理表格中已存在的脚本
for line in body_lines:
parts = [p.strip() for p in line.split('|')]
if len(parts) >= 4:
name = parts[1]
existing_names.add(name)
# 如果该脚本在本次 push 中被修改,更新时间
if name in updates:
line = f"| {name} | {updates[name]} | ✅ |"
new_body_lines.append(line)
# B. 添加本次修改引发的新增脚本
for name, tm in updates.items():
if name not in existing_names:
new_body_lines.append(f"| {name} | {tm} | ✅ |")
existing_names.add(name)
# C. 添加存在于 daily 目录但 README 表格中缺失的脚本
for name in all_envs:
if name not in existing_names:
new_body_lines.append(f"| {name} | {now} | ✅ |")
existing_names.add(name)
final_table = "\n".join(header + separator + new_body_lines)
final_content = f"{pre_part}{start_tag}\n{final_table}\n{end_tag}{post_part}"
with open(readme_path, 'w', encoding='utf-8') as f:
f.write(final_content)
print("README.md 更新成功。")
print("README.md 处理完成。")
EOF
python update_readme.py
+15 -9
View File
@@ -106,13 +106,19 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -215,13 +215,19 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -96,13 +96,19 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+152
View File
@@ -0,0 +1,152 @@
/*
------------------------------------------
@Author: sm
@Date: 2024.06.07 19:15
@Description: 测试
cron 8 10 * * *
------------------------------------------
#Notice:
变量名kekoukeleba 抓小程序可口可乐吧 member-api.icoke.cn/api Headers中 authorization 去掉Bearer 多账号&连接
⚠️【免责声明】
------------------------------------------
1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。
2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。
3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。
4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。
5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。
6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。
7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。
*/
const { Env } = require('../tools/env');
const $ = new Env("可口可乐吧");
let ckName = `kekoukeleba`;
const strSplitor = "#";
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 {
request(options) {
return axios.request(options);
}
}
class Task extends Public {
constructor(env) {
super();
this.index = $.userIdx++
let user = env.split(strSplitor);
this.token = user[0];
this.isSign = false;
}
async addSign() {
let options = {
method: "GET",
url: "https://member-api.icoke.cn/api/icoke-sign/icoke/mini/sign/main/sign",
headers: {
"accept": "application/json, text/plain, */*",
"accept-language": "zh-CN,zh;q=0.9",
"authorization": "" + this.token,
"content-type": "application/json",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site",
"xweb_xhr": "1",
"Referer": "https://servicewechat.com/wxa5811e0426a94686/421/page-frame.html",
"Referrer-Policy": "unsafe-url"
},
}
try {
let { data: res } = await this.request(options);
if (res.success == true) {
$.log(`签到成功 获得【${res.point}】快乐瓶`)
} else {
$.log(`签到失败`)
console.log(res);
}
} catch (e) {
console.log(e);
}
}
async userInfo() {
let options = {
method: "GET",
url: "https://member-api.icoke.cn/api/icoke-customer/icoke/mini/customer/main/points",
headers: {
"accept": "application/json, text/plain, */*",
"accept-language": "zh-CN,zh;q=0.9",
"authorization": "" + this.token,
"content-type": "application/json",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site",
"xweb_xhr": "1",
"Referer": "https://servicewechat.com/wxa5811e0426a94686/421/page-frame.html",
"Referrer-Policy": "unsafe-url"
},
}
try {
let { data: res } = await this.request(options);
$.log(`目前还剩【${res.point}】瓶 `)
} catch (e) {
console.log(e);
}
}
async run() {
await this.userInfo();
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() {
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+14 -8
View File
@@ -228,13 +228,19 @@ class Task {
.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,
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
}
let { data: res } = await axios.request(options);
$.log(res)
return res
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -140,13 +140,19 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -212,13 +212,19 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -302,13 +302,19 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -116,13 +116,19 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -119,13 +119,19 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -253,13 +253,19 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -170,13 +170,19 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -124,13 +124,19 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+121
View File
@@ -0,0 +1,121 @@
/*
------------------------------------------
@Author: sm
@Date: 2024.06.07 19:15
@Description: 活力伊利小程序签到
cron: 30 8 * * *
------------------------------------------
#Notice:
变量名 hlyl
抓取 https://msmarket.msx.digitalyili.com/请求头access-token 多账户&或换行
⚠️【免责声明】
------------------------------------------
1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。
2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。
3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。
4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。
5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。
6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。
7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。
*/
const { Env } = require("../tools/env")
const $ = new Env("活力伊利小程序");
let ckName = `hlyl`;
const strSplitor = "#";
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 Task {
constructor(env) {
this.index = $.userIdx++
this.user = env.split(strSplitor);
this.token = this.user[0];
}
async run() {
await this.signIn()
}
async signIn() {
let options = {
method: 'POST',
url: `https://msmarket.msx.digitalyili.com/gateway/api/member/sign/config`,
headers: {
"accept": "*/*",
"accept-language": "zh-CN,zh;q=0.9",
"access-token": "" + this.token,
"atv-page": "",
"content-type": "application/json",
"forward-appid": "",
"priority": "u=1, i",
"register-source": "",
"scene": "1145",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site",
"source-type": "",
"tenant-id": "",
"xweb_xhr": "1"
, data: {
}
}
}
let { data: result } = await axios.request(options);
if (result?.status == true) {
//打印签到结果
$.log(`🌸账号[${this.index}]` + `🕊签到获得${result.data.dailySignConfig.bonusPoint}分🎉`);
} else {
$.log(`🌸账号[${this.index}] 签到-失败:${result.error}❌`)
}
}
}
!(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() {
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -639,15 +639,21 @@ class Task {
});
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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -297,14 +297,20 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+106
View File
@@ -0,0 +1,106 @@
/*
------------------------------------------
@Author: sm
@Date: 2024.06.07 19:15
@Description: 康师傅畅饮社
cron: 30 10 * * *
------------------------------------------
#Notice:
康师傅畅饮社小程序
变量名 ksfcys
账号格式:抓https://club.biqr.cn/api/请求头token 多账户&或换行
⚠️【免责声明】
------------------------------------------
1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。
2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。
3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。
4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。
5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。
6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。
7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。
*/
const { Env } = require("../tools/env")
const $ = new Env("康师傅畅饮社");
let ckName = `ksfcys`;
const strSplitor = "#";
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 Task {
constructor(env) {
this.index = $.userIdx++
this.user = env.split(strSplitor);
this.token = this.user[0];
}
async run() {
await this.signIn()
}
async signIn() {
let options = {
url: `https://club.biqr.cn/api/signIn/integralSignIn`,
headers: {
"accept": "application/json, text/plain, */*",
"accept-language": "zh-CN,zh;q=0.9",
"content-type": "application/x-www-form-urlencoded;",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site",
"token": this.token,
"xweb_xhr": "1"
},
method: 'POST',
data: {}
}
let { data: result } = await axios.request(options);
if (result.code == 0) {
$.log(`账号[${this.index}]【${this.name}】 签到成功`);
} else {
$.log(result);
}
}
}
!(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() {
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -231,14 +231,20 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -369,13 +369,19 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -126,13 +126,19 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -170,13 +170,19 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -286,13 +286,19 @@ dOGyw/X4SFyodv8AEloqd81yGg==
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -148,13 +148,19 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -94,13 +94,19 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -266,13 +266,19 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+15 -9
View File
@@ -497,13 +497,19 @@ class Task {
.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 axios.request(options);
$.log(res)
return res
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
+130
View File
@@ -0,0 +1,130 @@
/*
------------------------------------------
@Author: sm
@Date: 2024.06.07 19:15
@Description: 植白说小程序
cron: 30 8 * * *
------------------------------------------
#Notice:
⚠️【免责声明】
------------------------------------------
1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。
2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。
3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。
4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。
5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。
6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。
7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。
*/
const { Env } = require("../tools/env")
const $ = new Env("植白说小程序");
let ckName = `zbs`;
const strSplitor = "#";
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 Task {
constructor(env) {
this.index = $.userIdx++
this.user = env.split(strSplitor);
this.token = this.user[0];
}
request(options) {
let baseHeraders = {
"accept": "*/*",
"accept-language": "zh-CN,zh;q=0.9",
"content-type": "application/json",
"priority": "u=1, i",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site",
"x-dts-token": "" + this.token,
"xweb_xhr": "1",
"User-Agent": defaultUserAgent,
}
options.headers = Object.assign(baseHeraders, options.headers)
return axios.request(options)
}
async run() {
await this.signIn()
}
async signIn() {
let options = {
method: 'GET',
url: "https://www.kozbs.com/demo/wx/home/sign?userId=",
headers: {},
};
let { data: result } = await this.request(options);
if (result?.errno == '0') {
//打印签到结果
$.log(`🌸账号[${this.index}]` + `签到成功🎉`);
} else {
$.log(`🌸账号[${this.index}] 签到-失败:${result.errmsg}❌`)
}
}
async getPoints() {
let options = {
method: 'GET',
url: "https://www.kozbs.com/demo/wx/user/getUserIntegral?userId=",
headers: {},
};
let { data: result } = await this.request(options);
if (result?.errno == '0') {
//打印签到结果
$.log(`🌸账号[${this.index}]` + `当前积分` + `${result.data.integer}🎉`);
} else {
$.log(`🌸账号[${this.index}] 获取积分-失败:${result.errmsg}❌`)
}
}
}
!(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() {
try {
let options = {
url: `https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/Notice.json`,
headers: {
"User-Agent": defaultUserAgent,
},
timeout:3000
}
let {
data: res
} = await axios.request(options);
$.log(res)
return res
} catch (e) {}
}
-291
View File
@@ -1,291 +0,0 @@
/*
------------------------------------------
@Author: sm
@Date: 2024.06.07 19:15
@Description: 康师傅
cron: 12 12 * * *
------------------------------------------
#Notice: 只适用于购买了luflytoken的 购买联系QQ860562056
变量wxcenter 填写自己部署的wxxcenter的域名,
变量wxid_ksf 在程序内登录的wxid 多账号&分割或者换行
⚠️【免责声明】
------------------------------------------
1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。
2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。
3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。
4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。
5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。
6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。
7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。
*/
const $ = new Env("康师傅");
let ckName = `wxid_ksf`;
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"
let wxcenter = process.env.wxcenter || ""
let appid = 'wx54f3e6a00f7973a7'
class Public {
request(options) {
return axios.request(options);
}
}
class Task extends Public {
constructor(env) {
super();
this.index = $.userIdx++
let user = env.split(strSplitor);
this.wxid = user[0];
this.passwd = user[1];
}
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.index}]【${this.name}】 获取code成功[${code}]`);
await this.login(code)
} else {
console.log(result);
}
}
async login(code) {
let options = {
url: `https://nclub.gdshcm.com/pro/whale-member/api/login/login`,
headers: {
'Content-Type': 'application/json'
},
method: 'POST',
data: { "code": "" + code, "inviterId": "", "inviterType": 1, "inviterMatchUserId": "", "spUrl": null }
}
let { data: result } = await this.request(options);
if (result.code == 0) {
let token = result.data.token
$.log(`账号[${this.index}]【${this.name}】 登录成功`);
await this.signIn(token)
} else {
console.log(result);
}
}
async signIn(token) {
let options = {
url: ` https://club.biqr.cn/api/signIn/integralSignIn`,
headers: {
'Content-Type': 'application/json',
'token': "" + token
},
method: 'POST',
data: {}
}
let { data: result } = await this.request(options);
if (result.code == 0) {
$.log(`账号[${this.index}]【${this.name}】 签到成功`);
} else {
console.log(result);
}
}
async run() {
if (!wxcenter) $.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);
}
-542
View File
@@ -1,542 +0,0 @@
/**
* 苏泊尔会员中心 (微信小程序)
* Show: 吃大米
* 变量名:suboer_wx
* 变量值:token&PHPSESSID@token1&PHPSESSID1
* 抓域名https://growrice.supor.com/rice/backend/public/index.php/api/login/auto-login?token= 后面的值
* 抓域名https://growrice.supor.com中请求体header中cookie中PHPSESSID 的值
* 多账号使用 @ 分割 拼接字符串为&
* cron 5 15 * * *
* const $ = new Env("苏泊尔-微信小程序");
* scriptVersionNow = "0.0.3";
*/
const ckName = "suboer_wx";
const Notify = 1; //0为关闭通知,1为打开通知,默认为1
let envSplitor = ["@", "\n"]; //多账号分隔符
let strSplitor = '&'; //多变量分隔符
const $ = new Env("苏泊尔");
let scriptVersionNow = "0.0.3";
let msg = "";
async function start() {
//await getVersion("smallfawn/QLScriptPublic/main/suboer.js");
//await getNotice();
let taskall = [];
for (let user of $.userList) {
if (user.ckStatus) {
taskall.push(await user.task());
await $.wait(1000);
}
}
await Promise.all(taskall);
}
class UserInfo {
constructor(str) {
this.index = ++$.userIdx;
this.ckStatus = true;
this.token = str.split(strSplitor)[0];
this.PHPSESSID = str.split(strSplitor)[1]; //单账号多变量分隔符
this.headers = {
"Host": "growrice.supor.com",
"user-agent": "Mozilla/5.0 (Linux; Android 10; MI 8 Lite Build/QKQ1.190910.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/107.0.5304.141 Mobile Safari/537.36 XWEB/5127 MMWEBSDK/20230405 MMWEBID/2585 MicroMessenger/8.0.35.2360(0x2800235D) WeChat/arm64 Weixin NetType/WIFI Language/zh_CN ABI/arm64 miniProgram/wx29135df42114f4ef",
"content-type": "application/x-www-form-urlencoded",
"accept": "*/*",
"x-requested-with": "com.tencent.mm",
"sec-fetch-site": "same-origin",
"sec-fetch-mode": "cors",
"sec-fetch-dest": "empty",
"referer": "https://growrice.supor.com/rice/fort/main.html",
"accept-encoding": "gzip, deflate",
"accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
"cookie": `PHPSESSID=${this.PHPSESSID}`,
}
}
async task() {
//登录
$.DoubleLog(`-------- 开始 【第${this.index}个账号】--------`)
await this.login()
//用户信息
await this.user_info()
if (this.ckStatus) {
//根据签到信息签到
await this.sign_info()
//任务列表
await this.task_list()
//获取可收取大米信息
await this.get_index_info()
//大米余额
await this.rice_num()
} else {
$.DoubleLog(`账号${this.index} 失效了好像`)
}
}
// 登录 post
async login() {
let options = {
method: "get",
url: `https://growrice.supor.com/rice/backend/public/index.php/api/login/auto-login?token=${this.token}`,
headers: this.headers,
};
let result = await httpRequest(options);
}
// 用户信息 - GET - https://growrice.supor.com/users/get-user-info
async user_info() {
let options = {
method: "get",
url: `https://growrice.supor.com/rice/backend/public/index.php/api/users/get-user-info`,
headers: this.headers,
};
let result = await httpRequest(options);
if (result["code"] == 1) {
$.DoubleLog(`账号${this.index} ${result["msg"]} 欢迎 ${result["data"]["nickname"]}`);
} else if (result["code"] == 0) {
$.DoubleLog(`账号${this.index} ${result.msg}`);
this.ckStatus = false
} else {
$.DoubleLog(`账号${this.index} 失败 ❌ 了呢,原因未知!`);
console.log(result);
this.ckStatus = false
}
}
// 签到信息 get
async sign_info() {
let options = {
method: "get",
url: `https://growrice.supor.com/rice/backend/public/index.php/api/signIn/sign-list`,
headers: this.headers,
};
let result = await httpRequest(options);
if (result["data"]["is_sign"] == false) {
$.DoubleLog(`账号${this.index} 未签到 去签到喽!`);
await this.do_sign()
} else if (result["data"]["is_sign"] == true) {
$.DoubleLog(`账号${this.index} 已签到 明天再来吧!`);
} else {
$.DoubleLog(`账号${this.index} 失败 ❌ 了呢`);
console.log(result);
}
}
//签到 - POST - https://growrice.supor.com/signIn/sign
async do_sign() {
let options = {
method: "post",
url: `https://growrice.supor.com/rice/backend/public/index.php/api/signIn/sign`,
headers: this.headers,
body: `https://growrice.supor.com/rice/backend/public/index.php/api/signIn/sign`,
};
let result = await httpRequest(options);
if (result["code"] == 1) {
$.DoubleLog(`账号${this.index} ${result["msg"]} ,获得 ${result["data"]["get_rice_num"]} 大米`);
} else if (result["code"] == 0) {
$.DoubleLog(`账号${this.index} ${result["msg"]}`);
} else {
$.DoubleLog(`账号${this.index} 失败❌了呢`);
console.log(result);
}
}
// 任务列表 get
async task_list() {
let options = {
method: "get",
url: `https://growrice.supor.com/rice/backend/public/index.php/api/task/index`,
headers: this.headers,
};
let result = await httpRequest(options);
// console.log(result);
if (result["code"] == 1) {
$.DoubleLog(`账号${this.index} ${result["msg"]}`);
let tasks = result.data//[]
for (let i of tasks) {
if ((i["id"] == 1 || i["name"].indexOf("浏览") !== -1) && i["is_finish"] == false) {
await this.link_task("&id=1")
} else if ((i["id"] == 1 || i["name"].indexOf("浏览") !== -1) && i["is_finish"] == true) {
$.DoubleLog(`今天完成浏览好物任务了,明天再来吧!`)
}
if ((i["id"] == 6 || i["name"].indexOf("收") !== -1) && i["is_finish"] == false) {
//收大米
for (let j = 0; j < 3; j++) {
await this.get_rice()
}
} else if ((i["id"] == 6 || i["name"].indexOf("收") !== -1) && i["is_finish"] == true) {
$.DoubleLog(`今天无法偷大米了,明天再来吧!`)
}
if ((i["id"] == 8 || i["name"].indexOf("其他") !== -1) && i["list"][0]["is_finish"] == false) {
//浏览菜谱
await this.link_task("&id=8&other_id=3")
} else if ((i["id"] == 8 || i["name"].indexOf("其他") !== -1) && i["list"][0]["is_finish"] == true) {
$.DoubleLog(`今天完成浏览菜谱了,明天再来吧!`)
}
}
} else if (result["code"] == 0) {
$.DoubleLog(`账号${this.index} ${result["msg"]}`);
} else {
$.DoubleLog(`账号${this.index} 失败❌了呢`);
console.log(result);
}
}
// 执行各种任务 https://growrice.supor.com/rice/backend/public/index.php/api/task/link-task
async link_task(bodyString) {
/*
浏览 菜谱 `&id=8&other_id=3`
浏览 好物 `&id=1`
*/
let options = {
method: "post",
url: `https://growrice.supor.com/rice/backend/public/index.php/api/task/link-task`,
headers: this.headers,
body: bodyString,
};
let result = await httpRequest(options);
// console.log(result);
if (result["code"] == 1) {
$.DoubleLog(`账号${this.index} ${result["msg"]}`);
} else {
$.DoubleLog(`账号${this.index} 失败❌了呢`);
console.log(result);
}
}
//获取题目 - POST - https://growrice.supor.com/rice/backend/public/index.php/api/question/getQuestion
async get_question() {
let options = {
method: "post",
url: `https://growrice.supor.com/rice/backend/public/index.php/api/question/getQuestion`,
headers: this.headers,
body: ""
};
let result = await httpRequest(options);
// console.log(result);
if (result["code"] == 1) {
$.DoubleLog(`账号${this.index} 题目:${result["data"]["id"]}${result["data"]["title"]}`)
$.DoubleLog(`选项 A${result["data"]["answer_a"]}`)
$.DoubleLog(`选项 B${result["data"]["answer_b"]}`)
$.DoubleLog(`选项 C${result["data"]["answer_c"]}`)
if ("answer_d" in result["data"]) {
(`选项 D${result["data"]["answer_d"]}`)
}
await this.answer(`&question_id=16&answer=D`)
} else {
$.DoubleLog(`账号${this.index} 失败❌了呢`);
console.log(result);
}
}
//回答题目 - POST - https://growrice.supor.com/rice/backend/public/index.php/api/question/answer
async answer(bodyString) {
let options = {
method: "post",
url: `https://growrice.supor.com/rice/backend/public/index.php/api/question/answer`,
headers: this.headers,
body: bodyString
};
let result = await httpRequest(options);
// console.log(result);
if (result["code"] == 1) {
$.DoubleLog(`账号${this.index} 题目:${result["msg"]["id"]}`)
if (result["data"]["status"] == 0) {
this.answer_status = false //还需要在答题
} else {
this.answer_status = true //答题任务完成
}
} else {
$.DoubleLog(`账号${this.index} 失败❌了呢`);
console.log(result);
}
}
// 获取可收取大米信息 get
async get_index_info() {
let options = {
method: "get",
url: `https://growrice.supor.com/rice/backend/public/index.php/api/index/index`,
headers: this.headers,
};
let result = await httpRequest(options);
// console.log(result);
if (result["code"] == 1) {
if (result["data"]["rice_list"].length == 0) {
$.DoubleLog(`账号${this.index} 没有可以收获的大米`)
} else if (result["data"]["rice_list"].length > 0) {
$.DoubleLog(`账号${this.index} 收获大米`)
for (let i of result["data"]["rice_list"]) {
await this.collect_rice(i["id"])
$.DoubleLog(`${i["name"]}收取完成`)
}
}
} else if (result["code"] == 2) {
$.DoubleLog(`账号${this.index} ${result['msg']} 请自己先打开一次小程序,种大米后在执行脚本!`)
} else {
$.DoubleLog(`账号${this.index} 失败❌了呢`);
console.log(result);
}
}
// 收大米
async collect_rice(id) {
let options = {
method: "post",
url: `https://growrice.supor.com/rice/backend/public/index.php/api/index/collect-rice`,
headers: this.headers,
body: `&id=${id}`,
};
let result = await httpRequest(options);
// console.log(result);
if (result["code"] == 1) {
$.DoubleLog(`账号${this.index} 收取大米 成功啦 ! 当前累计${result["data"]["sign_rice_num"]}大米`);
} else if (result["code"] == 0) {
$.DoubleLog(`账号${this.index} ${result["msg"]}`);
} else {
$.DoubleLog(`账号${this.index} 失败❌了呢`);
console.log(result);
}
}
// 查询大米数量 - GET - https://growrice.supor.com/rice/backend/public/index.php/api/exchange/index?&page=1&pagesize=10
async rice_num() {
let options = {
method: "get",
url: `https://growrice.supor.com/rice/backend/public/index.php/api/exchange/index?&page=1&pagesize=10`,
headers: this.headers,
};
let result = await httpRequest(options);
// console.log(result);
if (result["code"] == 1) {
$.DoubleLog(`账号${this.index} 现在有${result["data"]["rice_num"]} 大米`)
} else {
$.DoubleLog(`账号${this.index} 失败❌了呢`);
console.log(result);
}
}
// 获取同城大米id
async get_sameCity_id() {
let options = {
method: "get",
url: `https://growrice.supor.com/rice/backend/public/index.php/api/users/same-city-list`,
headers: this.headers,
};
let result = await httpRequest(options);
// console.log(result);
if (result["code"] == 1) {
let arr = []
for (let i of result["data"]) {
arr.push(i["id"])
}
return arr;
} else {
$.DoubleLog(`账号${this.index} 失败❌了呢`);
console.log(result);
}
}
// 偷好友大米
async get_rice() {
let SameCityIdList = await this.get_sameCity_id()//"获取好友大米id"
for (let i of SameCityIdList) {
let id = i
let options = {
method: "post",
url: `https://growrice.supor.com/rice/backend/public/index.php/api/users/get-rice`,
headers: this.headers,
body: `&friend_id=${id}`,
};
let result = await httpRequest(options);
if (result["code"] == 1) {
$.DoubleLog(`账号${this.index} ${result["msg"]} , 当前已有 ${result["data"]["sign_rice_num"]} 大米`);
} else if (result["code"] == 0) {
$.DoubleLog(`账号${this.index} ${result["msg"]}`);
} else {
$.DoubleLog(`账号${this.index} 失败❌了呢`);
console.log(result);
}
}
}
// 抽奖信息 get
/* async prize_Info() {
let options = {
method: "get",
url: `https://growrice.supor.com/prize/index`,
headers: this.headers,
};
let result = await httpRequest(options);
// console.log(result);
if (result.code == 1) {
$.DoubleLog(`账号${this.index} , 抽奖券${result.data.draw_num_1}张, 高级抽奖券${result.data.draw_num_2}张`)
if (result.data.draw_num_1 > 0) {
await this.prize('普通抽奖', '1')
}
if (result.data.draw_num_2 > 0) {
await this.prize('高级抽奖', '2')
}
if (result.data.draw_num_1 == 0 && result.data.draw_num_2 == 0) {
$.DoubleLog(`账号${this.index} 暂时无抽奖次数!`)
}
} else {
$.DoubleLog(`账号${this.index} 失败❌了呢`);
console.log(result);
}
}*/
// 抽奖 https://growrice.supor.com/rice/backend/public/index.php/api/prize/draw
/*async prize(type) {
let options = {
method: "post",
url: `https://growrice.supor.com/prize/draw`,
headers: this.headers,
body: `cate=${type}`,
};
let result = await httpRequest(options);
// console.log(result);
if (result.code == 1) {
let prize_info = result.data.prize_info
$.DoubleLog(`账号${this.index} 获得 ${prize_info.prize_name} , 奖品id: ${prize_info.prize_id}, 奖品类型: ${prize_info.prize_type}, 奖品数量: ${prize_info.prize_value}`);
await this.prize_Info('抽奖信息')
} else if (result.code == 0) {
$.DoubleLog(`账号${this.index} ${result.msg}`);
await this.prize_Info('抽奖信息')
} else {
$.DoubleLog(`账号${this.index} 失败❌了呢`);
console.log(result);
}
}*/
}
!(async () => {
if (!(await checkEnv())) return;
if ($.userList.length > 0) {
await start();
} await $.SendMsg(msg);
})().catch((e) => console.log(e)).finally(() => $.done());
//********************************************************
/**
* 变量检查与处理
* @returns
*/
async function checkEnv() {
let userCookie = ($.isNode() ? process.env[ckName] : $.getdata(ckName)) || "";
//let userCount = 0;
if (userCookie) {
// console.log(userCookie);
let e = envSplitor[0];
for (let o of envSplitor)
if (userCookie.indexOf(o) > -1) {
e = o;
break;
}
for (let n of userCookie.split(e)) n && $.userList.push(new UserInfo(n));
//userCount = $.userList.length;
} else {
console.log("未找到CK");
return;
}
return console.log(`共找到${$.userList.length}个账号`), true; //true == !0
}
/////////////////////////////////////////////////////////////////////////////////////
function httpRequest(options, method = null) {
method = options.method ? options.method.toLowerCase() : options.body ? "post" : "get";
return new Promise((resolve) => {
$[method](options, (err, resp, data) => {
if (err) {
console.log(`${method}请求失败`);
$.logErr(err);
} else {
if (data) {
try { data = JSON.parse(data); } catch (error) { }
resolve(data);
} else {
console.log(`请求api返回数据为空,请检查自身原因`);
}
}
resolve();
});
});
}
/**
* 获取远程版本
*/
function getVersion(scriptUrl, timeout = 3 * 1000) {
return new Promise((resolve) => {
const options = { url: `https://ghproxy.com/https://raw.githubusercontent.com/${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);
});
}
/**
* 获取远程通知
*/
async function getNotice() {
try {
const urls = [
"https://cdn.jsdelivr.net/gh/smallfawn/Note@main/Notice.json",
"https://ghproxy.com/https://raw.githubusercontent.com/smallfawn/Note/main/Notice.json",
"https://fastly.jsdelivr.net/gh/smallfawn/Note@main/Notice.json",
"https://ghproxy.net/https://raw.githubusercontent.com/smallfawn/Note/refs/heads/main/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);
}
}
// ==================== 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]) ||Line truncated
//Env rewrite:smallfawn Update-time:23-6-30 newAdd:DoubleLog & SendMsg
-397
View File
@@ -1,397 +0,0 @@
/**
*
* Xbox俱乐部 微信小程序
*
* cron 0 0,7 * * * xbox_v2.js
* 多账号并行执行任务模板V2
* 捉域名https://h5.youzan.com/wscuser/域名下的extra-data中的sid
*/
//=====================================================//
const $ = new Env("xbox俱乐部V2");
const notify = $.isNode() ? require("../sendNotify") : "";
const Notify = 1
const debug = 0
let ckStr = ($.isNode() ? process.env.xbox_data : $.getdata('xbox_data')) || ''; //检测CK 外部
let msg = '', ck;
let host = 'h5.youzan.com';
let hostname = 'https://' + host;
//---------------------------------------------------//
async function tips(ckArr) {
DoubleLog(`\n每日执行签到,积分兑换实物`);
//DoubleLog(`当前脚本版本 0.0.2\n📌,如果脚本版本不一致请及时更新`);
DoubleLog(`\n========== 共找到 ${ckArr.length} 个账号 ==========`);
debugLog(`【debug】 这是你的账号数组:\n ${ckArr}`);
}
!(async () => {
let ckArr = await checkEnv(ckStr, "xbox_data"); //检查CK
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, "xbox_data"); //检查CK
DoubleLog("\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() {
//console.log("\n📌📌📌📌📌📌📌📌执行任务1📌📌📌📌📌📌📌📌");
//for (i = 0; i < ckArr.length; i++) {
// ck = ckArr[i].split("&"); //单账号多变量分割符,如果一个账号需要user和token两个变量,那么则输入user1&token1@user2&token2...
// let CK = ckArr[i]
// await userinfo();
// await $.wait(2 * 1000);
//}
await newstart("查询", userinfo, 2)
await newstart("签到", checkin, 2)
}
//---------用户信息
async function userinfo() {
try {
let url = {
url: `${hostname}/wscuser/membercenter/global.json?app_id=wx7f4f694622875202&kdt_id=100464643`,
headers: {
"Host": host,
"user-agent": "Mozilla/5.0 (Linux; Android 10; ELS-AN00) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.92 Mobile Safari/537.36",
"extra-data": "{\"is_weapp\":1,\"sid\":\"" + ck[0] + "\"}"
},
};
let result = await httpGet(url, `用户信息查询`);
//console.log(result);
if (result?.code == 0) {
let nickName = result.data.user.nickName
await getpoints(nickName);
//console.log(`账号[` + Number(i + 1) + `]` + `用户[` + result.data.user.nickName + `]积分:` + points +`🎉`);
} else {
DoubleLog(`账号[` + Number(i + 1) + `]查询失败!`);
//console.log(result);
}
} catch (error) {
console.log(error);
}
}
//------------------------------------------------------------------------------------------
//用户积分查询
async function getpoints(nickName) {
try {
let url = {
url: `${hostname}/wscuser/membercenter/stats.json?app_id=wx7f4f694622875202&kdt_id=100464643`,
headers: {
"Host": host,
"user-agent": "Mozilla/5.0 (Linux; Android 10; ELS-AN00) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.92 Mobile Safari/537.36",
"extra-data": "{\"is_weapp\":1,\"sid\":\"" + ck[0] + "\"}"
},
};
let result = await httpGet(url, `用户积分查询`);
//console.log(result);
if (result?.code == 0) {
DoubleLog(`账号[` + Number(i + 1) + `]` + `用户[` + nickName + `]积分:${result.data.stats.points} 🎉`);
} else {
DoubleLog(`账号[` + Number(i + 1) + `]查询失败!`);
//console.log(result);
}
} catch (error) {
DoubleLog(error);
}
}
//用户签到
async function checkin() {
try {
let url = {
url: `${hostname}/wscump/checkin/checkinV2.json?checkinId=1597464&app_id=wx7f4f694622875202&kdt_id=100464643`,
headers: {
"Host": host,
"user-agent": "Mozilla/5.0 (Linux; Android 10; ELS-AN00) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.92 Mobile Safari/537.36",
"extra-data": "{\"is_weapp\":1,\"sid\":\"" + ck[0] + "\"}"
},
};
let result = await httpGet(url, `签到`);
//console.log(result);
if (result?.code == 0) {
DoubleLog(`账号[` + Number(i + 1) + `]` + `签到:${result.msg} 获得:${result.data.list[0].infos.title}🎉`);
await wait(2);
} else if (result?.code == 1000030071) {
DoubleLog(`账号[` + Number(i + 1) + `]` + `签到失败!原因${result.msg}`);
//console.log(result);
} else {
DoubleLog(`账号[` + Number(i + 1) + `]` + `签到失败!原因${result.msg}`)
}
} catch (error) {
DoubleLog(error);
}
}
// #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");
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} 失败了!请稍后尝试!!`
} 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} 失败了!请稍后尝试!!`
} finally {
resolve();
}
},
timeout
);
});
}
/**
* 网络请求 (get, post等)
*/
async function httpRequest(postOptionsObject, tip, timeout = 3) {
return new Promise((resolve) => {
let Options = postOptionsObject;
let request = require('request');
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} 请求 信息 ===============`);
console.log(Options);
}
request(Options, async (err, resp, data) => {
try {
if (debug) {
console.log(`\n\n 【debug】===============这是 ${tip} 返回数据==============`);
console.log(data);
console.log(`\n 【debug】=============这是 ${tip} json解析后数据============`);
console.log(JSON.parse(data));
}
let result = JSON.parse(data);
if (!result) return;
resolve(result);
} catch (e) {
console.log(err, resp);
console.log(`\n ${tip} 失败了!请稍后尝试!!`);
msg = `\n ${tip} 失败了!请稍后尝试!!`
} finally {
resolve();
}
}), timeout
});
}
/**
* debug调试
*/
function debugLog(...args) {
if (debug) {
console.log(...args);
}
}
// 完整 Env
function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(tLine truncated
-519
View File
@@ -1,519 +0,0 @@
/*
@随缘撸豆
伊利牛奶小程序 cron 45 12 * * * https://raw.githubusercontent.com/liuqi6968/-/main/ylnn.js
地址: #小程序://伊利/1jrunQEW7zfybgI
5.27 完成签到
------------------------ 青龙--配置文件-贴心复制区域 ----------------------
# 伊利牛奶 小程序
#小程序://伊利/1jrunQEW7zfybgI
抓取 https://msmarket.msx.digitalyili.com 中的access-token
export ylnn=" access-token "
多账号用 换行 或 @ 分割
注意脚本运行以后 在登录小程序ck会失效
这个就是以前畅意100 以前玩过的可以找客服把积分移过到这个小程序里面
*/
const $ = new Env("伊利牛奶")
const CK_NAME = "ylnn"
const Notify = 1 // 通知控制
const tgLogFlag = 1 // 是否tg发送通知, 偷撸车使用, 默认0--不发送
let msg = ''
//===========================================================================
//===========================================================================
//
async function main(userInfo) {
await userInfo.sign()
await userInfo.point()
}
class UserInfo {
constructor(index, str) {
this.user_log = `${$.name}\n`
this.index = index + 1
if (tgLogFlag) {
try {
this.ck = str
} catch (error) {
console.log(error)
}
}
}
async sign() {
let name = "签到";
let options = {
method: "post",
url: `https://msmarket.msx.digitalyili.com/gateway/api/member/daily/sign`,
headers: {
"Host": "msmarket.msx.digitalyili.com",
"charset": "utf-8",
"content-type": "application/json",
"access-token": `${this.ck}`
},
body: `{}`
};
// console.log(options);
let res = await httpRequest(options);
// console.log(res);
if (res.status == true) {
this.cusLog(`账号 ${this.index} : 签到成功`)
} else if (res.status == false) {
this.cusLog(`账号 ${this.index} : ck过期 请重新抓取 access-token`)
} else this.cusLog(`账号[${this.index}] ${name} 失败 ❌ 了呢`), console.log(res);
}
async point() {
let name = "个人信息";
let options = {
method: "get",
url: `https://msmarket.msx.digitalyili.com/gateway/api/member/point`,
headers: {
"Host": "msmarket.msx.digitalyili.com",
"charset": "utf-8",
"content-type": "application/json",
"access-token": `${this.ck}`
}
};
// console.log(options);
let res = await httpRequest(options);
// console.log(res);
if (res.status == true) {
this.cusLog(`账号 ${this.index} 总积分 : ${res.data} `)
} else if (res.status == false) {
this.cusLog(`账号 ${this.index} : ck过期 请重新抓取 access-token`)
} else this.cusLog(`账号[${this.index}] ${name} 失败 ❌ 了呢`), console.log(res);
}
async Sendtg_bot() {
const TelegramBot = require('node-telegram-bot-api');
const tg_token = process.env.tg_token;
// console.log(tg_token);
let bot = new TelegramBot(tg_token);
let msg = this.user_log;
// console.log(`=================`);
// console.log(this.chatId, msg);
await bot.sendMessage(this.chatId, msg);
}
cusLog(a) {
if (tgLogFlag) {
console.log(` ${a}`);
msg += `\n ${a}`;
this.user_log += `\n ${a}`;
} else {
console.log(` ${a}`);
msg += `\n ${a}`;
}
}
}
///////////////////////////////////////////////////////////////////
// 入口
!(async () => {
const notify = require("../sendNotify");
$.doubleLog(await $.yiyan());
let users = await getUsers(CK_NAME, async (index, element) => {
let userInfo = new UserInfo(index, element);
return userInfo;
});
list = [];
users.forEach(async element => {
list.push(main(element));
});
await Promise.all(list);
})()
.catch((e) => console.log(e))
.finally(() => $.done());
// ==============================================================================
async function getUsers(ckName, fnUserInfo) {
let userList = [];
let userCookie = process.env[ckName];
let envSplicer = ["@", "\n", "&"];
let userCount = 0;
if (userCookie) {
let e = envSplicer[0];
for (let o of envSplicer)
if (userCookie.indexOf(o) > -1) {
e = o;
break;
}
let arr = userCookie.split(e);
for (let index = 0; index < arr.length; index++) {
const element = arr[index];
element && userList.push(await fnUserInfo(index, element));
}
userCount = userList.length;
} else {
console.log("抓取https://msmarket.msx.digitalyili.com 中的access-token");
}
console.log(`共找到${userCount}个账号`), !0;
return userList;
}
async function httpRequest(options, type = false) {
return new Promise((resolve) => {
try {
$.send(options, async (err, res_body, res_format, res) => {
if (err) {
console.log(`错误, 检查点--2`); return;
}
if (!type) {
resolve(res_body);
} resolve(res_format);
});
} catch (error) {
console.log(error);
}
});
}
// ============================================================================================================================
// 新的 env 函数, 增加自定义功能 yml-11.12改 合并
function Env(name, env) {
"undefined" != typeof process &&
JSON.stringify(process.env).indexOf("GITHUB") > -1 &&
process.exit(0);
return new (class {
constructor(name, env) {
this.name = name;
this.notifyStr = "";
this.notifyFlag = false;
this.startTime = new Date().getTime();
Object.assign(this, env);
console.log(`${this.name} 开始运行: \n`);
}
isNode() {
return "undefined" != typeof module && !!module.exports;
}
send(options, e = () => { }) {
let m = options.method.toLowerCase();
let t = options;
if (m != "get" && m != "post" && m != "put" && m != "delete") {
console.log(`无效的http方法: ${m}`);
return;
}
if (m == "get" && t.headers) {
// delete t.headers["Content-Type"];
delete t.headers["Content-Length"];
} else if (t.body && t.headers) {
if (t.headers["content-type"]) {
let tem = t.headers["content-type"];
delete t.headers["content-type"];
t.headers["Content-Type"] = tem;
} else if (t.body && t.headers) {
if (!t.headers["Content-Type"])
t.headers["Content-Type"] = "application/x-www-form-urlencoded";
}
}
if (this.isNode()) {
this.request = this.request ? this.request : require("request");
this.request(options, function (error, response) {
if (error) throw new Error(error);
let res_body = response.body;
let res = response;
try {
if (typeof res_body == "string") {
if ($.isJsonStr(res_body)) {
res_body = JSON.parse(res_body);
let res_format = $.formatJson(response.body);
e(null, res_body, res_format, res);
} else e(null, res_body, res_format, res);
} else e(null, res_body, res_format, res);
} catch (error) {
console.log(error);
let a = `ENV -- request 请求错误, 检查点1\n${error}`;
e(a, null, null, null);
}
});
}
}
isJsonStr(str) {
if (typeof str == "string") {
try {
if (typeof JSON.parse(str) == "object") {
return true;
}
} catch (e) {
return false;
}
}
return false;
}
formatJson(value) {
var json = value;
var i = 0,
len = 0,
tab = " ",
targetJson = "",
indentLevel = 0,
inString = false,
currentChar = null;
for (i = 0, len = json.length; i < len; i += 1) {
currentChar = json.charAt(i);
switch (currentChar) {
case "{":
case "[":
if (!inString) {
targetJson += currentChar + "\n" + repeat(tab, indentLevel + 1);
indentLevel += 1;
} else {
targetJson += currentChar;
}
break;
case "}":
case "]":
if (!inString) {
indentLevel -= 1;
targetJson += "\n" + repeat(tab, indentLevel) + currentChar;
} else {
targetJson += currentChar;
}
break;
case ",":
if (!inString) {
targetJson += ",\n" + repeat(tab, indentLevel);
} else {
targetJson += currentChar;
}
break;
case ":":
if (!inString) {
targetJson += ": ";
} else {
targetJson += currentChar;
}
break;
case " ":
case "\n":
case "\t":
if (inString) {
targetJson += currentChar;
}
break;
case '"':
if (i > 0 && json.charAt(i - 1) !== "\\") {
inString = !inString;
}
targetJson += currentChar;
break;
default:
targetJson += currentChar;
break;
}
}
function repeat(s, count) {
return new Array(count + 1).join(s);
}
function repeat(s, count) {
return new Array(count + 1).join(s);
}
return targetJson;
}
type(str) {
if (this.strCode(str) > 20) {
return console.log(`数据类型是: ${typeof str}`);
}
return console.log(`${str}数据类型是: ${typeof str}`);
}
strCode(str) {
var count = 0;
if (str) {
let len = str.length;
for (var i = 0; i < len; i++) {
if (str.charCodeAt(i) > 255) {
count += 2;
} else {
count++;
}
}
return count;
} else return 0;
}
async SendMsg(message) {
if (!message) return;
if (Notify > 0) {
if ($.isNode()) {
var notify = require("../sendNotify");
await notify.sendNotify($.name, message);
} else {
console.log($.name, "", message);
}
} else {
console.log(message);
}
}
getMin(a, b) {
return a < b ? a : b;
}
getMax(a, b) {
return a < b ? b : a;
}
json2str(obj, c, encodeUrl = false) {
let ret = [];
for (let keys of Object.keys(obj).sort()) {
let v = obj[keys];
if (v && encodeUrl) v = encodeURIComponent(v);
ret.push(keys + "=" + v);
}
return ret.join(c);
}
str2json(str, decodeUrl = false) {
let ret = {};
for (let item of str.split("&")) {
if (!item) continue;
let idx = item.indexOf("=");
if (idx == -1) continue;
let k = item.substr(0, idx);
let v = item.substr(idx + 1);
if (decodeUrl) v = decodeURIComponent(v);
ret[k] = v;
}
return ret;
}
randomStr(len, up = false, charset = "abcdef0123456789") {
let str = "";
for (let i = 0; i < len; i++) {
str += charset.charAt(Math.floor(Math.random() * charset.length));
}
if (!up) {
return str;
}
return str.toUpperCase();
}
phoneNum(phone_num) {
if (phone_num.length == 11) {
let data = phone_num.replace(/(\d{3})\d{4}(\d{4})/, "$1****$2");
return data;
} else {
return phone_num;
}
}
randomInt(min, max) {
return Math.round(Math.random() * (max - min) + min);
}
async yiyan() {
this.request = this.request ? this.request : require("request");
return new Promise((resolve) => {
var options = {
method: "GET",
url: "https://v1.hitokoto.cn/",
headers: {},
};
this.request(options, function (error, response) {
let data = JSON.parse(response.body);
let data_ = `[一言]: ${data.hitokoto} by--${data.from}`;
resolve(data_);
});
});
}
wait(t) {
return new Promise((e) => setTimeout(e, t * 1000));
}
ts(type = false, _data = "") {
let myDate = new Date();
let a = "";
switch (type) {
case 10:
a = Math.round(new Date().getTime() / 1000).toString();
break;
case 13:
a = Math.round(new Date().getTime()).toString();
break;
case "h":
a = myDate.getHours();
break;
case "m":
a = myDate.getMinutes();
break;
case "y":
a = myDate.getFullYear();
break;
case "h":
a = myDate.getHours();
break;
case "mo":
a = myDate.getMonth();
break;
case "d":
a = myDate.getDate();
break;
case "ts2Data":
if (_data != "") {
time = _data;
if (time.toString().length == 13) {
let date = new Date(time + 8 * 3600 * 1000);
a = date.toJSON().substr(0, 19).replace("T", " ");
} else if (time.toString().length == 10) {
time = time * 1000;
let date = new Date(time + 8 * 3600 * 1000);
a = date.toJSON().substr(0, 19).replace("T", " ");
}
}
break;
default:
a = "未知错误,请检查";
break;
}
return a;
}
doubleLog(a) {
console.log(` ${a}`);
msg += `\n ${a}`;
}
async done(t = {}) {
await $.SendMsg(msg);
const e = new Date().getTime(),
s = (e - this.startTime) / 1e3;
console.log(`\n${this.name} 运行结束,共运行了 ${s} 秒!`);
}
})(name, env);
}
-294
View File
@@ -1,294 +0,0 @@
/*
------------------------------------------
@Author: sm
@Date: 2024.06.07 19:15
@Description: 测试
------------------------------------------
#Notice:
变量名kekoukeleba 抓小程序可口可乐吧 member-api.icoke.cn/api Headers中 authorization 去掉Bearer 多账号&连接
⚠️【免责声明】
------------------------------------------
1、此脚本仅用于学习研究,不保证其合法性、准确性、有效性,请根据情况自行判断,本人对此不承担任何保证责任。
2、由于此脚本仅用于学习研究,您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除,若违反规定引起任何事件本人对此均不负责。
3、请勿将此脚本用于任何商业或非法目的,若违反规定请自行对此负责。
4、此脚本涉及应用与本人无关,本人对因此引起的任何隐私泄漏或其他后果不承担任何责任。
5、本人对任何脚本引发的问题概不负责,包括但不限于由脚本错误引起的任何损失和损害。
6、如果任何单位或个人认为此脚本可能涉嫌侵犯其权利,应及时通知并提供身份证明,所有权证明,我们将在收到认证文件确认后删除此脚本。
7、所有直接或间接使用、查看此脚本的人均应该仔细阅读此声明。本人保留随时更改或补充此声明的权利。一旦您使用或复制了此脚本,即视为您已接受此免责声明。
*/
const $ = new Env("可口可乐吧");
let ckName = `kekoukeleba`;
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 {
request(options) {
return 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: "GET",
url: "https://member-api.icoke.cn/api/icoke-sign/icoke/mini/sign/main/sign",
headers: {
"accept": "application/json, text/plain, */*",
"accept-language": "zh-CN,zh;q=0.9",
"authorization": "Bearer " + this.token,
"content-type": "application/json",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site",
"xweb_xhr": "1",
"Referer": "https://servicewechat.com/wxa5811e0426a94686/421/page-frame.html",
"Referrer-Policy": "unsafe-url"
},
}
try {
let { data: res } = await this.request(options);
if (res.success == true) {
$.log(`签到成功 获得【${res.point}】快乐瓶`)
} else {
$.log(`签到失败`)
console.log(res);
}
} catch (e) {
console.log(e);
}
}
async userInfo() {
let options = {
method: "GET",
url: "https://member-api.icoke.cn/api/icoke-customer/icoke/mini/customer/main/points",
headers: {
"accept": "application/json, text/plain, */*",
"accept-language": "zh-CN,zh;q=0.9",
"authorization": "Bearer " + this.token,
"content-type": "application/json",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site",
"xweb_xhr": "1",
"Referer": "https://servicewechat.com/wxa5811e0426a94686/421/page-frame.html",
"Referrer-Policy": "unsafe-url"
},
}
try {
let { data: res } = await this.request(options);
$.log(`目前还剩【${res.point}】瓶 `)
} catch (e) {
console.log(e);
}
}
async run() {
await this.userInfo();
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);
$.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);
}
-9
View File
@@ -1,9 +0,0 @@
/**
* 微信小程序
* 托迈酷客
* 完成签到,浏览
* 变量名:tmkk
* 变量值:Authorization
* cron 10 8 * * *
*/
var version_='jsjiami.com.v7';const _0x1f1e99=_0x1971;(function(_0x49c20a,_0x5df291,_0x183514,_0x31a156,_0x49af2a,_0x494dd7,_0x2ebaab){return _0x49c20a=_0x49c20a>>0x7,_0x494dd7='hs',_0x2ebaab='hs',function(_0x307aef,_0x1da77,_0x307cc3,_0x8e6397,_0xe8169b){const _0x2cc2e7=_0x1971;_0x8e6397='tfi',_0x494dd7=_0x8e6397+_0x494dd7,_0xe8169b='up',_0x2ebaab+=_0xe8169b,_0x494dd7=_0x307cc3(_0x494dd7),_0x2ebaab=_0x307cc3(_0x2ebaab),_0x307cc3=0x0;const _0x4a3d5a=_0x307aef();while(!![]&&--_0x31a156+_0x1da77){try{_0x8e6397=parseInt(_0x2cc2e7(0x257,'XdGc'))/0x1+parseInt(_0x2cc2e7(0x292,'mA6L'))/0x2+-parseInt(_0x2cc2e7(0x2b5,'o9q3'))/0x3*(-parseInt(_0x2cc2e7(0x320,'cKwh'))/0x4)+parseInt(_0x2cc2e7(0x258,'j5d%'))/0x5+parseInt(_0x2cc2e7(0x1a4,'o&U)'))/0x6+parseInt(_0x2cc2e7(0x3dd,'ypmY'))/0x7+-parseInt(_0x2cc2e7(0x288,'cKwh'))/0x8;}catch(_0x2e0dbb){_0x8e6397=_0x307cc3;}finally{_0xe8169b=_0x4a3d5a[_0x494dd7]();if(_0x49c20a<=_0x31a156)_0x307cc3?_0x49af2a?_0x8e6397=_0xe8169b:_0x49af2a=_0xe8169b:_0x307cc3=_0xe8169b;else{if(_0x307cc3==_0x49af2a['replace'](/[WElLywRqfHrTCSNdYgDxG=]/g,'')){if(_0x8e6397===_0x1da77){_0x4a3d5a['un'+_0x494dd7](_0xe8169b);break;}_0x4a3d5a[_0x2ebaab](_0xe8169b);}}}}}(_0x183514,_0x5df291,function(_0x28745f,_0x59f64f,_0x35de71,_0xc0ad6b,_0x5cf67a,_0x2e84bc,_0x4d4f75){return _0x59f64f='\x73\x70\x6c\x69\x74',_0x28745f=arguments[0x0],_0x28745f=_0x28745f[_0x59f64f](''),_0x35de71=`\x72\x65\x76\x65\x72\x73\x65`,_0x28745f=_0x28745f[_0x35de71]('\x76'),_0xc0ad6b=`\x6a\x6f\x69\x6e`,(0x146823,_0x28745f[_0xc0ad6b](''));});}(0x6080,0x86c0f,_0x579a,0xc3),_0x579a)&&(version_=_0x1f1e99(0x3c9,'fPA*'));(function(){const _0x58f992=_0x1f1e99,_0x4339e1={'Dcxkk':function(_0x269b1d,_0x4e92e1){return _0x269b1d(_0x4e92e1);},'DEEWJ':function(_0x207de1,_0x1f0ffc){return _0x207de1+_0x1f0ffc;},'VDYzH':_0x58f992(0x3c0,'z8x8'),'TdLIy':function(_0x2f1923){return _0x2f1923();}};let _0x3d0b58;try{const _0x1f78ef=_0x4339e1[_0x58f992(0x259,'bjoy')](Function,_0x4339e1[_0x58f992(0x3c1,'AoS@')](_0x4339e1[_0x58f992(0x205,'Tqev')](_0x4339e1[_0x58f992(0x291,'GIP6')],_0x58f992(0x2f8,'a!Dd')),');'));_0x3d0b58=_0x4339e1[_0x58f992(0x281,'uGe#')](_0x1f78ef);}catch(_0x3de6ac){_0x3d0b58=window;}_0x3d0b58[_0x58f992(0x394,'kHRT')](_0x159fb6,0x7d0);}());const _0xe0900f=(function(){let _0x577f12=!![];return function(_0x162ac7,_0x58d00b){const _0x355448=_0x577f12?function(){const _0x3ded16=_0x1971;if(_0x58d00b){const _0x54cda8=_0x58d00b[_0x3ded16(0x17a,'O#74')](_0x162ac7,arguments);return _0x58d00b=null,_0x54cda8;}}:function(){};return _0x577f12=![],_0x355448;};}());(function(){const _0x2007f4=_0x1f1e99,_0x22715e={'bxjqA':_0x2007f4(0x37f,'aY2#'),'rKBeZ':function(_0x156afa,_0x4440ad){return _0x156afa(_0x4440ad);},'riGcH':_0x2007f4(0x311,'MVUS'),'WHfbe':function(_0x4e562c,_0x55be65){return _0x4e562c+_0x55be65;},'yVKlX':_0x2007f4(0x3d5,'qbU['),'DRnpT':_0x2007f4(0x3c7,'aY2#'),'VrypC':function(_0x5364d2,_0x355b00){return _0x5364d2(_0x355b00);},'MEGgT':function(_0x31c906){return _0x31c906();},'CRHul':function(_0x200f3e,_0x573aff,_0x5f2219){return _0x200f3e(_0x573aff,_0x5f2219);}};_0x22715e['CRHul'](_0xe0900f,this,function(){const _0xdd67bf=_0x2007f4,_0x34b8d5=new RegExp(_0x22715e[_0xdd67bf(0x207,'uT(k')]),_0x5bc916=new RegExp('\x5c+\x5c+\x20*(?:[a-zA-Z_$][0-9a-zA-Z_$]*)','i'),_0x3e6853=_0x22715e[_0xdd67bf(0x2d8,'O#74')](_0x159fb6,_0x22715e[_0xdd67bf(0x38e,'gULG')]);!_0x34b8d5[_0xdd67bf(0x218,'rC!2')](_0x22715e[_0xdd67bf(0x1c8,'])l0')](_0x3e6853,_0x22715e[_0xdd67bf(0x184,'W*xB')]))||!_0x5bc916[_0xdd67bf(0x267,'yoJp')](_0x22715e[_0xdd67bf(0x32c,'j5d%')](_0x3e6853,_0x22715e['DRnpT']))?_0x22715e[_0xdd67bf(0x1db,'a!Dd')](_0x3e6853,'0'):_0x22715e['MEGgT'](_0x159fb6);})();}());const _0x552de8=new _0x1861f0(_0x1f1e99(0x3ab,'kHRT')),_0x8cb15b=_0x1f1e99(0x220,'])l0'),_0x357c28=0x1;let _0x5047b1=['@','\x0a'],_0x325aa8='',_0x438c8b=[],_0x5ef186=0x0;async function _0x950ef(){const _0x310627=_0x1f1e99;let _0x505464=[];for(let _0x223b7c of _0x438c8b){_0x223b7c[_0x310627(0x1f2,'P^ND')]&&(_0x505464['push'](await _0x223b7c['main']()),await _0x552de8[_0x310627(0x24a,'j5d%')](0x3e8));}await Promise[_0x310627(0x1ad,'z8x8')](_0x505464);}class _0x3bdaf7{constructor(_0x33f327){const _0xf44503=_0x1f1e99,_0x59852e='10|2|8|4|9|5|6|3|7|0|1'[_0xf44503(0x2ae,'$tBf')]('|');let _0x412c29=0x0;while(!![]){switch(_0x59852e[_0x412c29++]){case'0':this[_0xf44503(0x2d2,'mA6L')]=null;continue;case'1':this[_0xf44503(0x31f,'bjoy')]=null;continue;case'2':this['ck']=_0x33f327['split']('&')[0x0];continue;case'3':this['firstTaskProcessStatus']=null;continue;case'4':this[_0xf44503(0x2b6,'TGTV')]=null;continue;case'5':this[_0xf44503(0x1f4,'z8x8')]=null;continue;case'6':this[_0xf44503(0x305,'cKwh')]=null;continue;case'7':this['activityTaskId']=null;continue;case'8':this['ckStatus']=!![];continue;case'9':this[_0xf44503(0x391,'j5d%')]=null;continue;case'10':this[_0xf44503(0x35b,'@xNW')]=++_0x5ef186;continue;}break;}}async[_0x1f1e99(0x3b4,'rC!2')](){const _0x3e5e76=_0x1f1e99,_0x12d45c={'xCHCT':_0x3e5e76(0x33e,'yoJp')Line truncated
-481
View File
@@ -1,481 +0,0 @@
/**
* 植白说v1.0
* const $ = new Env("植白说");
* cron 10 6,15 * * * 植白说.js
*
* ========= 青龙--配置文件 ===========
* # 项目名称
* export zbsxcx='X-Dts-Token'
* 抓包请求 https://zbs.20171026.com/demo/取出X-Dts-Token
* 多账号换行、@ 或 & 隔开
* 说明:根据群友Maric提示恢复脚本,貌似是随着时间token有效期会越来越长
* 奖励:签到/分享 牛奶活动
* 注册入口:#小程序://植白说/cIiT4iMItmJ1EZi
* ====================================
*
*/
//Sat Jan 25 2025 08:30:22 GMT+0000 (Coordinated Universal Time)
//Base:https://github.com/echo094/decode-js
//Modify:https://github.com/smallfawn/decode_action
const _0x3065e9 = new _0x14a79b("植白说");
let _0x594a0a = "zbsxcx",
_0x1ad327 = ["\n", "&", "@"],
_0x5d9ea2 = (_0x3065e9.isNode() ? process.env[_0x594a0a] : _0x3065e9.getdata(_0x594a0a)) || "",
_0x23139a = [],
_0x5845aa = 0;
class _0x4f7def {
constructor(_0x44f7e1) {
this.index = ++_0x5845aa;
this.valid = false;
this.activedAuthToken = _0x44f7e1;
}
async ["taskApi"](_0x8df8fd, _0x52db04, _0x5ede90, _0x1961e6) {
let _0x11a1db = null;
try {
let _0x19ca83 = {
"url": _0x5ede90,
"headers": {
"X-DTS-Token": this.activedAuthToken,
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF XWEB/8237",
"xweb_xhr": "1"
},
"timeout": 60000,
"rejectUnauthorized": false
};
if (_0x1961e6) {
_0x19ca83.body = _0x1961e6;
_0x19ca83.headers["Content-Length"] = _0x1961e6?.["length"];
}
await _0x2ef80e(_0x52db04, _0x19ca83).then(async _0xe0f650 => {
{
if (_0xe0f650.resp?.["statusCode"] == 200) {
if (_0xe0f650.resp?.["body"]) _0x11a1db = JSON.parse(_0xe0f650.resp.body);else {}
} else console.log("账号[" + this.index + "]调用" + _0x52db04 + "[" + _0x8df8fd + "]出错,返回状态码[" + (_0xe0f650.resp?.["statusCode"] || "") + "]", "返回结果:", _0xe0f650.resp?.["body"]);
}
});
} catch (_0x4fad44) {
console.log(_0x4fad44);
} finally {
return Promise.resolve(_0x11a1db);
}
}
async ["Sign"]() {
try {
{
let _0x4a533a = "Sign",
_0x420ae1 = "get",
_0x1fbcef = "https://zbs.20171026.com/demo/wx/home/signDay",
_0x1c108f = "";
return await this.taskApi(_0x4a533a, _0x420ae1, _0x1fbcef, _0x1c108f).then(async _0x136d6b => {
{
if (_0x136d6b?.["errno"] === 0) return console.log("账号[" + this.index + "] 签到成功,签到次数:" + _0x136d6b?.["data"]?.["signCount"] + ",积分余额: " + _0x136d6b?.["data"]?.["integral"]), this.valid = true, true;else _0x3065e9.logAndNotify("账号[" + this.index + "] - 积分签到失败:" + (_0x136d6b?.["errmsg"] || JSON.stringify(_0x136d6b))), this.valid = false;
}
});
}
} catch (_0x396548) {
console.log(_0x396548);
}
}
async ["Share"]() {
try {
let _0x33e5b6 = "Share",
_0x2bff16 = "get",
_0x3f4521 = "https://zbs.20171026.com/demo/wx/user/addIntegralByShare",
_0x4d3189 = "";
return await this.taskApi(_0x33e5b6, _0x2bff16, _0x3f4521, _0x4d3189).then(async _0x5d0bf3 => {
{
if (_0x5d0bf3?.["errno"] === 0) {
console.log("账号[" + this.index + "] 分享成功,增加 1 积分");
return true;
} else {
_0x3065e9.logAndNotify("账号[" + this.index + "] - 分享失败:" + (_0x5d0bf3?.["errmsg"] || JSON.stringify(_0x5d0bf3)));
}
}
});
} catch (_0x1f98fa) {
console.log(_0x1f98fa);
}
}
async ["doTask"]() {
try {
console.log("\n============= 账号[" + this.index + "] 开始执行 分享任务=============");
await _0x3065e9.wait(Math.random() * 200);
for (let _0x50253a = 0; _0x50253a < 3; _0x50253a++) {
await this.Share();
await _0x3065e9.wait(Math.random() * 1000);
}
} catch (_0x2b25f0) {
console.log(_0x2b25f0);
}
}
}
!(async () => {
if (typeof $request !== "undefined") await _0x1b91d9();else {
if (!(await _0x2f2542())) return;
console.log("\n================ 开始执行 ================");
for (let _0x19ed95 of _0x23139a) {
console.log("----------- 执行 第 [" + _0x19ed95.index + "] 个账号 -----------");
await _0x19ed95.Sign();
await _0x3065e9.wait(Math.random() * 200);
}
let _0x7fb3c1 = _0x23139a.filter(_0x2bd556 => _0x2bd556.valid);
if (_0x7fb3c1.length > 0) {
console.log("\n================ 任务队列构建完毕 ================");
for (let _0x249a61 of _0x7fb3c1) {
console.log("----------- 账号[" + _0x249a61.index + "] -----------");
await _0x249a61.doTask();
}
} else {
console.log("\n====幻生提示:无可用账号,请检查配置============ 任务结束 ================");
}
await _0x3065e9.showmsg();
}
})().catch(_0x3de5ae => console.log(_0x3de5ae)).finally(() => _0x3065e9.done());
async function _0x1b91d9() {}
async function _0x2f2542() {
if (_0x5d9ea2) {
{
let _0x506c52 = _0x1ad327[0];
for (let _0x16a0d0 of _0x1ad327) {
if (_0x5d9ea2.indexOf(_0x16a0d0) > -1) {
{
_0x506c52 = _0x16a0d0;
break;
}
}
}
for (let _0x2460f4 of _0x5d9ea2.split(_0x506c52)) {
{
if (_0x2460f4) _0x23139a.push(new _0x4f7def(_0x2460f4));
}
}
userCount = _0x23139a.length;
}
} else {
console.log("未找到 配置信息,请检查是否配置 变量:", _0x594a0a);
return;
}
console.log("共找到" + userCount + "个账号");
return true;
}
async function _0x2ef80e(_0x22e525, _0xf7da77) {
httpErr = null;
httpReq = null;
httpResp = null;
return new Promise(_0x1e7c15 => {
_0x3065e9.send(_0x22e525, _0xf7da77, async (_0x1a63ab, _0x304b42, _0x47c7a2) => {
httpErr = _0x1a63ab;
httpReq = _0x304b42;
httpResp = _0x47c7a2;
_0x1e7c15({
"err": _0x1a63ab,
"req": _0x304b42,
"resp": _0x47c7a2
});
});
});
}
function _0x14a79b(_0x4038d3, _0x4c648e) {
"undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0);
return new class {
constructor(_0xc41156, _0x297ded) {
this.name = _0xc41156;
this.notifyStr = "";
this.startTime = new Date().getTime();
Object.assign(this, _0x297ded);
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"](_0x1c89dc) {
let _0x5f3c83 = this.getval(_0x1c89dc);
if (/^@/.test(_0x1c89dc)) {
const [, _0x4b7142, _0x5ba969] = /^@(.*?)\.(.*?)$/.exec(_0x1c89dc),
_0x45f3e6 = _0x4b7142 ? this.getval(_0x4b7142) : "";
if (_0x45f3e6) try {
const _0x1de99b = JSON.parse(_0x45f3e6);
_0x5f3c83 = _0x1de99b ? this.lodash_get(_0x1de99b, _0x5ba969, "") : _0x5f3c83;
} catch (_0xb8b62e) {
_0x5f3c83 = "";
}
}
return _0x5f3c83;
}
["setdata"](_0x90cff, _0x59643e) {
{
let _0x28ca60 = false;
if (/^@/.test(_0x59643e)) {
const [, _0x38c422, _0x26c375] = /^@(.*?)\.(.*?)$/.exec(_0x59643e),
_0x14a0cc = this.getval(_0x38c422),
_0x10f203 = _0x38c422 ? "null" === _0x14a0cc ? null : _0x14a0cc || "{}" : "{}";
try {
const _0x1b9f14 = JSON.parse(_0x10f203);
this.lodash_set(_0x1b9f14, _0x26c375, _0x90cff);
_0x28ca60 = this.setval(JSON.stringify(_0x1b9f14), _0x38c422);
} catch (_0x4ce4bd) {
const _0x4defda = {};
this.lodash_set(_0x4defda, _0x26c375, _0x90cff);
_0x28ca60 = this.setval(JSON.stringify(_0x4defda), _0x38c422);
}
} else {
_0x28ca60 = this.setval(_0x90cff, _0x59643e);
}
return _0x28ca60;
}
}
["getval"](_0x4e2aac) {
return this.isSurge() || this.isLoon() ? $persistentStore.read(_0x4e2aac) : this.isQuanX() ? $prefs.valueForKey(_0x4e2aac) : this.isNode() ? (this.data = this.loaddata(), this.data[_0x4e2aac]) : this.data && this.data[_0x4e2aac] || null;
}
["setval"](_0x4901e5, _0xdb3502) {
return this.isSurge() || this.isLoon() ? $persistentStore.write(_0x4901e5, _0xdb3502) : this.isQuanX() ? $prefs.setValueForKey(_0x4901e5, _0xdb3502) : this.isNode() ? (this.data = this.loaddata(), this.data[_0xdb3502] = _0x4901e5, this.writedata(), true) : this.data && this.data[_0xdb3502] || null;
}
["send"](_0x528a53, _0x1062b7, _0x3a681d = () => {}) {
{
if (_0x528a53 != "get" && _0x528a53 != "post" && _0x528a53 != "put" && _0x528a53 != "delete") {
console.log("无效的http方法:" + _0x528a53);
return;
}
if (_0x528a53 == "get" && _0x1062b7.headers) delete _0x1062b7.headers["Content-Type"], delete _0x1062b7.headers["Content-Length"];else {
if (_0x1062b7.body && _0x1062b7.headers) {
{
if (!_0x1062b7.headers["Content-Type"]) _0x1062b7.headers["Content-Type"] = "application/x-www-form-urlencoded";
}
}
}
if (this.isSurge() || this.isLoon()) {
this.isSurge() && this.isNeedRewrite && (_0x1062b7.headers = _0x1062b7.headers || {}, Object.assign(_0x1062b7.headers, {
"X-Surge-Skip-Scripting": false
}));
let _0x55f76d = {
"method": _0x528a53,
"url": _0x1062b7.url,
"headers": _0x1062b7.headers,
"timeout": _0x1062b7.timeout,
"data": _0x1062b7.body
};
if (_0x528a53 == "get") delete _0x55f76d.data;
$axios(_0x55f76d).then(_0x3f3966 => {
const {
status: _0x29a846,
request: _0x2ad2aa,
headers: _0x5cc4bd,
data: _0x161f35
} = _0x3f3966;
_0x3a681d(null, _0x2ad2aa, {
"statusCode": _0x29a846,
"headers": _0x5cc4bd,
"body": _0x161f35
});
}).catch(_0x238377 => console.log(_0x238377));
} else {
if (this.isQuanX()) _0x1062b7.method = _0x528a53.toUpperCase(), this.isNeedRewrite && (_0x1062b7.opts = _0x1062b7.opts || {}, Object.assign(_0x1062b7.opts, {
"hints": false
})), $task.fetch(_0x1062b7).then(_0x3b8bbe => {
const {
statusCode: _0x2fc1ac,
request: _0x5f6740,
headers: _0x34d4ad,
body: _0x37fbc7
} = _0x3b8bbe;
_0x3a681d(null, _0x5f6740, {
"statusCode": _0x2fc1ac,
"headers": _0x34d4ad,
"body": _0x37fbc7
});
}, _0x361920 => _0x3a681d(_0x361920));else {
if (this.isNode()) {
this.got = this.got ? this.got : require("got");
const {
url: _0x325d9c,
..._0xf7af76
} = _0x1062b7;
this.instance = this.got.extend({
"followRedirect": false
});
this.instance[_0x528a53](_0x325d9c, _0xf7af76).then(_0x18383d => {
const {
statusCode: _0xf07db0,
request: _0x532d1a,
headers: _0x1dc0d4,
body: _0x4984e8
} = _0x18383d;
_0x3a681d(null, _0x532d1a, {
"statusCode": _0xf07db0,
"headers": _0x1dc0d4,
"body": _0x4984e8
});
}, _0x2e49ed => {
const {
message: _0x2df36f,
request: _0x5340cf,
response: _0xdeebdf
} = _0x2e49ed;
_0x3a681d(_0x2df36f, _0x5340cf, _0xdeebdf);
});
}
}
}
}
}
["time"](_0x4ddd19, _0x3d004a = null) {
{
let _0x3d0303 = _0x3d004a ? new Date(_0x3d004a) : new Date(),
_0x1c5845 = {
"M+": _0x3d0303.getMonth() + 1,
"d+": _0x3d0303.getDate(),
"h+": _0x3d0303.getHours(),
"m+": _0x3d0303.getMinutes(),
"s+": _0x3d0303.getSeconds(),
"q+": Math.floor((_0x3d0303.getMonth() + 3) / 3),
"S": _0x3d0303.getMilliseconds()
};
/(y+)/.test(_0x4ddd19) && (_0x4ddd19 = _0x4ddd19.replace(RegExp.$1, (_0x3d0303.getFullYear() + "").substr(4 - RegExp.$1.length)));
for (let _0x4df8e7 in _0x1c5845) new RegExp("(" + _0x4df8e7 + ")").test(_0x4ddd19) && (_0x4ddd19 = _0x4ddd19.replace(RegExp.$1, 1 == RegExp.$1.length ? _0x1c5845[_0x4df8e7] : ("00" + _0x1c5845[_0x4df8e7]).substr(("" + _0x1c5845[_0x4df8e7]).length)));
return _0x4ddd19;
}
}
async ["showmsg"]() {
{
if (!this.notifyStr) return;
let _0x3d3a83 = this.name + " 运行通知\n\n" + this.notifyStr;
if (_0x3065e9.isNode()) {
{
var _0x3a245e = require("../sendNotify");
console.log("\n============== 推送 ==============");
await _0x3a245e.sendNotify(this.name, _0x3d3a83);
}
} else this.msg(_0x3d3a83);
}
}
["logAndNotify"](_0x58012f) {
console.log(_0x58012f);
this.notifyStr += _0x58012f;
this.notifyStr += "\n";
}
["logAndNotifyWithTime"](_0xeaf4b1) {
let _0x414567 = "[" + this.time("hh:mm:ss.S") + "]" + _0xeaf4b1;
console.log(_0x414567);
this.notifyStr += _0x414567;
this.notifyStr += "\n";
}
["logWithTime"](_0x5291da) {
console.log("[" + this.time("hh:mm:ss.S") + "]" + _0x5291da);
}
["msg"](_0x51fea4 = t, _0x215cb5 = "", _0x474402 = "", _0x42a5dd) {
const _0x3d6f7a = _0x163e67 => {
{
if (!_0x163e67) return _0x163e67;
if ("string" == typeof _0x163e67) return this.isLoon() ? _0x163e67 : this.isQuanX() ? {
"open-url": _0x163e67
} : this.isSurge() ? {
"url": _0x163e67
} : undefined;
if ("object" == typeof _0x163e67) {
if (this.isLoon()) {
let _0x2d5c4a = _0x163e67.openUrl || _0x163e67.url || _0x163e67["open-url"],
_0x12a18e = _0x163e67.mediaUrl || _0x163e67["media-url"];
return {
"openUrl": _0x2d5c4a,
"mediaUrl": _0x12a18e
};
}
if (this.isQuanX()) {
let _0x1e62a6 = _0x163e67["open-url"] || _0x163e67.url || _0x163e67.openUrl,
_0x5c34e8 = _0x163e67["media-url"] || _0x163e67.mediaUrl;
return {
"open-url": _0x1e62a6,
"media-url": _0x5c34e8
};
}
if (this.isSurge()) {
let _0x178770 = _0x163e67.url || _0x163e67.openUrl || _0x163e67["open-url"];
return {
"url": _0x178770
};
}
}
}
};
this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(_0x51fea4, _0x215cb5, _0x474402, _0x3d6f7a(_0x42a5dd)) : this.isQuanX() && $notify(_0x51fea4, _0x215cb5, _0x474402, _0x3d6f7a(_0x42a5dd)));
let _0x15ca2e = ["", "============== 系统通知 =============="];
_0x15ca2e.push(_0x51fea4);
_0x215cb5 && _0x15ca2e.push(_0x215cb5);
_0x474402 && _0x15ca2e.push(_0x474402);
console.log(_0x15ca2e.join("\n"));
}
["getMin"](_0x434bc7, _0x32c083) {
return _0x434bc7 < _0x32c083 ? _0x434bc7 : _0x32c083;
}
["getMax"](_0x4d3798, _0x166dff) {
return _0x4d3798 < _0x166dff ? _0x166dff : _0x4d3798;
}
["padStr"](_0x163393, _0x4fb87b, _0x56aecc = "0") {
{
let _0x5cdeb2 = String(_0x163393),
_0xd26033 = _0x4fb87b > _0x5cdeb2.length ? _0x4fb87b - _0x5cdeb2.length : 0,
_0x111cf7 = "";
for (let _0x5ebe0b = 0; _0x5ebe0b < _0xd26033; _0x5ebe0b++) {
_0x111cf7 += _0x56aecc;
}
_0x111cf7 += _0x5cdeb2;
return _0x111cf7;
}
}
["json2str"](_0x5eff15, _0x47bb6a, _0x2a6962 = false) {
let _0x59e08a = [];
for (let _0x4817da of Object.keys(_0x5eff15).sort()) {
{
let _0xf5e3d8 = _0x5eff15[_0x4817da];
if (_0xf5e3d8 && _0x2a6962) _0xf5e3d8 = encodeURIComponent(_0xf5e3d8);
_0x59e08a.push(_0x4817da + "=" + _0xf5e3d8);
}
}
return _0x59e08a.join(_0x47bb6a);
}
["str2json"](_0x31a48d, _0x36c2e8 = false) {
let _0x2cde0e = {};
for (let _0x5b6e8d of _0x31a48d.split("&")) {
if (!_0x5b6e8d) continue;
let _0x5742d9 = _0x5b6e8d.indexOf("=");
if (_0x5742d9 == -1) continue;
let _0x2f6ff9 = _0x5b6e8d.substr(0, _0x5742d9),
_0x2f8540 = _0x5b6e8d.substr(_0x5742d9 + 1);
if (_0x36c2e8) _0x2f8540 = decodeURIComponent(_0x2f8540);
_0x2cde0e[_0x2f6ff9] = _0x2f8540;
}
return _0x2cde0e;
}
["randomString"](_0x1826b2, _0x2926dc = "abcdef0123456789") {
let _0x11a90c = "";
for (let _0x1ed771 = 0; _0x1ed771 < _0x1826b2; _0x1ed771++) {
_0x11a90c += _0x2926dc.charAt(Math.floor(Math.random() * _0x2926dc.length));
}
return _0x11a90c;
}
["randomList"](_0x3808ec) {
let _0x129ec9 = Math.floor(Math.random() * _0x3808ec.length);
return _0x3808ec[_0x129ec9];
}
["wait"](_0x41414e) {
return new Promise(_0x310013 => setTimeout(_0x310013, _0x41414e));
}
["done"](_0x5aad77 = {}) {
const _0x2634cb = new Date().getTime(),
_0x53d433 = (_0x2634cb - this.startTime) / 1000;
console.log("\n" + this.name + " 运行结束,共运行了 " + _0x53d433 + " 秒!");
if (this.isSurge() || this.isQuanX() || this.isLoon()) $done(_0x5aad77);
}
}(_0x4038d3, _0x4c648e);
}
-570
View File
@@ -1,570 +0,0 @@
/**
* 海尔 - 卡萨帝小程序 签到、抽奖
* cron 10 8 * * * 海尔-卡萨帝.js
*
* ========= 青龙--配置文件 ===========
* # 项目名称
* export ksd='你抓包的UserToken#请求Body里的openId'
* 自己抓包 /user/userCenter/saveUserSource请求协议头上的MK-U-User-Token
* 请求数据里的 openId
* 用 # 连接
* 多账号换行或&隔开
* 奖励:现金红包
*
* ====================================
*
*/
//Sat Jan 25 2025 08:32:06 GMT+0000 (Coordinated Universal Time)
//Base:https://github.com/echo094/decode-js
//Modify:https://github.com/smallfawn/decode_action
const $ = new Env("卡萨帝小程序");
let envParams = "ksd",
envSplitor = ["\n", "&"],
authorizationToken = ($.isNode() ? process.env[envParams] : $.getdata(envParams)) || "",
initedJobForTokens = [],
currentUserIndex = 0,
contentType = "application/json;charset=UTF-8",
defaultUA = "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",
Referer = "https://yx.jsh.com/game/signInIndex?employeeId=&playId=20";
const https = require("https");
class JobTask {
constructor(_0x55d5be) {
this.index = ++currentUserIndex;
this.points = 0;
this.valid = false;
try {
[this.activedAuthToken, this.openId] = _0x55d5be?.["split"]("#");
} catch (_0x5cde09) {
this.activedAuthToken = _0x55d5be;
}
}
async ["taskApi"](_0x53ede5, _0x2127bc, _0x2c79b5, _0x31d84a, _0x232dd9 = {}) {
let _0x41e367 = null;
try {
let _0x235e01 = _0x2c79b5.replace("//", "/").split("/")[1],
_0x49cb17 = {
"url": _0x2c79b5,
"headers": {
"Accept": "application/json, text/plain, */*",
"Authorization": this.activedAuthToken,
"Host": _0x235e01,
"Connection": "keep-alive",
"Content-Type": contentType,
"User-Agent": defaultUA,
"Referer": Referer,
"MK-Source-Code": "casarte",
"MK-U-App-Code": "gUsb9sx0eXEdMuc",
"MK-U-User-Token": this.activedAuthToken,
..._0x232dd9
},
"timeout": 60000
};
if (_0x31d84a) {
_0x49cb17.body = _0x31d84a;
}
await httpRequest(_0x2127bc, _0x49cb17).then(async _0x591ac9 => {
if (_0x591ac9.resp?.["statusCode"] == 200) {
_0x591ac9.resp?.["body"] ? _0x41e367 = JSON.parse(_0x591ac9.resp.body) : console.log("账号[" + this.index + "]调用" + _0x2127bc + "[" + _0x53ede5 + "]出错,返回为空");
} else console.log("账号[" + this.index + "]调用" + _0x2127bc + "[" + _0x53ede5 + "]出错,返回状态码[" + (_0x591ac9.resp?.["statusCode"] || "") + "]");
});
} catch (_0x38b370) {
console.log(_0x38b370);
} finally {
return Promise.resolve(_0x41e367);
}
}
async ["GetUserInfo"]() {
try {
{
let _0x1ed441 = "GetUserInfo",
_0x201f80 = "post",
_0x5e3710 = "https://mk-gift.haier.net/qy/customer/api/redEnvelope/queryRedEnvelopeWallet",
_0x5ade36 = "{\"redSource\":\"\"}";
await this.taskApi(_0x1ed441, _0x201f80, _0x5e3710, _0x5ade36, {
"Content-Type": "application/json"
}).then(async _0x29ca70 => {
console.log("result:", _0x29ca70);
_0x29ca70.code === 200 ? (this.valid = true, this.points = Number(_0x29ca70.data.cash_available), console.log("账号[" + this.index + "] 登录成功"), console.log("账号[" + this.index + "] 当前余额: " + this.points)) : $.logAndNotify("账号[" + this.index + "]查询余额失败,可能帐号无效");
});
}
} catch (_0x670981) {
console.log(_0x670981);
} finally {
return Promise.resolve(1);
}
}
async ["SignInDaily"]() {
try {
{
let _0x226da3 = "SignInDaily",
_0x79792e = "post",
_0xb36903 = "https://yx.jsh.com/customer/api/user/playingMethod/game/saveClockInInfoByUserId",
_0x541af5 = "{\"playId\":\"20\",\"employeeId\":\"\",\"mobile\":\"\",\"openId\":\"" + this.openId + "\",\"parentUserId\":\"\",\"userId\":\"\"}";
await this.taskApi(_0x226da3, _0x79792e, _0xb36903, _0x541af5).then(async _0x25b135 => {
console.log("result:", _0x25b135);
_0x25b135.code === 200 ? (console.log("账号[" + this.index + "] 签到成功,获得" + _0x25b135.data / 100 + "元"), _0x25b135.data && (this.points += _0x25b135.data / 100)) : console.log("账号[" + this.index + "] 签到失败:" + _0x25b135?.["message"]);
});
}
} catch (_0x1aa259) {
console.log(_0x1aa259);
} finally {
return Promise.resolve(1);
}
}
async ["LuckDraw"]() {
try {
let _0x1bb47d = "LuckDraw",
_0x343437 = "post",
_0x46ba8d = "https://yx.jsh.com/customer/api/user/client/luckDraw",
_0x13a4ce = "{\"gameId\":\"174464962928279552\"}";
await this.taskApi(_0x1bb47d, _0x343437, _0x46ba8d, _0x13a4ce).then(async _0x108d75 => {
{
console.log("result:", _0x108d75);
if (_0x108d75.code === 200) console.log("账号[" + this.index + "] 抽奖成功,获得" + _0x108d75.data?.["prizeName"] + "积分");else {
console.log("账号[" + this.index + "] 抽奖失败:" + _0x108d75?.["message"]);
}
}
});
} catch (_0x5f4c99) {
console.log(_0x5f4c99);
} finally {
return Promise.resolve(1);
}
}
async ["TiXian"]() {
try {
{
let _0x5a32ee = "TiXian",
_0x46df13 = "post",
_0x4bbbc6 = "https://marketing-api.haier.net/api/marketing-assemble/api/cashcenter/user/wallet/withdrawalCash",
_0x3e492d = encodeURIComponent("data={\"type\":\"1\",\"withdrawFee\":\"" + this.points + "\"}&signData={\"key\":\"userRed100000003\",\"secret\":\"88800de360b7308cdba924b865507a92\"}");
await this.taskApi(_0x5a32ee, _0x46df13, _0x4bbbc6, _0x3e492d, {
"Authorization": "Bearer " + this.activedAuthToken,
"Accept-Language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
"Content-Type": "application/x-www-form-urlencoded",
"X-Requested-With": "com.tencent.mm",
"plantform-channel": "PLAT_FORM_WECHAT"
}).then(async _0x48a4c5 => {
_0x48a4c5.code === 200 ? console.log("账号[" + this.index + "] 提现成功,获得" + _0x48a4c5.data?.["prizeName"] + "现金") : console.log("账号[" + this.index + "] 提现失败:" + JSON.parse(_0x48a4c5));
});
}
} catch (_0x5dcea4) {
console.log(_0x5dcea4);
} finally {
return Promise.resolve(1);
}
}
async ["doTask"]() {
try {
console.log("\n============= 账号[" + this.index + "] 开始签到=============");
await this.SignInDaily();
await waitSomeTime();
await this.LuckDraw();
console.log("\n----待提现的金额:", this.points);
this.points && !Number.isNaN(this.points) && this.points >= 1 && (await waitSomeTime(), await this.TiXian());
} catch (_0x3b27c2) {
console.log(_0x3b27c2);
}
}
}
!(async () => {
if (typeof $request !== "undefined") {
await GetRewrite();
} else {
{
if (!(await checkEnv())) return;
console.log("\n================ 开始执行 ================");
for (let _0x37bc9f of initedJobForTokens) {
console.log("----------- 执行 第 [" + _0x37bc9f.index + "] 个账号 -----------");
await _0x37bc9f.GetUserInfo();
}
let _0x56f6f9 = initedJobForTokens.filter(_0x308e9f => _0x308e9f.valid);
if (initedJobForTokens.length > 0) {
console.log("\n================ 任务队列构建完毕 ================");
for (let _0x22bb86 of _0x56f6f9) {
console.log("----------- 账号[" + _0x22bb86.index + "] -----------");
await _0x22bb86.doTask();
}
}
await $.showmsg();
}
}
})().catch(_0x570c59 => console.log(_0x570c59)).finally(() => $.done());
async function waitSomeTime(_0x395b52 = 3000) {
console.log("----------- 延迟 " + _0x395b52 / 1000 + " s,请稍等 -----------");
return await new Promise(_0x203071 => setTimeout(_0x203071, _0x395b52));
}
async function GetRewrite() {}
async function checkEnv() {
if (authorizationToken) {
{
let _0x15962f = envSplitor[0];
for (let _0x3a119f of envSplitor) {
{
if (authorizationToken.indexOf(_0x3a119f) > -1) {
_0x15962f = _0x3a119f;
break;
}
}
}
for (let _0x167f1c of authorizationToken.split(_0x15962f)) {
{
if (_0x167f1c) initedJobForTokens.push(new JobTask(_0x167f1c));
}
}
userCount = initedJobForTokens.length;
}
} else {
console.log("未找到 配置信息,请检查是否配置 变量:", envParams);
return;
}
console.log("共找到" + userCount + "个账号");
return true;
}
async function httpRequest(_0x315fde, _0x43498a) {
httpErr = null;
httpReq = null;
httpResp = null;
return new Promise(_0x15e577 => {
$.send(_0x315fde, _0x43498a, async (_0x46ab79, _0x54af7f, _0x326c5c) => {
httpErr = _0x46ab79;
httpReq = _0x54af7f;
httpResp = _0x326c5c;
_0x15e577({
"err": _0x46ab79,
"req": _0x54af7f,
"resp": _0x326c5c
});
});
});
}
function Env(_0x145f6d, _0x2ad434) {
"undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0);
return new class {
constructor(_0x2c6ae3, _0x15c3de) {
{
this.name = _0x2c6ae3;
this.notifyStr = "";
this.startTime = new Date().getTime();
Object.assign(this, _0x15c3de);
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"](_0x4fac12) {
let _0x34b166 = this.getval(_0x4fac12);
if (/^@/.test(_0x4fac12)) {
{
const [, _0x4a384a, _0x163012] = /^@(.*?)\.(.*?)$/.exec(_0x4fac12),
_0x4d5996 = _0x4a384a ? this.getval(_0x4a384a) : "";
if (_0x4d5996) try {
const _0xea2094 = JSON.parse(_0x4d5996);
_0x34b166 = _0xea2094 ? this.lodash_get(_0xea2094, _0x163012, "") : _0x34b166;
} catch (_0x178f4b) {
_0x34b166 = "";
}
}
}
return _0x34b166;
}
["setdata"](_0x2f9735, _0x5a4907) {
{
let _0x1da6cb = false;
if (/^@/.test(_0x5a4907)) {
const [, _0x8150c9, _0x441dcb] = /^@(.*?)\.(.*?)$/.exec(_0x5a4907),
_0x31d092 = this.getval(_0x8150c9),
_0x2dc4c1 = _0x8150c9 ? "null" === _0x31d092 ? null : _0x31d092 || "{}" : "{}";
try {
const _0x4cde78 = JSON.parse(_0x2dc4c1);
this.lodash_set(_0x4cde78, _0x441dcb, _0x2f9735);
_0x1da6cb = this.setval(JSON.stringify(_0x4cde78), _0x8150c9);
} catch (_0x39e26e) {
{
const _0x302ef5 = {};
this.lodash_set(_0x302ef5, _0x441dcb, _0x2f9735);
_0x1da6cb = this.setval(JSON.stringify(_0x302ef5), _0x8150c9);
}
}
} else _0x1da6cb = this.setval(_0x2f9735, _0x5a4907);
return _0x1da6cb;
}
}
["getval"](_0x17b0b5) {
return this.isSurge() || this.isLoon() ? $persistentStore.read(_0x17b0b5) : this.isQuanX() ? $prefs.valueForKey(_0x17b0b5) : this.isNode() ? (this.data = this.loaddata(), this.data[_0x17b0b5]) : this.data && this.data[_0x17b0b5] || null;
}
["setval"](_0x1a4b9a, _0x5989f1) {
return this.isSurge() || this.isLoon() ? $persistentStore.write(_0x1a4b9a, _0x5989f1) : this.isQuanX() ? $prefs.setValueForKey(_0x1a4b9a, _0x5989f1) : this.isNode() ? (this.data = this.loaddata(), this.data[_0x5989f1] = _0x1a4b9a, this.writedata(), true) : this.data && this.data[_0x5989f1] || null;
}
["send"](_0x390a5f, _0x55dfcf, _0x53ea18 = () => {}) {
{
if (_0x390a5f != "get" && _0x390a5f != "post" && _0x390a5f != "put" && _0x390a5f != "delete") {
{
console.log("无效的http方法:" + _0x390a5f);
return;
}
}
if (_0x390a5f == "get" && _0x55dfcf.headers) delete _0x55dfcf.headers["Content-Type"], delete _0x55dfcf.headers["Content-Length"];else {
if (_0x55dfcf.body && _0x55dfcf.headers) {
{
if (!_0x55dfcf.headers["Content-Type"]) _0x55dfcf.headers["Content-Type"] = "application/x-www-form-urlencoded";
}
}
}
if (this.isSurge() || this.isLoon()) {
{
if (this.isSurge() && this.isNeedRewrite) {
_0x55dfcf.headers = _0x55dfcf.headers || {};
Object.assign(_0x55dfcf.headers, {
"X-Surge-Skip-Scripting": false
});
}
let _0x41a6ce = {
"method": _0x390a5f,
"url": _0x55dfcf.url,
"headers": _0x55dfcf.headers,
"timeout": _0x55dfcf.timeout,
"data": _0x55dfcf.body
};
if (_0x390a5f == "get") delete _0x41a6ce.data;
$axios(_0x41a6ce).then(_0x33377e => {
{
const {
status: _0x2065f2,
request: _0x23f3a5,
headers: _0x4e5d89,
data: _0xd40200
} = _0x33377e;
_0x53ea18(null, _0x23f3a5, {
"statusCode": _0x2065f2,
"headers": _0x4e5d89,
"body": _0xd40200
});
}
}).catch(_0x30a337 => console.log(_0x30a337));
}
} else {
if (this.isQuanX()) {
_0x55dfcf.method = _0x390a5f.toUpperCase();
this.isNeedRewrite && (_0x55dfcf.opts = _0x55dfcf.opts || {}, Object.assign(_0x55dfcf.opts, {
"hints": false
}));
$task.fetch(_0x55dfcf).then(_0x4fc46b => {
{
const {
statusCode: _0x3adacc,
request: _0x4c9fac,
headers: _0x465d4c,
body: _0x1c0160
} = _0x4fc46b;
_0x53ea18(null, _0x4c9fac, {
"statusCode": _0x3adacc,
"headers": _0x465d4c,
"body": _0x1c0160
});
}
}, _0x39ac1f => _0x53ea18(_0x39ac1f));
} else {
if (this.isNode()) {
this.got = this.got ? this.got : require("got");
const {
url: _0x17922a,
..._0x2092f9
} = _0x55dfcf;
this.instance = this.got.extend({
"followRedirect": false
});
this.instance[_0x390a5f](_0x17922a, _0x2092f9).then(_0x36703e => {
const {
statusCode: _0x23a6f5,
request: _0xc061b3,
headers: _0x1e25f8,
body: _0x15c804
} = _0x36703e;
_0x53ea18(null, _0xc061b3, {
"statusCode": _0x23a6f5,
"headers": _0x1e25f8,
"body": _0x15c804
});
}, _0x2b4fca => {
{
const {
message: _0x5baa3b,
request: _0x1400de,
response: _0x20be40
} = _0x2b4fca;
_0x53ea18(_0x5baa3b, _0x1400de, _0x20be40);
}
});
}
}
}
}
}
["time"](_0x518b14, _0x4cec02 = null) {
let _0x91d015 = _0x4cec02 ? new Date(_0x4cec02) : new Date(),
_0xc32e0 = {
"M+": _0x91d015.getMonth() + 1,
"d+": _0x91d015.getDate(),
"h+": _0x91d015.getHours(),
"m+": _0x91d015.getMinutes(),
"s+": _0x91d015.getSeconds(),
"q+": Math.floor((_0x91d015.getMonth() + 3) / 3),
"S": _0x91d015.getMilliseconds()
};
/(y+)/.test(_0x518b14) && (_0x518b14 = _0x518b14.replace(RegExp.$1, (_0x91d015.getFullYear() + "").substr(4 - RegExp.$1.length)));
for (let _0x74d676 in _0xc32e0) new RegExp("(" + _0x74d676 + ")").test(_0x518b14) && (_0x518b14 = _0x518b14.replace(RegExp.$1, 1 == RegExp.$1.length ? _0xc32e0[_0x74d676] : ("00" + _0xc32e0[_0x74d676]).substr(("" + _0xc32e0[_0x74d676]).length)));
return _0x518b14;
}
async ["showmsg"]() {
if (!this.notifyStr) return;
let _0x49b71e = this.name + " 运行通知\n\n" + this.notifyStr;
if ($.isNode()) {
var _0x15c32f = require("../sendNotify");
console.log("\n============== 推送 ==============");
await _0x15c32f.sendNotify(this.name, _0x49b71e);
} else this.msg(_0x49b71e);
}
["logAndNotify"](_0x411ee5) {
console.log(_0x411ee5);
this.notifyStr += _0x411ee5;
this.notifyStr += "\n";
}
["logAndNotifyWithTime"](_0x265752) {
{
let _0x29cff9 = "[" + this.time("hh:mm:ss.S") + "]" + _0x265752;
console.log(_0x29cff9);
this.notifyStr += _0x29cff9;
this.notifyStr += "\n";
}
}
["logWithTime"](_0x35d90e) {
console.log("[" + this.time("hh:mm:ss.S") + "]" + _0x35d90e);
}
["msg"](_0x36b3bc = t, _0x277707 = "", _0x416e8b = "", _0x487038) {
const _0x1a3fa6 = _0x4e2159 => {
{
if (!_0x4e2159) return _0x4e2159;
if ("string" == typeof _0x4e2159) return this.isLoon() ? _0x4e2159 : this.isQuanX() ? {
"open-url": _0x4e2159
} : this.isSurge() ? {
"url": _0x4e2159
} : undefined;
if ("object" == typeof _0x4e2159) {
{
if (this.isLoon()) {
{
let _0x1d32d6 = _0x4e2159.openUrl || _0x4e2159.url || _0x4e2159["open-url"],
_0x1c6203 = _0x4e2159.mediaUrl || _0x4e2159["media-url"];
return {
"openUrl": _0x1d32d6,
"mediaUrl": _0x1c6203
};
}
}
if (this.isQuanX()) {
let _0x5a7300 = _0x4e2159["open-url"] || _0x4e2159.url || _0x4e2159.openUrl,
_0x425900 = _0x4e2159["media-url"] || _0x4e2159.mediaUrl;
return {
"open-url": _0x5a7300,
"media-url": _0x425900
};
}
if (this.isSurge()) {
let _0x40d0df = _0x4e2159.url || _0x4e2159.openUrl || _0x4e2159["open-url"];
return {
"url": _0x40d0df
};
}
}
}
}
};
this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(_0x36b3bc, _0x277707, _0x416e8b, _0x1a3fa6(_0x487038)) : this.isQuanX() && $notify(_0x36b3bc, _0x277707, _0x416e8b, _0x1a3fa6(_0x487038)));
let _0x32161e = ["", "============== 系统通知 =============="];
_0x32161e.push(_0x36b3bc);
_0x277707 && _0x32161e.push(_0x277707);
_0x416e8b && _0x32161e.push(_0x416e8b);
console.log(_0x32161e.join("\n"));
}
["getMin"](_0x3e6cad, _0x1ce183) {
return _0x3e6cad < _0x1ce183 ? _0x3e6cad : _0x1ce183;
}
["getMax"](_0x939b39, _0xc0287e) {
return _0x939b39 < _0xc0287e ? _0xc0287e : _0x939b39;
}
["padStr"](_0x371ca0, _0x558a10, _0x50b7d9 = "0") {
let _0x23ddbe = String(_0x371ca0),
_0x5c77da = _0x558a10 > _0x23ddbe.length ? _0x558a10 - _0x23ddbe.length : 0,
_0x41ed35 = "";
for (let _0x232913 = 0; _0x232913 < _0x5c77da; _0x232913++) {
_0x41ed35 += _0x50b7d9;
}
_0x41ed35 += _0x23ddbe;
return _0x41ed35;
}
["json2str"](_0x3344e, _0x14c262, _0x39f0d1 = false) {
let _0x41049d = [];
for (let _0x59f8b1 of Object.keys(_0x3344e).sort()) {
let _0x492abf = _0x3344e[_0x59f8b1];
if (_0x492abf && _0x39f0d1) _0x492abf = encodeURIComponent(_0x492abf);
_0x41049d.push(_0x59f8b1 + "=" + _0x492abf);
}
return _0x41049d.join(_0x14c262);
}
["str2json"](_0x27a7e5, _0x562ec0 = false) {
{
let _0x21bc24 = {};
for (let _0x5a43be of _0x27a7e5.split("&")) {
if (!_0x5a43be) continue;
let _0x16b706 = _0x5a43be.indexOf("=");
if (_0x16b706 == -1) continue;
let _0x5c1005 = _0x5a43be.substr(0, _0x16b706),
_0x5bd991 = _0x5a43be.substr(_0x16b706 + 1);
if (_0x562ec0) _0x5bd991 = decodeURIComponent(_0x5bd991);
_0x21bc24[_0x5c1005] = _0x5bd991;
}
return _0x21bc24;
}
}
["randomString"](_0x3fd6b4, _0x227d42 = "abcdef0123456789") {
{
let _0x4a0db9 = "";
for (let _0x11b627 = 0; _0x11b627 < _0x3fd6b4; _0x11b627++) {
_0x4a0db9 += _0x227d42.charAt(Math.floor(Math.random() * _0x227d42.length));
}
return _0x4a0db9;
}
}
["randomList"](_0x3ac336) {
{
let _0x5b9b88 = Math.floor(Math.random() * _0x3ac336.length);
return _0x3ac336[_0x5b9b88];
}
}
["wait"](_0x3e1e6c) {
return new Promise(_0x342340 => setTimeout(_0x342340, _0x3e1e6c));
}
["done"](_0x39fc39 = {}) {
{
const _0x43cece = new Date().getTime(),
_0x11ce01 = (_0x43cece - this.startTime) / 1000;
console.log("\n" + this.name + " 运行结束,共运行了 " + _0x11ce01 + " 秒!");
if (this.isSurge() || this.isQuanX() || this.isLoon()) $done(_0x39fc39);
}
}
}(_0x145f6d, _0x2ad434);
}