Python changes WeChat and Alipay steps

Python cola 2021-04-07 18:55:37
python changes wechat alipay steps


python Modifying WeChat and Alipay steps

  • Project significance

  • Implementation method

  • python Code

  • Download address

Project significance

If you want to gather a lot of energy trees in the Alipay ant forest , Contribute to environmental greening , Or do you want to dominate the wechat sports rankings every day , But I don't want to go out and walk , Then the python Scripts can help you implement it .

Implementation method

Installing third party software on mobile phones , Sign up to log in , Synchronize motion data to WeChat and Alipay . use python The script can remotely modify the steps of Lexin health's current login account .

First step : Installing Lexin health on mobile phone app.

 picture


Android download address : Lexin health Android
Apple version download address : Happy heart health iOS edition

The second step : Sign up to log in , And set the login password .

 picture


The third step : Complete third party synchronization , Synchronize motion data to WeChat and Alipay .

 picture


Step four : function python Script , Modify steps of Lexin health .

 picture

 

 picture

 

 picture

python Code

The program is set daily 7 Automatically modify the number of steps , Fill in the Lexin health account in the corresponding position of the script below 、 Lexin health code 、 Modify the steps , And then run the program . The recommended setting range for modifying steps is 30000 to 90000, The step value is too large to modify successfully . If you want to change the next day to automatically modify the number of steps time , Please change the location of the diagram 25200,+25200 On behalf of the next day 0 The number of seconds added after the dot , That is to say 7x60x60, namely 7 Hours , Just modify it according to your own needs . If you have to change the number of steps every day , Then keep the program running all the time .
Be careful : The running program will immediately modify the steps of the day , The number of automatic modification steps starts from the day after the program keeps running .

 picture

 picture


change_step.py

# -*- 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
# Sign in
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(' Login status code :%s' % status_code)
# print(' Login return data :%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 ' Login failed '
# Modify the steps
def change_step(self):
# Login results
login_result = self.login()
if login_result == ' Login failed ':
return ' Login failed '
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(' Modify step status code :%s' % status_code)
# print(' Modify steps to return data :%s' % response_text)
if status_code == 200:
return ' Modify steps to 【%s】 success ' % self.step
else:
return ' Failed to modify steps '
# The time from sleep to the next day to perform the modification steps
def get_sleep_time():
# Next day date
tomorrow = datetime.date.today() + datetime.timedelta(days=1)
# the second day 7 Time stamp
tomorrow_run_time = int(time.mktime(time.strptime(str(tomorrow), '%Y-%m-%d'))) + 25200
# print(tomorrow_run_time)
# Current timestamp
current_time = int(time.time())
# print(current_time)
return tomorrow_run_time - current_time
if __name__ == "__main__":
# Maximum number of running errors
fail_num = 3
while 1:
while fail_num > 0:
try:
# Modify step results
result = LexinSport(' Lexin health account ', ' Lexin health code ', Modify the steps ).change_step()
print(result)
break
except Exception as e:
print(' Operation error , reason :%s' % e)
fail_num -= 1
if fail_num == 0:
print(' Failed to modify steps ')
# Reset the number of running errors
fail_num = 3
# Get sleep time
sleep_time = get_sleep_time()
time.sleep(sleep_time)

版权声明
本文为[Python cola]所创,转载请带上原文链接,感谢
https://pythonmana.com/2021/04/20210407185354806z.html

  1. Python web menu project takes another step forward to learn about the built-in user authentication system from the application layer
  2. Python classic interview questions (with answers)!
  3. 【Python从零到壹】Python的循环结构详解
  4. 【Python从零到壹】Python列表详解
  5. 【Python从零到壹】Python的字典详解
  6. 【Python从零到壹】Python的字符串详解
  7. 【Python从零到壹】Python基础之函数的应用
  8. 【Python从零到壹】用Python实现植物大战僵尸里的面向对象
  9. Detailed explanation of Python loop structure
  10. Detailed explanation of Python list
  11. Detailed explanation of Python dictionary
  12. Detailed explanation of Python string
  13. [Python from zero to one] the application of Python basic functions
  14. [Python from zero to one] using Python to realize object-oriented in plant vs. zombie
  15. 用 Python 实现微信版飞机大战
  16. 用 Python 实现***帝国中的数字雨落既视感
  17. 想知道未来孩子长相?Python人脸融合告诉你
  18. 我用 Python 做了一个全球疫情数据大屏
  19. Using Python to realize wechat aircraft war
  20. Using Python to realize the visual sense of digital rain in the Empire of the Communist Party of China
  21. Want to know what kids will look like in the future? Python face fusion tells you
  22. I made a big screen of global epidemic data with Python
  23. python你TM太皮了——区区30行代码就能记录键盘的一举一动
  24. Python you TM too skinny - just 30 lines of code can record every move of the keyboard
  25. python的装饰器概念学习基础基础版
  26. Python decorator concept learning basic edition
  27. SQL配合Python-Flask的中转注入
  28. python3使用kivy生成安卓程序
  29. 不到 150 行代码写一个 Python 版的贪吃蛇
  30. Transfer injection of SQL and python flash
  31. Using Kivy to generate Android program in Python 3
  32. Less than 150 lines of code to write a python version of the snake
  33. Python面向对象练习题
  34. Python数据分析入门(八):Pandas统计计算和描述
  35. Python面向对象练习题
  36. Python object oriented exercises
  37. Introduction to Python data analysis (8): Pandas statistical calculation and description
  38. Python object oriented exercises
  39. WEB4-通过python获得flag
  40. python-web5
  41. Pandas-二进制操作
  42. python入门教程14-01 (python语法入门之python内存泄露)
  43. Web4 - get flag through Python
  44. python-web5
  45. Pandas binary operation
  46. python入门教程13-06 (python语法入门之视图、触发器、事务、存储过程、函数)
  47. python入门教程13-07 (python语法入门之ORM框架SQLAlchemy)
  48. python入门教程13-08 (python语法入门之python索引原理与慢查询优化)
  49. 定投指数到底能不能赚钱?Python 来告诉你答案
  50. Python入门学习之:10分钟1500访问量
  51. Getting started with Python 14-01
  52. 用 Python 画哆啦 A 梦
  53. Python 图表利器 pyecharts
  54. 用 Python 抓取公号文章保存成 HTML
  55. Introduction to Python 13-06 (view, trigger, transaction, stored procedure, function of introduction to Python syntax)
  56. Getting started with Python 13-07 (ORM framework Sqlalchemy for getting started with Python syntax)
  57. Introduction to Python 13-08
  58. Can fixed investment index make money? Python will tell you the answer
  59. Introduction to Python: 1500 visits in 10 minutes
  60. 用 Python 获取股市交易数据