new some code

This commit is contained in:
smallfawn 2026-04-12 12:59:30 +08:00
parent 2bf84f1593
commit 18eccc4f36
5 changed files with 399 additions and 208 deletions

View File

@ -1,102 +0,0 @@
#抓包www.stokkeshop.cn域名下的Authori-zation值填到环境变量STOKKE中多账号用&分割
#入口:http://mx.qrurl.net/h5/wxa/link?sid=26407QRIfeH
# new Env("stokkes小程序签到")
# cron 1 7 * * *
import os
import re
import requests
from typing import List, Dict, Tuple
# ---------- 通用请求头 ----------
_BASE_HEADERS = {
"Host": "www.stokkeshop.cn",
"Connection": "keep-alive",
"content-type": "application/json",
"charset": "utf-8",
"Referer": "https://servicewechat.com/wxe232c36aaca3dc1a/34/page-frame.html",
"Accept-Encoding": "gzip, deflate, br"
}
# ---------- 获取用户信息 ----------
def _get_user_info(token: str) -> Dict[str, str]:
url = "https://www.stokkeshop.cn/api/front/user"
headers = _BASE_HEADERS.copy()
headers["Authori-zation"] = token
try:
resp = requests.get(url, headers=headers, timeout=10)
resp.raise_for_status()
data = resp.json()
if data.get("code") != 200:
return {}
d = data["data"]
raw_phone = d["phone"]
masked = re.sub(r"(\d{3})\d{4}(\d{4})", r"\1****\2", raw_phone)
return {"nick": d["nickname"], "phone": masked, "integral": str(d["integral"])}
except Exception:
return {}
# ---------- 签到 ----------
def week_sign_all() -> None:
tokens = os.getenv("STOKKE", "").split("&")
if not tokens or tokens == [""]:
print("⚠️ 环境变量 STOKKE 为空,未配置任何 账号信息。")
return
url = "https://www.stokkeshop.cn/api/front/integral-task/finishWeekSign"
payload = {}
for token in tokens:
token = token.strip()
if not token:
continue
user = _get_user_info(token)
if not user:
print("❌ 获取用户信息失败,跳过当前账号。")
print("=" * 45)
continue
headers = _BASE_HEADERS.copy()
headers["Authori-zation"] = token
try:
resp = requests.post(url, json=payload, headers=headers, timeout=10)
resp.raise_for_status()
data = resp.json()
ok = data.get("code") == 200
print(
f"{'' if ok else ''} "
f"{user['nick']}({user['phone']}) 签到{'成功' if ok else '失败'}"
f"当前积分 {user['integral']}"
)
print("=" * 45)
except Exception as e:
print(
f"❗ 网络异常:{user['nick']}({user['phone']}) 签到失败,当前积分 {user['integral']} "
f"({e})"
)
# -------------------- 公告 --------------------
def get_proclamation():
primary_url = "https://github.com/3288588344/toulu/raw/refs/heads/main/tl.txt"
backup_url = "https://tfapi.cn/TL/tl.json"
for url in (primary_url, backup_url):
try:
r = requests.get(url, timeout=10)
if r.status_code == 200:
print("📢 公告信息")
print("=" * 45)
print(r.text)
print("=" * 45 + "\n")
return
except Exception as e:
continue
print("⚠️ 获取公告失败,跳过公告直接执行签到...\n")
# ---------- 示例 ----------
if __name__ == "__main__":
#get_proclamation()
week_sign_all()

View File

