小米游戏中心最近开启了个活动, 每天启动可以获取碎片, 集齐碎片可以换取不错的奖品, 代码如下:
1.代码
import requests
import json
import time
# 填写server酱sckey,不开启server酱则不用填
sckey = 'SCU91171Tc53719225522e2c70b14d08552356859d'
# 模拟启动
url1 = 'https://tgao.g.mi.com/doluck/api/lucky/draw/user/up/click'
# 模拟
url2 = 'https://tgao.g.mi.com/doluck/api/lucky/draw/result'
def start():
headers = {
'Content-Type': 'application/json',
'Host': 'tgao.g.mi.com',
'Connection': 'keep-alive',
'Accept': 'application/json, text/plain, */*',
'User-Agent': 'Mozilla/5.0 (Linux; Android 10; MI 9 Build/QKQ1.190825.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 gcv100300300 gc-app XiaoMi/MiuiBrowser/4.3',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'zh-CN,en-US;q=0.9',
'X-Requested-With': 'com.xiaomi.gamecenter'
}
payload1 ={
"gameId": "62230288",
"acId": "3",
"fuid": "101991604",
"token": "_SW01_H5G249564-959656565pC8oy7EQokFctqVTggVmXogJ0o"
}
payload2 ={
"gameId": "62230288",
"acId": "3",
"fuid": "101991604",
"token": "_SW01_H5G466484jkjkqC7%22455448QokFctqVTggVmXogJ0o",
"imei": "66e113164655b212f",
"imeiSha1": "SAI546464FZgj",
"oaid": "685316693571f",
"ua": "0"
}
# 模拟启动
requests.request("POST", url1, data =json.dumps(payload1), headers=headers)
time.sleep(1)
# 模拟抽奖
re2 = requests.request("POST", url2, data =json.dumps(payload2), headers=headers).text
requests.get('https://sc.ftqq.com/' + sckey + '.send?text=小米碎片抽取成功:'+ re2)
def main_handler(event, context):
return start()
if __name__ == '__main__':
start()
2. 参数说明
- gameId : 固定为6330288
- acId : 固定为3
- fuid : 抓包获取
- token : 抓包获取
- imei : 抓包获取
- imeiSha1 :抓包获取
- oaid : 抓包获取
- ua :抓包获取
3. 抓包说明
- 打开小米游戏中心, 王者荣耀游戏详情界面, 开启抓包工具, 抓取
tgao.g.mi.com
开头的链接即可获取相关参数
4. 运行环境
- 云函数-python3.6
评论区