From 9f1bb85f5e1fec3b40dae3f4208f80ba26007637 Mon Sep 17 00:00:00 2001 From: leiye <41333369@qq.com> Date: Sun, 30 Jun 2024 00:46:59 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8D176-181=E8=A1=8C?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=BC=A9=E8=BF=9B=E5=AF=BC=E8=87=B4=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E8=BE=BE=202.=20=E4=BF=AE=E6=94=B9200=E8=A1=8C?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=88=A4=E6=96=AD=E6=9D=A1=E4=BB=B6=E5=BA=94?= =?UTF-8?q?=E4=B8=BA=5FisFinished?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/base.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/api/base.py b/api/base.py index c15a241..020ee6c 100644 --- a/api/base.py +++ b/api/base.py @@ -173,12 +173,12 @@ def video_progress_log(self, _session, _course, _job, _job_info, _dtoken, _durat break # 如果返回为200正常,则跳出循环 elif resp.status_code == 403: continue # 如果出现403无权限报错,则继续尝试不同的rt参数 - if _success: - return resp.json() - else: - # 若出现两个rt参数都返回403的情况,则跳过当前任务 - logger.warning("出现403报错,尝试修复无效,正在跳过当前任务点...") - return False + if _success: + return resp.json() + else: + # 若出现两个rt参数都返回403的情况,则跳过当前任务 + logger.warning("出现403报错,尝试修复无效,正在跳过当前任务点...") + return False def study_video(self, _course, _job, _job_info, _speed: float = 1, _type: str = "Video"): if _type == "Video": @@ -197,7 +197,7 @@ def study_video(self, _course, _job, _job_info, _speed: float = 1, _type: str = _isFinished = False _playingTime = 0 logger.info(f"开始任务:{_job['name']}, 总时长: {_duration}秒") - while not _isPassed: + while not _isFinished: if _isFinished: _playingTime = _duration _isPassed = self.video_progress_log(_session, _course, _job, _job_info, _dtoken, _duration, _playingTime, _type)