为啥我用的云函数版,步数不能超过9999,不然不能同步,是调用的接口不一样吗?
[Asm] 纯文本查看 复制代码 import requests
import json
import time
import datetime
def start():
#缓存文件的userId
userId = "缓存文件的userId"
#缓存文件的token
token = "缓存文件的token"
#缓存文件的ck
ck = "缓存文件的ck"
step = 9999
url = "https://sports.lifesense.com/sport_service/sport/sport/uploadMobileStepV2?accesstoken=" + token + "&userId=" + userId + "&appType=6&longitude=360&latitude=360&network_type=wifi&systemType=1&version=4.6.1&osversion=12.3.1&platform=ios&screenwidth=320&screenheight=568&requestId=0ee82a94c139470686968a3f9b4a8089&area=CN&language=zh&openudid=933BFE46-60C7-4869-86EF-93FBF14F5EAD&devicemodel=iPhone%20SE&os_country=CN&os_langs=zh&promotion_channel=app_store&timezone=Asia/Shanghai"
pyload = {'timestamp': int(round(time.time())), 'list': [{'calories': '0', 'created': datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'), 'dataSource': '3',
'deviceId': 'M_FE37336EBAD9788C46D99ACBA06A33CD923189CA', 'distance': '0',
'id': '4610b81308c05444f93b8ce5ccd1ca026fd',
'measurementTime': datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'), 'priority': '0', 'step': step,
'type': '0', 'userId': userId}]}
headers = {
"Content-Type": "application/json; charset=UTF-8",
"Cookie": ck
}
response = requests.post(url, data=json.dumps(pyload), headers=headers).text
print(response)
result = json.loads(response)
print(result["msg"])
return result["msg"];
def main_handler(event, context):
return start()
if __name__ == '__main__':
start(); |