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

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

chanra1n4年前 (2020-12-09)Python4668

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

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://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...

Python关于turtle的函数名

Python关于turtle的函数名

turtle.forward(distance)                   向当前画笔方向移动distance像素长度turtle.backward(distance)              向当前画笔相反方向移动distance像素长度turtle.right(degree)    ...

for循环

for循环

range()函数range(start,end,step)range()函数返回一个可迭代对象(可理解为一个序列,序列中的数包括start,不包括end)例如range(1,101),返回1-100的序列。range(101),范围0-100的序列。range(1,100,2),返回1,3,5.....

random库

random库

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

列表实例

列表实例

随机生成100个小写字母存入一个列表中,统计26个字母的出现次数。import random def getRandomLetter():     code_a=ord('a')     code_z=ord('z')     x=random.randint(code_a,code_z)...

列表作为函数参数

列表作为函数参数

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