羊了个羊过关秘籍

最近今天这个羊了个羊非常的火爆哈,就写了个python小脚本把它给过了

需要的抓包软件

HTTPDebugPro

image-20220916112404560.png

打开微信小程序的羊了个羊,点击开始游戏

抓包

image-20220916112810439.png

就拿这个t参数就可以了

代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

import requests


map_api = "https://cat-match.easygame2021.com/sheep/v1/game/map_info?map_id=%s"
# 完成游戏接口 需要参数状态以及耗时(单位秒)
finish_api = "https://cat-match.easygame2021.com/sheep/v1/game/game_over?rank_score=1&rank_state=%s&rank_time=%s&rank_role=1&skin=1"

header_t = "放你的t"
header_user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36 Edg/105.0.1343.33"
cost_time = 300
cycle_count = 6666

request_header = {
"Host": "cat-match.easygame2021.com",
"User-Agent": header_user_agent,
"t": header_t
}

"""
调用完成闯关
Parameters:
state - 状态
cost_time - 耗时
"""


def finish_game(state, cost_time):
res = requests.get(finish_api % (state, cost_time), headers=request_header,verify=False)
# err_code为0则成功
if res.json()["err_code"] == 0:
print("状态成功")
else:
print(res.json())
print("请检查t的值是否合法")


if __name__ == '__main__':
print("【羊了个羊一键闯关开始启动】")
for i in range(cycle_count):
print(f"...第{i + 1}开始完成闯关...")
finish_game(1, 60)
print(f"...第{i + 1}次完成闯关...")
print("【羊了个羊一键闯关开始结束】")