From e7c791387c7865ea316fdce50e508526cf2220d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jax=EF=BD=9C=E6=9D=8E=E6=99=AF=E8=A1=8C?= Date: Tue, 19 May 2026 05:25:03 +0800 Subject: [PATCH] Fix: skip notes that fail to fetch instead of crashing Previously the crawler would crash on a single failed note. Now it logs a warning and continues. --- media_platform/xhs/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/media_platform/xhs/core.py b/media_platform/xhs/core.py index 83e0b0bdf..334fef395 100644 --- a/media_platform/xhs/core.py +++ b/media_platform/xhs/core.py @@ -302,7 +302,8 @@ async def get_note_detail_async_task( note_detail = await self.xhs_client.get_note_by_id_from_html(note_id, xsec_source, xsec_token, enable_cookie=True) if not note_detail: - raise Exception(f"[get_note_detail_async_task] Failed to get note detail, Id: {note_id}") + utils.logger.warning(f"[skip] Failed to get note detail, Id: {note_id}, 跳过继续") + return None note_detail.update({"xsec_token": xsec_token, "xsec_source": xsec_source})