new some code

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

No files matched your search

-102
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()
-103
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}")