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

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

chanra1n5年前 (2020-12-09)Python5325

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

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号” 的相关文章

搜索字符串

搜索字符串

常用搜索字符串中子串的方法str.count(substring)      返回str中substring子串出现的无覆盖的次数str.find(s1)                    返回s1在这个字符串的最低下标,如果字符串中不存在s1,则返回-1str.rfind(s1)       ...

(原创)使用Python对任意网站图片进行爬取,仅用于学习

(原创)使用Python对任意网站图片进行爬取,仅用于学习

import os import time import argparse import requests import re import io from urllib.parse import ...

(原创)使用Python递归获取网页内的所有URL,并进行清洗

(原创)使用Python递归获取网页内的所有URL,并进行清洗

import argparse import time from urllib.parse import urljoin, urlparse from selenium import webdriver...

(原创)使用Python自动对子文件夹中的图片文件进行重命名

(原创)使用Python自动对子文件夹中的图片文件进行重命名

为了解决Python深度学习的时候,经常遇到的文件名问题import os # 获取指定目录下的所有子文件夹 def get_subfolders(path):     subfolders = []...

(原创)使用Python提取Vivado工程的RTL代码

(原创)使用Python提取Vivado工程的RTL代码

在工程文件夹下运行Python程序即可#Author       : / #Description  : 从Vivado的项目文件夹中提取rtl文件,用于LEDA调试 #Time&nbs...