From 50b14952dc00ee96a8b92fe4ea49b4cef7a7f76c Mon Sep 17 00:00:00 2001 From: NormalDD <2660708435@qq.com> Date: Tue, 7 Jan 2025 18:47:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=A7=82=E7=9C=8B=E8=AF=BE=E4=BB=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 035ac6f..d7908d8 100644 --- a/main.py +++ b/main.py @@ -14,6 +14,8 @@ from base64 import b64encode, b64decode import traceback import gzip + +from pyasn1_modules.rfc8226 import id_ad_stirTNList from tqdm import tqdm import argparse from tools.drift import add_drift @@ -495,7 +497,38 @@ def finish(self): } resp = default_post("/run/finish", json.dumps(data)) print(resp) - + def get_ppt_list(self): + res_json = json.loads(default_post(router="/cwInfo/getStudentStudyList", data="")) + print(res_json) + data = res_json['data'] + cwList = data['cwList'] + id_list = [] + for cw in cwList: + if cw["fullMark"] != cw["currentScore"] : + id_list.append(cw["id"]) + return id_list + def watch_ppt(self): + id_list = self.get_ppt_list() + for id in id_list: + data = { + "id": str(id) + } + res_data = json.loads(default_post(router="/cwInfo/getStudentStudyById", data=json.dumps(data))) + print(res_data) + data = res_data['data'] + page_time = int(data['pageTime']) + page_count = int(data['pageCount']) + now_page = int(data["cwPageNum"]) + while now_page < page_count: + time.sleep(page_time) + data = { + "id": str(id), + "cwPageNum": str(now_page + 1), + } + print(default_post(router="/cwInfo/submitCwById", data=json.dumps(data))) + now_page += 1 + + pass if __name__ == '__main__': args = parse_args() cfg_path = args.config_path @@ -564,6 +597,11 @@ def finish(self): sure = input("确认:[y/n]") try: if sure == 'y': + mode = input("模式选择(跑步/观看PPT):[1/2]") + if mode == '2': + Yun = Yun_For_New() + Yun.watch_ppt() + exit() if args.auto_run: print_table = 'y' else: From be87a76733c09acb7dde19e1877a8c9bf2755f3c Mon Sep 17 00:00:00 2001 From: NormalDD <2660708435@qq.com> Date: Tue, 7 Jan 2025 18:52:22 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=A7=82=E7=9C=8B=E8=AF=BE=E4=BB=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index d7908d8..c6d8996 100644 --- a/main.py +++ b/main.py @@ -499,7 +499,6 @@ def finish(self): print(resp) def get_ppt_list(self): res_json = json.loads(default_post(router="/cwInfo/getStudentStudyList", data="")) - print(res_json) data = res_json['data'] cwList = data['cwList'] id_list = [] @@ -514,12 +513,14 @@ def watch_ppt(self): "id": str(id) } res_data = json.loads(default_post(router="/cwInfo/getStudentStudyById", data=json.dumps(data))) - print(res_data) data = res_data['data'] page_time = int(data['pageTime']) page_count = int(data['pageCount']) now_page = int(data["cwPageNum"]) + name = data["name"] + print(f"开始观看{name}") while now_page < page_count: + print(f"第{now_page}页") time.sleep(page_time) data = { "id": str(id), From a3d72e9de1ad660c0cab3a6212f5f06f268bdb06 Mon Sep 17 00:00:00 2001 From: NormalDD <2660708435@qq.com> Date: Tue, 7 Jan 2025 18:54:33 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E8=A7=82=E7=9C=8B=E8=AF=BE=E4=BB=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 1 - 1 file changed, 1 deletion(-) diff --git a/main.py b/main.py index c6d8996..a87b17c 100644 --- a/main.py +++ b/main.py @@ -15,7 +15,6 @@ import traceback import gzip -from pyasn1_modules.rfc8226 import id_ad_stirTNList from tqdm import tqdm import argparse from tools.drift import add_drift