当前位置:首页 > Software > Python > 正文内容

体温打卡python 可通过账户密码获取对应ID号

chanra1n4年前 (2020-12-09)Python4517

仅用于学习和测试,请勿自动填报或者干任何违法的事情

import datetime
import hashlib
import random
from urllib.parse import quote
import requests
import time

USRID=123456


def msg(name):
    url = 'https://qmsg.zendee.cn/send/xxxxxxxxxxxxxxxxx?msg=' + quote(name)
    r = requests.get(url)
    print(r.json()['reason'])


def getAttrs():
    random_str = ['1tddiejat2w', 's9rv1kijwz9', '0cr1jr4xjde', 'a0k8xrv1wyw', 'ewmww899uf7', 'jtev75ngjwg']
    time_str = int(time.time())
    sign_str_o = random.choice(random_str).upper() + str(time_str) + 'Q9y1Vr5sbjGwR8gekNCzELhZioQb9UZw'
    sign_str = hashlib.md5(sign_str_o.encode(encoding="utf-8")).hexdigest().upper()
    return str(time_str), sign_str

    
class tem():
    ZCTW = None
    ZCTJSJ = None
    ZWTW = None
    ZWTJSJ = None
    WSTW = None
    WSTJSJ = None
    tb_now = None
    flag = True
    def __init__(self):
        self.header1 = {
            'origin': 'https://wxyqfk.zhxy.net',
            'referer': 'https://wxyqfk.zhxy.net/?yxdm=12345',
            'sign': getAttrs()[1],
            'timestamp': getAttrs()[0],
            'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36 Edg/85.0.564.68'
        }
        self.check()
        tem_list = ['36.{}'.format(i) for i in range(2, 8)]
        if self.ZCTW == None:
            self.ZCTJSJ = self.tb_now
            self.ZCTW = random.choice(tem_list)
        else:
            if self.ZWTW == None:
                self.ZWTJSJ = self.ZCTJSJ = self.tb_now
                self.ZWTW = random.choice(tem_list)
            else:
                if self.WSTW == None:
                    self.WSTJSJ = self.ZWTJSJ = self.ZCTJSJ = self.tb_now
                    self.WSTW = random.choice(tem_list)
                else:
                    print("已全部填写!")
                    self.flag = False  # 用于判断是否继续填写温度

    def check(self):
        self.now = datetime.datetime.now()
        params = {
            'uid': USRID,
            'usertype': 1,
            'yxdm': '12345',
            'date': self.now.strftime("%Y-%m-%d")
        }
        r1 = requests.get('https://yqfkapi.zhxy.net/api/ClockIn/gettem', params=params, headers=self.header1)
        try:
            self.ID = r1.json()['data']['ID']
            self.ZCTW = r1.json()['data']['ZCTW']
            self.ZWTW = r1.json()['data']['ZWTW']
            self.WSTW = r1.json()['data']['WSTW']
            self.tb_now = self.now.strftime("%Y-%m-%d %H:%M:%S")
            print('已填报信息获取成功!')
            self.first_flag=False
        except:
            self.first_flag=True

    def tem_action(self):
        if self.flag:
            if self.first_flag:
                self.json2 = {
                    'UID': USRID,
                    'UType': 1,
                    'YXDM': "12345",

                    'ZCTJSJ': self.ZCTJSJ,
                    'ZCTW': self.ZCTW,
                }
            else:
                self.json2 = {
                    'ID': self.ID,
                    'SBRQ': self.now.strftime("%Y-%m-%d") + " 00:00:00",
                    'UID': USRID,
                    'UType': 1,
                    'YXDM': "12345",

                    'ZCTJSJ': self.ZCTJSJ,
                    'ZCTW': self.ZCTW,

                    'ZWTJSJ': self.ZWTJSJ,
                    'ZWTW': self.ZWTW,

                    'WSTJSJ': self.WSTJSJ,
                    'WSTW': self.WSTW
                }

            # 体温填报
            ses = requests.session()
            a=int(USRID)
            self.json2['UID']=a
            r1 = ses.post('https://yqfkapi.zhxy.net/api/ClockIn/SaveTem', headers=self.header1, json=self.json2).json()
            try:
                print("体温填写通知:\n每日体温已填报({})\n早晨:{}\n中午:{}\n晚上:{}".format(self.now.strftime("%Y-%m-%d"), r1['data']['ZCTW'], r1['data']['ZWTW'], r1['data']['WSTW']))
                #msg("体温填写通知:\n每日体温已填报({})\n早晨:{}\n中午:{}\n晚上:{}".format(self.now.strftime("%Y-%m-%d"), r1['data']['ZCTW'], r1['data']['ZWTW'], r1['data']['WSTW']))
            except:
                print(r1)
while(USRID<=888888):
    USRID=USRID+1;
    print("当前正在进行:"+str(USRID))
    tem().tem_action()

获取ID号

def getid():
    headero = {
            'origin': 'https://wxyqfk.zhxy.net',
            'referer': 'https://wxyqfk.zhxy.net/?yxdm=12345',
            'sign': getAttrs()[1],
            'timestamp': getAttrs()[0],
            'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36 Edg/85.0.564.68'
        }
    jsonusr = {
                    'YXDM': "12345",
                    'UserType': 1,
                    'XGH': USRXH,

                    'Name': USRNAME,
                    'PassWord': USRPSW,
                }
    seso = requests.session()
    usr = seso.post('https://yqfkapi.zhxy.net/api/User/CheckUser', headers=headero, json=jsonusr).json()
    #print(self.jsonusr)
    #print(usr)
    try:
        USRID=usr['data']['ID']
        tem().tem_action()
    except:
        print(USRID)


扫描二维码推送至手机访问。

版权声明:本文由我的FPGA发布,如需转载请注明出处。

本文链接:https://world.myfpga.cn/index.php/post/166.html

分享给朋友:

“体温打卡python 可通过账户密码获取对应ID号” 的相关文章

2.Python中的基本运算

2.Python中的基本运算

我们打开Python,请你尝试输入如下算式并尝试理解有什么为什么是这样的?1+1 1+1.0 1-2 2-3.5 1*1 1*1.1 1/2 2/1 2/3 3/2 3//2 3/1.0 5/2.5我们不难得到如下结果2 2.0 -1 -1.5 1 1.1 0.5...

math库的使用

math库的使用

math库包括4个数学常数math.pi      圆周率math.e       自然对数math.inf     正无穷大,负无穷大为-math.infmath.nan     非浮点数标记math库常用函数math.cell(x)      向上取整,返回不小于x的最小整数math.facto...

random库

random库

random()            生成一个[0.0,1.0)之间的随机小数randint(a,b)     生成一个[a,b]之间的整数uniform(a,b)     生成一个[a,b]之间的随机小数对random库的引用方法与math库一样,采用下面两种方式实现:import random...

顺序查找

顺序查找

如果需要查找某个特定值的位置(以便能够替换或删除它),可以直接使用index方法。searchedValue=100 #values是之前定义好的一个列表 if searchedValue in walues:     pos=values.index(searchedValue)     ...

列表作为函数参数

列表作为函数参数

列表作为函数参数,函数中可以修改原列表def multiply(values,factor):     for i in range(len(values)):        values[i]*=factor          aList=[1,2,3,4,5]  multiply(aL...