微信运动修改器python代码

本脚本通过POST请求向乐动力服务器发送指定步数数据,实现自动更新用户的每日步数记录。支持输入乐动力ID及自定义步数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

#coding: utf-8

#date: 2015年9月29日01:50:37

#usage: edit steps and ledongli's uid(u need to download this app) .That would be ok .Good luck. ^_^

import requests

import sys

import json

import datetime

import time

import random

def isnum(value):

    try:

        temp = int(value)

    except Exception:

        return False

    else:

        return True

# like 2015-09-25 00:00:00 converts to unix time stamp

def formatDate():

    nowtime = datetime.datetime.now()

    date = time.strftime('%Y-%m-%d')

    strtemp_date = date + ' 00:00:00'

    ledongli_date = time.strptime(strtemp_date, '%Y-%m-%d %H:%M:%S')

    finaldate = time.mktime(ledongli_date) # rusult is 1443456000.0(float type), but still need to format to 1443456000

    finaldate = int(finaldate)

    return finaldate

def main(steps, uid):

    if not isnum(steps):

        print( 'param error. steps must be an integer.')
        exit()

    url = 'http://pl.api.ledongli.cn/xq/io.ashx'

    fake_headers = {

                        'User-Agent'     : 'Dalvik/2.1.0 (Linux; U; Android 5.0.2; MI 2 MIUI/5.7.16)',

                        'Content-Type'   : 'application/x-www-form-urlencoded; charset=UTF-8',

                        'Accept-Encoding': 'gzip'

                    }

    keycontentjson = [

                        {

                            "date": formatDate(),

                            "calories": 0,

                            "activeValue": 108,

                            "steps": steps,

                            "pm2d5": 0,

                            "duration": 0,

                            "distance": 0,

                            "report": "[]"

                        }

                     ]

    # key is a str type

    # key must be a json data convert to string

    key = json.dumps(keycontentjson)

    param = {

                'action': 'profile',

                'pc':     '865863023705721',

                'cmd':    'updatedaily',

                'uid':    uid,

                'list':   key

            }

    r = requests.post(url, data = param, headers = fake_headers)

    return json.loads(r.text)["status"]

  

if __name__ == '__main__':
    print("Powered By 真红酱\n")
    uid =input("请输入乐动力ID--->")
    steps =input("请输入步数--->")
    while main(steps, uid)!="OK":
     pass
    print("设置完毕:"+str(steps))


只放代码,不解释

http://www.wooyun.org/bugs/wooyun-2010-0145359

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值