fix(douyin)优化图文发布正文和话题输入方式 ,tags直接拼接到description末尾一起赋值,避免hashtag解析混乱

This commit is contained in:
billy
2026-06-15 15:01:36 +08:00
parent 90e01c0106
commit 9677fa3d70
+8 -4
View File
@@ -278,11 +278,15 @@ class DouYinBaseUploader(BaseVideoUploader):
await description_editor.click() await description_editor.click()
await page.keyboard.press("Control+KeyA") await page.keyboard.press("Control+KeyA")
await page.keyboard.press("Delete") await page.keyboard.press("Delete")
await page.keyboard.type(description)
for tag in tags or []: # tags 合并到 description 结尾,一起用 textContent 赋值
await page.keyboard.type(" #" + tag) if tags:
await page.keyboard.press("Space") 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 = ""): async def set_location(self, page: Page, location: str = ""):
if not location: if not location: