支付宝一键修改步数,支付宝一键刷步数

首页 > 实用技巧 > 作者:YD1662023-05-28 10:22:55


部分源码如下:

# -*- coding: utf-8 -*-
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 '修改步数失败'

微信步数实现效果如下:

支付宝一键修改步数,支付宝一键刷步数(9)

支付宝运动实现效果如下:

支付宝一键修改步数,支付宝一键刷步数(10)

更多系列文章

敬请期待


我是CoCo,计算机科学与技术专业,深漂大厂互联网民工(女),坐标深圳。5年工作经验,3年持续输出技术文。ITester软件测试小栈(ID:ITestingA)号主,专注于软件测试技术和宝藏干货分享,每周准时更新原创技术文章,每月不定期赠送技术书籍,愿我们在更高处相逢。喜欢记得星标⭐我,及时获得最新文章推送,第三方转载请注明出处。

支付宝一键修改步数,支付宝一键刷步数(11)

支付宝一键修改步数,支付宝一键刷步数(12)

上一页1234下一页

栏目热文

文档排行

本站推荐

Copyright © 2018 - 2021 www.yd166.com., All Rights Reserved.