From 5393648d213ae1dc3a2a6b5098be538b4bda9ff3 Mon Sep 17 00:00:00 2001 From: yuyx <237899745@qq.com> Date: Wed, 17 Dec 2025 19:24:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(api):=20=E5=88=97=E8=A1=A8=E9=A1=B5?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E4=B8=8D=E7=AE=97=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api_browser.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/api_browser.py b/api_browser.py index 577e9ed..a003ab8 100755 --- a/api_browser.py +++ b/api_browser.py @@ -378,7 +378,6 @@ class APIBrowser: page = 1 base_url = None skipped_items = 0 - skipped_pages = 0 consecutive_failures = 0 max_consecutive_failures = 3 @@ -435,15 +434,8 @@ class APIBrowser: if next_url: base_url = next_url except Exception as e: - skipped_pages += 1 - consecutive_failures += 1 - self.log( - f"[API] 获取第{page}页列表失败,跳过本页(连续失败{consecutive_failures}/{max_consecutive_failures}): {str(e)}" - ) - if consecutive_failures >= max_consecutive_failures: - raise - page += 1 - continue + self.log(f"[API] 获取第{page}页列表失败,终止本次浏览: {str(e)}") + raise for article in articles: if should_stop_callback and should_stop_callback(): @@ -480,10 +472,8 @@ class APIBrowser: time.sleep(0.2) report_progress(force=True) - if skipped_items or skipped_pages: - self.log( - f"[API] 浏览完成: {total_items} 条内容,{total_attachments} 个附件(跳过 {skipped_items} 条内容,{skipped_pages} 页列表)" - ) + if skipped_items: + self.log(f"[API] 浏览完成: {total_items} 条内容,{total_attachments} 个附件(跳过 {skipped_items} 条内容)") else: self.log(f"[API] 浏览完成: {total_items} 条内容,{total_attachments} 个附件")