@ -1,103 +0,0 @@
#入口:https://i.postimg.cc/7YjhgtCH/mmexport1742029346894.jpg
#抓包任意域名下的authorization注意不要开头的Bearer支持多账号
#环境变量名:NWDJG
# new Env("浓五的酒馆")
# cron 8 8 * * *
#by:哆啦A梦
import requests
import os
tokens = os.getenv("NWDJG",'')
if not tokens:
raise ValueError("环境变量 NWDJG 未设置,请确保已正确配置环境变量。")
token_list = tokens.split("&")
headers_template = {
'xweb_xhr': '1',
'content-type': 'application/json',
'sec-fetch-site': 'cross-site',
'sec-fetch-mode': 'cors',
'sec-fetch-dest': 'empty',
'accept-language': 'zh-CN,zh;q=0.9',
}
sign_url = 'https://stdcrm.dtmiller.com/scrm-promotion-service/promotion/sign/today'
sign_params = {
'promotionId': 'PI69cb44d522cc56000aa80bbe',
}
points_url = 'https://stdcrm.dtmiller.com/scrm-promotion-service/mini/wly/user/info'
def get_proclamation():
external_url = "https://github.com/3288588344/toulu/raw/refs/heads/main/tl.txt"
try:
response = requests.get(external_url)
if response.status_code == 200:
print(response.text)
print("公告获取成功,开始执行任务...")
else:
print(f"获取公告失败,状态码: {response.status_code}")
except requests.exceptions.RequestException as e:
print(f"获取公告时发生错误: {e}")
#get_proclamation()
total_accounts = len(token_list)
success_count = 0
fail_count = 0
# 遍历每个账号,依次执行签到和查询积分任务
for index, token in enumerate(token_list, start=1):
print(f"\n正在处理账号 {index}/{total_accounts}...")
headers = headers_template.copy()
headers['authorization'] = f"Bearer {token}"
points_response = requests.get(points_url, headers=headers)
if points_response.status_code == 200:
points_data = points_response.json()
if points_data['code'] == 0:
mobile = points_data['data']['member']['mobile']
account_name = f"{mobile[:3]}*****{mobile[-3:]}"
print(f"账号:{account_name}")
else:
print(f"查询积分失败,{points_data['msg']}")
account_name = "未知"
else:
print(f"查询积分网络请求异常,状态码:{points_response.status_code},响应内容:{points_response.text}")
account_name = "未知"
print("正在尝试签到...")
sign_response = requests.get(sign_url, params=sign_params, headers=headers)
if sign_response.status_code == 200:
sign_data = sign_response.json()
if sign_data['code'] == 0:
print("签到成功!")
print(f"签到天数:{sign_data['data']['signDays']}")
print(f"是否已领取奖励:{sign_data['data']['isReceive']}")
print(f"奖励信息:{sign_data['data']['prize']['goodsName']},积分:{sign_data['data']['prize']['prizePoints']}")
success_count += 1
else:
print(f"签到失败,{sign_data['msg']}")
fail_count += 1
else:
print(f"签到网络请求异常,状态码:{sign_response.status_code},响应内容:{sign_response.text}")
fail_count += 1
print(f"\n任务完成!")
print(f"总账号数量:{total_accounts}")
print(f"签到成功账号:{success_count}")
print(f"签到失败账号:{fail_count}")

View File

