Add files via upload

This commit is contained in:
3288588344
2025-01-18 22:04:15 +08:00
committed by GitHub
parent c2574da5fd
commit e6e2129590
2 changed files with 201 additions and 0 deletions

75
达美乐.py Normal file
View File

@@ -0,0 +1,75 @@
'''
达美乐,开一把游戏抓取openid的值。
一定要在我的奖品那绑定好手机号!
变量名1dmlck多账号用@隔开。备注信息用#隔开 如openid的值#大帅比
变量名2pzid 填活动id这次是volcano活动ID自己抓
TL库:https://github.com/3288588344/toulu.git
tg频道:https://t.me/TLtoulu
QQ频道:https://pd.qq.com/s/672fku8ge
'''
import os
import time
import requests
import json
import notify
message = ''
# from dotenv import load_dotenv
# load_dotenv()
accounts = os.getenv('dmlck')
pzid = os.getenv('pzid')
if accounts is None:
print('你没有填入ck咋运行')
else:
accounts_list = os.environ.get('dmlck').split('@')
num_of_accounts = len(accounts_list)
print(f"获取到 {num_of_accounts} 个账号")
for i, account in enumerate(accounts_list, start=1):
values = account.split('#')
Cookie = values[0]
account_no = values[1] if len(values) > 1 else ""
print(f"\n=======开始执行账号{i} {account_no}=======")
url = f"https://game.dominos.com.cn/{pzid}/game/gameDone"
payload = f"openid={Cookie}&score=t5%2Bhzvt2h6jpwH7D%2BJkNWvT%2Fb6J2mWDStIgcC4ZSrhkqPEqXtcDrCC9LVFvQLRtGkeVQ7z0W6RYqcXxmeXi9596r4HZ1Pt0E5PpRLYWZZL%2BXQXEpyc0WX8c4ewMqQymjBgGMcSRFp3aaLTDNaRLvLcnnh2t5PpL70pW%2B7LcM8tnhtP1J2rLaTe0Dno7%2B9Qf32LuHUS%2BUXCgQ6YbCJwj%2BWrmhP1zbFvGthkH6HB9lkI9mS%2F%2BY9582WQeFREMF9OflJpRVjgPd1%2FPWFRWKWrl%2F7VGztrHpQLZvLQ9HRINK99cN4FBBvPVkkHxyACadINkuFwxgC9ODPYInHXXpn5iElg%3D%3D"
headers = {
'User-Agent': "Mozilla/5.0 (iPod; U; CPU iPhone OS 4_2 like Mac OS X; sd-PK) AppleWebKit/535.42.7 (KHTML, like Gecko) Version/4.0.5 Mobile/8B111 Safari/6535.42.7",
'Accept-Encoding': "gzip,compress,br,deflate",
'Content-Type': "application/x-www-form-urlencoded",
'charset': "utf-8",
'Referer': "https://servicewechat.com/wx887bf6ad752ca2f3/63/page-frame.html"
}
while True:
shrurl = f"https://game.dominos.com.cn/{pzid}/game/sharingDone"
payload2 = f"openid={Cookie}&from=1&target=0"
res = requests.post(shrurl, data=payload2, headers=headers).json()
if res['errorMessage'] == "今日分享已用完,请明日再来":
print(f'账号{i}分享已达上限,开始抽奖')
break
message +=f"账号{i}"
while True:
response = requests.post(url, data=payload, headers=headers)
response = response.json()
if response["statusCode"] == 0:
prize = response['content']['name']
print(f"\n{prize}")
message += f"\n {prize}"
time.sleep(1)
if response["statusCode"] != 0:
print(response)
err = response['errorMessage']
message += f'\n账号{i}\n {err}'
break
try:
notify.send('达美乐',message)
except Exception as e:
print(e)
print('推送失败')

126
达美乐短信认证.py Normal file
View File

