From 85b8363fedc7abbb150f292e7941110f6bdfa0ea Mon Sep 17 00:00:00 2001 From: dsh Date: Wed, 18 Nov 2026 13:10:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(fetch-emoji):=20=E4=B8=AA=E5=88=AB=E8=A1=A8?= =?UTF-8?q?=E6=83=85=20CDN=20=E7=BC=BA=E5=A4=B1=E4=B8=8D=E5=86=8D=E4=BB=A5?= =?UTF-8?q?=E9=9D=9E=E9=9B=B6=E7=A0=81=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 配合 shell set -e 时会中断后续 build-zim;现在只有全部失败才返回 1,缺失项回退文字标签。 --- tieba_archiver/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tieba_archiver/cli.py b/tieba_archiver/cli.py index afe1752..41d514c 100644 --- a/tieba_archiver/cli.py +++ b/tieba_archiver/cli.py @@ -598,8 +598,9 @@ def cmd_fetch_emoji(args) -> int: conn.close() print(f"[ok] 表情 {stats['total']} 个:下载 {stats['ok']},已有 {stats['skip']},失败 {len(stats['failed'])}") if stats["failed"]: - print(" 失败:", " ".join(stats["failed"][:20])) - return 0 if not stats["failed"] else 1 + print(" 失败(CDN 上没有,渲染时回退文字):", " ".join(stats["failed"][:20])) + # 部分表情缺失不影响构建,只有全都失败才算错 + return 0 if stats["ok"] or stats["skip"] else 1 def cmd_build_zim(args) -> int: