From 9677fa3d70a06b6d14326d32796f3fc7fa3e0bad Mon Sep 17 00:00:00 2001 From: billy Date: Mon, 15 Jun 2026 15:01:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(douyin)=E4=BC=98=E5=8C=96=E5=9B=BE=E6=96=87?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=AD=A3=E6=96=87=E5=92=8C=E8=AF=9D=E9=A2=98?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=96=B9=E5=BC=8F=20,tags=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E6=8B=BC=E6=8E=A5=E5=88=B0description=E6=9C=AB=E5=B0=BE?= =?UTF-8?q?=E4=B8=80=E8=B5=B7=E8=B5=8B=E5=80=BC=EF=BC=8C=E9=81=BF=E5=85=8D?= =?UTF-8?q?hashtag=E8=A7=A3=E6=9E=90=E6=B7=B7=E4=B9=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uploader/douyin_uploader/main.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/uploader/douyin_uploader/main.py b/uploader/douyin_uploader/main.py index 5b25597..61f555c 100644 --- a/uploader/douyin_uploader/main.py +++ b/uploader/douyin_uploader/main.py @@ -278,11 +278,15 @@ class DouYinBaseUploader(BaseVideoUploader): await description_editor.click() await page.keyboard.press("Control+KeyA") await page.keyboard.press("Delete") - await page.keyboard.type(description) - for tag in tags or []: - await page.keyboard.type(" #" + tag) - await page.keyboard.press("Space") + # tags 合并到 description 结尾,一起用 textContent 赋值 + if tags: + tags_text = " ".join(f"#{t}" for t in tags) + full_text = description + "\n\n" + tags_text + else: + full_text = description + + await description_editor.evaluate('(el, text) => el.textContent = text', full_text) async def set_location(self, page: Page, location: str = ""): if not location: