Skip to content

Commit ba419dd

Browse files
committed
[POLISH] 跳过部分无法完成的节点
1 parent 9689564 commit ba419dd

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

AIMoocMain/main.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,16 @@ def handle_resource(
150150
self.logging.info(f"{prefix} ⏭ 跳过测验")
151151
return
152152

153+
# 跳过子节点
154+
if file_type == "子节点":
155+
self.logging.info(f"{prefix} ⏭ 跳过无法展开的子节点")
156+
return
157+
158+
# 跳过文件夹
159+
if file_type == "文件夹":
160+
self.logging.info(f"{prefix} ⏭ 跳过文件夹")
161+
return
162+
153163
# 已完成的课程不再处理
154164
if source_id in self.study_record_list:
155165
self.logging.info(f"{prefix} ⏭ 跳过已完成的课程: {resource_name}")
@@ -185,7 +195,7 @@ def handle_resource(
185195
course_info_id = node.get("courseInfoId")
186196
study_time = total_num
187197

188-
wait_time = random.randint(1, 2)
198+
wait_time = round(random.uniform(0.5, 1.5), 2)
189199

190200
self.logging.info(
191201
f"{prefix} ⏳ 学习数: {total_num},等待 {wait_time} 秒..."

0 commit comments

Comments
 (0)