Continue seeded Qinglong script collection
This commit is contained in:
@@ -0,0 +1,521 @@
|
||||
# Source: https://github.com/3ixi/CodeScripts/blob/main/1diandian.py
|
||||
# Raw: https://raw.githubusercontent.com/3ixi/CodeScripts/main/1diandian.py
|
||||
# Repo: 3ixi/CodeScripts
|
||||
# Path: 1diandian.py
|
||||
# UploadedAt: 2025-09-23T14:07:43+08:00
|
||||
# SHA256: 0a75aad0ea5011db3a9836bbc82fb7dc2bc1a415cd32f1cee5636fffdb93b559
|
||||
# Category: 微信小程序/抓包版
|
||||
# Evidence: appid/openid/session_key/encryptedData等小程序字段
|
||||
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
1点点小程序签到脚本
|
||||
脚本作者:3iXi
|
||||
创建时间:2025/07/07
|
||||
!!此脚本需要配合iPad协议服务使用!!
|
||||
小程序:1点点alittleTea+
|
||||
---------------
|
||||
更新时间:2025/07/08(修复是否签到的判断逻辑,但是还需要修复签到积分获取逻辑,9号修复)
|
||||
"""
|
||||
|
||||
import time
|
||||
import hashlib
|
||||
from collections import OrderedDict
|
||||
from typing import Optional, Tuple
|
||||
from datetime import datetime
|
||||
|
||||
try:
|
||||
import httpx
|
||||
except ImportError:
|
||||
print("错误: 需要安装 httpx[http2] 依赖")
|
||||
exit(1)
|
||||
|
||||
import getCode
|
||||
|
||||
|
||||
class YidiandianSignin:
|
||||
"""1点点小程序签到类"""
|
||||
|
||||
DEFAULT_KEY = "4645f747025858aa92bdf966eb3d3abc" # n=1时使用
|
||||
SPECIAL_KEY = "11829b37265314822e26f5425e64e1f4" # n=2时使用
|
||||
|
||||
def __init__(self):
|
||||
"""初始化签到客户端"""
|
||||
self.base_url = "https://crmapi.alittle-group.cn"
|
||||
self.app_id = "202201129689"
|
||||
|
||||
self.client = httpx.Client(http2=True, timeout=30.0)
|
||||
|
||||
self.headers = {
|
||||
"host": "crmapi.alittle-group.cn",
|
||||
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B)",
|
||||
"content-type": "application/json",
|
||||
"accept": "*/*",
|
||||
"referer": "https://servicewechat.com/wxe87f500c8cef4c8a/255/page-frame.html",
|
||||
"accept-encoding": "gzip, deflate, br",
|
||||
"accept-language": "zh-CN,zh;q=0.9"
|
||||
}
|
||||
|
||||
def generate_sign(self, params, sign_type=1):
|
||||
"""
|
||||
生成签名
|
||||
|
||||
Args:
|
||||
params (dict): 请求参数字典
|
||||
sign_type (int): 签名类型,1=默认密钥,2=特殊密钥
|
||||
|
||||
Returns:
|
||||
str: MD5签名值
|
||||
"""
|
||||
# 1. 复制参数(避免修改原参数)
|
||||
sign_params = params.copy()
|
||||
|
||||
# 2. 移除sign参数(如果存在)
|
||||
if 'sign' in sign_params:
|
||||
del sign_params['sign']
|
||||
|
||||
# 3. 按键名排序
|
||||
sorted_params = OrderedDict(sorted(sign_params.items()))
|
||||
|
||||
# 4. 添加密钥
|
||||
if sign_type == 2:
|
||||
sorted_params['key'] = self.SPECIAL_KEY
|
||||
else:
|
||||
sorted_params['key'] = self.DEFAULT_KEY
|
||||
|
||||
# 5. 拼接参数字符串
|
||||
param_string = '&'.join([f"{k}={v}" for k, v in sorted_params.items()])
|
||||
|
||||
# 6. MD5加密
|
||||
sign = hashlib.md5(param_string.encode('utf-8')).hexdigest()
|
||||
|
||||
return sign
|
||||
|
||||
def get_openid_unionid(self, js_code: str) -> Tuple[Optional[str], Optional[str]]:
|
||||
"""
|
||||
获取openid和unionid
|
||||
|
||||
Args:
|
||||
js_code (str): 微信小程序登录code
|
||||
|
||||
Returns:
|
||||
Tuple[Optional[str], Optional[str]]: (openid, unionid)
|
||||
"""
|
||||
params = {
|
||||
"method": "crm.wechat.openid",
|
||||
"js_code": js_code,
|
||||
"app_id": self.app_id,
|
||||
"sign_type": "MD5",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
|
||||
sign = self.generate_sign(params)
|
||||
params["sign"] = sign
|
||||
|
||||
url = f"{self.base_url}/open"
|
||||
|
||||
try:
|
||||
response = self.client.get(url, params=params, headers=self.headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get("errCode") == 10000:
|
||||
result_data = data.get("data", {})
|
||||
openid = result_data.get("openid")
|
||||
unionid = result_data.get("unionid")
|
||||
|
||||
if openid and unionid:
|
||||
print("登录成功")
|
||||
return openid, unionid
|
||||
else:
|
||||
print("登录失败:未获取到openid或unionid")
|
||||
return None, None
|
||||
else:
|
||||
print(f"登录失败:{data.get('errMsg', '未知错误')}")
|
||||
return None, None
|
||||
|
||||
except Exception as e:
|
||||
print(f"登录请求失败: {e}")
|
||||
return None, None
|
||||
|
||||
def get_token(self, openid: str, unionid: str) -> Tuple[Optional[str], Optional[str]]:
|
||||
"""
|
||||
换取Token
|
||||
|
||||
Args:
|
||||
openid (str): 微信openid
|
||||
unionid (str): 微信unionid
|
||||
|
||||
Returns:
|
||||
Tuple[Optional[str], Optional[str]]: (token, nickname)
|
||||
"""
|
||||
params = {
|
||||
"method": "crm.member.wechat.user.login",
|
||||
"openid": openid,
|
||||
"unionid": unionid,
|
||||
"app_id": self.app_id,
|
||||
"sign_type": "MD5",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
|
||||
sign = self.generate_sign(params)
|
||||
params["sign"] = sign
|
||||
|
||||
url = f"{self.base_url}/open"
|
||||
|
||||
try:
|
||||
response = self.client.get(url, params=params, headers=self.headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get("errCode") == 10000:
|
||||
result_data = data.get("data", {})
|
||||
token = result_data.get("token")
|
||||
nickname = result_data.get("nickname")
|
||||
|
||||
if token:
|
||||
print(f"{nickname}的Token换取成功")
|
||||
return token, nickname
|
||||
else:
|
||||
print("Token换取失败:未获取到token")
|
||||
return None, None
|
||||
else:
|
||||
print(f"Token换取失败:{data.get('errMsg', '未知错误')}")
|
||||
return None, None
|
||||
|
||||
except Exception as e:
|
||||
print(f"Token换取请求失败: {e}")
|
||||
return None, None
|
||||
|
||||
def check_signin_status(self, token: str, openid: str) -> Optional[int]:
|
||||
"""
|
||||
检查今日签到状态
|
||||
|
||||
Args:
|
||||
token (str): 用户token
|
||||
openid (str): 微信openid
|
||||
|
||||
Returns:
|
||||
Optional[int]: 0表示未签到,1表示已签到,None表示请求失败
|
||||
"""
|
||||
params = {
|
||||
"method": "crm.activity.sign.in.config",
|
||||
"token": token,
|
||||
"openid": openid,
|
||||
"app_id": self.app_id,
|
||||
"sign_type": "MD5",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
|
||||
sign = self.generate_sign(params)
|
||||
params["sign"] = sign
|
||||
|
||||
url = f"{self.base_url}/open"
|
||||
|
||||
try:
|
||||
response = self.client.get(url, params=params, headers=self.headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get("errCode") == 10000:
|
||||
result_data = data.get("data", {})
|
||||
|
||||
today = datetime.now().strftime("%Y%m%d")
|
||||
|
||||
sign_list = result_data.get("list", [])
|
||||
|
||||
for day_info in sign_list:
|
||||
if day_info.get("day") == today:
|
||||
is_sign = day_info.get("is_sgin", 0)
|
||||
print(f"今日签到状态: {'已签到' if is_sign == 1 else '未签到'}")
|
||||
return is_sign
|
||||
|
||||
print("未找到今日签到记录,默认为未签到")
|
||||
return 0
|
||||
else:
|
||||
print(f"检查签到状态失败:{data.get('errMsg', '未知错误')}")
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f"检查签到状态请求失败: {e}")
|
||||
return None
|
||||
|
||||
def submit_signin(self, token: str, openid: str) -> Optional[int]:
|
||||
"""
|
||||
提交签到
|
||||
|
||||
Args:
|
||||
token (str): 用户token
|
||||
openid (str): 微信openid
|
||||
|
||||
Returns:
|
||||
Optional[int]: 签到获得的积分,None表示签到失败
|
||||
"""
|
||||
params = {
|
||||
"method": "crm.activity.sign.in.sign",
|
||||
"token": token,
|
||||
"openid": openid,
|
||||
"app_id": self.app_id,
|
||||
"sign_type": "MD5",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
|
||||
# 生成签名
|
||||
sign = self.generate_sign(params)
|
||||
params["sign"] = sign
|
||||
|
||||
url = f"{self.base_url}/open"
|
||||
|
||||
try:
|
||||
response = self.client.get(url, params=params, headers=self.headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get("errCode") == 10000:
|
||||
result_data = data.get("data", {})
|
||||
sign_d = result_data.get("sign_d", 0)
|
||||
print(f"签到成功,获得{sign_d}积分")
|
||||
return sign_d
|
||||
else:
|
||||
print(f"签到失败:{data.get('errMsg', '未知错误')}")
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f"签到请求失败: {e}")
|
||||
return None
|
||||
|
||||
def get_member_detail(self, token: str, unionid: str, openid: str) -> Optional[int]:
|
||||
"""
|
||||
获取会员详情(积分余额)
|
||||
|
||||
Args:
|
||||
token (str): 用户token
|
||||
unionid (str): 微信unionid
|
||||
openid (str): 微信openid
|
||||
|
||||
Returns:
|
||||
Optional[int]: 当前积分余额,None表示获取失败
|
||||
"""
|
||||
params = {
|
||||
"method": "crm.member.detail",
|
||||
"token": token,
|
||||
"platform": "WECHAT",
|
||||
"thirdparty_type": "unionid",
|
||||
"thirdparty_id": unionid,
|
||||
"openid": openid,
|
||||
"app_id": self.app_id,
|
||||
"sign_type": "MD5",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
|
||||
sign = self.generate_sign(params)
|
||||
params["sign"] = sign
|
||||
|
||||
url = f"{self.base_url}/open"
|
||||
|
||||
try:
|
||||
response = self.client.get(url, params=params, headers=self.headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get("errCode") == 10000:
|
||||
result_data = data.get("data", {})
|
||||
bonus = result_data.get("bonus", 0)
|
||||
print(f"当前积分{bonus}")
|
||||
return bonus
|
||||
else:
|
||||
print(f"获取积分余额失败:{data.get('errMsg', '未知错误')}")
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f"获取积分余额请求失败: {e}")
|
||||
return None
|
||||
|
||||
def get_coupon_activities(self, token: str, openid: str) -> list:
|
||||
"""
|
||||
查询可领取的优惠券活动
|
||||
|
||||
Args:
|
||||
token (str): 用户token
|
||||
openid (str): 微信openid
|
||||
|
||||
Returns:
|
||||
list: 可领取的优惠券活动列表
|
||||
"""
|
||||
params = {
|
||||
"method": "crm.coupon.activity.list",
|
||||
"token": token,
|
||||
"openid": openid,
|
||||
"app_id": self.app_id,
|
||||
"sign_type": "MD5",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
|
||||
sign = self.generate_sign(params)
|
||||
params["sign"] = sign
|
||||
|
||||
url = f"{self.base_url}/open"
|
||||
|
||||
try:
|
||||
response = self.client.get(url, params=params, headers=self.headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get("errCode") == 10000:
|
||||
activities = data.get("data", [])
|
||||
return activities if activities else []
|
||||
else:
|
||||
print(f"查询优惠券活动失败:{data.get('errMsg', '未知错误')}")
|
||||
return []
|
||||
|
||||
except Exception as e:
|
||||
print(f"查询优惠券活动请求失败: {e}")
|
||||
return []
|
||||
|
||||
def claim_coupon(self, token: str, openid: str, activity_id: int) -> bool:
|
||||
"""
|
||||
领取优惠券
|
||||
|
||||
Args:
|
||||
token (str): 用户token
|
||||
openid (str): 微信openid
|
||||
activity_id (int): 活动ID
|
||||
|
||||
Returns:
|
||||
bool: 是否领取成功
|
||||
"""
|
||||
params = {
|
||||
"method": "crm.coupon.activity.receive",
|
||||
"token": token,
|
||||
"openid": openid,
|
||||
"activity_id": str(activity_id),
|
||||
"app_id": self.app_id,
|
||||
"sign_type": "MD5",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
|
||||
sign = self.generate_sign(params)
|
||||
params["sign"] = sign
|
||||
|
||||
url = f"{self.base_url}/open"
|
||||
|
||||
try:
|
||||
response = self.client.get(url, params=params, headers=self.headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get("errCode") == 10000:
|
||||
return True
|
||||
else:
|
||||
print(f"领取优惠券失败:{data.get('errMsg', '未知错误')}")
|
||||
return False
|
||||
|
||||
except Exception as e:
|
||||
print(f"领取优惠券请求失败: {e}")
|
||||
return False
|
||||
|
||||
def process_account(self, nick_name: str, code: str) -> bool:
|
||||
"""
|
||||
处理单个账号的签到流程
|
||||
|
||||
Args:
|
||||
nick_name (str): 账号昵称
|
||||
code (str): 微信小程序登录code
|
||||
|
||||
Returns:
|
||||
bool: 是否处理成功
|
||||
"""
|
||||
print(f"\n开始处理账号: {nick_name}")
|
||||
|
||||
# 1. 获取openid和unionid
|
||||
openid, unionid = self.get_openid_unionid(code)
|
||||
if not openid or not unionid:
|
||||
print(f"账号 {nick_name} 登录失败")
|
||||
return False
|
||||
|
||||
# 2. 换取Token
|
||||
token, _ = self.get_token(openid, unionid)
|
||||
if not token:
|
||||
print(f"账号 {nick_name} Token换取失败")
|
||||
return False
|
||||
|
||||
# 3. 检查签到状态
|
||||
sign_status = self.check_signin_status(token, openid)
|
||||
if sign_status is None:
|
||||
print(f"账号 {nick_name} 检查签到状态失败")
|
||||
return False
|
||||
|
||||
if sign_status == 1:
|
||||
print("今日已签到")
|
||||
else:
|
||||
# 4. 提交签到
|
||||
signin_result = self.submit_signin(token, openid)
|
||||
if signin_result is None:
|
||||
print(f"账号 {nick_name} 签到失败")
|
||||
return False
|
||||
|
||||
# 5. 获取积分余额
|
||||
self.get_member_detail(token, unionid, openid)
|
||||
|
||||
# 6. 查询并领取优惠券
|
||||
coupon_activities = self.get_coupon_activities(token, openid)
|
||||
if coupon_activities:
|
||||
for activity in coupon_activities:
|
||||
activity_id = activity.get("activity_id")
|
||||
activity_name = activity.get("name")
|
||||
if activity_id and activity_name:
|
||||
success = self.claim_coupon(token, openid, activity_id)
|
||||
if success:
|
||||
print(f"领取优惠券【{activity_name}】成功")
|
||||
else:
|
||||
print(f"领取优惠券【{activity_name}】失败")
|
||||
|
||||
return True
|
||||
|
||||
def close(self):
|
||||
"""关闭HTTP客户端"""
|
||||
self.client.close()
|
||||
|
||||
|
||||
def main():
|
||||
"""主函数"""
|
||||
try:
|
||||
print("正在获取登录Code...")
|
||||
app_id = "wxe87f500c8cef4c8a"
|
||||
codes = getCode.get_wechat_codes(app_id)
|
||||
|
||||
if not codes:
|
||||
print("未获取到任何在线账号的Code")
|
||||
return
|
||||
|
||||
print(f"获取到 {len(codes)} 个账号的Code")
|
||||
|
||||
signin = YidiandianSignin()
|
||||
|
||||
try:
|
||||
for i, (nick_name, code) in enumerate(codes.items(), 1):
|
||||
print(f"\n{'='*50}")
|
||||
print(f"处理第 {i}/{len(codes)} 个账号")
|
||||
print(f"{'='*50}")
|
||||
|
||||
try:
|
||||
signin.process_account(nick_name, code)
|
||||
except Exception as e:
|
||||
print(f"处理账号 {nick_name} 时发生错误: {e}")
|
||||
|
||||
if i < len(codes):
|
||||
print(f"等待2秒后处理下一个账号...")
|
||||
time.sleep(2)
|
||||
|
||||
finally:
|
||||
signin.close()
|
||||
|
||||
print("\n所有账号处理完成")
|
||||
|
||||
except Exception as e:
|
||||
print(f"脚本执行失败: {e}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,296 @@
|
||||
# Source: https://github.com/3ixi/CodeScripts/blob/main/guaguafans.py
|
||||
# Raw: https://raw.githubusercontent.com/3ixi/CodeScripts/main/guaguafans.py
|
||||
# Repo: 3ixi/CodeScripts
|
||||
# Path: guaguafans.py
|
||||
# UploadedAt: 2025-09-23T14:07:43+08:00
|
||||
# SHA256: 0f205827f10d43cfebc4fa31c185af899a1004e83440b01ffa852770e3a922bc
|
||||
# Category: 微信小程序/抓包版
|
||||
# Evidence: appid/openid/session_key/encryptedData等小程序字段
|
||||
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
瓜瓜粉丝俱乐部小程序签到脚本
|
||||
脚本作者:3iXi
|
||||
创建时间:2025/09/16
|
||||
!!此脚本需要配合iPad协议服务使用!!
|
||||
小程序:瓜瓜粉丝俱乐部
|
||||
搜不到就在微信点这个链接:#小程序://瓜瓜粉丝俱乐部/elCKovIOnboDMDu
|
||||
"""
|
||||
|
||||
import time
|
||||
import json
|
||||
from datetime import datetime
|
||||
from urllib.parse import quote
|
||||
from typing import Optional
|
||||
|
||||
try:
|
||||
import httpx
|
||||
except ImportError:
|
||||
print("错误: 需要安装 httpx[http2] 依赖")
|
||||
exit(1)
|
||||
|
||||
import getCode
|
||||
|
||||
|
||||
class YoukeSignin:
|
||||
"""瓜瓜粉丝俱乐部小程序签到类"""
|
||||
|
||||
def __init__(self):
|
||||
"""初始化签到客户端"""
|
||||
self.base_url = "https://smp-api.iyouke.com"
|
||||
self.app_id = "wx05b4bfe1edf7efe5"
|
||||
|
||||
self.client = httpx.Client(http2=True, timeout=30.0, verify=False)
|
||||
|
||||
self.headers = {
|
||||
"host": "smp-api.iyouke.com",
|
||||
"xy-extra-data": "appid=wx05b4bfe1edf7efe5;version=2.13.18;envVersion=release;senceId=1256",
|
||||
"appid": "wx05b4bfe1edf7efe5",
|
||||
"envversion": "release",
|
||||
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a13) UnifiedPCWindowsWechat(0xf2541022) XWEB/16467",
|
||||
"xweb_xhr": "1",
|
||||
"content-type": "application/json",
|
||||
"version": "2.13.18",
|
||||
"accept": "*/*",
|
||||
"sec-fetch-site": "cross-site",
|
||||
"sec-fetch-mode": "cors",
|
||||
"sec-fetch-dest": "empty",
|
||||
"referer": "https://servicewechat.com/wx05b4bfe1edf7efe5/13/page-frame.html",
|
||||
"accept-encoding": "gzip, deflate, br",
|
||||
"accept-language": "zh-CN,zh;q=0.9",
|
||||
"priority": "u=1, i"
|
||||
}
|
||||
|
||||
self.access_token = None
|
||||
self.user_id = None
|
||||
|
||||
def login(self, code: str) -> bool:
|
||||
"""
|
||||
用户登录
|
||||
|
||||
Args:
|
||||
code (str): 微信小程序登录code
|
||||
|
||||
Returns:
|
||||
bool: 登录是否成功
|
||||
"""
|
||||
payload = {
|
||||
"appType": 1,
|
||||
"principal": code
|
||||
}
|
||||
|
||||
url = f"{self.base_url}/dtapi/appLogin"
|
||||
payload_str = json.dumps(payload, separators=(',', ':'))
|
||||
|
||||
try:
|
||||
headers = self.headers.copy()
|
||||
headers["content-length"] = str(len(payload_str))
|
||||
|
||||
response = self.client.post(url, content=payload_str, headers=headers)
|
||||
response.raise_for_status()
|
||||
|
||||
content_length = response.headers.get('content-length')
|
||||
if content_length == '0':
|
||||
print("登录失败:请检查值是否正确")
|
||||
return False
|
||||
|
||||
data = response.json()
|
||||
self.access_token = data.get("access_token")
|
||||
self.user_id = data.get("userId")
|
||||
|
||||
if self.access_token and self.user_id:
|
||||
self.headers["authorization"] = f"bearer{self.access_token}"
|
||||
print(f"登录成功,用户ID{self.user_id}")
|
||||
return True
|
||||
else:
|
||||
print("登录失败:未获取到access_token或userId")
|
||||
return False
|
||||
|
||||
except Exception as e:
|
||||
print(f"登录请求失败: {e}")
|
||||
return False
|
||||
|
||||
def sign_in(self) -> bool:
|
||||
"""
|
||||
提交签到
|
||||
|
||||
Returns:
|
||||
bool: 签到是否成功
|
||||
"""
|
||||
if not self.access_token:
|
||||
print("未获取到access_token,无法签到")
|
||||
return False
|
||||
|
||||
today = datetime.now().strftime("%Y/%m/%d")
|
||||
encoded_date = quote(today)
|
||||
|
||||
url = f"{self.base_url}/dtapi/pointsSign/user/sign?date={encoded_date}"
|
||||
|
||||
try:
|
||||
response = self.client.get(url, headers=self.headers)
|
||||
response.raise_for_status()
|
||||
|
||||
content_length = response.headers.get('content-length')
|
||||
if content_length == '0':
|
||||
print("签到失败:服务器返回空响应")
|
||||
return False
|
||||
|
||||
data = response.json()
|
||||
if data.get('error') == 0:
|
||||
sign_reward = data.get('data', {}).get('signReward', 0)
|
||||
extra_sign_reward = data.get('data', {}).get('extraSignReward', 0)
|
||||
|
||||
print(f"签到成功,获得积分+{sign_reward}")
|
||||
if extra_sign_reward > 0:
|
||||
print(f"获得额外积分+{extra_sign_reward}")
|
||||
return True
|
||||
else:
|
||||
error_msg = data.get('errorMsg', '未知错误')
|
||||
print(f"签到失败:{error_msg}")
|
||||
return False
|
||||
|
||||
except Exception as e:
|
||||
print(f"签到请求失败: {e}")
|
||||
return False
|
||||
|
||||
def get_points_info(self) -> Optional[dict]:
|
||||
"""
|
||||
查询用户积分
|
||||
|
||||
Returns:
|
||||
Optional[dict]: 积分信息,None表示查询失败
|
||||
"""
|
||||
if not self.access_token:
|
||||
print("未获取到access_token,无法查询积分")
|
||||
return None
|
||||
|
||||
url = f"{self.base_url}/dtapi/pointsSign/user/pointsInfo/query"
|
||||
|
||||
try:
|
||||
response = self.client.get(url, headers=self.headers)
|
||||
response.raise_for_status()
|
||||
|
||||
content_length = response.headers.get('content-length')
|
||||
if content_length == '0':
|
||||
print("查询积分失败:服务器返回空响应")
|
||||
return None
|
||||
|
||||
data = response.json()
|
||||
if data.get('error') == 0:
|
||||
points_data = data.get('data', {})
|
||||
points_nums = points_data.get('pointsNums', 0)
|
||||
series_days = points_data.get('seriesDays', 0)
|
||||
|
||||
print(f"已连续签到{series_days}天,当前有{points_nums}积分")
|
||||
return points_data
|
||||
else:
|
||||
error_msg = data.get('errorMsg', '未知错误')
|
||||
print(f"查询积分失败:{error_msg}")
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f"查询积分请求失败: {e}")
|
||||
return None
|
||||
|
||||
def process_account(self, nick_name: str, code: str) -> bool:
|
||||
"""
|
||||
处理单个账号的签到流程
|
||||
|
||||
Args:
|
||||
nick_name (str): 账号昵称
|
||||
code (str): 微信小程序登录code
|
||||
|
||||
Returns:
|
||||
bool: 是否处理成功
|
||||
"""
|
||||
print(f"\n开始处理账号: {nick_name}")
|
||||
|
||||
# 1. 登录
|
||||
if not self.login(code):
|
||||
print(f"账号 {nick_name} 登录失败")
|
||||
return False
|
||||
|
||||
# 2. 提交签到
|
||||
if not self.sign_in():
|
||||
print(f"账号 {nick_name} 签到失败")
|
||||
return False
|
||||
|
||||
# 3. 查询积分信息
|
||||
points_info = self.get_points_info()
|
||||
if points_info is None:
|
||||
print(f"账号 {nick_name} 查询积分失败")
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
def close(self):
|
||||
"""关闭HTTP客户端"""
|
||||
self.client.close()
|
||||
|
||||
def reset_session(self):
|
||||
"""
|
||||
重置/清理会话数据
|
||||
"""
|
||||
try:
|
||||
self.client.close()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
self.client = httpx.Client(http2=True, timeout=30.0, verify=False)
|
||||
|
||||
self.access_token = None
|
||||
self.user_id = None
|
||||
|
||||
if "authorization" in self.headers:
|
||||
try:
|
||||
del self.headers["authorization"]
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
print("已清理会话数据,准备下一个账号...")
|
||||
|
||||
|
||||
def main():
|
||||
"""主函数"""
|
||||
try:
|
||||
print("正在获取登录Code...")
|
||||
app_id = "wx05b4bfe1edf7efe5"
|
||||
codes = getCode.get_wechat_codes(app_id)
|
||||
|
||||
if not codes:
|
||||
print("未获取到任何在线账号的Code")
|
||||
return
|
||||
|
||||
print(f"获取到 {len(codes)} 个账号的Code")
|
||||
|
||||
signin = YoukeSignin()
|
||||
|
||||
try:
|
||||
for i, (nick_name, code) in enumerate(codes.items(), 1):
|
||||
print(f"\n{'='*50}")
|
||||
print(f"处理第 {i}/{len(codes)} 个账号")
|
||||
print(f"{'='*50}")
|
||||
|
||||
try:
|
||||
signin.process_account(nick_name, code)
|
||||
except Exception as e:
|
||||
print(f"处理账号 {nick_name} 时发生错误: {e}")
|
||||
|
||||
signin.reset_session()
|
||||
|
||||
if i < len(codes):
|
||||
print(f"等待2秒后处理下一个账号...")
|
||||
time.sleep(2)
|
||||
|
||||
finally:
|
||||
signin.close()
|
||||
|
||||
print("\n所有账号处理完成")
|
||||
|
||||
except Exception as e:
|
||||
print(f"脚本执行失败: {e}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,427 @@
|
||||
# Source: https://github.com/3ixi/CodeScripts/blob/main/kangshifu_cys.py
|
||||
# Raw: https://raw.githubusercontent.com/3ixi/CodeScripts/main/kangshifu_cys.py
|
||||
# Repo: 3ixi/CodeScripts
|
||||
# Path: kangshifu_cys.py
|
||||
# UploadedAt: 2025-09-23T14:07:43+08:00
|
||||
# SHA256: a38cc580c0069e34fb14419ee5699c3e3f4f286094caa26a90cea9f84a8f0bb2
|
||||
# Category: 微信小程序/抓包版
|
||||
# Evidence: appid/openid/session_key/encryptedData等小程序字段
|
||||
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
康师傅畅饮社小程序签到脚本
|
||||
脚本作者:3iXi
|
||||
创建时间:2025/08/28
|
||||
!!此脚本需要配合iPad协议服务使用!!
|
||||
小程序:康师傅畅饮社
|
||||
"""
|
||||
|
||||
import time
|
||||
import json
|
||||
from typing import Optional
|
||||
|
||||
try:
|
||||
import httpx
|
||||
except ImportError:
|
||||
print("错误: 需要安装 httpx[http2] 依赖")
|
||||
exit(1)
|
||||
|
||||
import getCode
|
||||
|
||||
|
||||
class BiqrSignin:
|
||||
"""康师傅畅饮社小程序签到类"""
|
||||
|
||||
def __init__(self):
|
||||
"""初始化签到客户端"""
|
||||
self.base_url = "https://club.biqr.cn"
|
||||
self.login_url = "https://nclub.gdshcm.com"
|
||||
self.app_id = "wx54f3e6a00f7973a7"
|
||||
|
||||
self.client = httpx.Client(http2=True, timeout=30.0, verify=False)
|
||||
|
||||
self.headers = {
|
||||
"Host": "club.biqr.cn",
|
||||
"Connection": "keep-alive",
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a13) UnifiedPCWindowsWechat(0xf254061a) XWEB/16203",
|
||||
"Accept": "application/json, text/plain, */*",
|
||||
"xweb_xhr": "1",
|
||||
"Content-Type": "application/x-www-form-urlencoded;",
|
||||
"Sec-Fetch-Site": "cross-site",
|
||||
"Sec-Fetch-Mode": "cors",
|
||||
"Sec-Fetch-Dest": "empty",
|
||||
"Referer": "https://servicewechat.com/wx54f3e6a00f7973a7/720/page-frame.html",
|
||||
"Accept-Encoding": "gzip, deflate, br",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9"
|
||||
}
|
||||
|
||||
self.login_headers = {
|
||||
"Host": "nclub.gdshcm.com",
|
||||
"Connection": "keep-alive",
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a13) UnifiedPCWindowsWechat(0xf254061a) XWEB/16203",
|
||||
"Accept": "application/json, text/plain, */*",
|
||||
"xweb_xhr": "1",
|
||||
"Content-Type": "application/json; charset=UTF-8",
|
||||
"Sec-Fetch-Site": "cross-site",
|
||||
"Sec-Fetch-Mode": "cors",
|
||||
"Sec-Fetch-Dest": "empty",
|
||||
"Referer": "https://servicewechat.com/wx54f3e6a00f7973a7/720/page-frame.html",
|
||||
"Accept-Encoding": "gzip, deflate, br",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9"
|
||||
}
|
||||
|
||||
self.token = None
|
||||
self.nickname = None
|
||||
self.initial_integral = None
|
||||
|
||||
def login(self, code: str) -> bool:
|
||||
"""
|
||||
用户登录
|
||||
|
||||
Args:
|
||||
code (str): 微信小程序登录code
|
||||
|
||||
Returns:
|
||||
bool: 登录是否成功
|
||||
"""
|
||||
payload = {
|
||||
"code": code,
|
||||
"inviterId": "",
|
||||
"inviterType": "",
|
||||
"inviterMatchUserId": "",
|
||||
"spUrl": None
|
||||
}
|
||||
|
||||
url = f"{self.login_url}/pro/whale-member/api/login/login"
|
||||
|
||||
try:
|
||||
response = self.client.post(url, json=payload, headers=self.login_headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get("code") == 0:
|
||||
self.token = data.get("data", {}).get("token")
|
||||
member_info = data.get("data", {}).get("member", {})
|
||||
self.nickname = member_info.get("nickname", "未知用户")
|
||||
self.initial_integral = member_info.get("totalIntegral", 0)
|
||||
|
||||
if self.token:
|
||||
self.headers["Token"] = self.token
|
||||
print(f"{self.nickname}登录成功,开始准备签到...")
|
||||
return True
|
||||
else:
|
||||
print("登录失败:当前账号未授权小程序,请手动进入小程序登录一次")
|
||||
return False
|
||||
else:
|
||||
print(f"登录失败:{data.get('msg', '未知错误')}")
|
||||
return False
|
||||
|
||||
except Exception as e:
|
||||
print(f"登录请求失败: {e}")
|
||||
return False
|
||||
|
||||
def check_signin_status(self) -> Optional[dict]:
|
||||
"""
|
||||
检查签到状态
|
||||
|
||||
Returns:
|
||||
Optional[dict]: 签到状态信息,None表示检查失败
|
||||
"""
|
||||
if not self.token:
|
||||
print("未获取到token,无法检查签到状态")
|
||||
return None
|
||||
|
||||
url = f"{self.base_url}/api/signIn/integralSignInList"
|
||||
payload = f"token={self.token}"
|
||||
|
||||
try:
|
||||
headers = self.headers.copy()
|
||||
headers["Content-Length"] = str(len(payload))
|
||||
|
||||
response = self.client.post(url, data=payload, headers=headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get('code') == 0:
|
||||
sign_data = data.get('data', {})
|
||||
sign_is = sign_data.get('signIs', False)
|
||||
continuous = sign_data.get('continuous', 0)
|
||||
|
||||
status_text = "已签到" if sign_is else "未签到"
|
||||
print(f"今日{status_text},已连续签到{continuous}天")
|
||||
return sign_data
|
||||
else:
|
||||
print(f"检查签到状态失败:{data.get('msg', '未知错误')}")
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f"检查签到状态请求失败: {e}")
|
||||
return None
|
||||
|
||||
def submit_signin(self) -> bool:
|
||||
"""
|
||||
提交签到
|
||||
|
||||
Returns:
|
||||
bool: 签到是否成功
|
||||
"""
|
||||
if not self.token:
|
||||
print("未获取到token,无法签到")
|
||||
return False
|
||||
|
||||
url = f"{self.base_url}/api/signIn/integralSignIn"
|
||||
payload = "{}"
|
||||
|
||||
try:
|
||||
headers = self.headers.copy()
|
||||
headers["Content-Length"] = str(len(payload))
|
||||
|
||||
response = self.client.post(url, data=payload, headers=headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get('code') == 0:
|
||||
msg = data.get('msg', '签到成功')
|
||||
print(msg)
|
||||
return True
|
||||
else:
|
||||
print(f"签到失败:{data.get('msg', '未知错误')}")
|
||||
return False
|
||||
|
||||
except Exception as e:
|
||||
print(f"签到请求失败: {e}")
|
||||
return False
|
||||
|
||||
def check_subscribe_status(self) -> Optional[bool]:
|
||||
"""
|
||||
检查订阅状态
|
||||
|
||||
Returns:
|
||||
Optional[bool]: True=已订阅, False=未订阅, None=检查失败
|
||||
"""
|
||||
if not self.token:
|
||||
print("未获取到token,无法检查订阅状态")
|
||||
return None
|
||||
|
||||
url = f"{self.base_url}/api/integral/subscribeStatus"
|
||||
payload = f"token={self.token}"
|
||||
|
||||
try:
|
||||
headers = self.headers.copy()
|
||||
headers["Content-Length"] = str(len(payload))
|
||||
|
||||
response = self.client.post(url, data=payload, headers=headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get('code') == 0:
|
||||
is_subscribed = data.get('data', True)
|
||||
return is_subscribed
|
||||
else:
|
||||
print(f"检查订阅状态失败:{data.get('msg', '未知错误')}")
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f"检查订阅状态请求失败: {e}")
|
||||
return None
|
||||
|
||||
def submit_subscribe(self) -> bool:
|
||||
"""
|
||||
提交订阅任务
|
||||
|
||||
Returns:
|
||||
bool: 订阅是否成功
|
||||
"""
|
||||
if not self.token:
|
||||
print("未获取到token,无法提交订阅")
|
||||
return False
|
||||
|
||||
url = f"{self.base_url}/api/integral/subscribeMessage"
|
||||
payload = "page=%2F25teaAlliance%2Fpages%2Findex&lat=0.00&lng=0.00&miniprogramState=formal"
|
||||
|
||||
try:
|
||||
headers = self.headers.copy()
|
||||
headers["Content-Length"] = str(len(payload))
|
||||
|
||||
response = self.client.post(url, data=payload, headers=headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get('code') == 0:
|
||||
print('"首次订阅小程序"任务完成')
|
||||
return True
|
||||
else:
|
||||
print(f"订阅任务失败:{data.get('msg', '未知错误')}")
|
||||
return False
|
||||
|
||||
except Exception as e:
|
||||
print(f"订阅任务请求失败: {e}")
|
||||
return False
|
||||
|
||||
def get_member_info(self) -> Optional[dict]:
|
||||
"""
|
||||
获取会员信息
|
||||
|
||||
Returns:
|
||||
Optional[dict]: 会员信息,None表示获取失败
|
||||
"""
|
||||
if not self.token:
|
||||
print("未获取到token,无法获取会员信息")
|
||||
return None
|
||||
|
||||
url = f"{self.login_url}/pro/whale-member/api/member/getMemberInfo?token={self.token}"
|
||||
|
||||
headers = {
|
||||
"Host": "nclub.gdshcm.com",
|
||||
"Connection": "keep-alive",
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a13) UnifiedPCWindowsWechat(0xf254061a) XWEB/16203",
|
||||
"Accept": "application/json, text/plain, */*",
|
||||
"xweb_xhr": "1",
|
||||
"Content-Type": "application/json",
|
||||
"Token": self.token,
|
||||
"Sec-Fetch-Site": "cross-site",
|
||||
"Sec-Fetch-Mode": "cors",
|
||||
"Sec-Fetch-Dest": "empty",
|
||||
"Referer": "https://servicewechat.com/wx54f3e6a00f7973a7/720/page-frame.html",
|
||||
"Accept-Encoding": "gzip, deflate, br",
|
||||
"Accept-Language": "zh-CN,zh;q=0.9"
|
||||
}
|
||||
|
||||
try:
|
||||
response = self.client.get(url, headers=headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get('code') == 0:
|
||||
return data.get('data', {})
|
||||
else:
|
||||
print(f"获取会员信息失败:{data.get('msg', '未知错误')}")
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f"获取会员信息请求失败: {e}")
|
||||
return None
|
||||
|
||||
def process_account(self, nick_name: str, code: str) -> bool:
|
||||
"""
|
||||
处理单个账号的签到流程
|
||||
|
||||
Args:
|
||||
nick_name (str): 账号昵称
|
||||
code (str): 微信小程序登录code
|
||||
|
||||
Returns:
|
||||
bool: 是否处理成功
|
||||
"""
|
||||
print(f"\n开始处理账号: {nick_name}")
|
||||
|
||||
# 1. 登录
|
||||
if not self.login(code):
|
||||
print(f"账号 {nick_name} 登录失败")
|
||||
return False
|
||||
|
||||
# 2. 检查签到状态
|
||||
sign_status = self.check_signin_status()
|
||||
if sign_status is None:
|
||||
print(f"账号 {nick_name} 检查签到状态失败")
|
||||
return False
|
||||
|
||||
# 3. 如果未签到则提交签到
|
||||
if not sign_status.get('signIs', False):
|
||||
if not self.submit_signin():
|
||||
print(f"账号 {nick_name} 签到失败")
|
||||
return False
|
||||
|
||||
# 4. 检查订阅状态
|
||||
subscribe_status = self.check_subscribe_status()
|
||||
if subscribe_status is None:
|
||||
print(f"账号 {nick_name} 检查订阅状态失败")
|
||||
return False
|
||||
|
||||
# 5. 如果未订阅则提交订阅
|
||||
if not subscribe_status:
|
||||
if not self.submit_subscribe():
|
||||
print(f"账号 {nick_name} 订阅小程序失败")
|
||||
return False
|
||||
|
||||
# 6. 获取最新积分信息
|
||||
member_info = self.get_member_info()
|
||||
if member_info:
|
||||
current_integral = member_info.get('totalIntegral', 0)
|
||||
today_integral = current_integral - self.initial_integral
|
||||
print(f"今日获得{today_integral}积分,当前有{current_integral}积分")
|
||||
|
||||
return True
|
||||
|
||||
def close(self):
|
||||
"""关闭HTTP客户端"""
|
||||
self.client.close()
|
||||
|
||||
def reset_session(self):
|
||||
"""
|
||||
重置/清理会话数据
|
||||
"""
|
||||
try:
|
||||
self.client.close()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
self.client = httpx.Client(http2=True, timeout=30.0, verify=False)
|
||||
|
||||
self.token = None
|
||||
self.nickname = None
|
||||
self.initial_integral = None
|
||||
|
||||
if "Token" in self.headers:
|
||||
try:
|
||||
del self.headers["Token"]
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
print("已清理会话数据,准备下一个账号...")
|
||||
|
||||
|
||||
def main():
|
||||
"""主函数"""
|
||||
try:
|
||||
print("正在获取登录Code...")
|
||||
app_id = "wx54f3e6a00f7973a7"
|
||||
codes = getCode.get_wechat_codes(app_id)
|
||||
|
||||
if not codes:
|
||||
print("未获取到任何在线账号的Code")
|
||||
return
|
||||
|
||||
print(f"获取到 {len(codes)} 个账号的Code")
|
||||
|
||||
signin = BiqrSignin()
|
||||
|
||||
try:
|
||||
for i, (nick_name, code) in enumerate(codes.items(), 1):
|
||||
print(f"\n{'='*50}")
|
||||
print(f"处理第 {i}/{len(codes)} 个账号")
|
||||
print(f"{'='*50}")
|
||||
|
||||
try:
|
||||
signin.process_account(nick_name, code)
|
||||
except Exception as e:
|
||||
print(f"处理账号 {nick_name} 时发生错误: {e}")
|
||||
|
||||
signin.reset_session()
|
||||
|
||||
if i < len(codes):
|
||||
print(f"等待2秒后处理下一个账号...")
|
||||
time.sleep(2)
|
||||
|
||||
finally:
|
||||
signin.close()
|
||||
|
||||
print("\n所有账号处理完成")
|
||||
|
||||
except Exception as e:
|
||||
print(f"脚本执行失败: {e}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
287
脚本库/微信小程序/抓包版/str,_code_str_-_bool/2025-09-23_sanfu_9dbc44bf.py
Normal file
287
脚本库/微信小程序/抓包版/str,_code_str_-_bool/2025-09-23_sanfu_9dbc44bf.py
Normal file
@@ -0,0 +1,287 @@
|
||||
# Source: https://github.com/3ixi/CodeScripts/blob/main/sanfu.py
|
||||
# Raw: https://raw.githubusercontent.com/3ixi/CodeScripts/main/sanfu.py
|
||||
# Repo: 3ixi/CodeScripts
|
||||
# Path: sanfu.py
|
||||
# UploadedAt: 2025-09-23T14:07:43+08:00
|
||||
# SHA256: 9dbc44bf77db255d285a3fb02d15f095f1d25724e6ccd3fa56b168b6078469ea
|
||||
# Category: 微信小程序/抓包版
|
||||
# Evidence: appid/openid/session_key/encryptedData等小程序字段
|
||||
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
三福小程序签到脚本
|
||||
脚本作者:3iXi
|
||||
创建时间:2025/07/10
|
||||
!!此脚本需要配合iPad协议服务使用!!
|
||||
小程序:三福会员中心
|
||||
"""
|
||||
|
||||
import time
|
||||
import json
|
||||
from typing import Optional
|
||||
|
||||
try:
|
||||
import httpx
|
||||
except ImportError:
|
||||
print("错误: 需要安装 httpx[http2] 依赖")
|
||||
exit(1)
|
||||
|
||||
import getCode
|
||||
|
||||
|
||||
class SanfuSignin:
|
||||
"""三福小程序签到类"""
|
||||
|
||||
def __init__(self):
|
||||
"""初始化签到客户端"""
|
||||
self.base_url = "https://crm.sanfu.com"
|
||||
self.app_id = "wxfe13a2a5df88b058"
|
||||
|
||||
self.client = httpx.Client(http2=True, timeout=30.0, verify=False)
|
||||
|
||||
self.headers = {
|
||||
"host": "crm.sanfu.com",
|
||||
"connection": "keep-alive",
|
||||
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B)",
|
||||
"content-type": "application/json",
|
||||
"accept": "*/*",
|
||||
"referer": "https://servicewechat.com/wxfe13a2a5df88b058/333/page-frame.html",
|
||||
"accept-encoding": "gzip, deflate, br",
|
||||
"accept-language": "zh-CN,zh;q=0.9"
|
||||
}
|
||||
|
||||
self.sid = None
|
||||
|
||||
def login(self, code: str) -> bool:
|
||||
"""
|
||||
用户登录
|
||||
|
||||
Args:
|
||||
code (str): 微信小程序登录code
|
||||
|
||||
Returns:
|
||||
bool: 登录是否成功
|
||||
"""
|
||||
payload = {
|
||||
"code": code,
|
||||
"appid": self.app_id,
|
||||
"shoId": "",
|
||||
"userId": "",
|
||||
"sourceWxsceneid": 1145,
|
||||
"sourceUrl": "pages/ucenter_index/ucenter_index"
|
||||
}
|
||||
|
||||
url = f"{self.base_url}/ms-sanfu-wechat-customer-core/customer/core/wxMiniAppLogin"
|
||||
|
||||
try:
|
||||
response = self.client.post(url, json=payload, headers=self.headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get("code") == 200 and data.get("success"):
|
||||
sid = data.get("data", {}).get("sid")
|
||||
if sid:
|
||||
self.sid = sid
|
||||
print("登录成功")
|
||||
return True
|
||||
else:
|
||||
print("登录失败:未获取到sid")
|
||||
return False
|
||||
else:
|
||||
print(f"登录失败:{data.get('msg', '未知错误')}")
|
||||
return False
|
||||
|
||||
except Exception as e:
|
||||
print(f"登录请求失败: {e}")
|
||||
return False
|
||||
|
||||
def check_signin_status(self) -> Optional[bool]:
|
||||
"""
|
||||
检查签到状态
|
||||
|
||||
Returns:
|
||||
Optional[bool]: True=已签到, False=未签到, None=检查失败
|
||||
"""
|
||||
if not self.sid:
|
||||
print("未获取到sid,无法检查签到状态")
|
||||
return None
|
||||
|
||||
url = f"{self.base_url}/ms-sanfu-wechat-customer/customer/index/equity?sid={self.sid}"
|
||||
|
||||
try:
|
||||
response = self.client.get(url, headers=self.headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get('code') == 200:
|
||||
sign_in = data.get('data', {}).get('signIn', 1)
|
||||
is_signed = sign_in == 1
|
||||
print(f"签到状态: {'已签到' if is_signed else '未签到'}")
|
||||
return is_signed
|
||||
else:
|
||||
print(f"检查签到状态失败:{data.get('msg', '未知错误')}")
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f"检查签到状态请求失败: {e}")
|
||||
return None
|
||||
|
||||
def submit_signin(self) -> Optional[dict]:
|
||||
"""
|
||||
提交签到
|
||||
|
||||
Returns:
|
||||
Optional[dict]: 签到结果数据,None表示签到失败
|
||||
"""
|
||||
if not self.sid:
|
||||
print("未获取到sid,无法签到")
|
||||
return None
|
||||
|
||||
payload = {
|
||||
"sid": self.sid,
|
||||
"signWay": 0
|
||||
}
|
||||
|
||||
url = f"{self.base_url}/ms-sanfu-wechat-common/customer/onSign"
|
||||
|
||||
try:
|
||||
response = self.client.post(url, json=payload, headers=self.headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get('code') == 200:
|
||||
return data.get('data', {})
|
||||
else:
|
||||
print(f"签到失败:{data.get('msg', '未知错误')}")
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f"签到请求失败: {e}")
|
||||
return None
|
||||
|
||||
def get_account_info(self) -> Optional[dict]:
|
||||
"""
|
||||
获取账号基本信息
|
||||
|
||||
Returns:
|
||||
Optional[dict]: 账号信息,None表示获取失败
|
||||
"""
|
||||
if not self.sid:
|
||||
print("未获取到sid,无法获取账号信息")
|
||||
return None
|
||||
|
||||
url = f"{self.base_url}/ms-sanfu-wechat-customer/customer/index/baseInfo?sid={self.sid}"
|
||||
|
||||
try:
|
||||
response = self.client.get(url, headers=self.headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get('code') == 200:
|
||||
return data.get('data', {})
|
||||
else:
|
||||
print(f"获取账号信息失败:{data.get('msg', '未知错误')}")
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f"获取账号信息请求失败: {e}")
|
||||
return None
|
||||
|
||||
def process_account(self, nick_name: str, code: str) -> bool:
|
||||
"""
|
||||
处理单个账号的签到流程
|
||||
|
||||
Args:
|
||||
nick_name (str): 账号昵称
|
||||
code (str): 微信小程序登录code
|
||||
|
||||
Returns:
|
||||
bool: 是否处理成功
|
||||
"""
|
||||
print(f"\n开始处理账号: {nick_name}")
|
||||
|
||||
# 1. 登录
|
||||
if not self.login(code):
|
||||
print(f"账号 {nick_name} 登录失败")
|
||||
return False
|
||||
|
||||
# 2. 检查签到状态
|
||||
sign_status = self.check_signin_status()
|
||||
if sign_status is None:
|
||||
print(f"账号 {nick_name} 检查签到状态失败")
|
||||
return False
|
||||
|
||||
if sign_status:
|
||||
print("今日已签到")
|
||||
else:
|
||||
# 3. 提交签到
|
||||
sign_result = self.submit_signin()
|
||||
if sign_result is None:
|
||||
print(f"账号 {nick_name} 签到失败")
|
||||
return False
|
||||
|
||||
# 4. 处理签到结果
|
||||
onSign_fubi = sign_result.get('fubi', 0)
|
||||
onKeepSignDay = sign_result.get('onKeepSignDay', 0)
|
||||
giftMoneyDaily = sign_result.get('giftMoneyDaily', 0)
|
||||
|
||||
print(f"签到成功,获得{onSign_fubi}个福币,连续签到{onKeepSignDay}天")
|
||||
if giftMoneyDaily > 0:
|
||||
print(f"再签{giftMoneyDaily}天可得神秘礼物🎁")
|
||||
|
||||
# 5. 获取账号信息
|
||||
account_info = self.get_account_info()
|
||||
if account_info:
|
||||
curCusId = account_info.get('curCusId', '未知ID')
|
||||
baseInfo_fubi = account_info.get('fubi', 0)
|
||||
print(f"账号ID: {curCusId},当前有{baseInfo_fubi}个福币")
|
||||
|
||||
return True
|
||||
|
||||
def close(self):
|
||||
"""关闭HTTP客户端"""
|
||||
self.client.close()
|
||||
|
||||
|
||||
def main():
|
||||
"""主函数"""
|
||||
try:
|
||||
print("正在获取登录Code...")
|
||||
app_id = "wxfe13a2a5df88b058"
|
||||
codes = getCode.get_wechat_codes(app_id)
|
||||
|
||||
if not codes:
|
||||
print("未获取到任何在线账号的Code")
|
||||
return
|
||||
|
||||
print(f"获取到 {len(codes)} 个账号的Code")
|
||||
|
||||
signin = SanfuSignin()
|
||||
|
||||
try:
|
||||
for i, (nick_name, code) in enumerate(codes.items(), 1):
|
||||
print(f"\n{'='*50}")
|
||||
print(f"处理第 {i}/{len(codes)} 个账号")
|
||||
print(f"{'='*50}")
|
||||
|
||||
try:
|
||||
signin.process_account(nick_name, code)
|
||||
except Exception as e:
|
||||
print(f"处理账号 {nick_name} 时发生错误: {e}")
|
||||
|
||||
if i < len(codes):
|
||||
print(f"等待2秒后处理下一个账号...")
|
||||
time.sleep(2)
|
||||
|
||||
finally:
|
||||
signin.close()
|
||||
|
||||
print("\n所有账号处理完成")
|
||||
|
||||
except Exception as e:
|
||||
print(f"脚本执行失败: {e}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,421 @@
|
||||
# Source: https://github.com/3ixi/CodeScripts/blob/main/sm_sign.py
|
||||
# Raw: https://raw.githubusercontent.com/3ixi/CodeScripts/main/sm_sign.py
|
||||
# Repo: 3ixi/CodeScripts
|
||||
# Path: sm_sign.py
|
||||
# UploadedAt: 2025-09-23T14:07:43+08:00
|
||||
# SHA256: 4241ca7df0f5d98f3f8ef50622fa0a842841e45d9c66404c2782ad90adfdc0b7
|
||||
# Category: 微信小程序/抓包版
|
||||
# Evidence: appid/openid/session_key/encryptedData等小程序字段
|
||||
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
SM广场小程序签到脚本
|
||||
脚本作者:3iXi
|
||||
创建时间:2025/07/28
|
||||
!!此脚本需要配合iPad协议服务使用!!
|
||||
小程序:成都SM广场、SM晋江国际广场、SM扬州、厦门SM商业城、重庆SM城市广场
|
||||
"""
|
||||
|
||||
import time
|
||||
import json
|
||||
from typing import Optional, Dict
|
||||
|
||||
MALL_CONFIG: Dict[str, int] = {
|
||||
"成都": 11544,
|
||||
"晋江": 12135,
|
||||
"扬州": 12540,
|
||||
"厦门": 11086,
|
||||
"重庆": 12305
|
||||
}
|
||||
|
||||
SELECTED_MALL = "成都" # 在这里修改商场名称,必须是上面字典中的城市名
|
||||
|
||||
try:
|
||||
import httpx
|
||||
except ImportError:
|
||||
print("错误: 需要安装 httpx[http2] 依赖")
|
||||
exit(1)
|
||||
|
||||
import getCode
|
||||
|
||||
|
||||
class SmSignin:
|
||||
"""成都SM广场小程序签到类"""
|
||||
|
||||
def __init__(self):
|
||||
"""初始化签到客户端"""
|
||||
self.base_url = "https://m.mallcoo.cn"
|
||||
self.app_id = "wx383a677b99e64655"
|
||||
|
||||
if SELECTED_MALL not in MALL_CONFIG:
|
||||
raise ValueError(f"错误:选择的商场 '{SELECTED_MALL}' 无效。请在脚本开头的 SELECTED_MALL 变量中设置正确的商场名称。")
|
||||
self.mall_id = MALL_CONFIG[SELECTED_MALL]
|
||||
print(f"当前选择的商场:{SELECTED_MALL}SM广场(ID: {self.mall_id})")
|
||||
|
||||
self.client = httpx.Client(http2=True, timeout=30.0, verify=False)
|
||||
|
||||
self.headers = {
|
||||
"host": "m.mallcoo.cn",
|
||||
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a13) UnifiedPCWindowsWechat(0xf2540615) XWEB/16133",
|
||||
"xweb_xhr": "1",
|
||||
"content-type": "application/json",
|
||||
"accept": "*/*",
|
||||
"referer": "https://servicewechat.com/wx383a677b99e64655/15/page-frame.html",
|
||||
"accept-encoding": "gzip, deflate, br",
|
||||
"accept-language": "zh-CN,zh;q=0.9"
|
||||
}
|
||||
|
||||
self.project_id = None
|
||||
self.token = None
|
||||
|
||||
def get_project_config_id(self) -> bool:
|
||||
"""
|
||||
获取小程序的接口项目ID
|
||||
|
||||
Returns:
|
||||
bool: 是否获取成功
|
||||
"""
|
||||
payload = {
|
||||
"MallID": self.mall_id,
|
||||
"Header": {
|
||||
"Token": None,
|
||||
"systemInfo": {
|
||||
"model": "microsoft",
|
||||
"SDKVersion": "3.8.10",
|
||||
"system": "Windows 10 x64",
|
||||
"version": "4.0.6.21",
|
||||
"miniVersion": "DZ.2.5.64.1.SM.24"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
url = f"{self.base_url}/api/home/Mall/GetProjectConfigIDStandard"
|
||||
|
||||
payload_str = json.dumps(payload, separators=(',', ':'))
|
||||
self.headers["content-length"] = str(len(payload_str.encode('utf-8')))
|
||||
|
||||
try:
|
||||
response = self.client.post(url, json=payload, headers=self.headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get("m") == 1:
|
||||
self.project_id = data.get("d")
|
||||
return True
|
||||
else:
|
||||
print(f"获取项目ID失败:{data.get('e', '未知错误')}")
|
||||
return False
|
||||
|
||||
except Exception as e:
|
||||
print(f"获取项目ID请求失败: {e}")
|
||||
return False
|
||||
|
||||
def login(self, code: str) -> bool:
|
||||
"""
|
||||
用户登录
|
||||
|
||||
Args:
|
||||
code (str): 微信小程序登录code
|
||||
|
||||
Returns:
|
||||
bool: 登录是否成功
|
||||
"""
|
||||
if not self.project_id:
|
||||
print("未获取到项目ID,无法登录")
|
||||
return False
|
||||
|
||||
payload = {
|
||||
"MallID": self.mall_id,
|
||||
"Code": code,
|
||||
"AppID": self.app_id,
|
||||
"OpenID": "",
|
||||
"NotVCodeAndGraphicVCode": True,
|
||||
"SNSType": 8,
|
||||
"Header": {
|
||||
"Token": None,
|
||||
"systemInfo": {
|
||||
"model": "microsoft",
|
||||
"SDKVersion": "3.8.10",
|
||||
"system": "Windows 10 x64",
|
||||
"version": "4.0.6.21",
|
||||
"miniVersion": "DZ.2.5.64.1.SM.24"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
url = f"{self.base_url}/a/liteapp/api/identitys/LoginForThirdV2"
|
||||
|
||||
payload_str = json.dumps(payload, separators=(',', ':'))
|
||||
self.headers["content-length"] = str(len(payload_str.encode('utf-8')))
|
||||
|
||||
try:
|
||||
response = self.client.post(url, json=payload, headers=self.headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get("m") == 1:
|
||||
user_data = data.get("d", {})
|
||||
self.token = user_data.get("Token")
|
||||
nick_name = user_data.get("NickName", "未知用户")
|
||||
if self.token:
|
||||
print(f"{nick_name}登录成功。")
|
||||
return True
|
||||
else:
|
||||
print("登录失败:未获取到Token")
|
||||
return False
|
||||
else:
|
||||
print(f"登录失败:{data.get('e', '未知错误')}")
|
||||
return False
|
||||
|
||||
except Exception as e:
|
||||
print(f"登录请求失败: {e}")
|
||||
return False
|
||||
|
||||
def check_signin_status(self) -> Optional[dict]:
|
||||
"""
|
||||
检查签到状态
|
||||
|
||||
Returns:
|
||||
Optional[dict]: 签到状态信息,None表示检查失败
|
||||
"""
|
||||
if not self.token or not self.project_id:
|
||||
print("未获取到Token或项目ID,无法检查签到状态")
|
||||
return None
|
||||
|
||||
payload = {
|
||||
"MallId": self.mall_id,
|
||||
"Header": {
|
||||
"Token": f"{self.token},{self.project_id}",
|
||||
"systemInfo": {
|
||||
"model": "microsoft",
|
||||
"SDKVersion": "3.8.10",
|
||||
"system": "Windows 10 x64",
|
||||
"version": "4.0.6.21",
|
||||
"miniVersion": "DZ.2.5.64.1.SM.24"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
url = f"{self.base_url}/api/user/user/GetNoticeFavoriteAndCheckinCount"
|
||||
|
||||
payload_str = json.dumps(payload, separators=(',', ':'))
|
||||
self.headers["content-length"] = str(len(payload_str.encode('utf-8')))
|
||||
|
||||
try:
|
||||
response = self.client.post(url, json=payload, headers=self.headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get("m") == 1:
|
||||
checkin_data = data.get("d", {})
|
||||
is_checkin_today = checkin_data.get("IsCheckInToday", False)
|
||||
is_open_checkin = checkin_data.get("IsOpenCheckin", False)
|
||||
|
||||
if is_open_checkin:
|
||||
if is_checkin_today:
|
||||
print("签到活动开放,今日已签到")
|
||||
else:
|
||||
print("签到活动开放,今日未签到")
|
||||
else:
|
||||
print("签到活动未开放")
|
||||
|
||||
return checkin_data
|
||||
else:
|
||||
print(f"检查签到状态失败:{data.get('e', '未知错误')}")
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f"检查签到状态请求失败: {e}")
|
||||
return None
|
||||
|
||||
def submit_signin(self) -> Optional[dict]:
|
||||
"""
|
||||
提交签到
|
||||
|
||||
Returns:
|
||||
Optional[dict]: 签到结果数据,None表示签到失败
|
||||
"""
|
||||
if not self.token or not self.project_id:
|
||||
print("未获取到Token或项目ID,无法签到")
|
||||
return None
|
||||
|
||||
payload = {
|
||||
"MallID": self.mall_id,
|
||||
"Header": {
|
||||
"Token": f"{self.token},{self.project_id}",
|
||||
"systemInfo": {
|
||||
"model": "microsoft",
|
||||
"SDKVersion": "3.8.10",
|
||||
"system": "Windows 10 x64",
|
||||
"version": "4.0.6.21",
|
||||
"miniVersion": "DZ.2.5.64.1.SM.24"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
url = f"{self.base_url}/api/user/User/CheckinV2"
|
||||
|
||||
payload_str = json.dumps(payload, separators=(',', ':'))
|
||||
self.headers["content-length"] = str(len(payload_str.encode('utf-8')))
|
||||
|
||||
try:
|
||||
response = self.client.post(url, json=payload, headers=self.headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get("m") == 1:
|
||||
signin_data = data.get("d", {})
|
||||
msg = signin_data.get("Msg", "签到成功")
|
||||
print(msg)
|
||||
return signin_data
|
||||
else:
|
||||
print(f"签到失败:{data.get('e', '未知错误')}")
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f"签到请求失败: {e}")
|
||||
return None
|
||||
|
||||
def get_account_info(self) -> Optional[dict]:
|
||||
"""
|
||||
获取账号积分余额
|
||||
|
||||
Returns:
|
||||
Optional[dict]: 账号信息,None表示获取失败
|
||||
"""
|
||||
if not self.token or not self.project_id:
|
||||
print("未获取到Token或项目ID,无法获取账号信息")
|
||||
return None
|
||||
|
||||
payload = {
|
||||
"MallId": self.mall_id,
|
||||
"Header": {
|
||||
"Token": f"{self.token},{self.project_id}",
|
||||
"systemInfo": {
|
||||
"model": "microsoft",
|
||||
"SDKVersion": "3.8.10",
|
||||
"system": "Windows 10 x64",
|
||||
"version": "4.0.6.21",
|
||||
"miniVersion": "DZ.2.5.64.1.SM.24"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
url = f"{self.base_url}/api/user/user/GetUserAndMallCard"
|
||||
|
||||
payload_str = json.dumps(payload, separators=(',', ':'))
|
||||
self.headers["content-length"] = str(len(payload_str.encode('utf-8')))
|
||||
|
||||
try:
|
||||
response = self.client.post(url, json=payload, headers=self.headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get("m") == 1:
|
||||
account_data = data.get("d", {})
|
||||
bonus = account_data.get("Bonus", 0)
|
||||
print(f"账号当前积分{bonus}")
|
||||
return account_data
|
||||
else:
|
||||
print(f"获取账号信息失败:{data.get('e', '未知错误')}")
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f"获取账号信息请求失败: {e}")
|
||||
return None
|
||||
|
||||
def process_account(self, nick_name: str, code: str) -> bool:
|
||||
"""
|
||||
处理单个账号的签到流程
|
||||
|
||||
Args:
|
||||
nick_name (str): 账号昵称
|
||||
code (str): 微信小程序登录code
|
||||
|
||||
Returns:
|
||||
bool: 是否处理成功
|
||||
"""
|
||||
print(f"\n开始处理账号: {nick_name}")
|
||||
|
||||
# 1. 获取项目ID
|
||||
if not self.get_project_config_id():
|
||||
print(f"账号 {nick_name} 获取项目ID失败")
|
||||
return False
|
||||
|
||||
# 2. 登录
|
||||
if not self.login(code):
|
||||
print(f"账号 {nick_name} 登录失败")
|
||||
return False
|
||||
|
||||
# 3. 检查签到状态
|
||||
signin_status = self.check_signin_status()
|
||||
if signin_status is None:
|
||||
print(f"账号 {nick_name} 检查签到状态失败")
|
||||
return False
|
||||
|
||||
is_checkin_today = signin_status.get("IsCheckInToday", False)
|
||||
is_open_checkin = signin_status.get("IsOpenCheckin", False)
|
||||
|
||||
if not is_open_checkin:
|
||||
print("签到活动未开放,跳过签到")
|
||||
elif is_checkin_today:
|
||||
print("今日已签到,跳过签到")
|
||||
else:
|
||||
# 4. 提交签到
|
||||
signin_result = self.submit_signin()
|
||||
if signin_result is None:
|
||||
print(f"账号 {nick_name} 签到失败")
|
||||
return False
|
||||
|
||||
# 5. 获取账号积分信息
|
||||
self.get_account_info()
|
||||
|
||||
return True
|
||||
|
||||
def close(self):
|
||||
"""关闭HTTP客户端"""
|
||||
self.client.close()
|
||||
|
||||
|
||||
def main():
|
||||
"""主函数"""
|
||||
try:
|
||||
print("正在获取登录Code...")
|
||||
app_id = "wx383a677b99e64655"
|
||||
codes = getCode.get_wechat_codes(app_id)
|
||||
|
||||
if not codes:
|
||||
print("未获取到任何在线账号的Code")
|
||||
return
|
||||
|
||||
print(f"获取到 {len(codes)} 个账号的Code")
|
||||
|
||||
signin = SmSignin()
|
||||
|
||||
try:
|
||||
for i, (nick_name, code) in enumerate(codes.items(), 1):
|
||||
print(f"\n{'='*50}")
|
||||
print(f"处理第 {i}/{len(codes)} 个账号")
|
||||
print(f"{'='*50}")
|
||||
|
||||
try:
|
||||
signin.process_account(nick_name, code)
|
||||
except Exception as e:
|
||||
print(f"处理账号 {nick_name} 时发生错误: {e}")
|
||||
|
||||
if i < len(codes):
|
||||
print(f"等待2秒后处理下一个账号...")
|
||||
time.sleep(2)
|
||||
|
||||
finally:
|
||||
signin.close()
|
||||
|
||||
print("\n所有账号处理完成")
|
||||
|
||||
except Exception as e:
|
||||
print(f"脚本执行失败: {e}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
341
脚本库/微信小程序/抓包版/str,_code_str_-_bool/2025-09-23_tuhu_179f7334.py
Normal file
341
脚本库/微信小程序/抓包版/str,_code_str_-_bool/2025-09-23_tuhu_179f7334.py
Normal file
@@ -0,0 +1,341 @@
|
||||
# Source: https://github.com/3ixi/CodeScripts/blob/main/tuhu.py
|
||||
# Raw: https://raw.githubusercontent.com/3ixi/CodeScripts/main/tuhu.py
|
||||
# Repo: 3ixi/CodeScripts
|
||||
# Path: tuhu.py
|
||||
# UploadedAt: 2025-09-23T14:07:43+08:00
|
||||
# SHA256: 179f73343412e09d59e370bf84ec999384d7b5f367287d762834fe4ca05c69d1
|
||||
# Category: 微信小程序/抓包版
|
||||
# Evidence: appid/openid/session_key/encryptedData等小程序字段
|
||||
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
途虎养车小程序签到脚本
|
||||
脚本作者:3iXi
|
||||
创建时间:2025/07/18
|
||||
!!此脚本需要配合iPad协议服务使用!!
|
||||
小程序:途虎养车
|
||||
"""
|
||||
|
||||
import time
|
||||
import json
|
||||
from typing import Optional, Tuple
|
||||
|
||||
try:
|
||||
import httpx
|
||||
except ImportError:
|
||||
print("错误: 需要安装 httpx[http2] 依赖")
|
||||
exit(1)
|
||||
|
||||
import getCode
|
||||
|
||||
|
||||
class TuhuSignin:
|
||||
"""途虎养车小程序签到类"""
|
||||
|
||||
def __init__(self):
|
||||
"""初始化签到客户端"""
|
||||
self.base_url = "https://gateway.tuhu.cn"
|
||||
self.login_url = "https://cl-gateway.tuhu.cn"
|
||||
|
||||
self.client = httpx.Client(http2=True, timeout=30.0)#verify=False
|
||||
|
||||
self.headers = {
|
||||
"host": "gateway.tuhu.cn",
|
||||
"authtype": "oauth",
|
||||
"user-agent": "Tuhu/7.29.0 (iPhone; iOS 18.3; Scale/3.0)",
|
||||
"accept-language": "zh-CN,zh-Hans;q=0.9",
|
||||
"accept": "*/*",
|
||||
"content-type": "application/json",
|
||||
"neederrorcode": "true",
|
||||
"accept-encoding": "gzip, deflate, br"
|
||||
}
|
||||
|
||||
self.login_headers = {
|
||||
"Host": "cl-gateway.tuhu.cn",
|
||||
"Content-Type": "application/json",
|
||||
"Connection": "keep-alive",
|
||||
"channel": "wechat-miniprogram",
|
||||
"content-type": "application/json",
|
||||
"platformSource": "uni-app",
|
||||
"authType": "oauth",
|
||||
"currentPage": "pages/home/home",
|
||||
"api_level": "2",
|
||||
"Accept-Encoding": "gzip,compress,br,deflate",
|
||||
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.61(0x18003d2c) NetType/4G Language/zh_CN",
|
||||
"Referer": "https://servicewechat.com/wx27d20205249c56a3/1130/page-frame.html"
|
||||
}
|
||||
|
||||
def _check_response(self, data: dict, operation: str) -> bool:
|
||||
"""
|
||||
检查响应是否成功
|
||||
|
||||
Args:
|
||||
data (dict): 响应数据
|
||||
operation (str): 操作名称
|
||||
|
||||
Returns:
|
||||
bool: 是否成功
|
||||
"""
|
||||
code = data.get("code")
|
||||
if code == 10000:
|
||||
return True
|
||||
else:
|
||||
message = data.get("message", "未知错误")
|
||||
print(f"{operation}失败:{message}")
|
||||
return False
|
||||
|
||||
def login(self, code: str) -> Tuple[Optional[str], Optional[str]]:
|
||||
"""
|
||||
登录获取用户会话
|
||||
|
||||
Args:
|
||||
code (str): 微信小程序登录code
|
||||
|
||||
Returns:
|
||||
Tuple[Optional[str], Optional[str]]: (userSession, nickName)
|
||||
"""
|
||||
url = f"{self.login_url}/cl-user-auth-login/login/authSilentSign"
|
||||
|
||||
payload = {
|
||||
"channel":"WXAPP",
|
||||
"code":code
|
||||
}
|
||||
|
||||
payload_str = json.dumps(payload, separators=(',', ':'), ensure_ascii=False)
|
||||
content_length = len(payload_str.encode('utf-8'))
|
||||
|
||||
headers = self.login_headers.copy()
|
||||
headers["Content-Length"] = str(content_length)
|
||||
|
||||
try:
|
||||
response = self.client.post(url, content=payload_str, headers=headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if self._check_response(data, "登录"):
|
||||
result_data = data.get("data", {})
|
||||
user_session = result_data.get("userSession")
|
||||
nick_name = result_data.get("nickName", "微信用户")
|
||||
|
||||
if user_session:
|
||||
print(f"账号{nick_name}登录成功")
|
||||
return user_session, nick_name
|
||||
else:
|
||||
print("登录失败:未获取到userSession")
|
||||
return None, None
|
||||
else:
|
||||
return None, None
|
||||
|
||||
except Exception as e:
|
||||
print(f"登录请求失败: {e}")
|
||||
return None, None
|
||||
|
||||
def check_signin_status(self, user_session: str) -> Optional[bool]:
|
||||
"""
|
||||
检查今日签到状态
|
||||
|
||||
Args:
|
||||
user_session (str): 用户会话
|
||||
|
||||
Returns:
|
||||
Optional[bool]: True表示已签到,False表示未签到,None表示请求失败
|
||||
"""
|
||||
url = f"{self.base_url}/cl/cl-common-api/api/member/getSignInInfo"
|
||||
|
||||
payload = {"channel": "app"}
|
||||
|
||||
payload_str = json.dumps(payload, separators=(',', ':'), ensure_ascii=False)
|
||||
content_length = len(payload_str.encode('utf-8'))
|
||||
|
||||
headers = self.headers.copy()
|
||||
headers["content-length"] = str(content_length)
|
||||
headers["authorization"] = f"Bearer {user_session}"
|
||||
|
||||
try:
|
||||
response = self.client.post(url, content=payload_str, headers=headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if self._check_response(data, "检查签到状态"):
|
||||
result_data = data.get("data", {})
|
||||
sign_in_status = result_data.get("signInStatus", False)
|
||||
|
||||
if sign_in_status:
|
||||
print("今日已签到")
|
||||
else:
|
||||
print("今日未签到")
|
||||
|
||||
return sign_in_status
|
||||
else:
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f"检查签到状态请求失败: {e}")
|
||||
return None
|
||||
|
||||
def submit_signin(self, user_session: str) -> Optional[dict]:
|
||||
"""
|
||||
提交签到
|
||||
|
||||
Args:
|
||||
user_session (str): 用户会话
|
||||
|
||||
Returns:
|
||||
Optional[dict]: 签到结果数据,None表示签到失败
|
||||
"""
|
||||
url = f"{self.base_url}/cl/cl-common-api/api/dailyCheckIn/userCheckIn"
|
||||
|
||||
payload = {"channel": "app"}
|
||||
|
||||
payload_str = json.dumps(payload, separators=(',', ':'), ensure_ascii=False)
|
||||
content_length = len(payload_str.encode('utf-8'))
|
||||
|
||||
headers = self.headers.copy()
|
||||
headers["content-length"] = str(content_length)
|
||||
headers["authorization"] = f"Bearer {user_session}"
|
||||
|
||||
try:
|
||||
response = self.client.post(url, content=payload_str, headers=headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if self._check_response(data, "签到"):
|
||||
result_data = data.get("data", {})
|
||||
reward_integral = result_data.get("rewardIntegral", 0)
|
||||
continuous_days = result_data.get("continuousDays", 0)
|
||||
|
||||
print(f"签到成功,获得{reward_integral}积分,已连续签到{continuous_days}天")
|
||||
return result_data
|
||||
else:
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f"签到请求失败: {e}")
|
||||
return None
|
||||
|
||||
def get_current_integral(self, user_session: str) -> Optional[int]:
|
||||
"""
|
||||
获取当前剩余积分
|
||||
|
||||
Args:
|
||||
user_session (str): 用户会话
|
||||
|
||||
Returns:
|
||||
Optional[int]: 当前积分,None表示获取失败
|
||||
"""
|
||||
url = f"{self.base_url}/cl/cl-common-api/api/member/getSignInInfo"
|
||||
|
||||
payload = {"channel": "app"}
|
||||
|
||||
payload_str = json.dumps(payload, separators=(',', ':'), ensure_ascii=False)
|
||||
content_length = len(payload_str.encode('utf-8'))
|
||||
|
||||
headers = self.headers.copy()
|
||||
headers["content-length"] = str(content_length)
|
||||
headers["authorization"] = f"Bearer {user_session}"
|
||||
|
||||
try:
|
||||
response = self.client.post(url, content=payload_str, headers=headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if self._check_response(data, "获取积分"):
|
||||
result_data = data.get("data", {})
|
||||
user_integral = result_data.get("userIntegral", 0)
|
||||
|
||||
print(f"当前积分{user_integral}")
|
||||
return user_integral
|
||||
else:
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f"获取积分请求失败: {e}")
|
||||
return None
|
||||
|
||||
def process_account(self, nick_name: str, code: str) -> bool:
|
||||
"""
|
||||
处理单个账号的签到流程
|
||||
|
||||
Args:
|
||||
nick_name (str): 账号昵称
|
||||
code (str): 微信小程序登录code
|
||||
|
||||
Returns:
|
||||
bool: 是否处理成功
|
||||
"""
|
||||
print(f"\n开始处理账号: {nick_name}")
|
||||
|
||||
# 1. 登录
|
||||
user_session, _ = self.login(code)
|
||||
if not user_session:
|
||||
print(f"账号 {nick_name} 登录失败")
|
||||
return False
|
||||
|
||||
# 2. 检查签到状态
|
||||
sign_status = self.check_signin_status(user_session)
|
||||
if sign_status is None:
|
||||
print(f"账号 {nick_name} 检查签到状态失败")
|
||||
return False
|
||||
|
||||
if sign_status:
|
||||
# 已签到,直接获取积分
|
||||
self.get_current_integral(user_session)
|
||||
else:
|
||||
# 3. 提交签到
|
||||
signin_result = self.submit_signin(user_session)
|
||||
if signin_result is None:
|
||||
print(f"账号 {nick_name} 签到失败")
|
||||
return False
|
||||
|
||||
# 4. 获取当前积分
|
||||
self.get_current_integral(user_session)
|
||||
|
||||
return True
|
||||
|
||||
def close(self):
|
||||
"""关闭HTTP客户端"""
|
||||
self.client.close()
|
||||
|
||||
|
||||
def main():
|
||||
"""主函数"""
|
||||
try:
|
||||
print("正在获取登录Code...")
|
||||
app_id = "wx27d20205249c56a3"
|
||||
codes = getCode.get_wechat_codes(app_id)
|
||||
|
||||
if not codes:
|
||||
print("未获取到任何在线账号的Code")
|
||||
return
|
||||
|
||||
print(f"获取到 {len(codes)} 个账号的Code")
|
||||
|
||||
signin = TuhuSignin()
|
||||
|
||||
try:
|
||||
for i, (nick_name, code) in enumerate(codes.items(), 1):
|
||||
print(f"\n{'='*50}")
|
||||
print(f"处理第 {i}/{len(codes)} 个账号")
|
||||
print(f"{'='*50}")
|
||||
|
||||
try:
|
||||
signin.process_account(nick_name, code)
|
||||
except Exception as e:
|
||||
print(f"处理账号 {nick_name} 时发生错误: {e}")
|
||||
|
||||
if i < len(codes):
|
||||
print(f"等待2秒后处理下一个账号...")
|
||||
time.sleep(2)
|
||||
|
||||
finally:
|
||||
signin.close()
|
||||
|
||||
print("\n所有账号处理完成")
|
||||
|
||||
except Exception as e:
|
||||
print(f"脚本执行失败: {e}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,482 @@
|
||||
# Source: https://github.com/3ixi/CodeScripts/blob/main/youzhiyunjia.py
|
||||
# Raw: https://raw.githubusercontent.com/3ixi/CodeScripts/main/youzhiyunjia.py
|
||||
# Repo: 3ixi/CodeScripts
|
||||
# Path: youzhiyunjia.py
|
||||
# UploadedAt: 2025-09-23T14:07:43+08:00
|
||||
# SHA256: 542fc84869094a71be1200e82e6930131f4a76a4d4e0050adbd9688801b613a0
|
||||
# Category: 微信小程序/抓包版
|
||||
# Evidence: appid/openid/session_key/encryptedData等小程序字段
|
||||
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
优智云家品牌商城小程序签到脚本
|
||||
脚本作者:3iXi
|
||||
创建时间:2025/07/10
|
||||
!!此脚本需要配合iPad协议服务使用!!
|
||||
小程序:优智云家品牌商城
|
||||
--------------------
|
||||
更新时间:2025/07/18
|
||||
更新内容:新增使用brotli依赖用于解压响应数据
|
||||
"""
|
||||
|
||||
import time
|
||||
import json
|
||||
from typing import Optional, Dict, Any
|
||||
|
||||
try:
|
||||
import httpx
|
||||
except ImportError:
|
||||
print("错误: 需要安装 httpx[http2] 依赖")
|
||||
exit(1)
|
||||
|
||||
try:
|
||||
import brotli
|
||||
except ImportError:
|
||||
print("错误: 需要安装 brotli 依赖")
|
||||
exit(1)
|
||||
|
||||
import getCode
|
||||
|
||||
|
||||
class YouzhiyunjiaSignin:
|
||||
"""优智云家品牌商城小程序签到类"""
|
||||
|
||||
def __init__(self):
|
||||
"""初始化签到客户端"""
|
||||
self.base_url = "https://xapi.weimob.com"
|
||||
self.app_id = "wxa61f98248d20178b"
|
||||
|
||||
self.client = httpx.Client(http2=True, timeout=30.0, verify=False)
|
||||
|
||||
self.headers = {
|
||||
"host": "xapi.weimob.com",
|
||||
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a13) UnifiedPCWindowsWechat(0xf2540611) XWEB/14199",
|
||||
"content-type": "application/json",
|
||||
"accept": "*/*",
|
||||
"referer": "https://servicewechat.com/wxa61f98248d20178b/81/page-frame.html",
|
||||
"accept-encoding": "gzip, deflate, br",
|
||||
"accept-language": "zh-CN,zh;q=0.9"
|
||||
}
|
||||
|
||||
self.token = None
|
||||
|
||||
def login(self, code: str) -> bool:
|
||||
"""
|
||||
用户登录
|
||||
|
||||
Args:
|
||||
code (str): 微信小程序登录code
|
||||
|
||||
Returns:
|
||||
bool: 登录是否成功
|
||||
"""
|
||||
payload = {
|
||||
"appid": self.app_id,
|
||||
"basicInfo": {
|
||||
"bosId": "4022115200359",
|
||||
"cid": "821033359",
|
||||
"tcode": "weimob",
|
||||
"vid": "6016741943359"
|
||||
},
|
||||
"env": "production",
|
||||
"extendInfo": {
|
||||
"source": 1
|
||||
},
|
||||
"is_pre_fetch_open": True,
|
||||
"parentVid": 0,
|
||||
"pid": "",
|
||||
"storeId": "",
|
||||
"code": code,
|
||||
"queryAuthConfig": True
|
||||
}
|
||||
|
||||
# 动态计算content-length
|
||||
payload_str = json.dumps(payload, separators=(',', ':'))
|
||||
content_length = len(payload_str.encode('utf-8'))
|
||||
|
||||
headers = self.headers.copy()
|
||||
headers["content-length"] = str(content_length)
|
||||
|
||||
url = f"{self.base_url}/fe/mapi/user/loginX"
|
||||
|
||||
try:
|
||||
response = self.client.post(url, json=payload, headers=headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get("errcode") == 0:
|
||||
token = data.get("data", {}).get("token")
|
||||
if token:
|
||||
self.token = token
|
||||
# 添加token到后续请求头
|
||||
self.headers["x-wx-token"] = token
|
||||
print("登录成功")
|
||||
return True
|
||||
else:
|
||||
print("登录失败:未获取到token")
|
||||
return False
|
||||
else:
|
||||
print(f"登录失败:{data.get('errmsg', '未知错误')}")
|
||||
return False
|
||||
|
||||
except Exception as e:
|
||||
print(f"登录请求失败: {e}")
|
||||
return False
|
||||
|
||||
def check_signin_status(self) -> Optional[bool]:
|
||||
"""
|
||||
检查签到状态
|
||||
|
||||
Returns:
|
||||
Optional[bool]: True=已签到, False=未签到, None=检查失败
|
||||
"""
|
||||
payload = {
|
||||
"appid": self.app_id,
|
||||
"basicInfo": {
|
||||
"vid": 6016741943359,
|
||||
"vidType": 2,
|
||||
"bosId": 4022115200359,
|
||||
"productId": 146,
|
||||
"productInstanceId": 15532102359,
|
||||
"productVersionId": "10003",
|
||||
"merchantId": 2000230069359,
|
||||
"tcode": "weimob",
|
||||
"cid": 821033359
|
||||
},
|
||||
"extendInfo": {
|
||||
"wxTemplateId": 7930,
|
||||
"analysis": [],
|
||||
"bosTemplateId": 1000001998,
|
||||
"childTemplateIds": [
|
||||
{"customId": 90004, "version": "crm@0.1.64"},
|
||||
{"customId": 90002, "version": "ec@69.1"},
|
||||
{"customId": 90006, "version": "hudong@0.0.229"},
|
||||
{"customId": 90008, "version": "cms@0.0.506"}
|
||||
],
|
||||
"quickdeliver": {"enable": True},
|
||||
"youshu": {"enable": False},
|
||||
"source": 1,
|
||||
"channelsource": 5,
|
||||
"refer": "onecrm-signgift",
|
||||
"mpScene": 1035
|
||||
},
|
||||
"queryParameter": None,
|
||||
"i18n": {
|
||||
"language": "zh",
|
||||
"timezone": "8"
|
||||
},
|
||||
"pid": "",
|
||||
"storeId": "",
|
||||
"customInfo": {
|
||||
"source": 0,
|
||||
"wid": 11659047914
|
||||
}
|
||||
}
|
||||
|
||||
# 动态计算content-length
|
||||
payload_str = json.dumps(payload, separators=(',', ':'))
|
||||
content_length = len(payload_str.encode('utf-8'))
|
||||
|
||||
headers = self.headers.copy()
|
||||
headers["content-length"] = str(content_length)
|
||||
|
||||
url = f"{self.base_url}/api3/onecrm/mactivity/sign/misc/sign/activity/c/signMainInfo"
|
||||
|
||||
try:
|
||||
response = self.client.post(url, json=payload, headers=headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get("errcode") == "0":
|
||||
has_sign = data.get("data", {}).get("hasSign", False)
|
||||
print(f"签到状态: {'已签到' if has_sign else '未签到'}")
|
||||
return has_sign
|
||||
else:
|
||||
print(f"检查签到状态失败:{data.get('errmsg', '未知错误')}")
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f"检查签到状态请求失败: {e}")
|
||||
return None
|
||||
|
||||
def submit_signin(self) -> Optional[Dict[str, Any]]:
|
||||
"""
|
||||
提交签到
|
||||
|
||||
Returns:
|
||||
Optional[Dict[str, Any]]: 签到奖励信息,None表示签到失败
|
||||
"""
|
||||
payload = {
|
||||
"appid": self.app_id,
|
||||
"basicInfo": {
|
||||
"vid": 6016741943359,
|
||||
"vidType": 2,
|
||||
"bosId": 4022115200359,
|
||||
"productId": 146,
|
||||
"productInstanceId": 15532102359,
|
||||
"productVersionId": "10003",
|
||||
"merchantId": 2000230069359,
|
||||
"tcode": "weimob",
|
||||
"cid": 821033359
|
||||
},
|
||||
"extendInfo": {
|
||||
"wxTemplateId": 7930,
|
||||
"analysis": [],
|
||||
"bosTemplateId": 1000001998,
|
||||
"childTemplateIds": [
|
||||
{"customId": 90004, "version": "crm@0.1.64"},
|
||||
{"customId": 90002, "version": "ec@69.1"},
|
||||
{"customId": 90006, "version": "hudong@0.0.229"},
|
||||
{"customId": 90008, "version": "cms@0.0.506"}
|
||||
],
|
||||
"quickdeliver": {"enable": True},
|
||||
"youshu": {"enable": False},
|
||||
"source": 1,
|
||||
"channelsource": 5,
|
||||
"refer": "onecrm-signgift",
|
||||
"mpScene": 1035
|
||||
},
|
||||
"queryParameter": None,
|
||||
"i18n": {
|
||||
"language": "zh",
|
||||
"timezone": "8"
|
||||
},
|
||||
"pid": "",
|
||||
"storeId": "",
|
||||
"customInfo": {
|
||||
"source": 0,
|
||||
"wid": 11659047914
|
||||
}
|
||||
}
|
||||
|
||||
# 动态计算content-length
|
||||
payload_str = json.dumps(payload, separators=(',', ':'))
|
||||
content_length = len(payload_str.encode('utf-8'))
|
||||
|
||||
headers = self.headers.copy()
|
||||
headers["content-length"] = str(content_length)
|
||||
|
||||
url = f"{self.base_url}/api3/onecrm/mactivity/sign/misc/sign/activity/core/c/sign"
|
||||
|
||||
try:
|
||||
response = self.client.post(url, json=payload, headers=headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get("errcode") == "0":
|
||||
reward_data = data.get("data", {})
|
||||
return reward_data
|
||||
else:
|
||||
print(f"签到失败:{data.get('errmsg', '未知错误')}")
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f"签到请求失败: {e}")
|
||||
return None
|
||||
|
||||
def print_signin_rewards(self, reward_data: Dict[str, Any]):
|
||||
"""
|
||||
打印签到奖励信息
|
||||
|
||||
Args:
|
||||
reward_data (Dict[str, Any]): 签到奖励数据
|
||||
"""
|
||||
fixed_reward = reward_data.get("fixedReward", {})
|
||||
extra_reward = reward_data.get("extraReward", {})
|
||||
|
||||
reward_messages = []
|
||||
|
||||
# 处理固定奖励
|
||||
fixed_parts = []
|
||||
if fixed_reward.get("points", 0) > 0:
|
||||
fixed_parts.append(f"{fixed_reward['points']}积分")
|
||||
if fixed_reward.get("growth", 0) > 0:
|
||||
fixed_parts.append(f"{fixed_reward['growth']}成长值")
|
||||
if fixed_reward.get("amount", 0) > 0:
|
||||
fixed_parts.append(f"{fixed_reward['amount']}余额")
|
||||
|
||||
if fixed_parts:
|
||||
reward_messages.append(f"固定奖励{','.join(fixed_parts)}")
|
||||
|
||||
# 处理额外奖励
|
||||
extra_parts = []
|
||||
if extra_reward.get("points", 0) > 0:
|
||||
extra_parts.append(f"{extra_reward['points']}积分")
|
||||
if extra_reward.get("growth", 0) > 0:
|
||||
extra_parts.append(f"{extra_reward['growth']}成长值")
|
||||
if extra_reward.get("amount", 0) > 0:
|
||||
extra_parts.append(f"{extra_reward['amount']}余额")
|
||||
|
||||
if extra_parts:
|
||||
reward_messages.append(f"额外奖励{','.join(extra_parts)}")
|
||||
|
||||
if reward_messages:
|
||||
print(f"签到成功,获得{','.join(reward_messages)}")
|
||||
else:
|
||||
print("签到成功")
|
||||
|
||||
def get_account_info(self) -> Optional[int]:
|
||||
"""
|
||||
获取账号积分信息
|
||||
|
||||
Returns:
|
||||
Optional[int]: 当前积分,None表示获取失败
|
||||
"""
|
||||
payload = {
|
||||
"appid": self.app_id,
|
||||
"basicInfo": {
|
||||
"vid": 6016741943359,
|
||||
"vidType": 2,
|
||||
"bosId": 4022115200359,
|
||||
"productId": 1,
|
||||
"productInstanceId": 15532140359,
|
||||
"productVersionId": "32049",
|
||||
"merchantId": 2000230069359,
|
||||
"tcode": "weimob",
|
||||
"cid": 821033359
|
||||
},
|
||||
"extendInfo": {
|
||||
"wxTemplateId": 7930,
|
||||
"analysis": [],
|
||||
"bosTemplateId": 1000001998,
|
||||
"childTemplateIds": [
|
||||
{"customId": 90004, "version": "crm@0.1.64"},
|
||||
{"customId": 90002, "version": "ec@69.1"},
|
||||
{"customId": 90006, "version": "hudong@0.0.229"},
|
||||
{"customId": 90008, "version": "cms@0.0.506"}
|
||||
],
|
||||
"quickdeliver": {"enable": True},
|
||||
"youshu": {"enable": False},
|
||||
"source": 1,
|
||||
"channelsource": 5,
|
||||
"refer": "cms-usercenter",
|
||||
"mpScene": 1035
|
||||
},
|
||||
"queryParameter": None,
|
||||
"i18n": {
|
||||
"language": "zh",
|
||||
"timezone": "8"
|
||||
},
|
||||
"pid": "",
|
||||
"storeId": "",
|
||||
"targetBasicInfo": {
|
||||
"productInstanceId": 15532102359
|
||||
},
|
||||
"request": {}
|
||||
}
|
||||
|
||||
# 动态计算content-length
|
||||
payload_str = json.dumps(payload, separators=(',', ':'))
|
||||
content_length = len(payload_str.encode('utf-8'))
|
||||
|
||||
headers = self.headers.copy()
|
||||
headers["content-length"] = str(content_length)
|
||||
|
||||
url = f"{self.base_url}/api3/onecrm/point/myPoint/getSimpleAccountInfo"
|
||||
|
||||
try:
|
||||
response = self.client.post(url, json=payload, headers=headers)
|
||||
response.raise_for_status()
|
||||
|
||||
data = response.json()
|
||||
if data.get("errcode") == "0":
|
||||
points = data.get("data", {}).get("sumAvailablePoint", 0)
|
||||
print(f"当前账号有{points}积分")
|
||||
return points
|
||||
else:
|
||||
print(f"获取账号信息失败:{data.get('errmsg', '未知错误')}")
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
print(f"获取账号信息请求失败: {e}")
|
||||
return None
|
||||
|
||||
def process_account(self, nick_name: str, code: str) -> bool:
|
||||
"""
|
||||
处理单个账号的签到流程
|
||||
|
||||
Args:
|
||||
nick_name (str): 账号昵称
|
||||
code (str): 微信小程序登录code
|
||||
|
||||
Returns:
|
||||
bool: 是否处理成功
|
||||
"""
|
||||
print(f"\n开始处理账号: {nick_name}")
|
||||
|
||||
# 1. 登录
|
||||
if not self.login(code):
|
||||
print(f"账号 {nick_name} 登录失败")
|
||||
return False
|
||||
|
||||
# 2. 检查签到状态
|
||||
sign_status = self.check_signin_status()
|
||||
if sign_status is None:
|
||||
print(f"账号 {nick_name} 检查签到状态失败")
|
||||
return False
|
||||
|
||||
if sign_status:
|
||||
print("今日已签到")
|
||||
else:
|
||||
print("未签到,开始签到")
|
||||
# 3. 提交签到
|
||||
reward_data = self.submit_signin()
|
||||
if reward_data is None:
|
||||
print(f"账号 {nick_name} 签到失败")
|
||||
return False
|
||||
|
||||
# 4. 打印签到奖励
|
||||
self.print_signin_rewards(reward_data)
|
||||
|
||||
# 5. 获取账号信息
|
||||
self.get_account_info()
|
||||
|
||||
return True
|
||||
|
||||
def close(self):
|
||||
"""关闭HTTP客户端"""
|
||||
self.client.close()
|
||||
|
||||
|
||||
def main():
|
||||
"""主函数"""
|
||||
try:
|
||||
print("正在获取登录Code...")
|
||||
app_id = "wxa61f98248d20178b"
|
||||
codes = getCode.get_wechat_codes(app_id)
|
||||
|
||||
if not codes:
|
||||
print("未获取到任何在线账号的Code")
|
||||
return
|
||||
|
||||
print(f"获取到 {len(codes)} 个账号的Code")
|
||||
|
||||
signin = YouzhiyunjiaSignin()
|
||||
|
||||
try:
|
||||
for i, (nick_name, code) in enumerate(codes.items(), 1):
|
||||
print(f"\n{'='*50}")
|
||||
print(f"处理第 {i}/{len(codes)} 个账号")
|
||||
print(f"{'='*50}")
|
||||
|
||||
try:
|
||||
signin.process_account(nick_name, code)
|
||||
except Exception as e:
|
||||
print(f"处理账号 {nick_name} 时发生错误: {e}")
|
||||
|
||||
if i < len(codes):
|
||||
print(f"等待2秒后处理下一个账号...")
|
||||
time.sleep(2)
|
||||
|
||||
finally:
|
||||
signin.close()
|
||||
|
||||
print("\n所有账号处理完成")
|
||||
|
||||
except Exception as e:
|
||||
print(f"脚本执行失败: {e}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user