免抓包 羊了个羊过通关次数和话题
本帖最后由 就往丶 于 2022-9-18 12:03 编辑在页面获取uid填写到下面代码中
```
import requests
headers = {
"user-agent":"Mozilla/5.0 (Linux; Android 10; HD1910 Build/QKQ1.190716.003; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.99 XWEB/4309 MMWEBSDK/20220303 Mobile Safari/537.36 MMWEBID/583 MicroMessenger/8.0.21.2120(0x280015F0) Process/appbrand1 WeChat/arm64 Weixin NetType/4G Language/zh_CN ABI/arm64 MiniProgramEnv/android"
}
#获取基本信息
def user_info(uid):
url = "https://cat-match.easygame2021.com/sheep/v1/game/user_info?"
params = {
"uid":uid,
"t":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2OTQ0MDU0MjMsIm5iZiI6MTY2MzMwMzIyMywiaWF0IjoxNjYzMzAxNDIzLCJqdGkiOiJDTTpjYXRfbWF0Y2g6bHQxMjM0NTYiLCJvcGVuX2lkIjoiIiwidWlkIjoxMDg0MzMxMjgsImRlYnVnIjoiIiwibGFuZyI6IiJ9.oT1OY9XokZmHt1Hzifc8ILF1U-xQxY-itXNaeLj02R8"
}
res = requests.get(url,params=params).json()["data"]
return res
#获取token
def get_token(uid):
user = user_info(uid)
url = "https://cat-match.easygame2021.com/sheep/v1/user/login_oppo"
data = {
"uid":user["wx_open_id"],
"nick_name": user["nick_name"],
"avatar":user["avatar"],
"sex" : 1
}
res = requests.post(url,data=data,headers=headers).json()['data']['token']
return res
#每日话题加入羊群
def join_sheep():
url = "https://cat-match.easygame2021.com/sheep/v1/game/topic_game_over?rank_score=1&rank_state=1&rank_time=1&rank_role=1&skin=1"
res = requests.get(url,headers=headers)
print(res.text)
#刷通关次数
def game_over():
url = "https://cat-match.easygame2021.com/sheep/v1/game/game_over?rank_score=1&rank_state=1&rank_time=1&rank_role=1&skin=1"
res = requests.get(url,headers=headers)
print(res.text)
if __name__ == '__main__':
token = get_token('xxxxxxx') #填写你自己的uid
headers['t'] = token
join_sheep()
game_over()
``` Traceback (most recent call last):
File "D:\ylgy.py", line 44, in <module>
token = get_token('123456') #填写你自己的uid
File "D:\ylgy.py", line 27, in get_token
res = requests.post(url,data=data,headers=headers).json()['data']['token']
TypeError: string indices must be integers
报以上错误的修改方法是:将nick_name修改成自己的微信名,接口返回的nick_name现在是空值,所以会报错
#获取token
def get_token(uid):
user = user_info(uid)
url = "https://cat-match.easygame2021.com/sheep/v1/user/login_oppo"
data = {
"uid":user["wx_open_id"],
"nick_name": '你的微信名字',#这里修改成你的微信名
"avatar":user["avatar"],
"sex" : 1
}
res = requests.post(url,data=data,headers=headers).json()['data']['token']
return res lz 你的 token 暴露了你的个人信息了
{
"err_code": 0,
"err_msg": "",
"data": {
"id": "6323125f9b9d2fa55d4738c1",
"created_at": "2022-09-15T11:54:07.187Z",
"updated_at": "2022-09-15T11:54:07.187Z",
"role": 2,
"uid": 108433128,
"gender": 0,
"nick_name": "南屿",
"avatar": "https://thirdwx.qlogo.cn/mmopen/vi_32/9o5bjRgVDbRic63YCFNRom3ULBkHjCOvmlxCpT5lHXZynwAhJwknK5uXwW6FicSdx7aHHvZyaVBh2b8GAohg7geg/132",
"wx_open_id": "oOYg25Eh7vcLENEZIWOQklTFN3DU",
"wx_union_id": "oNvyk5rVYickoPBw2CFS_QY1k68Q",
"last_login_time": null,
"last_logout_time": null,
"charge_first_time": 0,
"charge_last_time": 0,
"charge_total": 0,
"charge_times": 0
}
} 有可以手机上操作的吗
colitis 发表于 2022-9-18 12:02
有可以手机上操作的吗
可以去看看别的帖子可以修改关卡的类型 前来围观! 本帖最后由 NOOB 于 2022-9-18 12:16 编辑
可以的,更清楚了 看看拿走了 怎么使用这段代码?安装个pyhon? 前来察看,嘿嘿 大佬出个改羊了个羊背景音乐教程听得吐了{:1_937:}