From 9c3d8de82d49ea5292a59d8b9c5740fb7eb7e75a Mon Sep 17 00:00:00 2001 From: billy Date: Mon, 15 Jun 2026 15:32:54 +0800 Subject: [PATCH] =?UTF-8?q?feat(douyin):=E6=96=B0=E5=A2=9E=E5=9B=BE?= =?UTF-8?q?=E6=96=87=E6=A0=87=E9=A2=98=E5=92=8C=E6=AD=A3=E6=96=87=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E6=95=B0=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uploader/douyin_uploader/main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/uploader/douyin_uploader/main.py b/uploader/douyin_uploader/main.py index 61f555c..b9b71a6 100644 --- a/uploader/douyin_uploader/main.py +++ b/uploader/douyin_uploader/main.py @@ -636,6 +636,10 @@ class DouYinNote(DouYinBaseUploader): await self.validate_base_args() if not self.title or not str(self.title).strip(): raise ValueError("图文模式下,title 是必须的") + + if len(self.title) > 20: + raise ValueError(f"标题不能超过20字符,当前: {len(self.title)}字符") + if not self.image_paths: raise ValueError("图文模式下,图片是必须的") @@ -645,6 +649,10 @@ class DouYinNote(DouYinBaseUploader): if len(self.image_paths) > 35: raise ValueError("图文模式下最多只支持上传 35 张图片") + note_len = len(self.note) if self.note else 0 + if note_len > 1000: + raise ValueError(f"正文不能超过1000字符,当前: {note_len}字符") + normalized_image_paths = [] for image_path in self.image_paths: normalized_image_paths.append(str(self.validate_image_file(image_path)))