Files
XiaoGe-LiBai-yangmao/蒙娜丽莎会员.py
2025-11-10 16:12:48 +08:00

194 lines
7.0 KiB
Python
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
微信扫码https://img.meituan.net/portalweb/40d762a3e9eb4671bf76590d014ba0d0190451.jpg
说明:
签到获取积分,兑换实物。 变量名称mnls
抓包 webChatID
"""
import requests
import os
import sys
import time
import random
import datetime
from urllib.parse import quote
# ================== 配置区 ==================
NOTIFY = True # 是否推送通知
SCT_KEY = "" # Server 酱 SendKey推荐使用最简单填你的 SendKey如 "SCTxxx"
# ============================================
def get_info(webChatID):
url = 'https://mcs.monalisagroup.com.cn/member/doAction'
headers = {
'Host': 'mcs.monalisagroup.com.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(0xf2541113) XWEB/16771',
'xweb_xhr': '1',
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': '*/*',
'Sec-Fetch-Site': 'cross-site',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Dest': 'empty',
'Referer': 'https://servicewechat.com/wxce6a8f654e81b7a4/450/page-frame.html',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'zh-CN,zh;q=0.9'
}
data = {
'action': 'getCustomer',
'webChatID': webChatID,
'brand': 'MON'
}
try:
response = requests.post(url, headers=headers, data=data, timeout=10).json()
info = response['resultInfo'][0]
phone = info['Telephone']
customerid = info['CustomerID']
nickname = info['WebChatName']
integral = info['Integral']
return True, phone, customerid, nickname, integral
except Exception as e:
print('❌ 获取信息失败:', str(e))
return False, None, None, None, None
def get_sign_in(customerid, nickname):
url = 'https://mcs.monalisagroup.com.cn/member/doAction'
headers = {
'Host': 'mcs.monalisagroup.com.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(0xf2541113) XWEB/16771',
'xweb_xhr': '1',
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': '*/*',
'Sec-Fetch-Site': 'cross-site',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Dest': 'empty',
'Referer': 'https://servicewechat.com/wxce6a8f654e81b7a4/450/page-frame.html',
'Accept-Encoding': 'gzip, deflate, br',
'Accept-Language': 'zh-CN,zh;q=0.9'
}
data = {
'action': 'sign',
'CustomerID': str(customerid),
'CustomerName': quote(nickname),
'StoreID': '0',
'OrganizationID': '0',
'Brand': 'MON',
'ItemType': '002'
}
try:
response = requests.post(url, headers=headers, data=data, timeout=10).json()
if response['status'] == 0:
msg = f"✅ 签到成功,获得积分: {response['resultInfo']}"
else:
msg = " 签到失败,可能今日已签到"
return True, msg
except Exception as e:
print(f"❌ 请求异常: {str(e)}")
return False, f"请求异常: {str(e)}"
def download_notify():
"""下载 notify.py青龙专用"""
url = "https://raw.githubusercontent.com/whyour/qinglong/refs/heads/develop/sample/notify.py"
try:
response = requests.get(url, timeout=10)
response.raise_for_status()
with open("notify.py", "w", encoding="utf-8") as f:
f.write(response.text)
print("✅ notify.py 下载成功")
return True
except Exception as e:
print(f"❌ 下载 notify.py 失败: {str(e)}")
return False
def send_notification(title, content):
"""统一推送通知(优先使用 Server 酱 SCT"""
if SCT_KEY:
try:
url = f"https://sctapi.ftqq.com/{SCT_KEY}.send"
data = {"title": title, "desp": content}
requests.post(url, data=data, timeout=10)
print("✅ Server 酱推送成功")
return
except Exception as e:
print(f"❌ Server 酱推送失败: {e}")
# 备用:青龙 notify.py
if NOTIFY:
try:
if not os.path.exists("notify.py"):
if not download_notify():
print("❌ 无法使用 notify.py 推送")
return
import notify
notify.send(title, content)
print("✅ 青龙 notify 推送成功")
except Exception as e:
print(f"❌ notify.py 推送失败: {str(e)}")
def main():
# 读取环境变量
ck = os.environ.get("mnls")
if not ck:
print("❌ 请设置环境变量 mnls")
sys.exit()
# 延迟执行5:01-6:59
now = datetime.datetime.now().time()
start = datetime.time(5, 1)
end = datetime.time(6, 59)
if start <= now <= end:
delay = random.randint(100, 500)
print(f"⏰ 在 5:01-6:59 之间,延迟 {delay} 秒执行...")
time.sleep(delay)
accounts = [line.strip() for line in ck.split('\n') if line.strip()]
print(f"{' ' * 10}꧁༺ 蒙拉丽莎会员签到 ༻꧂\n")
log_msgs = [
f"📅 执行时间: {datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}",
f"📊 账号数量: {len(accounts)}",
"" * 30
]
for i, webChatID in enumerate(accounts, 1):
print(f'\n----------- 🍺 账号【{i}/{len(accounts)}】执行 🍺 -----------')
log_msg = f"【账号 {i}"
try:
success, phone, customerid, nickname, integral = get_info(webChatID)
if success:
print(f"👤 昵称: {nickname}")
print(f"📞 电话: {phone}")
print(f"🆔 客户ID: {customerid}")
print(f"⭐ 当前积分: {integral}")
log_msg += f"\n👤 昵称: {nickname}\n📞 电话: {phone}\n🆔 客户ID: {customerid}\n⭐ 当前积分: {integral}"
# 签到
time.sleep(random.randint(1, 2))
sign_success, sign_msg = get_sign_in(customerid, nickname)
print(sign_msg)
log_msg += f"\n📝 {sign_msg}"
else:
log_msg += "\n❌ 获取信息失败"
except Exception as e:
print(f"❌ 执行异常: {str(e)}")
log_msg += f"\n❌ 执行异常: {str(e)}"
finally:
log_msgs.append(log_msg)
# 推送通知
if NOTIFY:
title = "蒙拉丽莎会员签到完成"
content = "\n".join(log_msgs)
send_notification(title, content)
print(f'\n🎉 执行结束,共 {len(accounts)} 个账号')
if __name__ == '__main__':
main()