思路 先找到 提交步数的接口 (我老妈总是查我的微信步数)
这里我网上随便找了一个
https://apis.jxcxin.cn/doc/mi.html
挺好用的
第二步就是获取 当前步数了(个人技术原因 不能直接在)
只能依靠小程序
抓到请求接口
当然是有加密啦
逆向代码
核心 扣取下来分析 很简单
写代码咯
代码:
import requests from hashlib import md5 from time import time from random import random from copy import deepcopy class WxStep(): def __init__(self, userId, phone, passwd): self.userId = userId self.phone = phone self.passwd = passwd self.headers = { 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 15_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.17(0x1f0108e) NetType/WIFI Language/zh_CN' # 此ua 文心一言生成 } self.md = md5() self.params = { 'user': self.phone, 'password': self.passwd } def randStr(self): t = '' e = "0123456789qwertyuiopasdfghjklzxcvbnm" for i in range(10): t += e[int(random() * len(e))] return t def getstep(self): headers = deepcopy(self.headers) headers.update({ 'userId': self.userId, 'timestamp': str(round(time())), 'noncestr': self.randStr() }) n = headers['timestamp'] t = headers['noncestr'] self.md.update(("!51st26$#lktt@ds$jlf2dst84do6ysq" + t + n + "!51st26$#lktt@ds$jlf2dst84do6ysq").encode()) headers['token'] = self.md.hexdigest() ret = requests.get('https://api.m.xqzs.cn/api/v1/werun/rank/today/' + self.userId, headers=headers).json()['data']['rows'][0] nickName = ret['nickName'] updateTime = ret['updateTime'] step = ret['step'] print(nickName, updateTime, step) return step def addstep(self, stepNum): step = self.getstep() self.params['step'] = step + stepNum ret = requests.get(url='https://apis.jxcxin.cn/api/mi', params=self.params, headers=self.headers) print(ret.text) if __name__ == '__main__': x = WxStep('29****', '13******69', 'in****80') x.addstep(127)#增加步数View Code
软件账号密码是这个软件
自己注册绑定去吧
效果:
标签:__,写个,信步,老妈,self,userId,ret,headers,step From: https://www.cnblogs.com/inkser/p/17688272.html