微信支付宝刷步数_一劳永逸版(在用)
说明
支持 微信 qq 苹果健康 支付宝 阿里体育 小米穿戴设备步数同步
可以多账户,自定义刷步数时间
成果
其他方法
懒人版(氪金)**点击注册**送三天会员,一步到胃。
钉钉刷步数(一劳永逸,需要劳动|在写)
所需材料
- 小米运动app
- github账号
- 最好有个电脑,手机也可以。。
步骤
1.注册小米运动
注意不是小米账号,是小米运动账号。
下载zepp life[原小米运动] - 注册[用手机号] - 设置密码 - 登录 - 右下角我的 - 第三方介入 - 然后接入你想同步的app就好。
2.github fork
注册登录github[谷歌浏览器,可能需要科学上网,看缘分]
进入 https://github.com/577fkj/mimotion 仓库,作者:方块君
下面他的readme写的很详细了。用python写的。相关代码放最后面,一起学习,无视。
按步骤来。一劳永逸。
3.简单写下fork流程。
- 1.fork此仓库
- 2.设置账号密码
Settings–>Secrets–>Actions–>New repository secret
依次设置账号,密码等
列表如下(直接截的方块君的)
设置完如下
下面这个是设置推送的,比如运行一次就给你发消息,嫌弃打扰就不要设置,我在用的是pushplus推送,(关注公众号 pushplus推送加,功能-个人中心-开发设置-token-放在PKEY里就好)
多账户,自定义时间readme很清楚了,大概r就是这样,不会的再交流。。
#运动步数修改
import requests
import json
import hashlib
import time
import datetime
class LexinSport:
def __init__(self, username, password, step):
self.username = username
self.password = password
self.step = step
# 登录
def login(self):
url = 'https://sports.lifesense.com/sessions_service/login?systemType=2&version=4.6.7'
data = {'loginName': self.username, 'password': hashlib.md5(self.password.encode('utf8')).hexdigest(),
'clientId': '49a41c9727ee49dda3b190dc907850cc', 'roleType': 0, 'appType': 6}
headers = {
'Content-Type': 'application/json; charset=utf-8',
'User-Agent': 'Dalvik/2.1.0 (Linux; U; Android 7.1.2; LIO-AN00 Build/LIO-AN00)'
}
response_result = requests.post(url, data=json.dumps(data), headers=headers)
status_code = response_result.status_code
response_text = response_result.text
# print('登录状态码:%s' % status_code)
# print('登录返回数据:%s' % response_text)
if status_code == 200:
response_text = json.loads(response_text)
user_id = response_text['data']['userId']
access_token = response_text['data']['accessToken']
return user_id, access_token
else:
return '登录失败'
# 修改步数
def change_step(self):
# 登录结果
login_result = self.login()
if login_result == '登录失败':
return '登录失败'
else:
url = 'https://sports.lifesense.com/sport_service/sport/sport/uploadMobileStepV2?systemType=2&version=4.6.7'
data = {'list': [{'DataSource': 2, 'active': 1, 'calories': int(self.step/4), 'dataSource': 2,
'deviceId': 'M_NULL', 'distance': int(self.step/3), 'exerciseTime': 0, 'isUpload': 0,
'measurementTime': time.strftime('%Y-%m-%d %H:%M:%S'), 'priority': 0, 'step': self.step,
'type': 2, 'updated': int(round(time.time() * 1000)), 'userId': login_result[0]}]}
headers = {
'Content-Type': 'application/json; charset=utf-8',
'Cookie': 'accessToken=%s' % login_result[1]
}
response_result = requests.post(url, data=json.dumps(data), headers=headers)
status_code = response_result.status_code
# response_text = response_result.text
# print('修改步数状态码:%s' % status_code)
# print('修改步数返回数据:%s' % response_text)
if status_code == 200:
return '修改步数为【%s】成功' % self.step
else:
return '修改步数失败'
# 睡眠到第二天执行修改步数的时间
def get_sleep_time():
# 第二天日期
tomorrow = datetime.date.today() + datetime.timedelta(days=1)
# 第二天7点时间戳
tomorrow_run_time = int(time.mktime(time.strptime(str(tomorrow), '%Y-%m-%d'))) + 25200
# print(tomorrow_run_time)
# 当前时间戳
current_time = int(time.time())
# print(current_time)
return tomorrow_run_time - current_time
if __name__ == "__main__":
# 最大运行出错次数
fail_num = 3
while 1:
while fail_num > 0:
try:
# 修改步数结果
result = LexinSport('18663413868', 'Goodmorning66.', '11000').change_step()
print(result)
break
except Exception as e:
print('运行出错,原因:%s' % e)
fail_num -= 1
if fail_num == 0:
print('修改步数失败')
# 重置运行出错次数
fail_num = 3
# 获取睡眠时间
sleep_time = get_sleep_time()
time.sleep(sleep_time)