modified: __pycache__/initialization.cpython-310.pyc

modified:   __pycache__/kill_course.cpython-310.pyc
	modified:   __pycache__/single_course.cpython-310.pyc
	modified:   course_info.json
	modified:   kill_course.py
	modified:   main.py
	modified:   single_course.py
main
JesterHey 12 months ago
parent 27c2d92925
commit 672ee2844f

File diff suppressed because one or more lines are too long

@ -11,8 +11,10 @@ def kill_course(again: bool = False):
cnt = defaultdict(list)
# 读取课程信息
info = json.load(open('course_info.json', 'r'))
# 统计各个类别的课程 = 100的数量
cnt2 = Counter(info[k]['type'] for k in info.keys() if info[k]['rate'] == 100)
for k, v in info.items():
if v['rate'] < 100:
if v['rate'] < 100 and cnt2[v['type']] < 10:
cnt[v['type']].append((k, v['rate'])) # 课程类型作为键课程id作为值
logger.info('{}'.format(cnt))
if not cnt:

@ -18,7 +18,6 @@ if not os.path.exists('info.json'):
study_type = json.load(open('info.json', 'r'))['study_type']
# 这里以后会放一个初始化模块
get_info(first=True)
init(study_type=study_type)
# 执行刷课
kill_course()

@ -2,6 +2,7 @@ from DrissionPage import ChromiumPage
from DrissionPage.common import *
import time
from loguru import logger
from get_info import get_into_center
# 实现单个课程的刷课逻辑
@ -22,6 +23,8 @@ def one_course(cid: str, ctype: str, crate: int, again: bool = False):
if again:
# 关闭所有标签页和浏览器
cur_page.close()
# 进入个人中心
get_into_center(cur_page)
# 判定课程类别
if ctype == '必修':
cur_page.ele('@value=1').click()

Loading…
Cancel
Save