@ -6,9 +6,9 @@
cron: 30 9 * * *
------------------------------------------
#Notice:
谢瑞麟 微信小程序 签到得积分
米其林会员 每日任务
WeChatCodeServer 填写wx_server_url wx_auth 用于获取code
变量名称tslj
变量名称miqilin
免责声明
------------------------------------------
1此脚本仅用于学习研究不保证其合法性准确性有效性请根据情况自行判断本人对此不承担任何保证责任
@ -251,7 +251,6 @@ class Task {
if (process.env['wx_server_url'] && process.env['wx_auth']) {
$.userList = ['test']
}
$.userList = ['test']
for (let user of $.userList) {
await new Task(user).run();
}

196
wxTemp/nwdjg.js Normal file
View File

@ -0,0 +1,196 @@
/*
------------------------------------------
@Author: sm
@Date: 2024.06.07 19:15
@Description:
cron: 30 9 * * *
------------------------------------------
#Notice:
浓五的酒馆 微信小程序 签到得积分
WeChatCodeServer 填写wx_server_url wx_auth 用于获取code
变量名称nwdjg
免责声明
------------------------------------------
1此脚本仅用于学习研究不保证其合法性准确性有效性请根据情况自行判断本人对此不承担任何保证责任
2由于此脚本仅用于学习研究您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除若违反规定引起任何事件本人对此均不负责
3请勿将此脚本用于任何商业或非法目的若违反规定请自行对此负责
4此脚本涉及应用与本人无关本人对因此引起的任何隐私泄漏或其他后果不承担任何责任
5本人对任何脚本引发的问题概不负责包括但不限于由脚本错误引起的任何损失和损害
6如果任何单位或个人认为此脚本可能涉嫌侵犯其权利应及时通知并提供身份证明所有权证明我们将在收到认证文件确认后删除此脚本
7所有直接或间接使用查看此脚本的人均应该仔细阅读此声明本人保留随时更改或补充此声明的权利一旦您使用或复制了此脚本即视为您已接受此免责声明
*/
const {
Env
} = require("../tools/env")
const $ = new Env("浓五的酒馆");
const WeChatCodeServer = require("wechat-mini-server");
let ckName = `nwdjg`;
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"
let wechat = new WeChatCodeServer({
url: process.env.wx_server_url || 'http://192.168.31.196:12081',
appid: 'wxed3cf95a14b58a26',
auth: process.env.wx_auth || "your-api-key",
}
);
class Task {
constructor(env) {
this.index = $.userIdx++
this.user = env.split(strSplitor);
this.token = null
this.openid = null
this.isSign = false
}
async run() {
let { data: codeRes } = await wechat.GetMiniCode()
if (codeRes.status) {
await this.getUserToken(codeRes.data)
}
if (!this.token) {
$.log(`账号[${this.index}] 获取用户Token失败❌`)
return
}
this.token = 'Bearer ' + this.token
await this.getUserInfo()
if (!this.isSign) await this.doSign()
}
async getUserToken(code) {
let data = ({
"code": code,
"appId": "wxed3cf95a14b58a26"
});
let options = {
method: 'POST',
url: 'https://stdcrm.dtmiller.com/std-weixin-mp-service/miniApp/custom/login',
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781 NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF XWEB/50249',
'Content-Type': 'application/json',
'xweb_xhr': '1',
'authorization': '',
'sec-fetch-site': 'cross-site',
'sec-fetch-mode': 'cors',
'sec-fetch-dest': 'empty',
'referer': 'https://servicewechat.com/wxed3cf95a14b58a26/255/page-frame.html',
'accept-language': 'zh-CN,zh;q=0.9'
},
data: data
};
let {
data: result
} = await axios.request(options);
if (result?.code == '0') {
this.token = result.data
$.log(`🌸账号[${this.index}] 获取用户Token成功:${this.token}`)
} else {
$.log(`🌸账号[${this.index}] 获取用户Token-失败:${result.msg}`)
}
}
async getUserInfo() {
let options = {
method: 'GET',
url: `https://stdcrm.dtmiller.com/scrm-promotion-service/mini/wly/user/info`,
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781 NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF XWEB/50249',
'Content-Type': 'application/json',
'xweb_xhr': '1',
'authorization': '',
'sec-fetch-site': 'cross-site',
'sec-fetch-mode': 'cors',
'sec-fetch-dest': 'empty',
'referer': 'https://servicewechat.com/wxed3cf95a14b58a26/255/page-frame.html',
'accept-language': 'zh-CN,zh;q=0.9',
authorization: this.token
}
}
let {
data: result
} = await axios.request(options);
if (result?.code == '0') {
$.log(`🌸账号[${this.index}] 获取用户信息[${result.data.member.mobile}] 积分[${result.data.member.points}]`)
} else {
$.log(`🌸账号[${this.index}] 获取用户信息-失败:${result.msg}`)
}
}
async doSign() {
let options = {
method: 'GET',
url: `https://stdcrm.dtmiller.com/scrm-promotion-service/promotion/sign/today?promotionId=PI69cb44d522cc56000aa80bbe`,
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781 NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF XWEB/50249',
'Content-Type': 'application/json',
'xweb_xhr': '1',
'authorization': '',
'sec-fetch-site': 'cross-site',
'sec-fetch-mode': 'cors',
'sec-fetch-dest': 'empty',
'referer': 'https://servicewechat.com/wxed3cf95a14b58a26/255/page-frame.html',
'accept-language': 'zh-CN,zh;q=0.9',
authorization: this.token
}
};
let {
data: result
} = await axios.request(options);
if (result?.code == '0') {
//打印签到结果
$.log(`签到天数:${sign_data['data']['signDays']}`)
$.log(`签到成功`);
} else {
$.log(`🌸账号[${this.index}] 签到-失败:${result.msg}`)
}
}
}
!(async () => {
await getNotice()
$.checkEnv(ckName);
if (process.env['wx_server_url'] && process.env['wx_auth']) {
$.userList = ['test']
}
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) { }
}

201
wxTemp/stokke.js Normal file
View File