@@ -0,0 +1,126 @@
## 此脚本用于达美乐短信认证,只需要手动进一次游戏界面,不用玩!!!!
## 替换每期GAME_TYPE参数游戏类型
# TL库:https://github.com/3288588344/toulu.git
# tg频道:https://t.me/TLtoulu
# QQ频道:https://pd.qq.com/s/672fku8ge
import requests
# 固定分数
SCORE = "G+oAJ6PkCLjILdZ4ynoxaH4wQGqHQyXKKBe1tD/C6jj/Ew+gBmSGDj60ggw739hvaz0nzfQjha5jA+yBLiBE1smAjOR7xSLt6bR1cCNDiR6VgbfCYF6o19AvuHB64YTgwUQuJcSOP2zODgkjucSo33lwk1NJ82BFmA88v2sjJGLbMisjWWE0mOSeXz6VKNAhoVF8fwfjw79sxeEoUadqHkrpvUOuyswvzHsUJIlFwqD2eRQtffmR0PQNxFKoqttskJWpQTQ73uLYEjJfm9VCUxksVkqhtvzprqib9H4jFunQqQ25zdq09+0ZI6v7fLarKXEkV0/V+WmuEHzHxzHI+Q=="
# 每期游戏类型
GAME_TYPE = "volcano"
# 统一请求头
headers = {
'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090b13)XWEB/11177",
'Content-Type': "application/x-www-form-urlencoded",
'xweb_xhr': "1",
'Sec-Fetch-Site': "cross-site",
'Sec-Fetch-Mode': "cors",
'Sec-Fetch-Dest': "empty",
'Referer': "https://servicewechat.com/wx887bf6ad752ca2f3/66/page-frame.html",
'Accept-Language': "zh-CN,zh;q=0.9"
}
def post_request(endpoint, payload):
url = f"https://game.dominos.com.cn/{GAME_TYPE}/{endpoint}"
try:
response = requests.post(url, data=payload, headers=headers)
response.raise_for_status()
return response.json()
except requests.RequestException as e:
print(f"请求出现异常: {e}")
return None
def get_temp_id(openid, score):
payload = {'openid': openid, 'score': score, 'tempId': 'null'}
response_data = post_request('game/gameDone', payload)
if response_data:
status_code = response_data.get("statusCode")
if status_code == 10:
tempId = response_data.get("extra", {}).get("tempId")
if tempId:
print(f"成功获取 tempId: {tempId}")
return tempId
else:
print("获取 tempId 失败tempId 为 null")
else:
error_message = response_data.get("errorMessage", "无错误信息")
print(f"获取 tempId 失败,状态码: {status_code}, 信息: {error_message}")
return None
def send_sms(openid, mobile):
payload = {'openid': openid, 'mobile': mobile, 'type': 'null'}
response_data = post_request('sendSMS', payload)
if response_data:
status_code = response_data.get("statusCode")
error_message = response_data.get("errorMessage", "无错误信息")
if status_code == 10:
print(f"手机号码已绑定,错误信息: {error_message},跳过短信验证")
return True # 手机号已绑定,返回 True 表示跳过短信验证
elif status_code == 0:
print("短信发送成功!")
return False # 短信发送成功,返回 False 表示需要进行短信验证
else:
print(f"短信发送失败,状态码: {status_code}")
print(f"错误信息: {error_message}")
print(f"响应: {response_data}")
return False
def verify_code(openid, mobile, verification_code):
payload = {'openid': openid, 'mobile': mobile, 'code': verification_code}
response_data = post_request('verification', payload)
if response_data:
status_code = response_data.get("statusCode")
error_message = response_data.get("errorMessage", "无错误信息")
if status_code == 0:
print("验证码验证成功!")
else:
print(f"验证码验证失败,状态码: {status_code}")
print(f"错误信息: {error_message}")
print(f"响应: {response_data}")
def post_game_done(openid, score, tempId):
payload = {'openid': openid, 'score': score, 'tempId': tempId}
response_data = post_request('game/gameDone', payload)
if response_data:
print(f"游戏认证完成: 响应: {response_data}")
def main():
mobile = input("请输入手机号: ")
openid = input("请输入openid: ")
tempId = get_temp_id(openid, SCORE)
if tempId:
# 如果成功获取到 tempId执行 send_sms
if send_sms(openid, mobile):
# 如果手机号已绑定,直接执行后续任务
print("手机号已绑定")
post_game_done(openid, SCORE, tempId)
else:
# 如果短信发送成功,要求输入验证码进行验证
verification_code = input("请输入验证码: ")
verify_code(openid, mobile, verification_code)
post_game_done(openid, SCORE, tempId)
else:
# 如果未获取到 tempId直接获取短信验证码
if send_sms(openid, mobile):
# 如果手机号已绑定,直接执行后续任务
print("手机号已绑定")
post_game_done(openid, SCORE, 'null') # tempId 为 null因为未获取到 tempId
else:
verification_code = input("请输入验证码: ")
verify_code(openid, mobile, verification_code)
post_game_done(openid, SCORE, 'null') # tempId 为 null因为未获取到 tempId
if __name__ == "__main__":
main()