@ -0,0 +1,201 @@
/*
------------------------------------------
@Author: sm
@Date: 2024.06.07 19:15
@Description:
cron: 30 9 * * 1
------------------------------------------
#Notice:
stokke 微信小程序 每周签到得积分
WeChatCodeServer 填写wx_server_url wx_auth 用于获取code
变量名称stokke
免责声明
------------------------------------------
1此脚本仅用于学习研究不保证其合法性准确性有效性请根据情况自行判断本人对此不承担任何保证责任
2由于此脚本仅用于学习研究您必须在下载后 24 小时内将所有内容从您的计算机或手机或任何存储设备中完全删除若违反规定引起任何事件本人对此均不负责
3请勿将此脚本用于任何商业或非法目的若违反规定请自行对此负责
4此脚本涉及应用与本人无关本人对因此引起的任何隐私泄漏或其他后果不承担任何责任
5本人对任何脚本引发的问题概不负责包括但不限于由脚本错误引起的任何损失和损害
6如果任何单位或个人认为此脚本可能涉嫌侵犯其权利应及时通知并提供身份证明所有权证明我们将在收到认证文件确认后删除此脚本
7所有直接或间接使用查看此脚本的人均应该仔细阅读此声明本人保留随时更改或补充此声明的权利一旦您使用或复制了此脚本即视为您已接受此免责声明
*/
const {
Env
} = require("../tools/env")
const $ = new Env("stokke小程序");
const WeChatCodeServer = require("wechat-mini-server");
let ckName = `stokke`;
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"
let wechat = new WeChatCodeServer({
url: process.env.wx_server_url || 'http://192.168.31.196:12081',
appid: 'wxe232c36aaca3dc1a',
auth: process.env.wx_auth || "your-api-key",
}
);
class Task {
constructor(env) {
this.index = $.userIdx++
this.user = env.split(strSplitor);
this.token = null
this.openid = null
this.isSign = false
}
async run() {
let { data: codeRes } = await wechat.GetMiniCode()
if (codeRes.status) {
await this.getUserToken(codeRes.data)
}
if (!this.token) {
$.log(`账号[${this.index}] 获取用户Token失败❌`)
return
}
await this.getUserInfo()
if (!this.isSign) await this.doSign()
}
async getUserToken(code) {
let data = ({
"code": code,
"spread_spid": 0,
"type": "routine",
"inviteCode": "",
"inviteTime": ""
});
let options = {
method: 'POST',
url: 'https://www.stokkeshop.cn/api/front/wechat/authorize/program/login?code=' + code,
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781 NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF XWEB/50249',
'Content-Type': 'application/json',
'xweb_xhr': '1',
'Authori-zation': '',
'Sec-Fetch-Site': 'cross-site',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Dest': 'empty',
'Referer': 'https://servicewechat.com/wxe232c36aaca3dc1a/54/page-frame.html',
'Accept-Language': 'zh-CN,zh;q=0.9'
},
data: data
};
let {
data: result
} = await axios.request(options);
if (result?.code == '200') {
this.token = result.data.token
$.log(`🌸账号[${this.index}] 获取用户Token成功:${this.token}`)
} else {
$.log(`🌸账号[${this.index}] 获取用户Token-失败:${result.message}`)
}
}
async getUserInfo() {
let options = {
method: 'GET',
url: `https://www.stokkeshop.cn/api/front/user`,
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781 NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF XWEB/50249',
'Content-Type': 'application/json',
'xweb_xhr': '1',
'Authori-zation': '' + this.token + '',
'Sec-Fetch-Site': 'cross-site',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Dest': 'empty',
'Referer': 'https://servicewechat.com/wxe232c36aaca3dc1a/54/page-frame.html',
'Accept-Language': 'zh-CN,zh;q=0.9'
}
}
let {
data: result
} = await axios.request(options);
if (result?.code == '200') {
//打印签到结果
$.log(`🌸账号[${this.index}]` + `[${result.data.nickname}] 积分[${result.data.integral}]🎉`);
} else {
$.log(`🌸账号[${this.index}] 获取用户信息-失败:${result.message}`)
}
}
async doSign() {
let options = {
method: 'POST',
url: `https://www.stokkeshop.cn/api/front/integral-task/finishWeekSign`,
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781 NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF XWEB/50249',
'Content-Type': 'application/json',
'xweb_xhr': '1',
'Authori-zation': '' + this.token + '',
'Sec-Fetch-Site': 'cross-site',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Dest': 'empty',
'Referer': 'https://servicewechat.com/wxe232c36aaca3dc1a/54/page-frame.html',
'Accept-Language': 'zh-CN,zh;q=0.9'
},
data: {}
};
let {
data: result
} = await axios.request(options);
if (result?.code == '200') {
//打印签到结果
$.log(`签到成功 🎉`);
} else {
$.log(`🌸账号[${this.index}] 签到-失败:${result.message}`)
}
}
}
!(async () => {
await getNotice()
$.checkEnv(ckName);
if (process.env['wx_server_url'] && process.env['wx_auth']) {
$.userList = ['test']
}
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) { }
}